The Blocks application uses the SDL3 callback-based entry point pattern. Instead of a traditional main function, you implement specific lifecycle callbacks that the SDL runtime invokes.
Key callbacks include:
SDL_AppInit: Initializes the SDL subsystem, creates the window and GPU device, loads textures/atlases, and initializes game modules (World, Player, Sky, etc.).SDL_AppIterate: The main loop. Handles delta time calculation, updates game logic (World, Player, Sky, Input), triggers periodic saves, and executes the rendering pipeline.SDL_AppEvent: Processes incoming SDL events, delegating them to the Input module.SDL_AppQuit: Handles cleanup of all allocated resources, including GPU textures, pipelines, buffers, and game state saves.
// The application relies on these SDL3 callbacks being implemented:
SDL_AppResult SDLCALL SDL_AppInit(void** appstate, int argc, char** argv);
SDL_AppResult SDLCALL SDL_AppIterate(void* appstate);
SDL_AppResult SDLCALL SDL_AppEvent(void* appstate, SDL_Event* event);
void SDLCALL SDL_AppQuit(void* appstate, SDL_AppResult result);