12#ifndef INDEXBUFFER_H_6014714286
13#define INDEXBUFFER_H_6014714286
15#include <Carna/Carna.h>
137template<
typename IndexType >
140 static_assert(
sizeof(
IndexType ) < 0,
"Unknown index type." );
203template<
typename IndexType >
232template<
typename IndexType >
239template<
typename IndexType >
Defines Carna::base::BaseBuffer.
Represents an association.
Implements OpenGL buffer objects maintenance RAII base class.
Maintains GL_ELEMENT_ARRAY_BUFFER object that holds the vertex indices, that interconnect the vertice...
static const unsigned int TYPE_UINT_32
Indicates uint32_t element type.
static const unsigned int TYPE_UINT_16
Indicates uint16_t element type.
static const unsigned int PRIMITIVE_TYPE_LINE_LOOP
Draws lines. Indicates that the indices make up the th line segment. Another line segment from the l...
static const unsigned int PRIMITIVE_TYPE_LINES
Draws lines. Indicates that the indices make up the th line segment with .
static const unsigned int PRIMITIVE_TYPE_TRIANGLE_STRIP
Draws triangles. Indicates that the indices make up the th triangle with .
static const unsigned int TYPE_UINT_8
Indicates uint8_t element type.
static const unsigned int PRIMITIVE_TYPE_POINTS
Draws points. Indicates that each index makes up a single point.
void copy(const void *bufferPtr, std::size_t bufferSize, std::size_t indicesCount)
Copies indicesCount indices referenced by bufferPtr to the maintained index buffer object.
static const unsigned int PRIMITIVE_TYPE_TRIANGLES
Draws triangles. Indicates that the indices make up the th triangle with .
IndexBufferBase(unsigned int type, unsigned int primitiveType)
Creates GL_ELEMENT_ARRAY_BUFFER object.
const unsigned int type
Holds the element type of the maintained OpenGL buffer object.
static const unsigned int PRIMITIVE_TYPE_LINE_STRIP
Draws lines. Indicates that the indices make up a the th line segment with .
const unsigned int primitiveType
Holds how the indexed vertices do interconnect to primitives.
static const unsigned int PRIMITIVE_TYPE_TRIANGLE_FAN
Draws triangles. Indicates that the indices make up the th triangle with .
Specializes IndexBufferBase for particular IndexType.
IndexBuffer(unsigned int primitiveType)
Creates GL_ELEMENT_ARRAY_BUFFER object.
void copy(const IndexType *indicesPtr, const std::size_t indicesCount)
Copies indicesCount indices referenced by indicesPtr to the maintained index buffer object.
IndexType Index
Holds the index type maintained by this index buffer object.
Maps index buffer element types to descriptive constants.