21 #ifndef GLOFFSCREENRENDERER_H_ 22 #define GLOFFSCREENRENDERER_H_ 24 #include <tulip/tulipconf.h> 25 #include <tulip/Coord.h> 26 #include <tulip/GlScene.h> 28 #include <tulip/OpenGlIncludes.h> 32 class QGLFramebufferObject;
37 class GlGraphComposite;
59 class TLP_QT_SCOPE GlOffscreenRenderer {
65 static GlOffscreenRenderer *getInstance();
67 ~GlOffscreenRenderer();
72 void setViewPortSize(
const unsigned int viewPortWidth,
const unsigned int viewPortHeight);
73 unsigned int getViewportWidth();
74 unsigned int getViewportHeight();
75 bool frameBufferOk()
const;
80 void setZoomFactor(
double zoomFactor) {
81 this->zoomFactor = zoomFactor;
83 void setCameraCenter(
const Coord &cameraCenter) {
84 this->cameraCenter = cameraCenter;
87 void setSceneBackgroundColor(
const Color &color);
91 void addGlEntityToScene(GlSimpleEntity *entity);
95 void addGraphCompositeToScene(GlGraphComposite *graphComposite);
100 void addGraphToScene(Graph* graph);
105 void clearScene(
bool deleteGlEntities =
false);
110 void renderScene(
const bool centerScene =
true,
const bool antialiased =
false);
112 void renderExternalScene(GlScene *scene,
const bool antialiased =
false);
121 GLuint getGLTexture(
const bool generateMipMaps =
false);
125 GlOffscreenRenderer();
127 void initFrameBuffers(
const bool antialiased);
129 static GlOffscreenRenderer instance;
131 unsigned int vPWidth, vPHeight;
132 QGLFramebufferObject *glFrameBuf, *glFrameBuf2;
135 unsigned int entitiesCpt;