BALL  1.5.0
glDisplayList.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: glDisplayList.h,v 1.8.16.1 2007/03/25 21:26:14 oliver Exp $
5 
6 #ifndef BALL_VIEW_RENDERING_GLDISPLAYLIST_H
7 #define BALL_VIEW_RENDERING_GLDISPLAYLIST_H
8 
9 #ifndef BALL_COMMON_H
10 # include <BALL/common.h>
11 #endif
12 
13 #include <QtOpenGL/qgl.h>
14 
15 namespace BALL
16 {
17  namespace VIEW
18  {
19 
32 {
33  public:
34 
36 
37 
40 
45  typedef unsigned long GLList;
46 
48 
51 
56  static const GLList DISPLAYLIST_NOT_DEFINED;
57 
59 
62 
68  class BALL_VIEW_EXPORT NestedDisplayList: public Exception::GeneralException
69  {
70  public:
71 
72  NestedDisplayList(const char* file, int line) ;
73  };
74 
81  {
82  public:
83 
84  NoDisplayListAvailable(const char* file, int line);
85  };
86 
93  {
94  public:
95 
96  DisplayListRedeclaration(const char* file, int line);
97  };
98 
100 
103 
111  GLDisplayList();
112 
114 
117 
121  virtual ~GLDisplayList();
122 
126  virtual void clear();
127 
129 
132 
144  void startDefinition();
145 
150  void endDefinition();
151 
160  void draw();
161 
172  void useCompileMode();
173 
185  void useCompileAndExecuteMode();
186 
188 
191 
196  bool isCompileMode() const;
197 
202  bool isCompileAndExecuteMode() const;
203 
205 
211  virtual bool isValid() const
212  { return GL_list_ != 0; }
213 
220  virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
221 
223 
224  private:
225 
226  /* compile switch */
227  bool compile_;
228 
229  /* display list */
230  GLList GL_list_;
231 };
232 
233 # ifndef BALL_NO_INLINE_FUNCTIONS
234 # include <BALL/VIEW/RENDERING/glDisplayList.iC>
235 # endif
236 
237  } // namespace VIEW
238 } // namespace BALL
239 
240 #endif // BALL_VIEW_RENDERING_GLDISPLAYLIST_H
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
virtual bool isValid() const
Definition: constants.h:12
#define BALL_CREATE(name)
Definition: create.h:62