22 #ifndef GLOFFSCREENRENDERER_H_
23 #define GLOFFSCREENRENDERER_H_
25 #include <tulip/GlScene.h>
26 #include <QtOpenGL/QGLFramebufferObject>
50 class TLP_QT_SCOPE GlOffscreenRenderer {
56 static GlOffscreenRenderer *getInstance();
58 ~GlOffscreenRenderer();
63 void setViewPortSize(
const unsigned int viewPortWidth,
const unsigned int viewPortHeight);
64 unsigned int getViewportWidth();
65 unsigned int getViewportHeight();
66 bool frameBufferOk()
const {
67 return glFrameBuf->isValid();
73 void setZoomFactor(
double zoomFactor) {
74 this->zoomFactor = zoomFactor;
76 void setCameraCenter(
const Coord &cameraCenter) {
77 this->cameraCenter = cameraCenter;
80 void setSceneBackgroundColor(
const Color &color);
84 void addGlEntityToScene(GlSimpleEntity *entity);
88 void addGraphCompositeToScene(GlGraphComposite *graphComposite);
93 void addGraphToScene(Graph* graph);
103 void renderScene(
const bool centerScene =
true,
const bool antialiased =
false);
112 GLuint getGLTexture(
const bool generateMipMaps =
false);
116 GlOffscreenRenderer();
118 static GlOffscreenRenderer *instance;
120 unsigned int vPWidth, vPHeight;
121 QGLFramebufferObject *glFrameBuf, *glFrameBuf2;
124 unsigned int entitiesCpt;