R-Type
R-Type project
KapEngine::KEngine Class Reference

Class of engine. More...

#include <Engine.hpp>

Public Member Functions

 KEngine (bool debug=false, std::string const &gameName="Game", std::string const &version="1.0.0", std::string const &company="Default Company")
 Construct a new KapEngine Engine. More...
 
void setMaxFps (int fps)
 Fix max fps of game. More...
 
void run ()
 run your game
 
void stop ()
 stop your game (can be call by component)
 
bool isRunning () const
 Check if game is running. More...
 
bool debugMode () const
 check debug mode More...
 
void setDebugMod (bool b)
 Set the debug mode. More...
 
std::shared_ptr< Graphical::GraphicalLibgetCurrentGraphicalLib ()
 Get the Current Graphical Lib. More...
 
bool isGraphicalLibExists (std::size_t const &index) const
 Check if lib exists from it's id in engine. More...
 
bool isGraphicalLibExists (std::string const &name) const
 Check graphical lib exists from it's name in engine. More...
 
std::size_t getCurrentGraphicalLibIndex () const
 Get the Current Graphical Lib Index. More...
 
std::string getGameName () const
 Get the Game Name. More...
 
std::string getGameVersion () const
 Get the Game Version. More...
 
std::string getGameCompany () const
 Get the Game Company name. More...
 
std::shared_ptr< SceneManagement::SceneManagergetSceneManager () const
 Get the Scene Manager of game. More...
 
std::shared_ptr< Prefabs::PrefabManagergetPrefabManager () const
 Get the Prefab Manager of game. More...
 
Time::ETime getElapsedTime ()
 Get the Elapsed Time since last internal clock restart. More...
 
Events::EventManagergetEventManager ()
 Get the Event Manager of game. More...
 
void setDeltaTime (float dTime)
 Set the Delta Time of game more delta time increase more the game gonna be fast. more delta decrease, more the game gonna be slow. More...
 
std::shared_ptr< Graphical::GraphicalLibManagergetGraphicalLibManager () const
 Get the Graphical Lib Manager. More...
 
void setScreenSize (float width, float heigth)
 Set the Screen Size at the game beginning. More...
 
void setScreenSize (Tools::Vector2 size)
 Set the Screen Size at the game beginning. More...
 
Tools::Vector2 getScreenSize () const
 Get the Screen Size at the game beginning. More...
 
float getMaxFps () const
 Get the Max Fps of game. More...
 
bool __canRunFixed () const
 return if onFixedUpdate can be call More...
 
std::shared_ptr< SceneManagement::SplashScreengetSplashScreen () const
 Get the Splash Screen manager. More...
 
void setFixedTime (Time::ETime time)
 Set the Fixed Time of engine fixed time is used to call onFixedUpdate() function of component -> this your internal clock. More...
 
Time::ETime getFixedTime () const
 
void setIconGame (std::string const &iconPath)
 Set the Icon path of your Game. More...
 
std::string getIconPath () const
 Get the Icon Path of your game. More...
 
void setEngineThread (bool b)
 Set if engine have to use threads. More...
 
bool isEngineThreaded () const
 return if engine is threaded More...
 
void setTitle (std::string const &title)
 Set the Title of game windows. More...
 
void displayFPS (bool b)
 
bool isDisplayFPS () const
 

Detailed Description

Class of engine.

Constructor & Destructor Documentation

◆ KEngine()

KapEngine::KEngine::KEngine ( bool  debug = false,
std::string const &  gameName = "Game",
std::string const &  version = "1.0.0",
std::string const &  company = "Default Company" 
)

Construct a new KapEngine Engine.

Parameters
debugenable/disable debug mode
gameNamename of your game
versionversion of your game
companycompany name that developpe the game

Member Function Documentation

◆ __canRunFixed()

bool KapEngine::KEngine::__canRunFixed ( ) const
inline

return if onFixedUpdate can be call

Returns
true
false

◆ debugMode()

bool KapEngine::KEngine::debugMode ( ) const
inline

check debug mode

Return values
trueif debug mode is enable
falseif debug mode is disable

◆ getCurrentGraphicalLib()

std::shared_ptr< KapEngine::Graphical::GraphicalLib > KapEngine::KEngine::getCurrentGraphicalLib ( )

Get the Current Graphical Lib.

Returns
std::shared_ptr<KapEngine::Graphical::GraphicalLib>

◆ getCurrentGraphicalLibIndex()

std::size_t KapEngine::KEngine::getCurrentGraphicalLibIndex ( ) const

Get the Current Graphical Lib Index.

Returns
std::size_t

◆ getElapsedTime()

Time::ETime KapEngine::KEngine::getElapsedTime ( )
inline

Get the Elapsed Time since last internal clock restart.

