Skip to main content

Renderable.ixx File

Representative of a configurable Renderable rendered by the underlying GL API. More...

Included Headers

#include <memory> #include <optional> #include <stdexcept> #include <helios.math> #include <helios.util.log.Logger> #include <helios.util.log.LogManager> #include <helios.rendering.shader.UniformValueMap> #include <helios.rendering.RenderPrototype> #include <helios.rendering.RenderQueue>

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

Classes Index

classRenderable

Abstract base class for objects that can be rendered by the rendering system. More...

Macro Definitions Index

#defineHELIOS_LOG_SCOPE   "helios::rendering::Renderable"

Description

Representative of a configurable Renderable rendered by the underlying GL API.

Macro Definitions

HELIOS_LOG_SCOPE

#define HELIOS_LOG_SCOPE   "helios::rendering::Renderable"

Definition at line 22 of file Renderable.ixx.

22#define HELIOS_LOG_SCOPE "helios::rendering::Renderable"

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file Renderable.ixx
3 * @brief Representative of a configurable Renderable rendered by the underlying GL API.
4 */
5module;
6
7#include <memory>
8#include <optional>
9#include <stdexcept>
10
11export module helios.rendering.Renderable;
12
13import helios.rendering.RenderQueue;
14import helios.rendering.RenderPrototype;
15import helios.rendering.shader.UniformValueMap;
16
17import helios.util.log.Logger;
18import helios.util.log.LogManager;
19
20import helios.math;
21
22#define HELIOS_LOG_SCOPE "helios::rendering::Renderable"
23export namespace helios::rendering {
24
25 /**
26 * @brief Abstract base class for objects that can be rendered by the rendering system.
27 *
28 * A `Renderable` represents any visual entity that can submit render commands to the
29 * rendering pipeline. Concrete implementations define how the object emits itself
30 * to a `RenderQueue` and how uniform values are written for shader consumption.
31 *
32 * Subclasses must implement:
33 * - `localAABB()`: Returns the local-space axis-aligned bounding box.
34 * - `writeUniformValues()`: Writes object-specific uniform values to a uniform map.
35 * - `emit()`: Submits render commands to the render queue.
36 *
37 * @see helios::rendering::RenderQueue
38 * @see helios::rendering::RenderPrototype
39 */
40 class Renderable {
41
42 protected:
43
44
45 public:
46
47 /**
48 * @brief Virtual destructor for proper cleanup of derived classes.
49 */
50 virtual ~Renderable() = default;
51
52 /**
53 * @brief Default constructor.
54 */
55 Renderable() = default;
56
57 /**
58 * @brief Deleted copy constructor.
59 *
60 * Renderables are non-copyable to prevent accidental duplication of GPU resources.
61 */
62 Renderable(const Renderable&) = delete;
63
64 /**
65 * @brief Deleted copy assignment operator.
66 *
67 * Renderables are non-copyable to prevent accidental duplication of GPU resources.
68 */
69 Renderable& operator=(const Renderable&)= delete;
70
71 /**
72 * @brief Move constructor.
73 *
74 * Allows transfer of ownership of rendering resources.
75 */
76 Renderable(Renderable&&) noexcept = default;
77
78 /**
79 * @brief Move assignment operator.
80 *
81 * Allows transfer of ownership of rendering resources.
82 */
83 Renderable& operator=(Renderable&&) noexcept = default;
84
85 /**
86 * @brief Returns the local-space axis-aligned bounding box of this renderable.
87 *
88 * The AABB is used for visibility culling, collision detection, and spatial queries.
89 * It represents the bounds of the renderable in its local coordinate system before
90 * any world transformations are applied.
91 *
92 * @return A const reference to the local-space AABB.
93 */
94 [[nodiscard]] virtual const helios::math::aabbf& localAABB() const noexcept = 0;
95
96 /**
97 * @brief Writes object-specific uniform values to a uniform value map.
98 *
99 * This method allows the renderable to contribute its own uniform values
100 * (such as material properties or custom shader parameters) to the rendering
101 * pipeline.
102 *
103 * @param uniformValueMap The uniform value map to write values to.
104 */
105 virtual void writeUniformValues(helios::rendering::shader::UniformValueMap& uniformValueMap) const noexcept = 0;
106
107 /**
108 * @brief Emits render commands to the render queue.
109 *
110 * This method is called during the render traversal to submit this renderable's
111 * draw commands to the render queue. The render queue collects and potentially
112 * sorts these commands for efficient GPU execution.
113 *
114 * @param renderQueue The render queue to emit commands to.
115 * @param objectUniformValues Uniform values specific to this object instance
116 * (e.g., model matrix, object ID).
117 * @param materialUniformValues Uniform values for the material properties
118 * (e.g., colors, textures, shader parameters).
119 */
120 virtual void emit(
121 RenderQueue& renderQueue,
122 helios::rendering::shader::UniformValueMap& objectUniformValues,
123 helios::rendering::shader::UniformValueMap& materialUniformValues) const = 0;
124
125 };
126
127}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.