Unravel Engine C++ Reference
Loading...
Searching...
No Matches
rendering_system.h
Go to the documentation of this file.
1#pragma once
2
3#include <engine/ecs/ecs.h>
8#include <base/basetypes.hpp>
9#include <context/context.hpp>
10#include <hpp/span.hpp>
11
12#include <map>
13#include <memory>
14#include <vector>
15
16namespace unravel
17{
18
24{
25public:
26 rendering_system() = default;
27 ~rendering_system() = default;
28
34 auto init(rtti::context& ctx) -> bool;
35
41 auto deinit(rtti::context& ctx) -> bool;
42
43
45
51 void on_frame_update(scene& scn, delta_t dt);
53
54
55 void on_play_begin(hpp::span<const entt::handle> entities, delta_t dt);
63
70 void render_scene(const gfx::frame_buffer::ptr& output, scene& scn, delta_t dt);
71
78 auto render_scene(entt::handle camera_ent, camera_component& comp, scene& scn, delta_t dt) -> gfx::frame_buffer::ptr;
79
86 void render_scene(const gfx::frame_buffer::ptr& output, entt::handle camera_ent, camera_component& comp, scene& scn, delta_t dt);
87
88 void add_debugdraw_call(const std::function<void(gfx::dd_raii& dd)>& callback);
89private:
90 void render_debug(entt::handle camera_entity);
91
92 std::vector<std::function<void(gfx::dd_raii& dd)>> debug_draw_callbacks_;
93 std::shared_ptr<int> sentinel_ = std::make_shared<int>(0);
94
95
96};
97
98} // namespace unravel
Class that contains core camera data, used for rendering and other purposes.
Base class for different rendering paths in the ACE framework.
void on_play_begin(hpp::span< const entt::handle > entities, delta_t dt)
auto init(rtti::context &ctx) -> bool
Initializes the rendering path with the given context.
void add_debugdraw_call(const std::function< void(gfx::dd_raii &dd)> &callback)
void on_frame_update(scene &scn, delta_t dt)
Prepares the scene for rendering.
void on_frame_before_render(scene &scn, delta_t dt)
void on_frame_end(rtti::context &ctx, delta_t)
auto render_scene(scene &scn, delta_t dt) -> gfx::frame_buffer::ptr
Renders the scene and returns the frame buffer.
auto deinit(rtti::context &ctx) -> bool
Deinitializes the rendering path with the given context.
std::chrono::duration< float > delta_t
Represents a scene in the ACE framework, managing entities and their relationships.
Definition scene.h:21