Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
prism/engine/core/include/app.hpp
2020-08-11 12:07:21 -04:00

29 lines
929 B
C++
Executable file

#pragma once
class Engine;
/// The base class for any Prism application.
class App {
public:
/// Called when a render context is available.
virtual void initialize_render() {}
/// Called when the engine is about to quit. Should be overriden if an app needs to save data before qutting.
virtual void prepare_quit() {}
/// Called to check whether or not an app should intervene quitting.
virtual bool should_quit() {
return true;
}
/// Called when a engine starts a new frame. Typically used for inserting new imgui windows.
virtual void begin_frame() {}
/** Called during the engine's update cycle.
@param delta_time Delta time in milliseconds.
*/
virtual void update([[maybe_unused]] const float delta_time) {}
};
/// This is an app's equivalent main(). You can check command line arguments through Engine::comand_line_arguments.
void app_main(Engine* engine);