Qt 4.8
Public Functions | Properties | List of all members
QGLFBOGLPaintDevice Class Reference

#include <qglframebufferobject_p.h>

Inheritance diagram for QGLFBOGLPaintDevice:
QGLPaintDevice QPaintDevice

Public Functions

virtual bool alphaRequested () const
 
virtual QGLContextcontext () const
 
virtual QGLFormat format () const
 
virtual QPaintEnginepaintEngine () const
 
void setFBO (QGLFramebufferObject *f, QGLFramebufferObject::Attachment attachment)
 
virtual QSize size () const
 
- Public Functions inherited from QGLPaintDevice
virtual void beginPaint ()
 
int devType () const
 
virtual void endPaint ()
 
virtual void ensureActiveTarget ()
 
virtual bool isFlipped () const
 
 QGLPaintDevice ()
 
virtual ~QGLPaintDevice ()
 
- Public Functions inherited from QPaintDevice
int colorCount () const
 
int depth () const
 
virtual HDC getDC () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
QT_DEPRECATED int numColors () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
virtual void releaseDC (HDC hdc) const
 
int width () const
 
int widthMM () const
 
virtual ~QPaintDevice ()
 

Properties

QGLFramebufferObjectfbo
 
QGLFormat fboFormat
 
bool reqAlpha
 
bool wasBound
 

Additional Inherited Members

- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric {
  PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM,
  PdmNumColors, PdmDepth, PdmDpiX, PdmDpiY,
  PdmPhysicalDpiX, PdmPhysicalDpiY
}
 
- Static Public Functions inherited from QGLPaintDevice
static QGLPaintDevicegetDevice (QPaintDevice *)
 
- Static Public Functions inherited from QPaintDevice
static QWSDisplayqwsDisplay ()
 
- Protected Functions inherited from QGLPaintDevice
int metric (QPaintDevice::PaintDeviceMetric metric) const
 
- Protected Functions inherited from QPaintDevice
 QPaintDevice ()
 
- Protected Variables inherited from QGLPaintDevice
GLuint m_previousFBO
 
GLuint m_thisFBO
 
- Protected Variables inherited from QPaintDevice
ushort painters
 

Detailed Description

Definition at line 111 of file qglframebufferobject_p.h.

Functions

◆ alphaRequested()

virtual bool QGLFBOGLPaintDevice::alphaRequested ( ) const
inlinevirtual

Reimplemented from QGLPaintDevice.

Definition at line 118 of file qglframebufferobject_p.h.

118 { return reqAlpha; }

◆ context()

QGLContext * QGLFBOGLPaintDevice::context ( ) const
virtual

Implements QGLPaintDevice.

Definition at line 383 of file qglframebufferobject.cpp.

384 {
385  QGLContext *fboContext = const_cast<QGLContext *>(fbo->d_ptr->fbo_guard.context());
386  QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
387 
388  if (QGLContextPrivate::contextGroup(fboContext) == QGLContextPrivate::contextGroup(currentContext))
389  return currentContext;
390  else
391  return fboContext;
392 }
const QGLContext * context() const
Definition: qgl_p.h:873
static const QGLContext * currentContext()
Returns the current context, i.e.
Definition: qgl.cpp:3545
QGLSharedResourceGuard fbo_guard
QScopedPointer< QGLFramebufferObjectPrivate > d_ptr
The QGLContext class encapsulates an OpenGL rendering context.
Definition: qgl.h:310
static QGLContextGroup * contextGroup(const QGLContext *ctx)
Definition: qgl_p.h:464
QGLFramebufferObject * fbo

◆ format()

virtual QGLFormat QGLFBOGLPaintDevice::format ( ) const
inlinevirtual

Reimplemented from QGLPaintDevice.

Definition at line 117 of file qglframebufferobject_p.h.

117 {return fboFormat;}

◆ paintEngine()

virtual QPaintEngine* QGLFBOGLPaintDevice::paintEngine ( ) const
inlinevirtual

Implements QPaintDevice.

Definition at line 114 of file qglframebufferobject_p.h.

114 {return fbo->paintEngine();}
QPaintEngine * paintEngine() const
Reimplemented Function
QGLFramebufferObject * fbo

◆ setFBO()

void QGLFBOGLPaintDevice::setFBO ( QGLFramebufferObject f,
QGLFramebufferObject::Attachment  attachment 
)

Definition at line 355 of file qglframebufferobject.cpp.

357 {
358  fbo = f;
359  m_thisFBO = fbo->d_func()->fbo(); // This shouldn't be needed
360 
361  // The context that the fbo was created in may not have depth
362  // and stencil buffers, but the fbo itself might.
364  if (attachment == QGLFramebufferObject::CombinedDepthStencil) {
365  fboFormat.setDepth(true);
366  fboFormat.setStencil(true);
367  } else if (attachment == QGLFramebufferObject::Depth) {
368  fboFormat.setDepth(true);
369  fboFormat.setStencil(false);
370  } else {
371  fboFormat.setDepth(false);
372  fboFormat.setStencil(false);
373  }
374 
376  reqAlpha = (format != GL_RGB
377 #ifndef QT_OPENGL_ES
378  && format != GL_RGB5 && format != GL_RGB8
379 #endif
380  );
381 }
#define GL_RGB
void setStencil(bool enable)
If enable is true enables the stencil buffer; otherwise disables the stencil buffer.
Definition: qgl.cpp:724
static const QGLContext * currentContext()
Returns the current context, i.e.
Definition: qgl.cpp:3545
QGLFormat format() const
Returns the frame buffer format that was obtained (this may be a subset of what was requested)...
Definition: qgl.cpp:3495
QGLFramebufferObjectFormat format() const
Returns the format of this framebuffer object.
GLenum internalTextureFormat() const
Returns the internal format of a framebuffer object&#39;s texture or multisample framebuffer object&#39;s col...
void setDepth(bool enable)
If enable is true enables the depth buffer; otherwise disables the depth buffer.
Definition: qgl.cpp:599
QGLFramebufferObject * fbo
unsigned int GLenum
Definition: main.cpp:50

◆ size()

virtual QSize QGLFBOGLPaintDevice::size ( ) const
inlinevirtual

Implements QGLPaintDevice.

Definition at line 115 of file qglframebufferobject_p.h.

115 {return fbo->size();}
QSize size() const
Returns the size of the texture attached to this framebuffer object.
QGLFramebufferObject * fbo

Properties

◆ fbo

QGLFramebufferObject* QGLFBOGLPaintDevice::fbo
private

Definition at line 124 of file qglframebufferobject_p.h.

◆ fboFormat

QGLFormat QGLFBOGLPaintDevice::fboFormat
private

Definition at line 125 of file qglframebufferobject_p.h.

◆ reqAlpha

bool QGLFBOGLPaintDevice::reqAlpha
private

Definition at line 127 of file qglframebufferobject_p.h.

◆ wasBound

bool QGLFBOGLPaintDevice::wasBound
private

Definition at line 126 of file qglframebufferobject_p.h.


The documentation for this class was generated from the following files: