9#include <entt/entity/registry.hpp>
10#include <entt/signal/sigh.hpp>
43 entt::registry &_registry;
45 SDL_GPUGraphicsPipeline *_trianglePipeline;
46 SDL_GPUGraphicsPipeline *_linePipeline;
47 SDL_GPUTextureFormat _swapchainTextureFormat, _depthFormat;
48 std::vector<std::unique_ptr<IDebugSubSystem>> _systems;
51 SDL_GPURenderPass *render_pass,
52 const Camera &camera)
const;
63 entt::registry &
registry() {
return _registry; }
64 const entt::registry &
registry()
const {
return _registry; }
67 template <std::derived_from<IDebugSubSystem> System,
typename... Args>
69 auto sys = std::make_unique<System>(std::forward<Args>(args)...);
70 _systems.push_back(std::move(sys));
71 return static_cast<System &
>(*_systems.back());
78 std::tuple<entt::entity, DebugMeshComponent &>
addTriad();
80 std::tuple<entt::entity, DebugMeshComponent &>
84 for (
auto &system : _systems) {
85 system->update(*
this);
95static_assert(Scene<DebugScene>);
Definition CommandBuffer.h:17
Scene for organizing debug entities and render systems.
Definition DebugScene.h:42
entt::registry & registry()
Definition DebugScene.h:63
DebugScene & operator=(const DebugScene &)=delete
void setupPipelines(const MeshLayout &layout)
Setup pipelines; this will only have an effect ONCE.
const entt::registry & registry() const
Definition DebugScene.h:64
DebugScene(entt::registry ®istry, const Renderer &renderer)
void render(CommandBuffer &cmdBuf, const Camera &camera) const
std::tuple< entt::entity, DebugMeshComponent & > addTriad()
Just the basic 3D triad.
System & addSystem(Args &&...args)
Add a subsystem (IDebugSubSystem) to the scene.
Definition DebugScene.h:68
@ COLOR_SLOT
Definition DebugScene.h:56
void update()
Definition DebugScene.h:83
DebugScene(const DebugScene &)=delete
~DebugScene()
Definition DebugScene.h:93
std::tuple< entt::entity, DebugMeshComponent & > addLineGrid(std::optional< Float4 > color=std::nullopt)
Add a basic line grid.
const Device & device() const noexcept
Definition DebugScene.h:62
@ TRANSFORM_SLOT
Definition DebugScene.h:55
This class defines the layout of a mesh's vertices.
Definition MeshLayout.h:98
Handle class for meshes (vertex buffers and an optional index buffer) on the GPU.
Definition Mesh.h:57
Eigen::Vector3f Float3
Definition math_types.h:8
DebugPipelines
Definition DebugScene.h:14
@ LINE
Definition DebugScene.h:16
@ TRIANGLE_FILL
Definition DebugScene.h:15
The main way of using a camera to render things.
Definition Camera.h:19
Definition DebugScene.h:30
std::vector< GpuVec4 > colors
Definition DebugScene.h:34
DebugPipelines pipeline_type
Definition DebugScene.h:31
Float3 scale
Definition DebugScene.h:36
bool enable
Definition DebugScene.h:35
Mesh mesh
Definition DebugScene.h:32
RAII wrapper for SDL_GPUDevice.
Definition Device.h:17
A subsystem for the DebugScene.
Definition DebugScene.h:25
virtual void update(DebugScene &)=0
virtual ~IDebugSubSystem()=default
The Renderer class provides a rendering context for a graphical application.
Definition Renderer.h:20