Base level class for any galaxy app.
More...
#include <Application.hpp>
|
| | App (const std::string &config_file="config.json") |
| | Default constructor.
|
| |
| | ~App () |
| | Destructor.
|
| |
| void | run () |
| | Loads the default appdata file.
|
| |
| 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.
|
| |
| SDL_Event & | events () noexcept |
| | Get event data.
|
| |
|
| using | LoopFunc = std::move_only_function<void(App* app)> |
| | Defines a callback for update() or render() loops in app.run().
|
| |
Base level class for any galaxy app.
Definition at line 21 of file Application.hpp.
◆ LoopFunc
Defines a callback for update() or render() loops in app.run().
Definition at line 26 of file Application.hpp.
◆ 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_file | Filepath of config file. |
Definition at line 41 of file Application.cpp.
◆ ~App()
◆ App() [2/3]
| galaxy::App::App |
( |
const App & | | ) |
|
|
privatedelete |
◆ App() [3/3]
| galaxy::App::App |
( |
App && | | ) |
|
|
privatedelete |
◆ run()
| void galaxy::App::run |
( |
| ) |
|
Loads the default appdata file.
Main game loop.
Definition at line 85 of file Application.cpp.
◆ set_update_func()
| void galaxy::App::set_update_func |
( |
LoopFunc && | update | ) |
|
Use a custom update step in game loop.
- Parameters
-
Definition at line 186 of file Application.cpp.
◆ set_render_func()
| void galaxy::App::set_render_func |
( |
LoopFunc && | render | ) |
|
Use a custom rendering step in game loop.
- Parameters
-
Definition at line 191 of file Application.cpp.
◆ events()
| SDL_Event & galaxy::App::events |
( |
| ) |
|
|
noexcept |
◆ operator=() [1/2]
| App & galaxy::App::operator= |
( |
const App & | | ) |
|
|
privatedelete |
Copy assignment operator.
◆ operator=() [2/2]
| App & galaxy::App::operator= |
( |
App && | | ) |
|
|
privatedelete |
Move assignment operator.
◆ setup_async()
| void galaxy::App::setup_async |
( |
| ) |
|
|
private |
◆ setup_logging()
| void galaxy::App::setup_logging |
( |
| ) |
|
|
private |
◆ setup_config()
| void galaxy::App::setup_config |
( |
std::string_view | config_file | ) |
|
|
private |
◆ setup_platform()
| void galaxy::App::setup_platform |
( |
| ) |
|
|
private |
◆ setup_fs()
| void galaxy::App::setup_fs |
( |
| ) |
|
|
private |
◆ setup_rendering()
| void galaxy::App::setup_rendering |
( |
| ) |
|
|
private |
◆ setup_events()
| void galaxy::App::setup_events |
( |
| ) |
|
|
private |
◆ setup_input()
| void galaxy::App::setup_input |
( |
| ) |
|
|
private |
◆ setup_meta()
| void galaxy::App::setup_meta |
( |
| ) |
|
|
private |
◆ setup_services()
| void galaxy::App::setup_services |
( |
| ) |
|
|
private |
◆ setup_scripting()
| void galaxy::App::setup_scripting |
( |
| ) |
|
|
private |
◆ m_events
| SDL_Event galaxy::App::m_events |
|
private |
◆ m_update
◆ m_render
The documentation for this class was generated from the following files: