Anvil Engine
Loading...
Searching...
No Matches
AEngine Class Reference

The main engine class that manages the application lifecycle, rendering, entities, and game logic. More...

#include <AEngine.h>

Public Member Functions

 AEngine ()
 Constructor for AEngine.
virtual ~AEngine ()
 Virtual destructor for AEngine.
void Run ()
 Main engine loop that runs the application.
void LoadMap (const char *mapName)
 Loads a map by name.
AEntityCreateEntity (std::string name)
 Creates a new entity with the specified name.
void BindAction (std::string name, std::function< void()> action)
 Binds an action to a trigger name.
void OnTrigger (std::string name)
 Executes the action associated with the trigger name.
AnvilPhysicsGetPhysics ()
 Gets the physics world instance.

Static Public Member Functions

static AEngineGet ()
 Gets the singleton instance of the engine.

Detailed Description

The main engine class that manages the application lifecycle, rendering, entities, and game logic.

Constructor & Destructor Documentation

◆ AEngine()

AEngine::AEngine ( )

Constructor for AEngine.

Constructor for AEngine class Initializes the engine components including window, OpenGL context, physics world, shader, resource manager, and loads the game DLL

◆ ~AEngine()

AEngine::~AEngine ( )
virtual

Virtual destructor for AEngine.

Member Function Documentation

◆ BindAction()

void AEngine::BindAction ( std::string name,
std::function< void()> action )
inline

Binds an action to a trigger name.

Parameters
nameThe trigger name to bind to
actionThe function to execute when the trigger is activated

◆ CreateEntity()

AEntity * AEngine::CreateEntity ( std::string name)

Creates a new entity with the specified name.

Parameters
nameThe name for the new entity
Returns
Pointer to the created entity

Creates a new entity and adds it to the engine's entity list

Parameters
nameThe name to assign to the new entity
Returns
Pointer to the newly created entity

◆ Get()

AEngine * AEngine::Get ( )
inlinestatic

Gets the singleton instance of the engine.

Returns
Pointer to the engine instance

◆ GetPhysics()

AnvilPhysics * AEngine::GetPhysics ( )
inline

Gets the physics world instance.

Returns
Pointer to the physics world

◆ LoadMap()

void AEngine::LoadMap ( const char * mapName)

Loads a map by name.

Parameters
mapNameThe name of the map to load

Loads a map file into the engine

Parameters
mapNameName of the map file to load (without extension)

◆ OnTrigger()

void AEngine::OnTrigger ( std::string name)
inline

Executes the action associated with the trigger name.

Parameters
nameThe trigger name to activate

◆ Run()

void AEngine::Run ( )

Main engine loop that runs the application.

Main game loop for the engine Handles updating game state, physics, and rendering


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