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>
10#include <base/basetypes.hpp>
11#include <context/context.hpp>
12#include <hpp/span.hpp>
13
14#include <map>
15#include <memory>
16#include <vector>
17
18namespace unravel
19{
20
26{
27public:
28 rendering_system() = default;
29 ~rendering_system() = default;
30
36 auto init(rtti::context& ctx) -> bool;
37
43 auto deinit(rtti::context& ctx) -> bool;
44
45
47
53 void on_frame_update(scene& scn, delta_t dt);
55
56
57 void on_play_begin(hpp::span<const entt::handle> entities, delta_t dt);
58
59 auto release_pipeline_resources(scene& scn) -> bool;
60
68
75 void render_scene(const gfx::frame_buffer::ptr& output, scene& scn, delta_t dt);
76
86 auto render_scene(entt::handle camera_ent, camera_component& comp, scene& scn, delta_t dt,
87 bool render_screen_space = true) -> gfx::frame_buffer::ptr;
88
98 void render_scene(const gfx::frame_buffer::ptr& output, entt::handle camera_ent, camera_component& comp, scene& scn,
99 delta_t dt, bool render_screen_space = true);
100
101 void add_debugdraw_call(const std::function<void(gfx::dd_raii& dd)>& callback);
102
103private:
111 void render_debug(entt::handle camera_entity);
112
113 std::vector<std::function<void(gfx::dd_raii& dd)>> debug_draw_callbacks_;
114 std::shared_ptr<int> sentinel_ = std::make_shared<int>(0);
115
116
117};
118
119} // 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 release_pipeline_resources(scene &scn) -> bool
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:70