OpenGLEnumMapper Namespace
Definition
Functions Index
| GLenum | toOpenGL (const PrimitiveType primitiveType) noexcept |
|
Translates a helios abstract PrimitiveType enum to its corresponding OpenGL GLenum value. More... | |
Functions
toOpenGL()
| noexcept |
Translates a helios abstract PrimitiveType enum to its corresponding OpenGL GLenum value.
This utility function maps API-agnostic primitive types defined by helios to their OpenGL equivalents. It is used internally by OpenGLMeshRenderer and other OpenGL rendering components.
Supported mappings:
- PrimitiveType::Points → GL_POINTS
- PrimitiveType::Lines → GL_LINES
- PrimitiveType::LineLoop → GL_LINE_LOOP
- PrimitiveType::LineStrip → GL_LINE_STRIP
- PrimitiveType::Triangles → GL_TRIANGLES
- PrimitiveType::TriangleStrip → GL_TRIANGLE_STRIP
- PrimitiveType::TriangleFan → GL_TRIANGLE_FAN
Example usage:
- Parameters
-
primitiveType The API-agnostic PrimitiveType value.
- Returns
The corresponding OpenGL primitive type as a GLenum. Falls back to GL_TRIANGLES if the mapping is not explicitly defined.
This function is marked [[nodiscard]] to encourage proper usage of the return value.
Definition at line 41 of file OpenGLEnumMapper.ixx.
The documentation for this namespace was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.