C++ Game Programming Tutorial – Let's make a game: Episode 1

Welcome to my new set of C++ Game Programming tutorials!

In Episode 1, we set up our Engine class and a rudimentary Sprite class that we used to load a .png. We use OpenGL, GLFW, and the SOIL library.

These are cached versions of my Twitch streams. I just started this new series a week ago and it’s basically going through the process of making a game from scratch in C++ using OpenGL and helper libraries like GLFW and SFML.

I don’t really have a set plan, as I mention in the video. The point here is collaborative efforts across the viewers and myself so that we can make something cool together! If you have any cool ideas, feel free to share them with me! We’ll end up making something cool regardless 🙂

You can watch the stream live on twitch on Wednesdays at 7pm PST starting on July 13th at
I also upload our progress onto github so that you can pull our latest code before watching the next stream! You can find the repo at


Xem thêm bài viết khác:

  1. Treyzk 8 months ago

    I tried this and kept getting error " argument type "char" is incompatible with parameter of type "Char*" " trying to call the initialize function. Any help?

  2. Gaurav Hira 8 months ago

    ok so I was getting following errors in vs19 :-

    1>SOIL.lib(stb_image_aug.o) : error LNK2019: unresolved external symbol __alloca referenced in function _stbi_zlib_decode_noheader_buffer

    1>SOIL.lib(image_helper.o) : error LNK2019: unresolved external symbol _sqrtf referenced in function _RGBE_to_RGBdivA2

    How I resolved it :-

    step 1) go to SOIL>projects>VC9>SOIL (microsoft vs solution)

    step 2) build this project in vs 2019, you'll get a migration report

    step 3) now once again build but this time change solution configuration to release (previously 'debug')

    step 4) in file explorer, open SOIL>projects>VC9 >Release, you'll find SOIL.lib there (mine was of 576 kb), copy that

    step 5) go to SOIL>lib where your original SOIL.lib was present, delete that, paste new one and you're good to go!

    step 6) now build twitch and voila!

    Also, thanks for the video!

  3. BruderAlex 8 months ago

    I cant install glfw and opengl

  4. Ben Norton 8 months ago

    To anyone who is using visual studio 2019 and is getting an error " SOIL_load_OGL_texture.".

    There is a nupen package for soil 1.16.0 that you can download but it needs some extra work to get it working:

    1. if you have done any linking (additional dependencies etc) of Soil folders that you got online before the nupen download, remove them, it was the final reason why i couldn't get SOIL working

    2. the #include line wasn't showing soil.h, by finding its exact location on the computer, you can circumvent this issue:
    it installs soil.1.16.0 next to the nupen gl stuff, so you can find the directionary if your path is different.


    Great video dude, and it helped me alot, i wanted to put down my solution just in case someone wants to follow your steps without hours of research.

  5. Ouranikos 8 months ago

    In Texture::Texture (string path) I get "unresolved external symbol" for SOIL_load_OGL_texture.
    I did everything identically and this even shows up when I clone your repo and try to build it.

    Full error message: "unresolved external symbol _SOIL_load_OGL_texture referenced in function "public: __thiscall Texture::Texture(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Texture@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)"

  6. Logan Houston 8 months ago

    "I want the starting point to be at the bottom left" Angers every game developer ever

  7. Abirami Sridharan 8 months ago

    Hi thank you for your video, however i tried to create a window with the function glfCreateWindow(), and it throws an error any idea why this is happening

  8. Ibrahim Atbouli 8 months ago

    6:31 When i type nupen, it says no extension found. When I add gl.core it still says no extension found. Can someone help me ? I've got Visual Studio Code and Version: 1.42.0.
    Thx to whoever does! I hope I get an answer

  9. Ali elnajjar 8 months ago

    hi, just wanna ask, can i start learning game development without knowing c++? i mean can i learn c++ and game development simultaneously?

  10. リアル 8 months ago

    #pragma once isn't a windows thing
    also it's a preprocessor keyword

    works everywhere (at least since 2019 (I don't know how it was in 2016, but I think it was))
    the funny thing is, you said to make it platform independend, but later on you called
    #pragma comment(lib, "opengl32.lib")
    and if #pragma was a windows thing, you messed yourself up at that point 😛

  11. Vinicius Oliveira 8 months ago

    When I try to run the project, I get the error:

    Severity Code Description Project File Line Suppression State
    Error LNK2019 unresolved external symbol _SOIL_load_OGL_texture referenced in function "public: __thiscall Texture::Texture(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Texture@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) Twitch_GameProject D:C++ ProjectsTwitch_GameProjectTexture.obj 1

    It has something to do with the function SOIL_load_OGL_texture. If I comment this line out in the Texture.cpp file, the code runs, but with no ID, so I get the message of Error loading image.
    Any idea on how to solve this issue so SOIL_load_OGL_texture works properly?
    This error also happens on the project I downloaded from your GitHub.


  12. Papp David 8 months ago

    I have done everything as you did(even downloaded the same sprite) and it didn't render the sprite for me to the screen?Any advice?

  13. Gabriel Cangiano 8 months ago

    Visual Studio Code doesn't load my image (Reb Biplane) but I put the path in
    Sprite testSprite = Sprite("(MY PATH)",…,…). I moved the path of my image in the same path of my project but tge programs doesn't show the image! HELP MEE!

  14. Elliott Bork 8 months ago

    cant hear you very well:(

  15. christopher clark 8 months ago

    The Sprites texture is definitely loaded. the GetWidth and GetHeight are returning the correct size values, but the sprite is not rendering. The only thing I did differently was used nuget to add SOIL 1.16 as a dependency, I tried copying it into the project and that had worse effects and errors, I'm going to assume its not soil, because the texture is definitely loaded. Here is my render method. GetID is also returning 1, as it is the only texture.


    glBindTexture(GL_TEXTURE_2D, texture.GetID());


    glTranslatef(xPos, yPos, 0);

    glColor4f(1, 1, 0, 0);


    glTexCoord2f(0, 0);

    glVertex2f(0, 0);

    glTexCoord2f(1, 0);

    glVertex2f(texture.GetWidth(), 0);

    glTexCoord2f(1, 1);

    glVertex2f(texture.GetWidth(), texture.GetHeight());

    glTexCoord2f(0, 1);

    glVertex2f(0, texture.GetHeight());



  16. christopher clark 8 months ago

    Wait, is this crossplatform? I got a bit into this project, but then got worried this can't target windows, linux, android, mac etc.

  17. Haunted Fappy Fop 8 months ago

    error LNK2001 and fatal error LNK 1120 can you help me solve these error?(Edited) solved it.

  18. kristula 8 months ago

    Who here saw the ad for like if you did 😀

  19. tom franky 8 months ago

    I don't want to disappreciate your work and proficiency on programming, but what you did by those huge codes was just putting a downloaded image on a green screen! It seems to create a really good game we need 100 times more than what you wrote. Although, why not changing your episode title?!

  20. imen ben alaya 8 months ago

    Could someone please explain me why i can't see the plane?? "Error loading image with path:AssetsArtBiplane.png"

  21. Nils 8 months ago

    Thank you very much. Your tutorial has helped me break a big scary barrier going from console applications to graphical applications!

  22. BGivo 8 months ago

    Thank you for this. Few quick questions below perhaps you or someone else can help answer 🙂

    1. Is the way you imported the package through NuGet preferred or just used it to speed things up?

    2. Is #pragma once not compiler-dependent and fully supported now? You mentioned windows only, which I have read is not true. Just wanted to be clear as you seemed certain about it.

  23. Michael Dunayevski 8 months ago

    'using namespace std' in a header is highly un-recommended.

  24. Ford Prefect 8 months ago

    I pressed alt+tab roughly 9000 times

  25. AncientScarab 8 months ago

    void Render() declaration in the Engine class says “void Engine::Render() function definition for ‘Render’ not found. Please help me

  26. spool 2 kool 8 months ago

    NuGet has soil in vs2017.
    I'm using SOIL-VC141.

  27. spool 2 kool 8 months ago

    in vs 2017, use const char* not char* !!!!!!!
    will get errors if you don't!

  28. MrHallows 8 months ago

    @Progrematic You very well may be the fastest typist I have ever seen. Mindblowingly impressive. @_@

  29. Louis Johnson 8 months ago

    Those finger clicks are making me

  30. trashcanhands 8 months ago

    No errors, no warnings…no airplane… wtf?

  31. Yona Godwin 8 months ago

    Thanks bro! 🙂

  32. Mile M 8 months ago

    You can also download SOIL with Manage NuGet packages. Just type in soil. Maybe this will help somebody if not just ignore it 🙂 Btw this is very nice tutorial.

Leave a Comment

Your email address will not be published.

You may also like