Skip to content

C++ Fast Track for Games Programming Part 1: Getting Started

C++ Fast Track

Welcome to the first article in the C++ Fast Track for Games Programming tutorial series! These tutorials are designed to take you from zero to a decent entry level in a somewhat smooth fashion. We start at the absolute basics: all that you need to get started is a laptop or PC, a fair bit of time, and quite a bit of dedication.

Regarding dedication: These tutorials are supposed to take you anywhere between two and four hours each. Aim to complete a minimum of two tutorials per week. That means that you have an extra workload of 4-8 hours. No-one said this was going to be easy, right?

If you need support while going through these articles, join the Discord channel https://discord.com/invite/gsxxaxc. You’ll have no problems getting answers to your newbie questions there. Lecturers and experienced programmers also roam this channel.

This course was originally created for the Games programme at Breda University of Applied Sciences (known as IGAD at the previously named NHTV); see https://www.buas.nl/games.
It was recently updated for the students of the Utrecht University as well; see https://www.uu.nl/en/organisation/faculty-of-science/education/bachelors-programmes.

This tutorial was written by Jacco Bikker, Brian Beuken, Nils Deslé, and Carlos Bott and updated for Visual Studio 2019 by Robbie Grigg and Phil de Groot and updated for Visual Studio 2026 by Jeremiah van Oosten.

For the purpose of these tutorials, we assume you develop your games on a Windows PC. The development environment we use is Microsoft’s Visual Studio 2026. The Community edition of Visual Studio is free, and you can download it from https://visualstudio.microsoft.com/downloads/.

Checklist:

  • A PC or laptop: pretty much any CPU and GPU will do.
  • Windows 10 or Windows 11 (64-bit).
  • Visual Studio 2026 Community (Professional and Enterprise are more than welcome) with the Desktop development with C++ workload.

On the download page, click Free download under Visual Studio Community:

The Visual Studio download page, with the Free download button of Visual Studio Community

Visual Studio Community is free for students and individuals.

Run the file that you downloaded (VisualStudioSetup.exe): it starts the Visual Studio Installer. When it asks you what you want to install, check the Desktop development with C++ workload on the Workloads tab (it’s in the Desktop & Mobile section), and click Install. Without this workload, Visual Studio can’t build C++ programs: you won’t even find the C++ project templates.

The Visual Studio Installer with the Desktop development with C++ workload checked

Check Desktop development with C++. You don’t need any of the other workloads for these articles.

The installer then downloads and installs Visual Studio. This takes a while (it’s several gigabytes), so it’s a good moment to get a drink.

The Visual Studio Installer while it installs Visual Studio Community 2026

Visual Studio Community 2026 is being installed.

The first time you start Visual Studio, it asks you to sign in with a Microsoft account. Signing in is optional: you can skip it and add an account later (or never). Next, you get to pick a theme. As the window says, you can always change this later. The screenshots in these articles use the Dark theme.

You are then greeted by the start window:

The Visual Studio 2026 start window

The Visual Studio 2026 start window. The list on the left shows the projects you opened recently: it’s empty the first time.

Click Create a new project on the right side of the start window. You then need to select the type of project. We are building a very simple program, so select Empty Project (the one with the C++, Windows and Console tags) and click Next:

The Create a new project dialog, with Empty Project selected

Starting with an empty project means we don’t have to delete as many things later.

In the next dialog, you choose the name of your project and where your files go:

The Configure your new project dialog

You may choose any folder you want for your new project.

  1. Set the Project name to Getting Started.
  2. Set the Location to C:\Projects\C++ Fast Track. You’ll make a new project for each part of this series, and they all go in this folder. Visual Studio creates the folder if it doesn’t exist yet.
  3. Set the Solution name to Part 1.
  4. Leave Place solution and project in the same directory unchecked.

Below the settings, Visual Studio shows where your project ends up: C:\Projects\C++ Fast Track\Part 1\Getting Started\.

Click the Create button to create your new project! You should see something similar to the screenshot below.

Visual Studio with the new, empty Getting Started project

An empty project: the Solution Explorer on the left shows the solution, the project and its (empty) folders.

The Solution Explorer on the left side of the window shows your solution (Part 1) and the project inside it (Getting Started). The project has a few folders (filters, really) that help you organize your files: Header Files, Resource Files and Source Files. They are all empty. If you don’t see the Solution Explorer, open it with View > Solution Explorer in the main menu.

