BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 namespace BALL
23 {
24  namespace VIEW
25  {
26  class Mesh;
27  class GLRenderer;
28 
41  {
42  public:
43 
45 
46  typedef GLuint Buffer[4];
47 
49  MeshBuffer();
50 
52  MeshBuffer(const MeshBuffer& mesh_buffer);
53 
55  virtual ~MeshBuffer();
56 
60  static bool initGL();
61 
63  const MeshBuffer& operator = (const MeshBuffer& buffer);
64 
66  const Mesh* getMesh() { return mesh_;}
67 
69  void setMesh(const Mesh& mesh) {mesh_ = & mesh;}
70 
72  bool initialize();
73 
75  bool draw();
76 
78  void clear();
79 
81  void clearBuffer();
82 
84  bool isBusy() const { return busy_;}
85 
91  static void setGLRenderer(GLRenderer* renderer) { gl_renderer_ = renderer;}
92 
93  protected:
94 
95  const Mesh* mesh_;
96  Buffer buffer_;
97  bool filled_;
99  bool busy_;
104  };
105 
106  } // namespace VIEW
107 } // namespace BALL
108 
109 #endif // BALL_VIEW_RENDERING_VERTEXBUFFER_H
#define BALL_CREATE(name)
Definition: create.h:62
void setMesh(const Mesh &mesh)
Set the Mesh which shall be drawn with this buffer object.
Definition: vertexBuffer.h:69
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
bool isBusy() const
Return true, if currently updateing or drawing.
Definition: vertexBuffer.h:84
static void setGLRenderer(GLRenderer *renderer)
Definition: vertexBuffer.h:91
static GLRenderer * gl_renderer_
Definition: vertexBuffer.h:98