BALL  1.5.0
vertexBuffer.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: vertexBuffer.h,v 1.6 2005/12/23 17:02:21 amoll Exp $
5 //
6 
7 #ifndef BALL_VIEW_RENDERING_RENDERERS_VERTEXBUFFER_H
8 #define BALL_VIEW_RENDERING_RENDERERS_VERTEXBUFFER_H
9 
10 #ifndef BALL_COMMON_H
11 # include <BALL/common.h>
12 #endif
13 
14 #ifndef BALL_VIEW_KERNEL_COMMON_H
15 # include <BALL/VIEW/KERNEL/common.h>
16 #endif
17 
18 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
20 #endif
21 
22 //#include <QtGui/QOpenGLFunctions>
23 
24 namespace BALL
25 {
26  namespace VIEW
27  {
28  class Mesh;
29  class GLRenderer;
30 
42  class BALL_VIEW_EXPORT MeshBuffer //: protected QOpenGLFunctions
43  {
44  public:
45 
47 
48  typedef GLuint Buffer[4];
49 
51  MeshBuffer();
52 
54  MeshBuffer(const MeshBuffer& mesh_buffer);
55 
57  virtual ~MeshBuffer();
58 
62  static bool initGL();
63 
65  const MeshBuffer& operator = (const MeshBuffer& buffer);
66 
68  const Mesh* getMesh() { return mesh_;}
69 
71  void setMesh(const Mesh& mesh) {mesh_ = & mesh;}
72 
74  bool initialize();
75 
77  bool draw();
78 
80  void clear();
81 
83  void clearBuffer();
84 
86  bool isBusy() const { return busy_;}
87 
93  static void setGLRenderer(GLRenderer* renderer) { gl_renderer_ = renderer;}
94 
95  protected:
96 
97  const Mesh* mesh_;
98  Buffer buffer_;
99  bool filled_;
101  bool busy_;
106  };
107 
108  } // namespace VIEW
109 } // namespace BALL
110 
111 #endif // BALL_VIEW_RENDERING_VERTEXBUFFER_H
void setMesh(const Mesh &mesh)
Set the Mesh which shall be drawn with this buffer object.
Definition: vertexBuffer.h:71
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
static GLRenderer * gl_renderer_
Definition: vertexBuffer.h:100
bool isBusy() const
Return true, if currently updateing or drawing.
Definition: vertexBuffer.h:86
static void setGLRenderer(GLRenderer *renderer)
Definition: vertexBuffer.h:93
Definition: constants.h:12
#define BALL_CREATE(name)
Definition: create.h:62