C++ is still evolving: a new version of the language appears every three years. The newest version that Visual Studio supports is C++23, and that is the version we use in these articles. A new project uses C++20 by default, so we have to tell Visual Studio to use C++23 instead.

Right-click the Getting Started project in the Solution Explorer and select Properties (at the bottom of the menu). In the Property Pages dialog that appears:

  1. Set Configuration (at the top) to All Configurations, so the setting applies to the Debug and the Release version of your program.
  2. Select Configuration Properties > General on the left.
  3. Click the value of C++ Language Standard, open the dropdown list, and select ISO C++23 Standard (/std:c++23).
  4. Click OK.
The Property Pages dialog with the C++ Language Standard set to ISO C++23

Select ISO C++23 Standard for All Configurations.

Before we go on:

That being said, let’s get coding! Now it’s finally time to add a C++ source file to play with. Right-click the Source Files folder of the Getting Started project in the Solution Explorer and select Add > New Item.

Type main.cpp as the name of the new file (or anything else really, as long as it ends with .cpp), and press Enter.

The Add New Item dialog, with main.cpp as the name of the new file

We just need the one .cpp file for now.

The new file is immediately opened, and we’re ready for some coding.

A tutorial on C++ is not complete without a “Hello world” example, so here we go. Enter the following program:

main.cpp
#include <print>
int main()
{
std::println("Hello world!");
}
Visual Studio with the Hello World program in main.cpp

Your first C++ program. Check that the toolbar says Debug and x64.

So what does this program do?

  • #include <print> makes the std::println function available to your program. It comes with C++ (in the standard library), but you have to ask for it.
  • int main() is where every C++ program starts. The code between the curly braces { and } is executed when you run the program.
  • std::println("Hello world!"); prints the text between the quotes, followed by a new line. Note the semicolon at the end: every statement in C++ ends with one.

Start the program by pressing F5, or by clicking the green Local Windows Debugger button on the toolbar. Visual Studio builds your program first: it turns your code into an executable file. Then it starts it.

You should see a console window with the text Hello world! printed in it.

A console window that shows Hello world!

Your program prints Hello world!. The lines below it are added by Visual Studio.

The text below Hello world! is not printed by your program: when your program ends, Visual Studio keeps the console window open, so you can read what your program printed. Press any key (while the console window has the keyboard focus) to close it.

Open the folder C:\Projects\C++ Fast Track\Part 1 in File Explorer. Visual Studio created quite a few files and folders for you:

File Explorer showing the Part 1 solution folder

The solution folder.

  • Part 1.slnx: your solution file, which points to
  • Getting Started\Getting Started.vcxproj: your project file, which points to
  • Getting Started\main.cpp: the source code file.

A project can have multiple source files, and a solution can have multiple projects. The most interesting file is in the x64\Debug folder, and it’s called Getting Started.exe. That’s the program you just made. Double-click it, and you’ll see that you created it yourself (if you are fast enough: the console window closes as soon as the program ends, because Visual Studio isn’t there to keep it open).

The other files:

  • Getting Started\Getting Started.vcxproj.filters: the folders (filters) that you see in the Solution Explorer;
  • Getting Started\Getting Started.vcxproj.user: your own settings for the project, for example for debugging;
  • Getting Started\x64\Debug: files that the compiler creates while it builds your program, such as .obj files;
  • x64\Debug: your program (.exe) and its debug information (.pdb);
  • .vs: a hidden folder with information that Visual Studio keeps for itself, such as which files you had open.

Quite confusing perhaps, but all that matters right now is the .cpp file in the Getting Started folder and the executable that was built from it.

If you don’t see the .vs folder, or if you don’t see the file extensions (.slnx, .cpp, .exe), tell File Explorer to show them. In Windows 11, open the View menu, select Show, and check File name extensions and Hidden items. In Windows 10, check File name extensions and Hidden items on the View tab of the ribbon.

The View > Show menu of File Explorer in Windows 11

Programmers want to see everything: show the file name extensions and hidden items.

So, here’s your task:

  1. Every article in this series ends with a small practical assignment. You need to complete this assignment. Feel free to share your solution on the 3dgep.com Discord server: https://discord.com/invite/gsxxaxc.
  2. Create a program that prints your name 10 times, then waits for a key, then prints Coding is awesome! 10 times, then waits for a key again, then exits.

Comments