Claire's Game Engine
Full C++ Engine using OpenGL
Loading...
Searching...
No Matches
Engine Class Reference

Engine is the main class responsible for initializing and running the game. It manages the game loop, rendering, updating the game world, handling input, and managing scenes. The Engine class interacts with the renderer, window, and various game components, ensuring that the game runs efficiently and responds to user input. More...

#include <Engine.h>

Public Member Functions

 Engine (std::string pTitle, std::vector< Scene * > pScene, IRenderer::RendererType pRendererType)
 Constructor for Engine. Initializes the engine with a window title, a list of scenes, and a specified renderer type.
 
 ~Engine ()
 Destructor for Engine. Cleans up the renderer, window, and scenes.
 
 Engine (const Engine &)=delete
 
Engineoperator= (const Engine &)=delete
 
void Initialize (IRenderer::RendererType pRendererType)
 Initializes the engine components, including the window, renderer, and first scene.
 
void Loop ()
 Starts the main game loop. This function repeatedly updates the game state, processes input, and renders the game until the game is closed.
 
void Render ()
 Renders the game by calling the renderer to draw all objects to the screen.
 
void Update ()
 Updates the game state by calling the current scene's update function.
 
void CheckForInputs ()
 Checks for input events such as keyboard and window events, and processes them.
 
void Close ()
 Closes the engine, performing necessary cleanup tasks.
 

Static Public Attributes

static bool mInDebugMode = false
 
static bool mInWireframeMode = false
 
static bool mIsGamePaused = false
 

Detailed Description

Engine is the main class responsible for initializing and running the game. It manages the game loop, rendering, updating the game world, handling input, and managing scenes. The Engine class interacts with the renderer, window, and various game components, ensuring that the game runs efficiently and responds to user input.

Constructor & Destructor Documentation

◆ Engine() [1/2]

Engine::Engine ( std::string pTitle,
std::vector< Scene * > pScene,
IRenderer::RendererType pRendererType )

Constructor for Engine. Initializes the engine with a window title, a list of scenes, and a specified renderer type.

Parameters
pTitleThe title of the window.
pSceneA vector of pointers to Scene objects.
pRendererTypeThe type of renderer to use (e.g., SDL, OpenGL).

◆ ~Engine()

Engine::~Engine ( )

Destructor for Engine. Cleans up the renderer, window, and scenes.

◆ Engine() [2/2]

Engine::Engine ( const Engine & )
delete

Member Function Documentation

◆ CheckForInputs()

void Engine::CheckForInputs ( )

Checks for input events such as keyboard and window events, and processes them.

◆ Close()

void Engine::Close ( )

Closes the engine, performing necessary cleanup tasks.

◆ Initialize()

void Engine::Initialize ( IRenderer::RendererType pRendererType)

Initializes the engine components, including the window, renderer, and first scene.

Parameters
pRendererTypeThe type of renderer to use.

◆ Loop()

void Engine::Loop ( )

Starts the main game loop. This function repeatedly updates the game state, processes input, and renders the game until the game is closed.

◆ operator=()

Engine & Engine::operator= ( const Engine & )
delete

◆ Render()

void Engine::Render ( )

Renders the game by calling the renderer to draw all objects to the screen.

◆ Update()

void Engine::Update ( )

Updates the game state by calling the current scene's update function.

Member Data Documentation

◆ mInDebugMode

bool Engine::mInDebugMode = false
inlinestatic

◆ mInWireframeMode

bool Engine::mInWireframeMode = false
inlinestatic

◆ mIsGamePaused

bool Engine::mIsGamePaused = false
inlinestatic

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