From f6e7da37ad93b5a065d20c83ea939f905940fc73 Mon Sep 17 00:00:00 2001 From: acetheking987 Date: Fri, 6 Sep 2024 13:38:49 +0000 Subject: [PATCH] Add Engine --- Engine.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Engine.md diff --git a/Engine.md b/Engine.md new file mode 100644 index 0000000..59aaec4 --- /dev/null +++ b/Engine.md @@ -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()`.