Add Engine

acetheking987 2024-09-06 13:38:49 +00:00
parent 281c6a6194
commit f6e7da37ad

28
Engine.md Normal file

@ -0,0 +1,28 @@
# Engine
The engine initializes SDL2, TFF and handles basic functions
## Constructor
This initializes SDL2 and creates a window.
` engine = new Engine("Game", 800, 600);`
## startFrame
This sets the `frameStart` variable to the output of `SDL_GetTicks()` to be able to adjust framerate.
## render
This updates the screen with any changes by running `SDL_RenderPresent(renderer);`. It also automatically delays to reach the desired framerate if necessary.
## clear
This clears the screen with a provided color `engine->clear({ 100, 150, 255, 255 });`, this color is a `SDL_Colour` type.
## Update
This runs all the input updates using the Input class.
## Deconstructor
This destroys the `renderer` and `window`, It also runs `SDL_Quit()` and `TFF_Quit()`.