Skip to main content

MeshRenderCommand.ixx File

Representation of a low-level render command. More...

Included Headers

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

namespacemesh

Mesh rendering abstractions and command types. More...

Classes Index

classMeshRenderCommand

DTO for storing rendering-specific command information to be passed to the RenderQueue. More...

Description

Representation of a low-level render command.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file MeshRenderCommand.ixx
3 * @brief Representation of a low-level render command.
4 */
5module;
6
7#include <memory>
8
9export module helios.rendering.mesh.MeshRenderCommand;
10
11import helios.rendering.RenderPrototype;
12import helios.rendering.shader.UniformValueMap;
13
14export namespace helios::rendering::mesh {
15
16 /**
17 * @brief DTO for storing rendering-specific command information to be passed to the RenderQueue.
18 *
19 * A `MeshRenderCommand` encapsulates all data needed to render a single mesh instance:
20 * - A reference to the `RenderPrototype` (mesh + material)
21 * - Object-specific uniform values (e.g., model matrix)
22 * - Material-specific uniform values (e.g., colors, textures)
23 *
24 * ## Ownership Model
25 *
26 * - **RenderPrototype:** Non-owning raw pointer. The caller must ensure that the
27 * `RenderPrototype` remains valid for the lifetime of this command (typically
28 * within a single frame).
29 * - **UniformValueMaps:** Owned by the command. Moved into the command on construction.
30 *
31 * ## Design
32 *
33 * - **Move-Only:** Commands are non-copyable to prevent accidental duplication
34 * during render queue processing.
35 * - **Single-Frame Lifetime:** Commands are typically created during scene traversal
36 * and consumed by the renderer within the same frame.
37 *
38 * @see RenderQueue
39 * @see MeshRenderer
40 * @see RenderPrototype
41 */
43 /**
44 * @brief A non-owning raw pointer to the RenderPrototype to be used.
45 *
46 * The caller must ensure the `RenderPrototype` outlives this command.
47 */
48 const helios::rendering::RenderPrototype* renderPrototype_;
49
50 /**
51 * @brief An owning, unique pointer to the uniform values specific for the object to be rendered.
52 * This map contains uniforms that change per object instance, such as the world
53 * transformation matrix.
54 */
56
57 /**
58 * @brief An owning, unique pointer to the uniform values specific to the material of the object to
59 * be rendered. This map contains uniforms related to the surface properties of a material.
60 */
62
63 public:
64 /**
65 * @brief Prevent copying.
66 * A MeshRenderCommand is not intended to be copied.
67 */
69
70 /**
71 * @brief Prevent copy assignment.
72 * A MeshRenderCommand is not intended to be copied.
73 */
75
76 /**
77 * @brief Default move constructor.
78 */
79 MeshRenderCommand(MeshRenderCommand&&) noexcept = default;
80
81 /**
82 * @brief Default move assignment.
83 */
84 MeshRenderCommand& operator=(MeshRenderCommand&&) noexcept = default;
85
86 /**
87 * @brief Default destructor.
88 */
89 ~MeshRenderCommand() = default;
90
91 /**
92 * @brief Constructs a new `MeshRenderCommand`.
93 *
94 * Initializes this command with a non-owning pointer to the render prototype
95 * and takes ownership of the provided `UniformValueMaps`.
96 *
97 * @param renderPrototype A raw pointer to the `RenderPrototype` to be associated with this command.
98 * Must remain valid for the lifetime of this command.
99 * @param objectUniformValues A `UniformValueMap` containing all uniform values for the rendered object.
100 * @param materialUniformValues A `UniformValueMap` containing all uniform values for the material.
101 */
104 const helios::rendering::shader::UniformValueMap& objectUniformValues,
105 const helios::rendering::shader::UniformValueMap& materialUniformValues
106 ) noexcept :
107 renderPrototype_(renderPrototype),
108 objectUniformValues_(objectUniformValues),
109 materialUniformValues_(materialUniformValues) { }
110
111 /**
112 * @brief Returns the RenderPrototype associated with this command.
113 *
114 * @return A raw pointer to this command's RenderPrototype.
115 * May be `nullptr` if no prototype was provided.
116 */
117 [[nodiscard]] const helios::rendering::RenderPrototype* renderPrototype() const noexcept {
118 return renderPrototype_;
119 }
120
121 /**
122 * @brief Returns a const ref to this command's UniformValueMap for the object.
123 *
124 * @return A const ref to this command's UniformValueMap for the object.
125 */
127 return objectUniformValues_;
128 }
129
130 /**
131 * @brief Returns a const ref to this command's UniformValueMap for the material.
132 *
133 * @return A const ref to this command's UniformValueMap for the material.
134 */
136 return materialUniformValues_;
137 }
138 };
139
140
141}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.