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 primitiveType() const -> GLenum
Returns the primitive type (GL_TRIANGLES, GL_TRIANGLE_STRIP, ...)
auto firstVertex() const -> GLint
Returns the index of the first vertex to draw.
auto numVertices() const -> GLsizei
Returns the number of vertices.
auto numElementsPerVertex() 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 setNumVertices(GLsizei numVertices)
Sets the number of vertices.
void setNumElementsPerVertex(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 hostVertexPointer() 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 numIndices() 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 setNumIndices(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 hostIndexPointer() 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