LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
LibCarna::base::IndexBuffer< IndexType > Class Template Reference

Specializes IndexBufferBase for particular IndexType. More...

#include <IndexBuffer.hpp>

+ Inheritance diagram for LibCarna::base::IndexBuffer< IndexType >:
+ Collaboration diagram for LibCarna::base::IndexBuffer< IndexType >:

Public Types

typedef IndexType Index
 Holds the index type maintained by this index buffer object.
 

Public Member Functions

 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.
 
- Public Member Functions inherited from LibCarna::base::IndexBufferBase
 IndexBufferBase (unsigned int type, unsigned int primitiveType)
 Creates GL_ELEMENT_ARRAY_BUFFER object.
 
- Public Member Functions inherited from LibCarna::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.
 

Additional Inherited Members

- Public Attributes inherited from LibCarna::base::IndexBufferBase
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 LibCarna::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 inherited from LibCarna::base::IndexBufferBase
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 inherited from LibCarna::base::IndexBufferBase
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 LibCarna::base::BaseBuffer
 BaseBuffer (unsigned int target)
 Acquires new OpenGL buffer object.
 
void setSize (std::size_t size)
 Sets the size of the maintained buffer object.
 
- Protected Attributes inherited from LibCarna::base::BaseBuffer
bool valid
 Flag that indicates whether the maintained OpenGL buffer object is valid.
 

Detailed Description

template<typename IndexType>
class LibCarna::base::IndexBuffer< IndexType >

Specializes IndexBufferBase for particular IndexType.

Author
Leonid Kostrykin

Definition at line 206 of file IndexBuffer.hpp.

Member Typedef Documentation

◆ Index

Holds the index type maintained by this index buffer object.

Definition at line 214 of file IndexBuffer.hpp.

Constructor & Destructor Documentation

◆ IndexBuffer()

template<typename IndexType >
LibCarna::base::IndexBuffer< IndexType >::IndexBuffer ( unsigned int  primitiveType)

Creates GL_ELEMENT_ARRAY_BUFFER object.

Parameters
primitiveTypeindicates how primitives should be assembled from the vertices indexed by this buffer.

Definition at line 235 of file IndexBuffer.hpp.

Member Function Documentation

◆ copy()

template<typename IndexType >
void LibCarna::base::IndexBuffer< IndexType >::copy ( const IndexType indicesPtr,
const std::size_t  indicesCount 
)

Copies indicesCount indices referenced by indicesPtr to the maintained index buffer object.

Definition at line 242 of file IndexBuffer.hpp.


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