nCine::Geometry class

Contains geometric data for a drawable node.

Constructors, destructors, conversion operators

Geometry()
Default constructor.
~Geometry()
Geometry(const Geometry&) deleted

Public functions

auto operator=(const Geometry&) -> Geometry& deleted
auto GetPrimitiveType() const -> GLenum
Returns the primitive type (GL_TRIANGLES, GL_TRIANGLE_STRIP, ...)
auto GetFirstVertex() const -> GLint
Returns the index of the first vertex to draw.
auto GetVertexCount() const -> GLsizei
Returns the number of vertices.
auto GetElementsPerVertex() const -> std::uint32_t
Returns the number of float elements that composes the vertex format.
void SetDrawParameters(GLenum primitiveType, GLint firstVertex, GLsizei numVertices)
Sets all three drawing parameters.
void SetPrimitiveType(GLenum primitiveType)
Sets the primitive type (GL_TRIANGLES, GL_TRIANGLE_STRIP, ...)
void SetFirstVertex(GLint firstVertex)
Sets the index number of the first vertex to draw.
void SetVertexCount(GLsizei numVertices)
Sets the number of vertices.
void SetElementsPerVertex(std::uint32_t numElements)
Sets the number of float elements that composes the vertex format.
void CreateCustomVbo(std::uint32_t numFloats, GLenum usage)
Creates a custom VBO that is unique to this Geometry object.
auto AcquireVertexPointer(std::uint32_t numFloats, std::uint32_t numFloatsAlignment) -> GLfloat*
Retrieves a pointer that can be used to write vertex data from a custom VBO owned by this object.
auto AcquireVertexPointer(std::uint32_t numFloats) -> GLfloat*
Retrieves a pointer that can be used to write vertex data from a custom VBO owned by this object.
auto AcquireVertexPointer() -> GLfloat*
Retrieves a pointer that can be used to write vertex data from 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 Geometry object.
auto GetIndexCount() const -> std::uint32_t
Returns the number of indices used to render the geometry.
void SetFirstIndex(GLushort firstIndex)
Sets the index number 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, GLenum usage)
Creates a custom IBO that is unique to this Geometry object.
auto AcquireIndexPointer(std::uint32_t numIndices) -> GLushort*
Retrieves a pointer that can be used to write index data from a custom IBO owned by this object.
auto AcquireIndexPointer() -> GLushort*
Retrieves a pointer that can be used to write index data from a IBO owned by the buffers manager.
void ReleaseIndexPointer()
Releases the pointer used to write index data.
auto GetHostIndexPointer() const -> const GLushort*
Returns a pointer into host memory containing index data to be copied into a IBO.
void SetHostIndexPointer(const GLushort* indexPointer)
Sets a pointer into host memory containing index data to be copied into a IBO.
void ShareIbo(const Geometry* geometry)
Shares the IBO of another Geometry object.

Function documentation

GLfloat* nCine::Geometry::AcquireVertexPointer(std::uint32_t numFloats, std::uint32_t numFloatsAlignment)

Retrieves a pointer that can be used to write vertex data from a custom VBO owned by this object.

This overloaded version allows a custom alignment specification