|
KarmaEngine
Game Engine for practical learning and research purposes
|
The class for Game + Editor in application form. More...
#include <Application.h>

Public Member Functions | |
| Application () | |
| A constructor for Application. | |
| ~Application () | |
| Destructor. | |
| void | Run () |
| Routine containing the main application loop. | |
| void | OnEvent (Event &e) |
| For dispatching events and trickling down the call to Layer stack. | |
| void | PushLayer (Layer *layer) |
| Places the Layer in the stack of layers and sends a notification. | |
| void | PushOverlay (Layer *layer) |
| Places the Layer at the front most position, in the sense, after the last inserted layer. | |
| void | PrepareApplicationForRun () |
| Do the preliminaries before the main loop run. | |
| void | HookInputSystem (std::shared_ptr< Input > input) |
| Set an event callback to the given input system. | |
| void | PrepareMemorySoftBed () |
| All the bulk memory allocation is done to prevent frequent calls to context switching new/delete operators. | |
| void | InitializeApplicationEngine () |
| Instantiate the instance of KEngine. | |
| void | DecommisionApplicationEngine () |
| Clean up all the KEngine relevant mess. | |
| Window & | GetWindow () const |
| Getter for the Window handle. | |
| void | CloseApplication () |
| Closing of the Application and do the relevant processing for clean up. | |
Static Public Member Functions | |
| static Application & | Get () |
| Getter for the instance (s_Instance) of the Application. | |
The class for Game + Editor in application form.
| Karma::Application::Application | ( | ) |
A constructor for Application.
Does the following steps
| Karma::Application::~Application | ( | ) |
Destructor.
| void Karma::Application::CloseApplication | ( | ) |
Closing of the Application and do the relevant processing for clean up.
| void Karma::Application::DecommisionApplicationEngine | ( | ) |
|
inlinestatic |
Getter for the instance (s_Instance) of the Application.
|
inline |
Getter for the Window handle.
| void Karma::Application::HookInputSystem | ( | std::shared_ptr< Input > | input | ) |
Set an event callback to the given input system.
| void Karma::Application::InitializeApplicationEngine | ( | ) |
| void Karma::Application::OnEvent | ( | Event & | e | ) |
For dispatching events and trickling down the call to Layer stack.
The OnEvent call is basically made by the glfw library via m_Data.EventCallback. The registration is done like so
whilst, the EventCallback is called in the lambdas of (Linux/Mac/Windows)Window::SetGLFWCallbacks()
| void Karma::Application::PrepareApplicationForRun | ( | ) |
| void Karma::Application::PrepareMemorySoftBed | ( | ) |
All the bulk memory allocation is done to prevent frequent calls to context switching new/delete operators.
| void Karma::Application::PushLayer | ( | Layer * | layer | ) |
Places the Layer in the stack of layers and sends a notification.
LayerStack::m_Layers.emplace() is used to place the supplied layer at an index in ascending order. For instance the layer inserted first has least index and subsequent layers have higher indices ordered accordingly.
| layer | The Layer to be placed |
| void Karma::Application::PushOverlay | ( | Layer * | layer | ) |
| void Karma::Application::Run | ( | ) |
Routine containing the main application loop.
The purpose of the loop is multifold