Member-only story
Trying out SDL3 by writing a C++ Game Engine
SDL3 is around the corner! SDL3_image has been released, and we’re waiting for SDL3_ttf, SDL3_mixer and SDL3_net to be released soon as well.
On the menu:
- more consistent naming conventions
- many API improvements (native dialog windows, main callbacks, …)
- integration of old third-party libraries for GPU code
- …
But is it ready for production?
In my opinion, not yet. There are still some performance problem (both CPU-wise and memory-wise) that needs to be ironed out, a few bugs to be fixed, etc. SDL2 has been battled tested for more than a decade, SDL3 is still young, but that’s only a temporary issue.
Also, that’s no reason to not try it out! Let’s try to make a game with SDL3!
Wait… Why make games when you can make a game engine instead?
Making games is hard. Making a game engine is harder. But it’s actually funnier (and it does not require art skills). Let’s do it step by step:
Step 1: The boilerplate
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <entt/entt.hpp>
#define FPS 60
struct global_state {
bool running;
SDL_Window* window;
SDL_Renderer*…