CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::PrimitiveTopology Struct Referencefinal

Primitive topology enumeration. More...

#include <CeresEngine/Mesh/PrimitiveTopology.hpp>

Inheritance diagram for CeresEngine::PrimitiveTopology:
CeresEngine::StructEnum< PrimitiveTopology >

Public Types

enum  : UnderlyingType {
  Points , Lines , LineStrip , LineLoop ,
  LineListAdjacency , LineStripAdjacency , Triangles , TriangleStrip ,
  TriangleFan , TriangleListAdjacency , TriangleStripAdjacency , Patches
}
 
using RawType = decltype(raw)
 
- Public Types inherited from CeresEngine::StructEnum< PrimitiveTopology >
using UnderlyingType = UInt32
 
using Self = PrimitiveTopology
 

Public Member Functions

constexpr PrimitiveTopology ()=default
 
constexpr PrimitiveTopology (RawType raw)
 
constexpr PrimitiveTopology (UnderlyingType raw)
 
StringView toString () const noexcept
 Gets a string representation of PrimitiveTopology.
 
UInt32 getVertexCount () const noexcept
 Gets the number of vertices in a single primitive.
 
- Public Member Functions inherited from CeresEngine::StructEnum< PrimitiveTopology >
 operator UnderlyingType () const noexcept
 Converts the enum into it's underlying type.
 
void toString (std::ostream &stream) const noexcept
 Writes a string representation of the ShaderType to the given stream.
 

Static Public Member Functions

static Optional< PrimitiveTopologyfromString (StringView string) noexcept
 Creates a new PrimitiveTopology from a string representation.
 
- Static Public Member Functions inherited from CeresEngine::StructEnum< PrimitiveTopology >
static Self fromRawUnderlying (UnderlyingType underlying) noexcept
 Creates a new Self from it's underlying numeric representation.
 

Public Attributes

enum CeresEngine::PrimitiveTopology:: { ... }  raw
 

Static Public Attributes

static const constexpr auto values
 

Detailed Description

Primitive topology enumeration.

Member Typedef Documentation

◆ RawType

Member Enumeration Documentation

◆ anonymous enum

Enumerator
Points 

Point list, where each vertex represents a single point primitive.

Lines 

Line list, where each pair of two vertices represents a single line primitive.

LineStrip 

Line strip, where each vertex generates a new line primitive while the previous vertex is used as line start.

LineLoop 

Line loop, which is similar to LineStrip but the first and last vertices generate yet another line primitive.

LineListAdjacency 

Adjacency line list, which is similar to LineList but each end point has a corresponding adjacent vertex that is accessible in a geometry shader.

LineStripAdjacency 

Adjacency line strip, which is similar to LineStrip but each end point has a corresponding adjacent vertex that is accessible in a geometry shader.

Triangles 

Triangle list, where each set of three vertices represent a single triangle primitive.

TriangleStrip 

Triangle strip, where each vertex generates a new triangle primitive with an alternative triangle winding.

TriangleFan 

Triangle fan, where each vertex generates a new triangle primitive while all share the same first vertex.

TriangleListAdjacency 

Adjacency triangle list, which is similar to TriangleList but each triangle edge has a corresponding adjacent vertex that is accessible in a geometry shader.

TriangleStripAdjacency 

Adjacency triangle strips which is similar to TriangleStrip but each triangle edge has a corresponding adjacent vertex that is accessible in a geometry shader.

Patches 

Patches with control points that are accessible in a tessellation shader.

Constructor & Destructor Documentation

◆ PrimitiveTopology() [1/3]

constexpr CeresEngine::PrimitiveTopology::PrimitiveTopology ( )
constexprdefault

◆ PrimitiveTopology() [2/3]

constexpr CeresEngine::PrimitiveTopology::PrimitiveTopology ( RawType  raw)
inlineconstexpr

◆ PrimitiveTopology() [3/3]

constexpr CeresEngine::PrimitiveTopology::PrimitiveTopology ( UnderlyingType  raw)
inlineexplicitconstexpr

Member Function Documentation

◆ fromString()

static Optional< PrimitiveTopology > CeresEngine::PrimitiveTopology::fromString ( StringView  string)
staticnoexcept

Creates a new PrimitiveTopology from a string representation.

If the string value is invalid, an empty optional is returned.

◆ getVertexCount()

UInt32 CeresEngine::PrimitiveTopology::getVertexCount ( ) const
noexcept

Gets the number of vertices in a single primitive.

◆ toString()

StringView CeresEngine::PrimitiveTopology::toString ( ) const
noexcept

Gets a string representation of PrimitiveTopology.

Member Data Documentation

◆ []

enum { ... } CeresEngine::PrimitiveTopology::raw

◆ values

const constexpr auto CeresEngine::PrimitiveTopology::values
inlinestaticconstexpr
Initial value:
= {
}
@ TriangleListAdjacency
Adjacency triangle list, which is similar to TriangleList but each triangle edge has a corresponding ...
Definition PrimitiveTopology.hpp:63
@ LineLoop
Line loop, which is similar to LineStrip but the first and last vertices generate yet another line pr...
Definition PrimitiveTopology.hpp:36
@ Lines
Line list, where each pair of two vertices represents a single line primitive.
Definition PrimitiveTopology.hpp:28
@ Points
Point list, where each vertex represents a single point primitive.
Definition PrimitiveTopology.hpp:24
@ LineStripAdjacency
Adjacency line strip, which is similar to LineStrip but each end point has a corresponding adjacent v...
Definition PrimitiveTopology.hpp:46
@ Triangles
Triangle list, where each set of three vertices represent a single triangle primitive.
Definition PrimitiveTopology.hpp:50
@ LineListAdjacency
Adjacency line list, which is similar to LineList but each end point has a corresponding adjacent ver...
Definition PrimitiveTopology.hpp:41
@ LineStrip
Line strip, where each vertex generates a new line primitive while the previous vertex is used as lin...
Definition PrimitiveTopology.hpp:32
@ TriangleStripAdjacency
Adjacency triangle strips which is similar to TriangleStrip but each triangle edge has a correspondin...
Definition PrimitiveTopology.hpp:68
@ TriangleFan
Triangle fan, where each vertex generates a new triangle primitive while all share the same first ver...
Definition PrimitiveTopology.hpp:58
@ Patches
Patches with control points that are accessible in a tessellation shader.
Definition PrimitiveTopology.hpp:72
@ TriangleStrip
Triangle strip, where each vertex generates a new triangle primitive with an alternative triangle win...
Definition PrimitiveTopology.hpp:54

The documentation for this struct was generated from the following file: