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. |
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 | 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 | onBeginFrame() |
virtual void | onClose() |
virtual void | onEndFrame() |
virtual void | onInit() |
virtual void | onUpdate(double delta) |
Detailed Description
class Application;
class Application;
Application class.
A wrapper for UI windows.
Public Functions Documentation
function ~Application
virtual ~Application()
virtual ~Application()
function beginFrame
void beginFrame()
void beginFrame()
function close
void close()
void close()
Shutdown the whole application.
See: onClose()
Called when CloseCommand is received.
function display
void display()
void display()
function endFrame
void endFrame()
void endFrame()
function enqueueCommand
void enqueueCommand(
ICommand * command
)
void enqueueCommand(
ICommand * command
)
Issue command.
Parameters:
- command Pointer to command base class.
Application will process all enqueued command in the main loop.
function getTitle
const std::string & getTitle()
const std::string & getTitle()
function getWindow
GLFWwindow * getWindow()
GLFWwindow * getWindow()
Get the main GLFW window.
function init
bool init()
bool init()
Performs initialization of the application.
See: onInit()
function initWindow
void initWindow()
void initWindow()
Init OpenGL stuffs before display loop.
Taken from Muller GLFW. Initializes ImGui and I3T stuffs.
function run
int run()
int run()
Enter main loop.
function setTitle
void setTitle(
const std::string & title
)
void setTitle(
const std::string & title
)
function update
void update()
void update()
Perform logic update.
See: onUpdate()
function createModule
template <typename T ,
typename... Args>
static inline T * createModule(
Args &&... args
)
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()
static Application & get()
function getCurrentWindow
static GLFWwindow * 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()
template <typename T >
static T & getModule()
Protected Functions Documentation
function Application
Application()
Application()
function onBeginFrame
inline virtual void onBeginFrame()
inline virtual void onBeginFrame()
Reimplemented by: I3TApplication::onBeginFrame
function onClose
inline virtual void onClose()
inline virtual void onClose()
Reimplemented by: I3TApplication::onClose
function onEndFrame
inline virtual void onEndFrame()
inline virtual void onEndFrame()
Reimplemented by: I3TApplication::onEndFrame
function onInit
inline virtual void onInit()
inline virtual void onInit()
Reimplemented by: I3TApplication::onInit
function onUpdate
inline virtual void onUpdate(
double delta
)
inline virtual void onUpdate(
double delta
)
Reimplemented by: I3TApplication::onUpdate
Updated on 2025-01-07 at 13:40:43 +0000