Carna  Version 3.3.2
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
Carna::base::IndexBufferBase Class Reference

Maintains GL_ELEMENT_ARRAY_BUFFER object that holds the vertex indices, that interconnect the vertices to primitives. This class realizes the RAII-idiom. More...

#include <IndexBuffer.h>

+ Inheritance diagram for Carna::base::IndexBufferBase:
+ Collaboration diagram for Carna::base::IndexBufferBase:

Public Member Functions

 IndexBufferBase (unsigned int type, unsigned int primitiveType)
 Creates GL_ELEMENT_ARRAY_BUFFER object. More...
 
- Public Member Functions inherited from Carna::base::BaseBuffer
virtual ~BaseBuffer ()
 Deletes the maintained OpenGL buffer object.
 
std::size_t size () const
 Tells the previously set size of the maintained buffer object.
 
void bind () const
 Invokes glBindBuffer to bind the maintained buffer object to target.
 
bool isValid () const
 Tells whether the buffer object was marked as valid.
 

Public Attributes

const unsigned int type
 Holds the element type of the maintained OpenGL buffer object.
 
const unsigned int primitiveType
 Holds how the indexed vertices do interconnect to primitives.
 
- Public Attributes inherited from Carna::base::BaseBuffer
const unsigned int target
 Holds where the maintained buffer object is to be bound to by glBindBuffer.
 
const unsigned int id
 Holds the ID of the maintained OpenGL buffer object.
 

Static Public Attributes

static const unsigned int TYPE_UINT_8
 Indicates uint8_t element type.
 
static const unsigned int TYPE_UINT_16
 Indicates uint16_t element type.
 
static const unsigned int TYPE_UINT_32
 Indicates uint32_t element type.
 
static const unsigned int PRIMITIVE_TYPE_TRIANGLES
 Draws triangles. Indicates that the indices \(3i+k, k \in \left\{0,1,2\right\}\) make up the \(i\)th triangle with \(i \geq 2\).
 
static const unsigned int PRIMITIVE_TYPE_TRIANGLE_STRIP
 Draws triangles. Indicates that the indices \(i-k, k \in \left\{0,1,2\right\}\) make up the \(i\)th triangle with \(i \geq 2\).
 
static const unsigned int PRIMITIVE_TYPE_TRIANGLE_FAN
 Draws triangles. Indicates that the indices \(0, i-2, i-1\) make up the \(i\)th triangle with \(i \geq 2\).
 
static const unsigned int PRIMITIVE_TYPE_LINES
 Draws lines. Indicates that the indices \(2i, 2i-1\) make up the \(i\)th line segment with \(i \geq 1\).
 
static const unsigned int PRIMITIVE_TYPE_LINE_STRIP
 Draws lines. Indicates that the indices \(i, i-1\) make up a the \(i\)th line segment with \(i \geq 1\).
 
static const unsigned int PRIMITIVE_TYPE_LINE_LOOP
 Draws lines. Indicates that the indices \(i, i-1\) make up the \(i\)th line segment. Another line segment from the last to the first index is added automatically.
 
static const unsigned int PRIMITIVE_TYPE_POINTS
 Draws points. Indicates that each index makes up a single point.
 

Protected Member Functions

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.
 
- Protected Member Functions inherited from Carna::base::BaseBuffer
 BaseBuffer (unsigned int target)
 Acquires new OpenGL buffer object. More...
 
void setSize (std::size_t size)
 Sets the size of the maintained buffer object.
 

Additional Inherited Members

- Protected Attributes inherited from Carna::base::BaseBuffer
bool valid
 Flag that indicates whether the maintained OpenGL buffer object is valid.
 

Detailed Description

Maintains GL_ELEMENT_ARRAY_BUFFER object that holds the vertex indices, that interconnect the vertices to primitives. This class realizes the RAII-idiom.

Author
Leonid Kostrykin
Date
1.9.14 - 14.3.15

Definition at line 43 of file IndexBuffer.h.

Constructor & Destructor Documentation

◆ IndexBufferBase()

Carna::base::IndexBufferBase::IndexBufferBase ( unsigned int  type,
unsigned int  primitiveType 
)

Creates GL_ELEMENT_ARRAY_BUFFER object.

Parameters
typeindicates the element type of the maintained OpenGL buffer object.
primitiveTypeindicates how primitives should be assembled from the vertices indexed by this buffer.

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