Update Engine
parent
f6e7da37ad
commit
b68d6344c9
14
Engine.md
14
Engine.md
@ -2,27 +2,29 @@
|
|||||||
|
|
||||||
The engine initializes SDL2, TFF and handles basic functions
|
The engine initializes SDL2, TFF and handles basic functions
|
||||||
|
|
||||||
## Constructor
|
## Functions
|
||||||
|
|
||||||
|
### Constructor
|
||||||
|
|
||||||
This initializes SDL2 and creates a window.
|
This initializes SDL2 and creates a window.
|
||||||
` engine = new Engine("Game", 800, 600);`
|
` engine = new Engine("Game", 800, 600);`
|
||||||
|
|
||||||
## startFrame
|
### startFrame
|
||||||
|
|
||||||
This sets the `frameStart` variable to the output of `SDL_GetTicks()` to be able to adjust framerate.
|
This sets the `frameStart` variable to the output of `SDL_GetTicks()` to be able to adjust framerate.
|
||||||
|
|
||||||
## render
|
### render
|
||||||
|
|
||||||
This updates the screen with any changes by running `SDL_RenderPresent(renderer);`. It also automatically delays to reach the desired framerate if necessary.
|
This updates the screen with any changes by running `SDL_RenderPresent(renderer);`. It also automatically delays to reach the desired framerate if necessary.
|
||||||
|
|
||||||
## clear
|
### clear
|
||||||
|
|
||||||
This clears the screen with a provided color `engine->clear({ 100, 150, 255, 255 });`, this color is a `SDL_Colour` type.
|
This clears the screen with a provided color `engine->clear({ 100, 150, 255, 255 });`, this color is a `SDL_Colour` type.
|
||||||
|
|
||||||
## Update
|
### Update
|
||||||
|
|
||||||
This runs all the input updates using the Input class.
|
This runs all the input updates using the Input class.
|
||||||
|
|
||||||
## Deconstructor
|
### Deconstructor
|
||||||
|
|
||||||
This destroys the `renderer` and `window`, It also runs `SDL_Quit()` and `TFF_Quit()`.
|
This destroys the `renderer` and `window`, It also runs `SDL_Quit()` and `TFF_Quit()`.
|
||||||
|
Loading…
Reference in New Issue
Block a user