xoreos
0.0.5
|
Buffer containing indices data. More...
#include <indexbuffer.h>
Public Member Functions | |
IndexBuffer () | |
IndexBuffer (const IndexBuffer &other) | |
~IndexBuffer () | |
IndexBuffer & | operator= (const IndexBuffer &other) |
void | setSize (uint32 indexCount, uint32 indexSize, GLenum indexType) |
Change buffer size. More... | |
GLvoid * | getData () |
Access buffer data. More... | |
const GLvoid * | getData () const |
Access buffer data. More... | |
uint32 | getCount () const |
Get element count. More... | |
GLenum | getType () const |
Get element type. More... | |
void | initGL (GLuint hint=GL_STATIC_DRAW) |
Initialise internal buffer object for GL handling. More... | |
void | updateGL () |
Update existing GL buffer object. More... | |
void | destroyGL () |
Clear (destroy) GL resources associated with the buffer. More... | |
GLuint | getIBO () const |
Private Attributes | |
uint32 | _count |
Number of elements in buffer. More... | |
uint32 | _size |
Size of a buffer element in bytes. More... | |
GLenum | _type |
Element type (GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, ...). More... | |
byte * | _data |
Buffer data. More... | |
GLuint | _ibo |
"Index" Buffer Object. More... | |
GLuint | _hint |
GL hint for static or dynamic data. More... | |
Buffer containing indices data.
Definition at line 33 of file indexbuffer.h.
Graphics::IndexBuffer::IndexBuffer | ( | ) |
Definition at line 32 of file indexbuffer.cpp.
Graphics::IndexBuffer::IndexBuffer | ( | const IndexBuffer & | other | ) |
Definition at line 35 of file indexbuffer.cpp.
Graphics::IndexBuffer::~IndexBuffer | ( | ) |
Definition at line 39 of file indexbuffer.cpp.
References _data, and destroyGL().
void Graphics::IndexBuffer::destroyGL | ( | ) |
Clear (destroy) GL resources associated with the buffer.
Definition at line 116 of file indexbuffer.cpp.
References _ibo.
Referenced by Graphics::Mesh::Mesh::destroyGL(), and ~IndexBuffer().
uint32 Graphics::IndexBuffer::getCount | ( | ) | const |
Get element count.
Definition at line 86 of file indexbuffer.cpp.
References _count.
Referenced by Graphics::VertexBuffer::draw(), Graphics::Mesh::Mesh::initGL(), and Graphics::Mesh::Mesh::render().
GLvoid * Graphics::IndexBuffer::getData | ( | ) |
Access buffer data.
Definition at line 78 of file indexbuffer.cpp.
References _data.
Referenced by Graphics::Aurora::ModelNode_DragonAge::createIndexBuffer(), Graphics::Aurora::ModelNode_Jade::createMesh(), Graphics::VertexBuffer::draw(), Graphics::Aurora::Model_Sonic::evaluatePrimitive(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Engines::NWN2::TRXFile::loadTRRN(), Engines::NWN2::TRXFile::loadWATR(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), and Graphics::Aurora::ModelNode_Witcher::readTexturePaint().
const GLvoid * Graphics::IndexBuffer::getData | ( | ) | const |
GLuint Graphics::IndexBuffer::getIBO | ( | ) | const |
Definition at line 123 of file indexbuffer.cpp.
References _ibo.
Referenced by Graphics::Mesh::Mesh::initGL(), and Graphics::Mesh::Mesh::render().
GLenum Graphics::IndexBuffer::getType | ( | ) | const |
Get element type.
Definition at line 90 of file indexbuffer.cpp.
References _type.
Referenced by Graphics::VertexBuffer::draw(), and Graphics::Mesh::Mesh::render().
void Graphics::IndexBuffer::initGL | ( | GLuint | hint = GL_STATIC_DRAW | ) |
Initialise internal buffer object for GL handling.
Definition at line 94 of file indexbuffer.cpp.
References _count, _data, _hint, _ibo, and _size.
Referenced by Graphics::Mesh::Mesh::initGL().
IndexBuffer & Graphics::IndexBuffer::operator= | ( | const IndexBuffer & | other | ) |
Change buffer size.
Will allocate memory, free previous.
Definition at line 65 of file indexbuffer.cpp.
References _count, _data, _size, and _type.
Referenced by Graphics::Aurora::ModelNode_DragonAge::createIndexBuffer(), Graphics::Aurora::ModelNode_Jade::createMesh(), Graphics::Aurora::Model_Sonic::evaluatePrimitive(), Graphics::Aurora::ModelNode_NWN2::loadRigid(), Graphics::Aurora::ModelNode_NWN2::loadSkin(), Engines::NWN2::TRXFile::loadTRRN(), Engines::NWN2::TRXFile::loadWATR(), operator=(), Graphics::Aurora::ModelNode_Witcher::readMesh(), Graphics::Aurora::ModelNode_NWN_Binary::readMesh(), Graphics::Aurora::ModelNode_KotOR::readMesh(), and Graphics::Aurora::ModelNode_Witcher::readTexturePaint().
void Graphics::IndexBuffer::updateGL | ( | ) |
Update existing GL buffer object.
Try not to call while rendering.
Definition at line 108 of file indexbuffer.cpp.
References _count, _data, _hint, _ibo, and _size.
Referenced by Graphics::Mesh::Mesh::updateGL().
|
private |
Number of elements in buffer.
Definition at line 70 of file indexbuffer.h.
Referenced by getCount(), initGL(), operator=(), setSize(), and updateGL().
|
private |
Buffer data.
Definition at line 73 of file indexbuffer.h.
Referenced by getData(), initGL(), operator=(), setSize(), updateGL(), and ~IndexBuffer().
|
private |
GL hint for static or dynamic data.
Definition at line 76 of file indexbuffer.h.
Referenced by initGL(), and updateGL().
|
private |
"Index" Buffer Object.
Definition at line 75 of file indexbuffer.h.
Referenced by destroyGL(), getIBO(), initGL(), and updateGL().
|
private |
Size of a buffer element in bytes.
Definition at line 71 of file indexbuffer.h.
Referenced by initGL(), operator=(), setSize(), and updateGL().
|
private |
Element type (GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, ...).
Definition at line 72 of file indexbuffer.h.
Referenced by getType(), operator=(), and setSize().