galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::App Class Referencefinal

Base level class for any galaxy app. More...

#include <Application.hpp>

Collaboration diagram for galaxy::App:

Public Member Functions

 App (const std::string &config_file="config.json")
 Default constructor.
 ~App ()
 Destructor.
void load ()
 Loads the default appdata file.
void run ()
 Main game loop.
void set_update_func (LoopFunc &&update)
 Use a custom update step in game loop.
void set_render_func (LoopFunc &&render)
 Use a custom rendering step in game loop.

Private Types

using LoopFunc = std::move_only_function<void(App* app)>
 Defines a callback for update() or render() loops in app.run().

Private Member Functions

 App (const App &)=delete
 Copy constructor.
 App (App &&)=delete
 Move constructor.
Appoperator= (const App &)=delete
 Copy assignment operator.
Appoperator= (App &&)=delete
 Move assignment operator.
void setup_async ()
void setup_logging ()
void setup_config (std::string_view config_file)
void setup_platform ()
void setup_fs ()
void setup_rendering ()
void setup_input ()
void setup_nuklear ()
void setup_loader ()
void setup_meta ()
void setup_services ()
void setup_scripting ()

Private Attributes

LoopFunc m_update
 Update step in gameloop.
LoopFunc m_render
 Render step in gameloop.

Detailed Description

Base level class for any galaxy app.

Definition at line 19 of file Application.hpp.

Member Typedef Documentation

◆ LoopFunc

using galaxy::App::LoopFunc = std::move_only_function<void(App* app)>
private

Defines a callback for update() or render() loops in app.run().

Definition at line 24 of file Application.hpp.

Constructor & Destructor Documentation

◆ App() [1/3]

galaxy::App::App ( const std::string & config_file = "config.json")
explicit

Default constructor.

Sets up the engine. You need to inherit this and call it from a subclass. Also calls std::srand(std::time(nullptr)) for you.

Parameters
config_fileFilepath of config file.

Definition at line 36 of file Application.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~App()

galaxy::App::~App ( )

Destructor.

Definition at line 55 of file Application.cpp.

◆ App() [2/3]

galaxy::App::App ( const App & )
privatedelete

Copy constructor.

Here is the call graph for this function:

◆ App() [3/3]

galaxy::App::App ( App && )
privatedelete

Move constructor.

Here is the call graph for this function:

Member Function Documentation

◆ load()

void galaxy::App::load ( )

Loads the default appdata file.

Definition at line 69 of file Application.cpp.

◆ run()

void galaxy::App::run ( )

Main game loop.

Definition at line 77 of file Application.cpp.

Here is the call graph for this function:

◆ set_update_func()

void galaxy::App::set_update_func ( LoopFunc && update)

Use a custom update step in game loop.

Parameters
updateCallback.

Definition at line 163 of file Application.cpp.

◆ set_render_func()

void galaxy::App::set_render_func ( LoopFunc && render)

Use a custom rendering step in game loop.

Parameters
renderCallback.

Definition at line 168 of file Application.cpp.

◆ operator=() [1/2]

App & galaxy::App::operator= ( const App & )
privatedelete

Copy assignment operator.

Here is the call graph for this function:

◆ operator=() [2/2]

App & galaxy::App::operator= ( App && )
privatedelete

Move assignment operator.

Here is the call graph for this function:

◆ setup_async()

void galaxy::App::setup_async ( )
private

Definition at line 173 of file Application.cpp.

Here is the caller graph for this function:

◆ setup_logging()

void galaxy::App::setup_logging ( )
private

Definition at line 192 of file Application.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_config()

void galaxy::App::setup_config ( std::string_view config_file)
private

Definition at line 208 of file Application.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_platform()

void galaxy::App::setup_platform ( )
private

Definition at line 215 of file Application.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_fs()

void galaxy::App::setup_fs ( )
private

Definition at line 220 of file Application.cpp.

Here is the caller graph for this function:

◆ setup_rendering()

void galaxy::App::setup_rendering ( )
private

Definition at line 225 of file Application.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_input()

void galaxy::App::setup_input ( )
private

Definition at line 295 of file Application.cpp.

Here is the call graph for this function:

◆ setup_nuklear()

void galaxy::App::setup_nuklear ( )
private

Definition at line 316 of file Application.cpp.

◆ setup_loader()

void galaxy::App::setup_loader ( )
private

Definition at line 321 of file Application.cpp.

◆ setup_meta()

void galaxy::App::setup_meta ( )
private

Definition at line 326 of file Application.cpp.

◆ setup_services()

void galaxy::App::setup_services ( )
private

Definition at line 360 of file Application.cpp.

◆ setup_scripting()

void galaxy::App::setup_scripting ( )
private

Definition at line 378 of file Application.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_update

LoopFunc galaxy::App::m_update
private

Update step in gameloop.

Definition at line 104 of file Application.hpp.

◆ m_render

LoopFunc galaxy::App::m_render
private

Render step in gameloop.

Definition at line 109 of file Application.hpp.


The documentation for this class was generated from the following files: