|
ToyMaker Game Engine 0.0.2
ToyMaker is a game engine developed and maintained by Zoheb Shujauddin.
|
Class that handles setup for the rest of the engine and application. More...
#include <application.hpp>
Classes | |
| class | getByPath_Helper |
| Base template for engine object getter, used by Application::getObject(). More... | |
| struct | getByPath_Helper< TObject, typename std::enable_if_t< SceneNodeCore::getByPath_Helper< TObject >::s_valid > > |
Public Member Functions | |
| ~Application () | |
| Destroys the application object. | |
| void | execute () |
| Runs the application loop after setup. | |
| template<typename TObject> | |
| TObject | getObject (const std::string &path="") |
| Gets an object of a specific type by its scene path. | |
| SignalTracker & | getSignalTracker () |
| Gets the signal tracker associated with the application. | |
Static Public Member Functions | |
| static Application & | getInstance () |
| Gets the (sole) instance of Application for this project. | |
| static std::shared_ptr< Application > | instantiate (const std::string &projectPath) |
| Creates the single Application object used by the project and returns a reference to it. | |
Private Member Functions | |
| Application (const std::string &projectPath) | |
| Constructs a new Application object. | |
| void | initialize (const nlohmann::json &windowProperties) |
| Initializes this project's 3rd party packages, creates an application window. | |
| void | cleanup () |
| Clean up of 3rd party packages and window resources, if required. | |
Private Attributes | |
| SignalTracker | mSignalTracker {} |
| The signal tracker associated with this object, which broadcasts Application events and receives events Application is interested in. | |
| uint32_t | mSimulationStep { 1000/30 } |
| The simulation step for the application specified in the app's project file. | |
| InputManager | mInputManager {} |
| The input manager associated with this object. | |
| std::weak_ptr< SceneSystem > | mSceneSystem {} |
| A pointer to this project's scene system, valid throughout the project. | |
Static Private Attributes | |
| static std::weak_ptr< Application > | s_pInstance {} |
| A pointer to the (sole) instance of the Application for this project. | |
| static bool | s_instantiated { false } |
| A small static helper variable to determine whether application instantiation has occurred, preventing it from recurring at a later time. | |
Class that handles setup for the rest of the engine and application.
This class is responsible for initializing the various packages used by the engine, reading window and other project configurations from project.json, and loading and initializing the default or first scene in the project.
Here's an example of a valid project json file:
|
private |
Constructs a new Application object.
| projectPath | The path to the project JSON file containing the parameters to be used by this Application. |
|
static |
Gets the (sole) instance of Application for this project.
| TObject ToyMaker::Application::getObject | ( | const std::string & | path = "" | ) |
Gets an object of a specific type by its scene path.
| TObject | The type of object being retrieved. |
| path | The path to that object. |
|
inline |
Gets the signal tracker associated with the application.
|
private |
Initializes this project's 3rd party packages, creates an application window.
| windowProperties | The properties of the window desired by the application. |
|
static |
Creates the single Application object used by the project and returns a reference to it.
| projectPath | The path to the file containing project level configuration data. |
|
private |
The input manager associated with this object.
Responsible for receiving and translating SDL events into a form useable by the application.