Programming in C++11 and SDL2
Welcome to my blog abut C++11 and game programming in SDL2! Here you’ll find a list of all the tutorials on this blog.
Here you will find mainly tutorials on
OpenGL but also a few other post. I try to make my tutorials a bit slow paced, dwelling a bit longer on each subject in order to be able to give more details and better understanding of each subject. This is hugely important because development is always hard when you don’t know all the details, how things work, what each line of coed does etc.
Hopefully my blogs will teach you all you need to make an awesome game!
If you have any questions about anything, please check out the forums.
My newest tutorial. Aims to teach you all about
OpenGLand help you understand what each function does, how and when you should call it. This can be very hard in
OpenGL( a lot harder than in
SDL2) but at the same time ; 3d is awesome!
You can find the
OpenGL forum here.
OpenGLmakes it really easy. And it’ll all be multi-platform. And if you’ve already read my previous tutorials on
SDL2, you already know a lot about using
An introduction to how we can use
VBOs, what they are and how we can use them to represent object models, colors and more.
Shaders are small pieces of code that runs on the GPU. We use them to move objects around, set color/lighting and more.
We finally take the step into 3D! Learn about how we project models from 3D space onto a 2D plane ( your screen ). We also take a look at verticies and matrices, inclduing translation matrix, view matrix and projection matrix.
A tutorial about making games. Focuses a lot on SDL 2, but also other topics related to game programming. Some parts are pretty extensive so that you’ll get a deeper understanding about what’s going on.
You can find the
SDL 2 forum here.
This part gives you a quick introduction to SDL 2. It’ll help you set up SDL2 including header files, linking and everything you need to get SDL 2 up and running. It also contains a bare-boned SDL2 program.
A guide on how to set up
SDL2development. Also includes a fix for
Visual Studio 2015( which failed when you tried to compile it with
SDL2stuff because they changed it. ) This guide also works for setting up additional libs like
Here we take a look at the two basic structs of SDL 2,
SDL_Renderer. It’ll help you understand what these do and how to initialize them and the basics of SDL2 correctly. We also take a look at how to set the render color ( which also works as background color )
Here we take a look at
SDL_Rect and how to render it with
About events in SDL 2. How to get the events, how the event structure,
SDL_Event laid out, and how we do we handle the event.
We learn how to check for collisions and make a simple game out of it.
In this part we take a look at
SDL_Textures and how to create them from image files ( bmp. ) We also look at how to render
We look at, and set up,
SDL_Image library. This is used to load png files which then can be rendered with the transparency layer.
Here we look at a new rendering function,
SDL_RenderCopyEx. The function lets us render textures rotated. We use it to make a simple analog clock.
Up until now we’ve used
SDL_Delay to limit framerate to ~16 FPS. We look at how to render using a delta time.
Text rendering in games can be tricky. Luckily,
SDL2_TTF does this for us. This part talks about
SDL2_TTF, how to set it up and how to use it.
Now that we know how to render text, we look at how to set various styles like bold, italics, underline and
In order to get multiplayer functionality, we need to learn about networks / Internet and how it works. This part deals about
UDPconnections and how use them in
SDL_net. It’ll over what you need to know in order to communicate via
In the previous part, we looked at
UDP. This time we take a close look at
TCP, see how it solves some of the problems
UDPhas. We also look at how to use
TCPcommunication ( without blocking )
A series about the new features of C++11. I will try to explain everything thoroughly and extensively. The goal is to learn about C++11, how the various parts of it works and why you should use them.
I will cover both minor features like
enum classes and larger ones like
This is a very short part about the new version of
enum classes. It covers what they are and why you should use them as much as possible
This part is very extensive and covers the new timing features of
C++11, chrono. It will help you when you’re dealing with timing in games and other applications.
My SDL2 Tutorial part 9 ( No more delays! ) also deals with
chrono but this part covers it more extensively.
About smart pointers in C++11 (
weak_ptr ) what they are, how they work and how to use them. You should always use smart pointers unless you have a really good to.
About the four major iterator types in C++ (
random-acces iterator). We’ll look at what they do and don”t do and how to use them.