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>
38 class QGLFramebufferObject;
43 class GlGraphComposite;
65 class TLP_QT_SCOPE GlOffscreenRenderer {
71 static GlOffscreenRenderer *getInstance();
73 ~GlOffscreenRenderer();
78 void setViewPortSize(
const unsigned int viewPortWidth,
const unsigned int viewPortHeight);
79 unsigned int getViewportWidth();
80 unsigned int getViewportHeight();
81 bool frameBufferOk()
const;
86 void setZoomFactor(
double zoomFactor) {
87 this->zoomFactor = zoomFactor;
89 void setCameraCenter(
const Coord &cameraCenter) {
90 this->cameraCenter = cameraCenter;
93 void setSceneBackgroundColor(
const Color &color);
97 void addGlEntityToScene(GlSimpleEntity *entity);
101 void addGraphCompositeToScene(GlGraphComposite *graphComposite);
106 void addGraphToScene(Graph* graph);
116 void renderScene(
const bool centerScene =
true,
const bool antialiased =
false);
118 void renderExternalScene(GlScene *scene,
const bool antialiased =
false);
127 GLuint getGLTexture(
const bool generateMipMaps =
false);
131 GlOffscreenRenderer();
133 void initFrameBuffers(
const bool antialiased);
135 static GlOffscreenRenderer *instance;
137 unsigned int vPWidth, vPHeight;
138 QGLFramebufferObject *glFrameBuf, *glFrameBuf2;
141 unsigned int entitiesCpt;