12 #include "SceneManager.hpp"
13 #include "PrefabManager.hpp"
14 #include "GraphicalLibManager.hpp"
15 #include "SplashScreen.hpp"
18 #include "KapEngineSettings.hpp"
20 #if KAPENGINE_THREAD_ACTIVE
26 namespace SceneManagement {
62 #if !KAPENGINE_BETA_ACTIVE
70 KEngine(
bool debug =
false, std::string
const& gameName =
"Game", std::string
const& version =
"1.0.0", std::string
const& company =
"Default Company");
78 KEngine(std::string
const& gameName =
"Game", std::string
const& version =
"1.0.0", std::string
const& company =
"Default Company");
87 PROFILER_FUNC_START();
106 PROFILER_FUNC_START();
110 #if !KAPENGINE_BETA_ACTIVE
118 PROFILER_FUNC_START();
127 PROFILER_FUNC_START();
170 PROFILER_FUNC_START();
180 PROFILER_FUNC_START();
190 PROFILER_FUNC_START();
201 PROFILER_FUNC_START();
203 return _sceneManager;
212 PROFILER_FUNC_START();
214 return _prefabManager;
222 PROFILER_FUNC_START();
243 PROFILER_FUNC_START();
278 PROFILER_FUNC_START();
289 PROFILER_FUNC_START();
301 PROFILER_FUNC_START();
312 PROFILER_FUNC_START();
314 return _splashsScreen;
324 PROFILER_FUNC_START();
330 PROFILER_FUNC_START();
341 PROFILER_FUNC_START();
352 PROFILER_FUNC_START();
357 #if !KAPENGINE_BETA_ACTIVE
365 PROFILER_FUNC_START();
377 PROFILER_FUNC_START();
383 #if KAPENGINE_THREAD_ACTIVE
384 std::mutex &getMutex() {
396 PROFILER_FUNC_START();
397 #if KAPENGINE_BETA_ACTIVE
398 #if KAPENGINE_THREAD_ACTIVE
403 #if KAPENGINE_BETA_ACTIVE
404 #if KAPENGINE_THREAD_ACTIVE
411 void displayFPS(
bool b) {
412 PROFILER_FUNC_START();
413 #if KAPENGINE_BETA_ACTIVE
414 #if KAPENGINE_THREAD_ACTIVE
419 #if KAPENGINE_BETA_ACTIVE
420 #if KAPENGINE_THREAD_ACTIVE
427 bool isDisplayFPS()
const {
428 PROFILER_FUNC_START();
436 #if !KAPENGINE_BETA_ACTIVE
438 bool _threaded =
false;
440 #if KAPENGINE_THREAD_ACTIVE
444 bool _runFixed =
false;
445 bool _displayFps =
false;
449 float deltaTime = 1.0f;
451 Tools::Vector2 screenSize;
453 Time::EClock _internalClock;
454 Time::ETime _elapsed;
455 Time::ETime _fixedTime;
458 std::string _gameName;
459 std::string _gameVersion;
460 std::string _gameCompany;
461 std::string _icon =
"Library/KapEngine/Documentation/images/KapEngineLogo100x100.png";
464 std::shared_ptr<SceneManagement::SceneManager> _sceneManager;
467 std::shared_ptr<Prefabs::PrefabManager> _prefabManager;
470 std::shared_ptr<Graphical::GraphicalLibManager> _libManager;
473 std::shared_ptr<Events::EventManager> _eventManager;
476 std::shared_ptr<SceneManagement::SplashScreen> _splashsScreen;
481 bool __canRunUpdate();
std::size_t getCurrentGraphicalLibIndex() const
Get the Current Graphical Lib Index.
Definition: Engine.cpp:134
void setScreenSize(float width, float heigth)
Set the Screen Size at the game beginning.
Definition: Engine.cpp:160
Engine Time is internal time system of engine.
Definition: ETime.hpp:25
std::string getGameCompany() const
Get the Game Company name.
Definition: Engine.hpp:189
std::string getGameVersion() const
Get the Game Version.
Definition: Engine.hpp:179
Events::EventManager & getEventManager()
Get the Event Manager of game.
Definition: Engine.cpp:156
Event manager.
Definition: EventManager.hpp:36
Definition: EClock.hpp:22
bool isRunning() const
Check if game is running.
Definition: Engine.hpp:105
std::shared_ptr< Prefabs::PrefabManager > getPrefabManager() const
Get the Prefab Manager of game.
Definition: Engine.hpp:211
Time::ETime getElapsedTime()
Get the Elapsed Time since last internal clock restart.
Definition: Engine.hpp:221
void setFixedTime(Time::ETime time)
Set the Fixed Time of engine fixed time is used to call onFixedUpdate() function of component -> this...
Definition: Engine.hpp:323
void setMilliseconds(int64_t ms)
Set the Milliseconds of time.
Definition: ETime.hpp:162
void setEngineThread(bool b)
Set if engine have to use threads.
Definition: Engine.hpp:364
std::string getGameName() const
Get the Game Name.
Definition: Engine.hpp:169
void setDeltaTime(float dTime)
Set the Delta Time of game more delta time increase more the game gonna be fast. more delta decrease,...
Definition: Engine.hpp:242
float getMaxFps() const
Get the Max Fps of game.
Definition: Engine.hpp:288
void setTitle(std::string const &title)
Set the Title of game windows.
Definition: Engine.hpp:395
void run()
run your game
Definition: Engine.cpp:47
std::string getIconPath() const
Get the Icon Path of your game.
Definition: Engine.hpp:351
std::shared_ptr< SceneManagement::SceneManager > getSceneManager() const
Get the Scene Manager of game.
Definition: Engine.hpp:200
std::shared_ptr< Graphical::GraphicalLibManager > getGraphicalLibManager() const
Get the Graphical Lib Manager.
Definition: Engine.hpp:253
virtual int32_t asMilliSecond() const
avoir le temps en millisecondes
Definition: ETime.hpp:62
bool isEngineThreaded() const
return if engine is threaded
Definition: Engine.hpp:376
bool isGraphicalLibExists(std::size_t const &index) const
Check if lib exists from it's id in engine.
Definition: Engine.cpp:122
void stop()
stop your game (can be call by component)
Definition: Engine.cpp:98
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.
Definition: Engine.cpp:11
void setIconGame(std::string const &iconPath)
Set the Icon path of your Game.
Definition: Engine.hpp:340
Definition: GraphicalLibManager.hpp:31
bool __canRunFixed() const
return if onFixedUpdate can be call
Definition: Engine.hpp:300
main namespace
Definition: Component.hpp:17
std::shared_ptr< Graphical::GraphicalLib > getCurrentGraphicalLib()
Get the Current Graphical Lib.
Definition: Engine.cpp:118
bool debugMode() const
check debug mode
Definition: Engine.hpp:117
void setDebugMod(bool b)
Set the debug mode.
Definition: Engine.hpp:126
Definition: GraphicalLib.hpp:50
Tools::Vector2 getScreenSize() const
Get the Screen Size at the game beginning.
Definition: Engine.hpp:277
std::shared_ptr< SceneManagement::SplashScreen > getSplashScreen() const
Get the Splash Screen manager.
Definition: Engine.hpp:311
void setMaxFps(int fps)
Fix max fps of game.
Definition: Engine.hpp:86
Class of engine.
Definition: Engine.hpp:60