7 #ifndef BALL_VIEW_RENDERING_GLRENDERER_H
8 #define BALL_VIEW_RENDERING_GLRENDERER_H
10 #ifndef BALL_VIEW_RENDERING_RENDERER_H
14 #ifndef BALL_MATHS_QUATERNION_H
18 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
22 #ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H
26 #ifndef BALL_VIEW_KERNEL_STAGE_H
34 #ifndef BALL_VIEW_RENDERING_GLDISPLAYLIST_H
38 #ifndef BALL_DATATYPE_REGULARDATA3D_H
52 #define BALL_GLRENDERER_PICKING_NUMBER_OF_MAX_OBJECTS 1000000
83 DUAL_VIEW_DIFFERENT_DISPLAY_STEREO
90 RENDER_MODE_UNDEFINED = 0,
99 RENDER_MODE_ALWAYS_FRONT
107 DIRECT_RENDERING = 0,
113 REBUILD_DISPLAY_LISTS
126 WrongModes(
const char* file,
int line,
int mode,
int precision);
139 virtual void clear();
142 void dump(std::ostream& s,
Size depth)
const;
150 virtual bool init(
Scene& scene);
153 virtual bool init(
const Stage& stage,
float width,
float height);
156 virtual void setLights(
bool reset_all =
false);
160 virtual void setSmoothLines(
bool smooth_lines);
161 virtual bool getSmoothLines();
182 void pickObjects2(std::list<GeometricObject*>& objects);
185 void enterPickingMode();
188 void exitPickingMode();
191 void setSize(
float width,
float height);
194 float getXScale()
const;
197 float getYScale()
const;
200 virtual void updateBackgroundColor();
203 void initTransparent();
209 void initAlwaysFront();
212 void setAntialiasing(
bool state);
242 virtual void renderToBuffer(
RenderTarget* renderTarget, BufferMode);
245 virtual bool render(
const Representation& representation,
bool for_display_list =
false);
247 virtual void bufferingDependentRender_(
const Representation& repr, BufferMode mode);
252 bool isExtensionSupported(
const String& extension)
const;
258 bool vertexBuffersSupported()
const;
267 String getOpenGLVersion();
270 vector<String> getExtensions();
273 bool enableVertexBuffers(
bool state);
276 bool vertexBuffersEnabled()
const;
282 void initPerspective();
285 void setProjection();
288 void setColorRGBA_(
const ColorRGBA& color);
291 void vertexVector3_(
const Vector3& v);
294 void updateCamera(
const Camera* camera = 0);
297 void setupStereo(
float eye_separation,
float focal_length);
302 void getFrustum(
float& near,
float& far,
float& left,
float& right,
float& top,
float& bottom);
309 bool mapViewplaneToScreen_();
311 void renderRepresentation_(
const Representation& representation,
bool for_display_list);
314 void renderRepresentations_(BufferMode mode);
317 virtual void renderLabel_(
const Label& );
320 virtual void renderLine_(
const Line& );
323 virtual void renderMultiLine_(
const MultiLine& line);
326 virtual void renderMesh_(
const Mesh& );
329 virtual void renderQuadMesh_(
const QuadMesh& );
332 void initDrawingMeshes_();
335 void initDrawingOthers_();
344 virtual void renderRuler();
347 virtual void renderPoint_(
const Point& );
350 virtual void renderSimpleBox_(
const SimpleBox& );
353 virtual void renderBox_(
const Box& );
356 virtual void renderSphere_(
const Sphere& );
359 virtual void renderDisc_(
const Disc& );
362 virtual void renderTube_(
const Tube& );
371 virtual void renderClippingPlane_(
const ClippingPlane& plane);
380 void createSpheres_();
389 void createDottedSphere_(
int precision);
395 void createLineBox_();
398 void createDotBox_();
401 void createSolidBox_();
407 void normalVector3_(
const Vector3& v);
411 void translateVector3_(
const Vector3& v);
415 { glTexCoord3f(v.
x, v.
y, v.
z); }
418 void scaleVector3_(
const Vector3& v);
421 void rotateVector3Angle_(
const Vector3& v,
Real angle);
424 void scale_(
float f);
430 void setOrthographicZoom(
float orthographic_zoom);
433 float getOrthographicZoom(
void);
436 void generateIlluminationTexture_(
float ka,
float kd,
float kr,
float shininess);
472 GLubyte line_tex_[128][128][4];
506 # ifndef BALL_NO_INLINE_FUNCTIONS
507 # include <BALL/VIEW/RENDERING/glRenderer.iC>
513 #endif // BALL_VIEW_RENDERING_GLRENDERER_H