Skip to main content

Rectangle.ixx File

Basic rectangle shape for rendering. More...

Included Headers

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

namespaceasset

Rendering asset management. More...

namespaceshape

Geometric shape definitions. More...

namespacebasic

Basic primitive shapes. More...

Classes Index

structRectangle

Basic Rectangle Shape. More...

Description

Basic rectangle shape for rendering.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file Rectangle.ixx
3 * @brief Basic rectangle shape for rendering.
4 */
5module;
6
7#include <vector>
8
9export module helios.rendering.asset.shape.basic.Rectangle;
10
11import helios.rendering.asset.shape.Shape;
12
13import helios.rendering.Vertex;
14import helios.rendering.mesh.PrimitiveType;
15
16using namespace helios::rendering;
17
19
20 /**
21 * @brief Basic Rectangle Shape.
22 *
23 * Creates vertex and index data for a single 2D rectangle.
24 *
25 * @note Uses indices {0, 1, 2, 3, 0} with PrimitiveType::LineStrip to render the rectangle outline.
26 */
27 struct Rectangle : public Shape {
28
30 std::vector<Vertex>{
31 {{ -0.5f, -0.5f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
32 {{ -0.5f, 0.5f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
33 {{ 0.5f, 0.5f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
34 {{ 0.5f, -0.5f, 0.0f}, { 0.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
35 },
36 std::vector<unsigned int>{
37 0, 1, 2, 3, 0
38 }
39 ) {}
40
41 [[nodiscard]] helios::rendering::mesh::PrimitiveType primitiveType() const noexcept override {
43 }
44
45 };
46
47}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.