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

38 lines
1.2 KiB
C++
Raw Normal View History

2020-08-11 12:07:21 -04:00
#pragma once
class GFXCommandBuffer;
2020-08-11 12:07:21 -04:00
namespace prism {
2021-04-19 12:23:18 -04:00
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) {}
virtual void render([[maybe_unused]] GFXCommandBuffer* command_buffer) {}
virtual bool wants_no_scene_rendering() { return false; }
};
}
/// This is an app's equivalent of main(). You can check command line arguments through Engine::command_line_arguments.
2021-04-19 12:23:18 -04:00
void app_main(prism::engine* engine);