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);
111 void renderScene(
const bool centerScene =
true,
const bool antialiased =
false);
113 void renderExternalScene(GlScene *scene,
const bool antialiased =
false);
124 GLuint getGLTexture(
const bool generateMipMaps =
false);
127 GlOffscreenRenderer();
129 void initFrameBuffers(
const bool antialiased);
131 static GlOffscreenRenderer instance;
133 unsigned int vPWidth, vPHeight;
134 QGLFramebufferObject *glFrameBuf, *glFrameBuf2;
137 unsigned int entitiesCpt;