Loading...
Searching...
No Matches
vertexBuffer.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: vertexBuffer.h,v 1.6 2005/12/23 17:02:21 amoll Exp $
//
#ifndef BALL_VIEW_RENDERING_RENDERERS_VERTEXBUFFER_H
#define BALL_VIEW_RENDERING_RENDERERS_VERTEXBUFFER_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_VIEW_KERNEL_COMMON_H
# include <BALL/VIEW/KERNEL/common.h>
#endif
#ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
# include <BALL/VIEW/DATATYPE/colorRGBA.h>
#endif
//#include <QtGui/QOpenGLFunctions>
namespace BALL
{
namespace VIEW
{
class Mesh;
class GLRenderer;
class BALL_VIEW_EXPORT MeshBuffer //: protected QOpenGLFunctions
{
public:
BALL_CREATE(MeshBuffer)
typedef GLuint Buffer[4];
MeshBuffer();
MeshBuffer(const MeshBuffer& mesh_buffer);
virtual ~MeshBuffer();
static bool initGL();
const MeshBuffer& operator = (const MeshBuffer& buffer);
const Mesh* getMesh() { return mesh_;}
void setMesh(const Mesh& mesh) {mesh_ = & mesh;}
bool initialize();
bool draw();
void clear();
void clearBuffer();
bool isBusy() const { return busy_;}
static void setGLRenderer(GLRenderer* renderer) { gl_renderer_ = renderer;}
protected:
const Mesh* mesh_;
Buffer buffer_;
bool filled_;
static GLRenderer* gl_renderer_;
bool busy_;
bool multiple_colors_;
ColorRGBA color_;
Size vertices_;
Size triangles_;
};
} // namespace VIEW
} // namespace BALL
#endif // BALL_VIEW_RENDERING_VERTEXBUFFER_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
common.h
BALL::VIEW::ColorRGBA
Definition colorRGBA.h:32
BALL::VIEW::GLRenderer
Definition glRenderer.h:76
BALL::VIEW::MeshBuffer::Buffer
GLuint Buffer[4]
Definition vertexBuffer.h:48
BALL::VIEW::MeshBuffer::isBusy
bool isBusy() const
Return true, if currently updateing or drawing.
Definition vertexBuffer.h:86
BALL::VIEW::MeshBuffer::getMesh
const Mesh * getMesh()
Get the Mesh for this buffer object.
Definition vertexBuffer.h:68
BALL::VIEW::MeshBuffer::mesh_
const Mesh * mesh_
Definition vertexBuffer.h:97
BALL::VIEW::MeshBuffer::initGL
static bool initGL()
BALL::VIEW::MeshBuffer::buffer_
Buffer buffer_
Definition vertexBuffer.h:98
BALL::VIEW::MeshBuffer::filled_
bool filled_
Definition vertexBuffer.h:99
BALL::VIEW::MeshBuffer::triangles_
Size triangles_
Definition vertexBuffer.h:105
BALL::VIEW::MeshBuffer::gl_renderer_
static GLRenderer * gl_renderer_
Definition vertexBuffer.h:100
BALL::VIEW::MeshBuffer::clearBuffer
void clearBuffer()
Free the reserved (and filled) vertex buffer.
BALL::VIEW::MeshBuffer::busy_
bool busy_
Definition vertexBuffer.h:101
BALL::VIEW::MeshBuffer::draw
bool draw()
Draw the mesh from the buffer.
BALL::VIEW::MeshBuffer::MeshBuffer
MeshBuffer()
BALL::VIEW::MeshBuffer::color_
ColorRGBA color_
Definition vertexBuffer.h:103
BALL::VIEW::MeshBuffer::multiple_colors_
bool multiple_colors_
Definition vertexBuffer.h:102
BALL::VIEW::MeshBuffer::setMesh
void setMesh(const Mesh &mesh)
Set the Mesh which shall be drawn with this buffer object.
Definition vertexBuffer.h:71
BALL::VIEW::MeshBuffer::setGLRenderer
static void setGLRenderer(GLRenderer *renderer)
Definition vertexBuffer.h:93
BALL::VIEW::MeshBuffer::clear
void clear()
Unset the mesh pointer and clear the buffer.
BALL::VIEW::MeshBuffer::vertices_
Size vertices_
Definition vertexBuffer.h:104
BALL::VIEW::MeshBuffer::initialize
bool initialize()
Transfer all vertex, normal, index and color data of the mesh into the vertex buffer object.
BALL::VIEW::Mesh
Definition mesh.h:42
colorRGBA.h
common.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114