Geometry class
#include <nCine/Graphics/Geometry.h>
Contains the vertex and index buffer data for a drawable node.
Owns (or shares) the vertex buffer object and optional index buffer object that back a single render command, together with the draw parameters (primitive type, first vertex, vertex/index counts). Vertex and index data can either be supplied through host pointers or written directly into mapped buffer memory acquired from the RenderBuffersManager.
Constructors, destructors, conversion operators
Public functions
- auto operator=(const Geometry&) -> Geometry& deleted
- auto GetPrimitiveType() const -> PrimitiveType
- Returns the primitive type (
PrimitiveType::Triangles,PrimitiveType::TriangleStrip, ...). -
auto GetFirstVertex() const -> std::
int32_t - Returns the index of the first vertex to draw.
-
auto GetVertexCount() const -> std::
int32_t - Returns the number of vertices.
-
auto GetElementsPerVertex() const -> std::
uint32_t - Returns the number of float elements that compose the vertex format.
-
void SetDrawParameters(PrimitiveType primitiveType,
std::
int32_t firstVertex, std:: int32_t numVertices) - Sets all three drawing parameters at once.
- void SetPrimitiveType(PrimitiveType primitiveType)
- Sets the primitive type (
PrimitiveType::Triangles,PrimitiveType::TriangleStrip, ...). -
void SetFirstVertex(std::
int32_t firstVertex) - Sets the index of the first vertex to draw.
-
void SetVertexCount(std::
int32_t numVertices) - Sets the number of vertices.
-
void SetElementsPerVertex(std::
uint32_t numElements) - Sets the number of float elements that compose the vertex format.
-
void CreateCustomVbo(std::
uint32_t numFloats, BufferUsage usage) - Creates a custom VBO that is unique to this object.
-
auto AcquireVertexPointer(std::
uint32_t numFloats, std:: uint32_t numFloatsAlignment) -> float* - Acquires a pointer for writing vertex data into a custom VBO owned by this object.
-
auto AcquireVertexPointer(std::
uint32_t numFloats) -> float* - Acquires a pointer for writing vertex data into a custom VBO owned by this object.
- auto AcquireVertexPointer() -> float*
- Acquires a pointer for writing vertex data into a VBO owned by the buffers manager.
- void ReleaseVertexPointer()
- Releases the pointer used to write vertex data.
- auto GetHostVertexPointer() const -> const float*
- Returns a pointer into host memory containing vertex data to be copied into a VBO.
- void SetHostVertexPointer(const float* vertexPointer)
- Sets a pointer into host memory containing vertex data to be copied into a VBO.
- void ShareVbo(const Geometry* geometry)
- Shares the VBO of another object.
-
auto GetIndexCount() const -> std::
uint32_t - Returns the number of indices used to render the geometry.
-
void SetFirstIndex(std::
uint16_t firstIndex) - Sets the index of the first index to draw.
-
void SetIndexCount(std::
uint32_t numIndices) - Sets the number of indices used to render the geometry.
-
void CreateCustomIbo(std::
uint32_t numIndices, BufferUsage usage) - Creates a custom IBO that is unique to this object.
-
auto AcquireIndexPointer(std::
uint32_t numIndices) -> std:: uint16_t* - Acquires a pointer for writing index data into a custom IBO owned by this object.
-
auto AcquireIndexPointer() -> std::
uint16_t* - Acquires a pointer for writing index data into an IBO owned by the buffers manager.
- void ReleaseIndexPointer()
- Releases the pointer used to write index data.
-
auto GetHostIndexPointer() const -> const std::
uint16_t* - Returns a pointer into host memory containing index data to be copied into an IBO.
-
void SetHostIndexPointer(const std::
uint16_t* indexPointer) - Sets a pointer into host memory containing index data to be copied into an IBO.
- void ShareIbo(const Geometry* geometry)
- Shares the IBO of another object.
Function documentation
float* nCine:: Geometry:: AcquireVertexPointer(std:: uint32_t numFloats,
std:: uint32_t numFloatsAlignment)
Acquires a pointer for writing vertex data into a custom VBO owned by this object.
| Parameters | |
|---|---|
| numFloats | Number of floats to be written |
| numFloatsAlignment | Alignment in floats |
This overload allows a custom alignment to be specified.