21 #ifndef GLOFFSCREENRENDERER_H_
22 #define GLOFFSCREENRENDERER_H_
24 #include <tulip/tulipconf.h>
25 #include <tulip/Coord.h>
26 #include <tulip/GlScene.h>
32 #if defined(__APPLE__)
33 #include <OpenGL/gl.h>
39 class QGLFramebufferObject;
44 class GlGraphComposite;
66 class TLP_QT_SCOPE GlOffscreenRenderer {
72 static GlOffscreenRenderer *getInstance();
74 ~GlOffscreenRenderer();
79 void setViewPortSize(
const unsigned int viewPortWidth,
const unsigned int viewPortHeight);
80 unsigned int getViewportWidth();
81 unsigned int getViewportHeight();
82 bool frameBufferOk()
const;
87 void setZoomFactor(
double zoomFactor) {
88 this->zoomFactor = zoomFactor;
90 void setCameraCenter(
const Coord &cameraCenter) {
91 this->cameraCenter = cameraCenter;
94 void setSceneBackgroundColor(
const Color &color);
98 void addGlEntityToScene(GlSimpleEntity *entity);
102 void addGraphCompositeToScene(GlGraphComposite *graphComposite);
107 void addGraphToScene(Graph* graph);
117 void renderScene(
const bool centerScene =
true,
const bool antialiased =
false);
119 void renderExternalScene(GlScene *scene,
const bool antialiased =
false);
128 GLuint getGLTexture(
const bool generateMipMaps =
false);
132 GlOffscreenRenderer();
134 void initFrameBuffers(
const bool antialiased);
136 static GlOffscreenRenderer *instance;
138 unsigned int vPWidth, vPHeight;
139 QGLFramebufferObject *glFrameBuf, *glFrameBuf2;
142 unsigned int entitiesCpt;