2D Engine v0.1.0
Loading...
Searching...
No Matches
Application Class Reference

The main application class. More...

#include <Application.hpp>

Collaboration diagram for Application:
Collaboration graph

Public Member Functions

 Application (Board *board, bool renderDebug)
 Construct a new Application object.
 
 ~Application ()
 Destroy the Application object.
 
bool Input (float deltaTime) const
 Handle user input events.
 
void Update (float deltaTime) const
 Update the application state.
 
void Render ()
 Render the application.
 
void Loop (float targetFPS)
 The main game loop.
 
void AddSprite (const EntityID &entity, const std::string filePath, const float width, const float height)
 Add a Sprite Component to an entity.
 
void AddBox2D (const EntityID &entity, const float x, const float y, const float width, const float height, const bool isStatic, const bool isTrigger)
 Add a Box2D component to an entity.
 
void ImportSpritesheetLevel (const std::string levelPath, const std::string spritesheetPath)
 Add a Box2D component to an entity.
 
const SceneGetScene ()
 

Public Attributes

bool m_isRunning = true
 

Detailed Description

The main application class.

Constructor & Destructor Documentation

◆ Application()

Application::Application ( Board * board,
bool renderDebug )
inline

Construct a new Application object.

Parameters
boardGame board
renderDebugRender ImGUI debug panels

◆ ~Application()

Application::~Application ( )

Destroy the Application object.

Member Function Documentation

◆ AddBox2D()

void Application::AddBox2D ( const EntityID & entity,
const float x,
const float y,
const float width,
const float height,
const bool isStatic,
const bool isTrigger )

Add a Box2D component to an entity.

Parameters
entityEntityID
xPosition in Pixels
yPosition in Pixels
isStatic
isTrigger

◆ AddSprite()

void Application::AddSprite ( const EntityID & entity,
const std::string filePath,
const float width,
const float height )

Add a Sprite Component to an entity.

Parameters
entityEntityID
filePathFilepath of sprite
widthWidth in Board Units
heightHeight in Board Units

◆ GetScene()

const Scene & Application::GetScene ( )
inline

◆ ImportSpritesheetLevel()

void Application::ImportSpritesheetLevel ( const std::string levelPath,
const std::string spritesheetPath )

Add a Box2D component to an entity.

Parameters
levelPath
spritesheetPath

◆ Input()

bool Application::Input ( float deltaTime) const

Handle user input events.

Parameters
deltaTimetime since last frame
Returns
true if application should quit
false if application should continue

◆ Loop()

void Application::Loop ( float targetFPS)

The main game loop.

Parameters
targetFPSthe target frames per second

◆ Render()

void Application::Render ( )

Render the application.

◆ Update()

void Application::Update ( float deltaTime) const

Update the application state.

Parameters
deltaTimetime since last frame

Member Data Documentation

◆ m_isRunning

bool Application::m_isRunning = true

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