|
CeresEngine 0.2.0
A game development framework
|
A base class to be used by all engine applications. More...
#include <CeresEngine/Application.hpp>
Public Member Functions | |
| Application (const Vector< StringView > &arguments={}) | |
| Creates a new application instance. | |
| Application (const char *argv[], int argc) | |
| Creates a new application instance. | |
| ~Application () override | |
| Destroys the application instance. | |
| virtual bool | prepareStartUp () |
| A method called to prepare the application for start-up. | |
| virtual void | startUp () |
| A method called to perform the application for start-up. | |
| virtual void | shutDown () |
| A method called to perform the application for shutdown. | |
| virtual void | update () |
| A method called by the application on every update loop. | |
| void | updateFromPlatform () |
| A temporary function that must be invoked by the platform on every update tick. | |
| int | run () |
| Runs the engine main loop. | |
Public Member Functions inherited from CeresEngine::Engine | |
| Engine () | |
| Creates a new engine instance. | |
| Engine (const Engine &engine)=delete | |
| Engine & | operator= (const Engine &engine)=delete |
| virtual | ~Engine () |
| Destroys the engine instance. | |
Static Public Member Functions | |
| static Application & | shared () noexcept |
Static Public Member Functions inherited from CeresEngine::Engine | |
| static Engine & | shared () noexcept |
Public Attributes | |
| const Vector< StringView > | arguments |
| The argument given to the application command line. | |
Public Attributes inherited from CeresEngine::Engine | |
| UPtr< ExecutionContext > | backgroundQueue |
| A work queue that gets drained by several background threads. | |
| Service< RunLoop > | mainRunLoop |
| The engine's main thread run loop. | |
| Service< ResourceManager > | resourceManager |
| The engine's resource manager. | |
| Service< RenderAPI > | renderAPI |
| The engine's render API. | |
| Service< AudioAPI > | audioAPI |
| The engine's audio API. | |
| Service< InputProvider > | inputProvider |
| The engine's input provider. | |
| Service< InputManager > | inputManager |
| The engine's input manager. | |
| Service< SceneManager > | sceneManager |
| The engine's scene manager. Handles the simulation of a scene. | |
| Service< Renderer > | renderer |
| The engine's scene renderer. Can be null if rendering is disabled. | |
| Service< Platform > | platform |
| The engine's platform implementation. | |
| Service< URLSession > | urlSession |
| The engine URL session service. | |
| double | lastSimulationTime = 0.0 |
| The amount of time took to render the last frame. | |
| double | lastRenderTime = 0.0 |
| The amount of time took to render the last frame. | |
| UInt64 | visibleObjects = 0 |
Protected Member Functions | |
| virtual void | createCommandLineParser (CommandLineInterface &cli) |
| A method called by the engine whenever it is creating the command line parser. | |
Private Attributes | |
| bool | mShouldExitProgram = false |
| A flag set by Window::didClose to indicate that the engine's main loop should exit when the window gets closed. | |
| SteadyClockDate | mLastRenderTime |
| The last time a frame was rendered by the engine. | |
A base class to be used by all engine applications.
This class can be used to initialize engine, game and application services.
|
explicit |
Creates a new application instance.
| arguments | The command line arguments. |
Creates a new application instance.
| argv | The command-line argument array given by the OS. |
| argc | The number of command-line arguments in argv. |
|
override |
Destroys the application instance.
|
protectedvirtual |
A method called by the engine whenever it is creating the command line parser.
Applications can override this method to add custom command line arguments.
A method called to prepare the application for start-up.
| int CeresEngine::Application::run | ( | ) |
Runs the engine main loop.
This method will normally not return until the user has left the game (by triggering exitAction) or closed the application window.
|
staticnoexcept |
A method called to perform the application for shutdown.
A method called to perform the application for start-up.
A method called by the application on every update loop.
| void CeresEngine::Application::updateFromPlatform | ( | ) |
A temporary function that must be invoked by the platform on every update tick.
| const Vector<StringView> CeresEngine::Application::arguments |
The argument given to the application command line.
|
private |
The last time a frame was rendered by the engine.
This is used to compute the time interval since two frames.
A flag set by Window::didClose to indicate that the engine's main loop should exit when the window gets closed.