Application
Application class. More...
#include "Core/Application.h"
Inherited by I3TApplication
Public Functions
| Name | |
|---|---|
| virtual | ~Application() |
| void | beginFrame() |
| void | close()<br>Shutdown the whole application. |
| void | display() |
| void | endFrame() |
| void | enqueueCommand(ICommand * command)<br>Issue command. |
| bool | frame()<br>Single iteration of the game loop. |
| AppLoopManager & | getAppLoopManager() |
| double | getDeltaTime() const |
| const std::string & | getTitle() |
| GLFWwindow * | getWindow()<br>Get the main GLFW window. |
| bool | init()<br>Performs initialization of the application. |
| void | initWindow()<br>Init OpenGL stuffs before display loop. |
| int | run()<br>Enter main loop. |
| void | setTitle(const std::string & title) |
| void | setVSync(bool enable) |
| void | update()<br>Perform logic update. |
| template <typename T ,typename... Args> <br>T * | createModule(Args &&... args)<br>Creates instance of module, registers it to the application, and calls its init() method. |
| Application & | get() |
| GLFWwindow * | getCurrentWindow()<br>Get the active GLFW window. |
| template <typename T > <br>T & | getModule() |
Protected Functions
| Name | |
|---|---|
| Application() | |
| virtual void | onBeforeFrame() |
| virtual void | onBeginFrame() |
| virtual void | onClose() |
| virtual void | onEndFrame() |
| virtual void | onInit() |
| virtual void | onUpdate(double delta) |
Protected Attributes
| Name | |
|---|---|
| AppLoopManager | m_appLoopManager |
| bool | m_shouldClose |
| Window * | m_window |
Detailed Description
class Application;Application class.
A wrapper for UI windows.
Public Functions Documentation
function ~Application
virtual ~Application()function beginFrame
void beginFrame()function close
void close()Shutdown the whole application.
See: onClose()
Called when CloseCommand is received.
function display
void display()function endFrame
void endFrame()function enqueueCommand
void enqueueCommand(
ICommand * command
)Issue command.
Parameters:
- command Pointer to command base class.
Application will process all enqueued command in the main loop.
function frame
bool frame()Single iteration of the game loop.
Return: Whether the game loop should continue
function getAppLoopManager
AppLoopManager & getAppLoopManager()function getDeltaTime
double getDeltaTime() constfunction getTitle
const std::string & getTitle()function getWindow
GLFWwindow * getWindow()Get the main GLFW window.
function init
bool init()Performs initialization of the application.
See: onInit()
function initWindow
void initWindow()Init OpenGL stuffs before display loop.
Taken from Muller GLFW. Initializes ImGui and I3T stuffs.
function run
int run()Enter main loop.
function setTitle
void setTitle(
const std::string & title
)function setVSync
void setVSync(
bool enable
)function update
void update()Perform logic update.
See: onUpdate()
function createModule
template <typename T ,
typename... Args>
static inline T * createModule(
Args &&... args
)Creates instance of module, registers it to the application, and calls its init() method.
Parameters:
- args
Template Parameters:
- T
- Args
Return:
Note: Modules are destroyed in the reverse order of their creation!
function get
static Application & get()function getCurrentWindow
static GLFWwindow * getCurrentWindow()Get the active GLFW window.
This may return a different window than the getWindow() method due to ImGui potentially create new native windows to handle ImGui windows being dragged out of the main window.
function getModule
template <typename T >
static T & getModule()Protected Functions Documentation
function Application
Application()function onBeforeFrame
inline virtual void onBeforeFrame()function onBeginFrame
inline virtual void onBeginFrame()Reimplemented by: I3TApplication::onBeginFrame
function onClose
inline virtual void onClose()Reimplemented by: I3TApplication::onClose
function onEndFrame
inline virtual void onEndFrame()Reimplemented by: I3TApplication::onEndFrame
function onInit
inline virtual void onInit()Reimplemented by: I3TApplication::onInit
function onUpdate
inline virtual void onUpdate(
double delta
)Reimplemented by: I3TApplication::onUpdate
Protected Attributes Documentation
variable m_appLoopManager
AppLoopManager m_appLoopManager;variable m_shouldClose
bool m_shouldClose = false;variable m_window
Window * m_window;Updated on 2026-09-11 at 21:24:25 +0000