My Project
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Application Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Application()

Application::Application ( int w,
int h )
inline

Constructor that initializes the game application.

Parameters
wThe width of the game window.
hThe height of the game window.

This constructor initializes SDL, creates the game window and renderer, and switches to the initial game scene.

◆ ~Application()

Application::~Application ( )
inline

Destructor that shuts down the game application.

This destructor handles the clean-up and resource deallocation for the game application.

Member Function Documentation

◆ Loop()

void Application::Loop ( float targetFPS)
inline

Runs the main loop of the game application.

Parameters
targetFPSThe 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.

◆ Shutdown()

void Application::Shutdown ( )
inline

Shuts down the game application, releasing all resources.

This method deallocates all allocated resources, destroys the game window, and quits SDL.

◆ StartUp()

void Application::StartUp ( int w,
int h )
inline

Initializes the SDL library, creates the game window and renderer.

Parameters
wThe width of the game window.
hThe 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.


The documentation for this class was generated from the following file: