hx3d  1
2D/3D Simple Game Framework
Public Member Functions | Protected Attributes | List of all members
hx3d::graphics::buffers::Buffer< T > Class Template Reference

OpenGL data buffer. More...

#include <buffer.hpp>

Public Member Functions

void set (const std::vector< T > &values)
 Set the buffer values. More...
 
void add (const std::vector< T > &values)
 Add buffer values. More...
 
T * data ()
 Get the buffer values. More...
 
GLuint getId ()
 Get the buffer ID. More...
 
unsigned int size ()
 Get the buffer size. More...
 
std::vector< T > & getVector ()
 Get the vector. More...
 
getValue (unsigned int i)
 Get a value. More...
 
void setValue (const unsigned int i, const T value)
 Set a value. More...
 
void clear ()
 Clear all values.
 

Protected Attributes

std::vector< T > _vector
 Data.
 
GLuint _buf
 Internal ID.
 

Detailed Description

template<class T>
class hx3d::graphics::buffers::Buffer< T >

OpenGL data buffer.

Definition at line 42 of file buffer.hpp.

Member Function Documentation

template<class T>
void hx3d::graphics::buffers::Buffer< T >::add ( const std::vector< T > &  values)

Add buffer values.

Parameters
valuesValues

Definition at line 49 of file buffer.inl.hpp.

template<class T >
T * hx3d::graphics::buffers::Buffer< T >::data ( )

Get the buffer values.

Returns
Values

Definition at line 57 of file buffer.inl.hpp.

template<class T >
GLuint hx3d::graphics::buffers::Buffer< T >::getId ( )

Get the buffer ID.

Returns
ID

Definition at line 36 of file buffer.inl.hpp.

template<class T >
T hx3d::graphics::buffers::Buffer< T >::getValue ( unsigned int  i)

Get a value.

Parameters
iPosition
Returns
Value

Definition at line 72 of file buffer.inl.hpp.

template<class T >
std::vector< T > & hx3d::graphics::buffers::Buffer< T >::getVector ( )

Get the vector.

Returns
Vector

Definition at line 67 of file buffer.inl.hpp.

template<class T>
void hx3d::graphics::buffers::Buffer< T >::set ( const std::vector< T > &  values)

Set the buffer values.

Parameters
valuesValues

Definition at line 41 of file buffer.inl.hpp.

template<class T>
void hx3d::graphics::buffers::Buffer< T >::setValue ( const unsigned int  i,
const T  value 
)

Set a value.

Parameters
iPosition
valueValue

Definition at line 77 of file buffer.inl.hpp.

template<class T >
unsigned int hx3d::graphics::buffers::Buffer< T >::size ( )

Get the buffer size.

Returns
Buffer size

Definition at line 62 of file buffer.inl.hpp.


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