xoreos  0.0.5
Public Member Functions | Private Attributes | List of all members
Graphics::IndexBuffer Class Reference

Buffer containing indices data. More...

#include <indexbuffer.h>

Public Member Functions

 IndexBuffer ()
 
 IndexBuffer (const IndexBuffer &other)
 
 ~IndexBuffer ()
 
IndexBufferoperator= (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...
 

Detailed Description

Buffer containing indices data.

Definition at line 33 of file indexbuffer.h.

Constructor & Destructor Documentation

◆ IndexBuffer() [1/2]

Graphics::IndexBuffer::IndexBuffer ( )

Definition at line 32 of file indexbuffer.cpp.

◆ IndexBuffer() [2/2]

Graphics::IndexBuffer::IndexBuffer ( const IndexBuffer other)

Definition at line 35 of file indexbuffer.cpp.

◆ ~IndexBuffer()

Graphics::IndexBuffer::~IndexBuffer ( )

Definition at line 39 of file indexbuffer.cpp.

References _data, and destroyGL().

Here is the call graph for this function:

Member Function Documentation

◆ 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().

Here is the caller graph for this function:

◆ getCount()

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().

Here is the caller graph for this function:

◆ getData() [1/2]

GLvoid * Graphics::IndexBuffer::getData ( )

◆ getData() [2/2]

const GLvoid * Graphics::IndexBuffer::getData ( ) const

Access buffer data.

Definition at line 82 of file indexbuffer.cpp.

References _data.

◆ getIBO()

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().

Here is the caller graph for this function:

◆ getType()

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().

Here is the caller graph for this function:

◆ initGL()

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().

Here is the caller graph for this function:

◆ operator=()

IndexBuffer & Graphics::IndexBuffer::operator= ( const IndexBuffer other)

Definition at line 44 of file indexbuffer.cpp.

References _count, _data, _size, _type, and setSize().

Here is the call graph for this function:

◆ setSize()

void Graphics::IndexBuffer::setSize ( uint32  indexCount,
uint32  indexSize,
GLenum  indexType 
)

◆ updateGL()

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().

Here is the caller graph for this function:

Member Data Documentation

◆ _count

uint32 Graphics::IndexBuffer::_count
private

Number of elements in buffer.

Definition at line 70 of file indexbuffer.h.

Referenced by getCount(), initGL(), operator=(), setSize(), and updateGL().

◆ _data

byte* Graphics::IndexBuffer::_data
private

Buffer data.

Definition at line 73 of file indexbuffer.h.

Referenced by getData(), initGL(), operator=(), setSize(), updateGL(), and ~IndexBuffer().

◆ _hint

GLuint Graphics::IndexBuffer::_hint
private

GL hint for static or dynamic data.

Definition at line 76 of file indexbuffer.h.

Referenced by initGL(), and updateGL().

◆ _ibo

GLuint Graphics::IndexBuffer::_ibo
private

"Index" Buffer Object.

Definition at line 75 of file indexbuffer.h.

Referenced by destroyGL(), getIBO(), initGL(), and updateGL().

◆ _size

uint32 Graphics::IndexBuffer::_size
private

Size of a buffer element in bytes.

Definition at line 71 of file indexbuffer.h.

Referenced by initGL(), operator=(), setSize(), and updateGL().

◆ _type

GLenum Graphics::IndexBuffer::_type
private

Element type (GL_UNSIGNED_SHORT, GL_UNSIGNED_INT, ...).

Definition at line 72 of file indexbuffer.h.

Referenced by getType(), operator=(), and setSize().


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