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);
65
72 void render_scene(const gfx::frame_buffer::ptr& output, scene& scn, delta_t dt);
73
80 auto render_scene(entt::handle camera_ent, camera_component& comp, scene& scn, delta_t dt) -> gfx::frame_buffer::ptr;
81
88 void render_scene(const gfx::frame_buffer::ptr& output, entt::handle camera_ent, camera_component& comp, scene& scn, delta_t dt);
89
90 void add_debugdraw_call(const std::function<void(gfx::dd_raii& dd)>& callback);
91
92private:
100 void render_debug(entt::handle camera_entity);
101
102 std::vector<std::function<void(gfx::dd_raii& dd)>> debug_draw_callbacks_;
103 std::shared_ptr<int> sentinel_ = std::make_shared<int>(0);
104
105
106};
107
108} // 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