Skip to content

Application

Application class. More...

#include "Core/Application.h"

Inherited by I3TApplication

Public Functions

Name
virtual~Application()
voidbeginFrame()
voidclose()<br>Shutdown the whole application.
voiddisplay()
voidendFrame()
voidenqueueCommand(ICommand * command)<br>Issue command.
const std::string &getTitle()
GLFWwindow *getWindow()<br>Get the main GLFW window.
voidinit()<br>Performs initialization of the application.
voidinitWindow()<br>Init OpenGL stuffs before display loop.
voidrun()<br>Enter main loop.
voidsetTitle(const std::string & title)
voidupdate()<br>Perform logic update.
template <typename T ,typename... Args&gt; <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 &gt; <br>T &getModule()

Protected Functions

Name
Application()
virtual voidonBeginFrame()
virtual voidonClose()
virtual voidonEndFrame()
virtual voidonInit()
virtual voidonUpdate(double delta)

Detailed Description

cpp
class Application;
class Application;

Application class.

A wrapper for UI windows.

Public Functions Documentation

function ~Application

cpp
virtual ~Application()
virtual ~Application()

function beginFrame

cpp
void beginFrame()
void beginFrame()

function close

cpp
void close()
void close()

Shutdown the whole application.

See: onClose()

Called when CloseCommand is received.

function display

cpp
void display()
void display()

function endFrame

cpp
void endFrame()
void endFrame()

function enqueueCommand

cpp
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

cpp
const std::string & getTitle()
const std::string & getTitle()

function getWindow

cpp
GLFWwindow * getWindow()
GLFWwindow * getWindow()

Get the main GLFW window.

function init

cpp
void init()
void init()

Performs initialization of the application.

See: onInit()

function initWindow

cpp
void initWindow()
void initWindow()

Init OpenGL stuffs before display loop.

Taken from Muller GLFW. Initializes ImGui and I3T stuffs.

function run

cpp
void run()
void run()

Enter main loop.

function setTitle

cpp
void setTitle(
    const std::string & title
)
void setTitle(
    const std::string & title
)

function update

cpp
void update()
void update()

Perform logic update.

See: onUpdate()

function createModule

cpp
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

cpp
static Application & get()
static Application & get()

function getCurrentWindow

cpp
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

cpp
template <typename T >
static T & getModule()
template <typename T >
static T & getModule()

Protected Functions Documentation

function Application

cpp
Application()
Application()

function onBeginFrame

cpp
inline virtual void onBeginFrame()
inline virtual void onBeginFrame()

Reimplemented by: I3TApplication::onBeginFrame

function onClose

cpp
inline virtual void onClose()
inline virtual void onClose()

Reimplemented by: I3TApplication::onClose

function onEndFrame

cpp
inline virtual void onEndFrame()
inline virtual void onEndFrame()

Reimplemented by: I3TApplication::onEndFrame

function onInit

cpp
inline virtual void onInit()
inline virtual void onInit()

Reimplemented by: I3TApplication::onInit

function onUpdate

cpp
inline virtual void onUpdate(
    double delta
)
inline virtual void onUpdate(
    double delta
)

Reimplemented by: I3TApplication::onUpdate


Updated on 2024-03-16 at 19:15:01 +0000