21 #ifndef Tulip_QGLBUFFERMANAGER_H 22 #define Tulip_QGLBUFFERMANAGER_H 26 #include <tulip/tulipconf.h> 29 class QGLFramebufferObject;
36 class TLP_QT_SCOPE QGlBufferManager {
42 static QGlBufferManager &getInst() {
44 inst =
new QGlBufferManager();
49 static void clearBuffers();
54 bool canUsePixelBuffer() {
55 return pixelBufferWork;
61 bool canUseFramebufferObject() {
62 return framebufferObjectWork;
68 QGLPixelBuffer *getPixelBuffer(
int width,
int height);
73 QGLFramebufferObject *getFramebufferObject(
int width,
int height);
81 static QGlBufferManager *inst;
83 std::map<std::pair<int, int>, QGLPixelBuffer *> widthHeightToBuffer;
84 std::map<QGLPixelBuffer *, std::pair<int, int>> bufferToWidthHeight;
85 std::map<std::pair<int, int>, QGLFramebufferObject *> widthHeightToFramebuffer;
86 std::map<QGLFramebufferObject *, std::pair<int, int>> framebufferToWidthHeight;
89 bool framebufferObjectWork;
93 #endif // Tulip_QGLBUFFERMANAGER_H