src/opengl/qglframebufferobject_p.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   109 public:
   109 public:
   110     virtual QPaintEngine* paintEngine() const {return fbo->paintEngine();}
   110     virtual QPaintEngine* paintEngine() const {return fbo->paintEngine();}
   111     virtual QSize size() const {return fbo->size();}
   111     virtual QSize size() const {return fbo->size();}
   112     virtual QGLContext* context() const;
   112     virtual QGLContext* context() const;
   113     virtual QGLFormat format() const {return fboFormat;}
   113     virtual QGLFormat format() const {return fboFormat;}
   114     virtual void ensureActiveTarget();
       
   115     virtual void beginPaint();
       
   116     virtual void endPaint();
       
   117 
   114 
   118     void setFBO(QGLFramebufferObject* f,
   115     void setFBO(QGLFramebufferObject* f,
   119                 QGLFramebufferObject::Attachment attachment);
   116                 QGLFramebufferObject::Attachment attachment);
   120 
   117 
   121 private:
   118 private:
   125 };
   122 };
   126 
   123 
   127 class QGLFramebufferObjectPrivate
   124 class QGLFramebufferObjectPrivate
   128 {
   125 {
   129 public:
   126 public:
   130     QGLFramebufferObjectPrivate() : fbo_guard(0), texture(0), depth_stencil_buffer(0), color_buffer(0), valid(false), previous_fbo(0), engine(0) {}
   127     QGLFramebufferObjectPrivate() : fbo_guard(0), texture(0), depth_stencil_buffer(0)
       
   128                                   , color_buffer(0), valid(false), engine(0) {}
   131     ~QGLFramebufferObjectPrivate() {}
   129     ~QGLFramebufferObjectPrivate() {}
   132 
   130 
   133     void init(QGLFramebufferObject *q, const QSize& sz,
   131     void init(QGLFramebufferObject *q, const QSize& sz,
   134               QGLFramebufferObject::Attachment attachment,
   132               QGLFramebufferObject::Attachment attachment,
   135               GLenum internal_format, GLenum texture_target, GLint samples = 0);
   133               GLenum internal_format, GLenum texture_target, GLint samples = 0);
   141     GLenum target;
   139     GLenum target;
   142     QSize size;
   140     QSize size;
   143     QGLFramebufferObjectFormat format;
   141     QGLFramebufferObjectFormat format;
   144     uint valid : 1;
   142     uint valid : 1;
   145     QGLFramebufferObject::Attachment fbo_attachment;
   143     QGLFramebufferObject::Attachment fbo_attachment;
   146     GLuint previous_fbo;
       
   147     mutable QPaintEngine *engine;
   144     mutable QPaintEngine *engine;
   148     QGLFBOGLPaintDevice glDevice;
   145     QGLFBOGLPaintDevice glDevice;
   149 
   146 
   150     inline GLuint fbo() const { return fbo_guard.id(); }
   147     inline GLuint fbo() const { return fbo_guard.id(); }
   151 };
   148 };