The main application class.
More...
#include <Application.hpp>
|
| 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 Scene & | GetScene () |
|
The main application class.
◆ Application()
Application::Application |
( |
Board * | board, |
|
|
bool | renderDebug ) |
|
inline |
Construct a new Application object.
- Parameters
-
board | Game board |
renderDebug | Render ImGUI debug panels |
◆ ~Application()
Application::~Application |
( |
| ) |
|
◆ 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
-
entity | EntityID |
x | Position in Pixels |
y | Position 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
-
entity | EntityID |
filePath | Filepath of sprite |
width | Width in Board Units |
height | Height 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
-
deltaTime | time 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
-
targetFPS | the target frames per second |
◆ Render()
void Application::Render |
( |
| ) |
|
◆ Update()
void Application::Update |
( |
float | deltaTime | ) |
const |
Update the application state.
- Parameters
-
deltaTime | time since last frame |
◆ m_isRunning
bool Application::m_isRunning = true |
The documentation for this class was generated from the following files: