My Project
|
The Application class is responsible for initializing, running, and shutting down the game application. More...
#include <Application.hpp>
Public Member Functions | |
Application (int w, int h) | |
Constructor that initializes the game application. | |
~Application () | |
Destructor that shuts down the game application. | |
void | StartUp (int w, int h) |
Initializes the SDL library, creates the game window and renderer. | |
void | Shutdown () |
Shuts down the game application, releasing all resources. | |
void | Loop (float targetFPS) |
Runs the main loop of the game application. | |
The Application class is responsible for initializing, running, and shutting down the game application.
This class encapsulates the game's main loop, including initialization of SDL, the game window, and renderer, as well as managing the game's state through the SceneManager.
|
inline |
Constructor that initializes the game application.
w | The width of the game window. |
h | The height of the game window. |
This constructor initializes SDL, creates the game window and renderer, and switches to the initial game scene.
|
inline |
Destructor that shuts down the game application.
This destructor handles the clean-up and resource deallocation for the game application.
|
inline |
Runs the main loop of the game application.
targetFPS | The target frames per second (FPS) the game tries to maintain. |
This method runs the game's main loop, which includes updating the game state, handling input, rendering, and regulating the game's frame rate.
|
inline |
Shuts down the game application, releasing all resources.
This method deallocates all allocated resources, destroys the game window, and quits SDL.
|
inline |
Initializes the SDL library, creates the game window and renderer.
w | The width of the game window. |
h | The height of the game window. |
This method initializes SDL and sets up the game window and renderer. If SDL cannot be initialized or the renderer cannot be created, it logs an error.