![]() |
Carna Version 3.3.3
|
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>
Public Member Functions | |
IndexBufferBase (unsigned int type, unsigned int primitiveType) | |
Creates GL_ELEMENT_ARRAY_BUFFER object. | |
![]() | |
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. | |
![]() | |
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. | |
![]() | |
BaseBuffer (unsigned int target) | |
Acquires new OpenGL buffer object. | |
void | setSize (std::size_t size) |
Sets the size of the maintained buffer object. | |
Additional Inherited Members | |
![]() | |
bool | valid |
Flag that indicates whether the maintained OpenGL buffer object is valid. | |
Maintains GL_ELEMENT_ARRAY_BUFFER
object that holds the vertex indices, that interconnect the vertices to primitives. This class realizes the RAII-idiom.
Definition at line 43 of file IndexBuffer.h.
Creates GL_ELEMENT_ARRAY_BUFFER
object.
type | indicates the element type of the maintained OpenGL buffer object. |
primitiveType | indicates how primitives should be assembled from the vertices indexed by this buffer. |
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.
Definition at line 97 of file IndexBuffer.h.
Draws lines. Indicates that the indices \(i, i-1\) make up a the \(i\)th line segment with \(i \geq 1\).
Definition at line 90 of file IndexBuffer.h.
Draws lines. Indicates that the indices \(2i, 2i-1\) make up the \(i\)th line segment with \(i \geq 1\).
Definition at line 84 of file IndexBuffer.h.
Draws points. Indicates that each index makes up a single point.
Definition at line 102 of file IndexBuffer.h.
Draws triangles. Indicates that the indices \(0, i-2, i-1\) make up the \(i\)th triangle with \(i \geq 2\).
Definition at line 78 of file IndexBuffer.h.
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\).
Definition at line 72 of file IndexBuffer.h.
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\).
Definition at line 65 of file IndexBuffer.h.
Holds how the indexed vertices do interconnect to primitives.
Definition at line 112 of file IndexBuffer.h.
Holds the element type of the maintained OpenGL buffer object.
Definition at line 107 of file IndexBuffer.h.
Indicates uint16_t
element type.
Definition at line 57 of file IndexBuffer.h.
Indicates uint32_t
element type.
Definition at line 58 of file IndexBuffer.h.
Indicates uint8_t
element type.
Definition at line 56 of file IndexBuffer.h.
Documentation generated by Doxygen