Sandbox 1
Sandbox game that emulates different material physics
Loading...
Searching...
No Matches
main.cpp File Reference

Main file of the game, glues everything together. More...

#include <SDL3/SDL_keycode.h>
#include <SDL3/SDL_main.h>
#include "include/classes.hpp"
Include dependency graph for main.cpp:

Macros

#define SDL_MAIN_USE_CALLBACKS   1 /* use the callbacks instead of main() */
#define FPS   200
 Defines how many times per second game will be updated.
#define BETWEEN_FRAME_INTERVAL   (1000 / FPS)
 Defines how many miliseconds should be waited to update.

Functions

SDL_AppResult SDL_AppInit (void **appstate, int argc, char *argv[])
 This function runs once at startup. Calls World::initWorld().
SDL_AppResult SDL_AppEvent (void *appstate, SDL_Event *event)
 This function runs when a new event occurs.
SDL_AppResult SDL_AppIterate (void *appstate)
 This function runs each frame. Calls World::redrawWorld() each time BETWEEN_FRAME_INTERVAL passes.
void SDL_AppQuit (void *appstate, SDL_AppResult result)
 This function runs on showdown.

Detailed Description

Main file of the game, glues everything together.

Uses classes and functions defined in include/classes.hpp

Date
2026/03/15

Function Documentation

◆ SDL_AppEvent()

SDL_AppResult SDL_AppEvent ( void * appstate,
SDL_Event * event )

This function runs when a new event occurs.