Returns
KapEngine::Time::ETime

◆ getEventManager()

KapEngine::Events::EventManager & KapEngine::KEngine::getEventManager ( )

Get the Event Manager of game.

Returns
KapEngine::Events::EventManager&

◆ getGameCompany()

std::string KapEngine::KEngine::getGameCompany ( ) const
inline

Get the Game Company name.

Returns
std::string

◆ getGameName()

std::string KapEngine::KEngine::getGameName ( ) const
inline

Get the Game Name.

Returns
std::string

◆ getGameVersion()

std::string KapEngine::KEngine::getGameVersion ( ) const
inline

Get the Game Version.

Returns
std::string

◆ getGraphicalLibManager()

std::shared_ptr<Graphical::GraphicalLibManager> KapEngine::KEngine::getGraphicalLibManager ( ) const
inline

Get the Graphical Lib Manager.

Returns
std::shared_ptr<KapEngine::Graphical::GraphicalLibManager>

◆ getIconPath()

std::string KapEngine::KEngine::getIconPath ( ) const
inline

Get the Icon Path of your game.

Returns
std::string

◆ getMaxFps()

float KapEngine::KEngine::getMaxFps ( ) const
inline

Get the Max Fps of game.

Returns
float

◆ getPrefabManager()

std::shared_ptr<Prefabs::PrefabManager> KapEngine::KEngine::getPrefabManager ( ) const
inline

Get the Prefab Manager of game.

Returns
std::shared_ptr<KapEngine::Prefabs::PrefabManager>

◆ getSceneManager()

std::shared_ptr<SceneManagement::SceneManager> KapEngine::KEngine::getSceneManager ( ) const
inline

Get the Scene Manager of game.

Returns
std::shared_ptr<KapEngine::SceneManagement::SceneManager>

◆ getScreenSize()

Tools::Vector2 KapEngine::KEngine::getScreenSize ( ) const
inline

Get the Screen Size at the game beginning.

Returns
Tools::Vector2

◆ getSplashScreen()

std::shared_ptr<SceneManagement::SplashScreen> KapEngine::KEngine::getSplashScreen ( ) const
inline

Get the Splash Screen manager.

Returns
std::shared_ptr<KapEngine::SceneManagement::SplashScreen>

◆ isEngineThreaded()

bool KapEngine::KEngine::isEngineThreaded ( ) const
inline

return if engine is threaded

Returns
true
false

◆ isGraphicalLibExists() [1/2]

bool KapEngine::KEngine::isGraphicalLibExists ( std::size_t const &  index) const

Check if lib exists from it's id in engine.

Parameters
index
Returns
true if lib exists
false if lib does not exist

◆ isGraphicalLibExists() [2/2]

bool KapEngine::KEngine::isGraphicalLibExists ( std::string const &  name) const

Check graphical lib exists from it's name in engine.

Parameters
name
Returns
true if lib exists
false if lib does not exist

◆ isRunning()

bool KapEngine::KEngine::isRunning ( ) const
inline

Check if game is running.

Return values
trueif game is running
falseif game is not running

◆ setDebugMod()

void KapEngine::KEngine::setDebugMod ( bool  b)
inline

Set the debug mode.

Parameters
b

◆ setDeltaTime()

void KapEngine::KEngine::setDeltaTime ( float  dTime)
inline

Set the Delta Time of game more delta time increase more the game gonna be fast. more delta decrease, more the game gonna be slow.

Parameters
dTime

◆ setEngineThread()

void KapEngine::KEngine::setEngineThread ( bool  b)
inline

Set if engine have to use threads.

Parameters
b

◆ setFixedTime()

void KapEngine::KEngine::setFixedTime ( Time::ETime  time)
inline

Set the Fixed Time of engine fixed time is used to call onFixedUpdate() function of component -> this your internal clock.

Parameters
time

◆ setIconGame()

void KapEngine::KEngine::setIconGame ( std::string const &  iconPath)
inline

Set the Icon path of your Game.

Parameters
iconPath

◆ setMaxFps()

void KapEngine::KEngine::setMaxFps ( int  fps)
inline

Fix max fps of game.

Parameters
fpsfps amount

◆ setScreenSize() [1/2]

void KapEngine::KEngine::setScreenSize ( float  width,
float  heigth 
)

Set the Screen Size at the game beginning.

Parameters
width
heigth

◆ setScreenSize() [2/2]

void KapEngine::KEngine::setScreenSize ( Tools::Vector2  size)

Set the Screen Size at the game beginning.

Parameters
size(KapEngine::Tools::Vector2)

◆ setTitle()

void KapEngine::KEngine::setTitle ( std::string const &  title)
inline

Set the Title of game windows.

Parameters
title

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