#include <BALL/VIEW/RENDERING/vertexBuffer.h>
Wrapper class to draw BALLView Mesh instances with OpenGL vertex buffer objects. Vertex Buffer Objects are an OpenGL extension available since OpenGL version 1.5.
- See http://oss.sgi.com/projects/ogl-sample/registry/EXT/pixel_buffer_object.txt
- Vertex Buffer Objects can drasticaly increase drawing speed for triangulated surfaces (up to 5 fold) compared with OpenGL display lists. To ensure a maximum of platform independence we use method pointers in the source file. These must be initialised by calling MeshBuffer::initGL() (See below).
Definition at line 40 of file vertexBuffer.h.
◆ Buffer
typedef GLuint BALL::VIEW::MeshBuffer::Buffer[4] |
◆ MeshBuffer() [1/2]
BALL::VIEW::MeshBuffer::MeshBuffer |
( |
| ) |
|
◆ MeshBuffer() [2/2]
BALL::VIEW::MeshBuffer::MeshBuffer |
( |
const MeshBuffer & |
mesh_buffer | ) |
|
◆ ~MeshBuffer()
virtual BALL::VIEW::MeshBuffer::~MeshBuffer |
( |
| ) |
|
|
virtual |
◆ clear()
void BALL::VIEW::MeshBuffer::clear |
( |
| ) |
|
Unset the mesh pointer and clear the buffer.
◆ clearBuffer()
void BALL::VIEW::MeshBuffer::clearBuffer |
( |
| ) |
|
Free the reserved (and filled) vertex buffer.
◆ draw()
bool BALL::VIEW::MeshBuffer::draw |
( |
| ) |
|
Draw the mesh from the buffer.
◆ getMesh()
const Mesh* BALL::VIEW::MeshBuffer::getMesh |
( |
| ) |
|
|
inline |
◆ initGL()
static bool BALL::VIEW::MeshBuffer::initGL |
( |
| ) |
|
|
static |
Initialise the GL needed methods. Call this method one time after having a valid GL context (e.g. in GLRenderer::init).
◆ initialize()
bool BALL::VIEW::MeshBuffer::initialize |
( |
| ) |
|
Transfer all vertex, normal, index and color data of the mesh into the vertex buffer object.
◆ isBusy()
bool BALL::VIEW::MeshBuffer::isBusy |
( |
| ) |
const |
|
inline |
Return true, if currently updateing or drawing.
Definition at line 84 of file vertexBuffer.h.
◆ operator=()
◆ setGLRenderer()
static void BALL::VIEW::MeshBuffer::setGLRenderer |
( |
GLRenderer * |
renderer | ) |
|
|
inlinestatic |
Set the GLRender. This GLRender pointer is used to know if to draw the mesh transparent solid or transparent, as solid triangles or as points. Meshes can currently not drawn in wireframe mode with vertex buffer.
Definition at line 91 of file vertexBuffer.h.
◆ setMesh()
void BALL::VIEW::MeshBuffer::setMesh |
( |
const Mesh & |
mesh | ) |
|
|
inline |
Set the Mesh which shall be drawn with this buffer object.
Definition at line 69 of file vertexBuffer.h.
◆ buffer_
Buffer BALL::VIEW::MeshBuffer::buffer_ |
|
protected |
◆ busy_
bool BALL::VIEW::MeshBuffer::busy_ |
|
protected |
◆ color_
◆ filled_
bool BALL::VIEW::MeshBuffer::filled_ |
|
protected |
◆ gl_renderer_
◆ mesh_
const Mesh* BALL::VIEW::MeshBuffer::mesh_ |
|
protected |
◆ multiple_colors_
bool BALL::VIEW::MeshBuffer::multiple_colors_ |
|
protected |
◆ triangles_
Size BALL::VIEW::MeshBuffer::triangles_ |
|
protected |
◆ vertices_
Size BALL::VIEW::MeshBuffer::vertices_ |
|
protected |