1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qglframebufferobject.cpp -->
<title>Qt 4.8: QGLFramebufferObject Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtopengl.html">QtOpenGL</a></li>
<li>QGLFramebufferObject</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#threading">Threading</a></li>
</ul>
</div>
<h1 class="title">QGLFramebufferObject Class Reference</h1>
<!-- $$$QGLFramebufferObject-brief -->
<p>The QGLFramebufferObject class encapsulates an OpenGL framebuffer object. <a href="#details">More...</a></p>
<!-- @@@QGLFramebufferObject -->
<pre class="cpp"> <span class="preprocessor">#include <QGLFramebufferObject></span></pre><p><b>Inherits: </b><a href="qpaintdevice.html">QPaintDevice</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qglframebufferobject-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#Attachment-enum">Attachment</a></b> { NoAttachment, CombinedDepthStencil, Depth }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#QGLFramebufferObject">QGLFramebufferObject</a></b> ( const QSize & <i>size</i>, GLenum <i>target</i> = GL_TEXTURE_2D )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#QGLFramebufferObject-2">QGLFramebufferObject</a></b> ( int <i>width</i>, int <i>height</i>, GLenum <i>target</i> = GL_TEXTURE_2D )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#QGLFramebufferObject-3">QGLFramebufferObject</a></b> ( const QSize & <i>size</i>, const QGLFramebufferObjectFormat & <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#QGLFramebufferObject-4">QGLFramebufferObject</a></b> ( int <i>width</i>, int <i>height</i>, const QGLFramebufferObjectFormat & <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#QGLFramebufferObject-5">QGLFramebufferObject</a></b> ( int <i>width</i>, int <i>height</i>, Attachment <i>attachment</i>, GLenum <i>target</i> = GL_TEXTURE_2D, GLenum <i>internal_format</i> = GL_RGBA8 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#QGLFramebufferObject-6">QGLFramebufferObject</a></b> ( const QSize & <i>size</i>, Attachment <i>attachment</i>, GLenum <i>target</i> = GL_TEXTURE_2D, GLenum <i>internal_format</i> = GL_RGBA8 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#dtor.QGLFramebufferObject">~QGLFramebufferObject</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Attachment </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#attachment">attachment</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#bind">bind</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#drawTexture">drawTexture</a></b> ( const QRectF & <i>target</i>, GLuint <i>textureId</i>, GLenum <i>textureTarget</i> = GL_TEXTURE_2D )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#drawTexture-2">drawTexture</a></b> ( const QPointF & <i>point</i>, GLuint <i>textureId</i>, GLenum <i>textureTarget</i> = GL_TEXTURE_2D )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLFramebufferObjectFormat </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#format">format</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> GLuint </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#handle">handle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#isBound">isBound</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#release">release</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> GLuint </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#texture">texture</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QImage </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#toImage">toImage</a></b> () const</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QPaintEngine * </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#paintEngine">paintEngine</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#blitFramebuffer">blitFramebuffer</a></b> ( QGLFramebufferObject * <i>target</i>, const QRect & <i>targetRect</i>, QGLFramebufferObject * <i>source</i>, const QRect & <i>sourceRect</i>, GLbitfield <i>buffers</i> = GL_COLOR_BUFFER_BIT, GLenum <i>filter</i> = GL_NEAREST )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#hasOpenGLFramebufferBlit">hasOpenGLFramebufferBlit</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#hasOpenGLFramebufferObjects">hasOpenGLFramebufferObjects</a></b> ()</td></tr>
</table>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qglframebufferobject.html#metric">metric</a></b> ( PaintDeviceMetric <i>metric</i> ) const</td></tr>
</table>
<ul>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGLFramebufferObject-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QGLFramebufferObject class encapsulates an OpenGL framebuffer object.</p>
<p>The QGLFramebufferObject class encapsulates an OpenGL framebuffer object, defined by the <tt>GL_EXT_framebuffer_object</tt> extension. In addition it provides a rendering surface that can be painted on with a <a href="qpainter.html">QPainter</a>, rendered to using native GL calls, or both. This surface can be bound and used as a regular texture in your own GL drawing code. By default, the QGLFramebufferObject class generates a 2D GL texture (using the <tt>GL_TEXTURE_2D</tt> target), which is used as the internal rendering target.</p>
<p><b>It is important to have a current GL context when creating a QGLFramebufferObject, otherwise initialization will fail.</b></p>
<p>OpenGL framebuffer objects and pbuffers (see <a href="qglpixelbuffer.html">QGLPixelBuffer</a>) can both be used to render to offscreen surfaces, but there are a number of advantages with using framebuffer objects instead of pbuffers:</p>
<ol class="1">
<li>A framebuffer object does not require a separate rendering context, so no context switching will occur when switching rendering targets. There is an overhead involved in switching targets, but in general it is cheaper than a context switch to a pbuffer.</li>
<li>Rendering to dynamic textures (i.e. render-to-texture functionality) works on all platforms. No need to do explicit copy calls from a render buffer into a texture, as was necessary on systems that did not support the <tt>render_texture</tt> extension.</li>
<li>It is possible to attach several rendering buffers (or texture objects) to the same framebuffer object, and render to all of them without doing a context switch.</li>
<li>The OpenGL framebuffer extension is a pure GL extension with no system dependant WGL, CGL, or GLX parts. This makes using framebuffer objects more portable.</li>
</ol>
<p>When using a <a href="qpainter.html">QPainter</a> to paint to a QGLFramebufferObject you should take care that the QGLFramebufferObject is created with the <a href="qglframebufferobject.html#Attachment-enum">CombinedDepthStencil</a> attachment for <a href="qpainter.html">QPainter</a> to be able to render correctly. Note that you need to create a QGLFramebufferObject with more than one sample per pixel for primitives to be antialiased when drawing using a <a href="qpainter.html">QPainter</a>. To create a multisample framebuffer object you should use one of the constructors that take a QGLFramebufferObject parameter, and set the QGLFramebufferObject::samples() property to a non-zero value.</p>
<p>When painting to a QGLFramebufferObject using <a href="qpainter.html">QPainter</a>, the state of the current GL context will be altered by the paint engine to reflect its needs. Applications should not rely upon the GL state being reset to its original conditions, particularly the current shader program, GL viewport, texture units, and drawing modes.</p>
<p>For multisample framebuffer objects a color render buffer is created, otherwise a texture with the specified texture target is created. The color render buffer or texture will have the specified internal format, and will be bound to the <tt>GL_COLOR_ATTACHMENT0</tt> attachment in the framebuffer object.</p>
<p>If you want to use a framebuffer object with multisampling enabled as a texture, you first need to copy from it to a regular framebuffer object using QGLContext::blitFramebuffer().</p>
<a name="threading"></a>
<h3>Threading</h3>
<p>As of Qt 4.8, it's possible to draw into a QGLFramebufferObject using a <a href="qpainter.html">QPainter</a> in a separate thread. Note that OpenGL 2.0 or OpenGL ES 2.0 is required for this to work. Also, under X11, it's necessary to set the <a href="qt.html#ApplicationAttribute-enum">Qt::AA_X11InitThreads</a> application attribute.</p>
</div>
<p><b>See also </b><a href="opengl-framebufferobject.html">Framebuffer Object Example</a>.</p>
<!-- @@@QGLFramebufferObject -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Attachment$$$NoAttachment$$$CombinedDepthStencil$$$Depth -->
<h3 class="fn"><a name="Attachment-enum"></a>enum QGLFramebufferObject::<span class="name">Attachment</span></h3>
<p>This enum type is used to configure the depth and stencil buffers attached to the framebuffer object when it is created.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QGLFramebufferObject::NoAttachment</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">No attachment is added to the framebuffer object. Note that the OpenGL depth and stencil tests won't work when rendering to a framebuffer object without any depth or stencil buffers. This is the default value.</td></tr>
<tr><td class="topAlign"><tt>QGLFramebufferObject::CombinedDepthStencil</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">If the <tt>GL_EXT_packed_depth_stencil</tt> extension is present, a combined depth and stencil buffer is attached. If the extension is not present, only a depth buffer is attached.</td></tr>
<tr><td class="topAlign"><tt>QGLFramebufferObject::Depth</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">A depth buffer is attached to the framebuffer object.</td></tr>
</table>
<p>This enum was introduced or modified in Qt 4.3.</p>
<p><b>See also </b><a href="qglframebufferobject.html#attachment">attachment</a>().</p>
<!-- @@@Attachment -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGLFramebufferObject[overload1]$$$QGLFramebufferObjectconstQSize&GLenum -->
<h3 class="fn"><a name="QGLFramebufferObject"></a>QGLFramebufferObject::<span class="name">QGLFramebufferObject</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> & <i>size</i>, <span class="type">GLenum</span> <i>target</i> = GL_TEXTURE_2D )</h3>
<p>Constructs an OpenGL framebuffer object and binds a 2D GL texture to the buffer of the size <i>size</i>. The texture is bound to the <tt>GL_COLOR_ATTACHMENT0</tt> target in the framebuffer object.</p>
<p>The <i>target</i> parameter is used to specify the GL texture target. The default target is <tt>GL_TEXTURE_2D</tt>. Keep in mind that <tt>GL_TEXTURE_2D</tt> textures must have a power of 2 width and height (e.g. 256x512), unless you are using OpenGL 2.0 or higher.</p>
<p>By default, no depth and stencil buffers are attached. This behavior can be toggled using one of the overloaded constructors.</p>
<p>The default internal texture format is <tt>GL_RGBA8</tt> for desktop OpenGL, and <tt>GL_RGBA</tt> for OpenGL/ES.</p>
<p>It is important that you have a current GL context set when creating the <a href="qglframebufferobject.html">QGLFramebufferObject</a>, otherwise the initialization will fail.</p>
<p><b>See also </b><a href="qglframebufferobject.html#size">size</a>(), <a href="qglframebufferobject.html#texture">texture</a>(), and <a href="qglframebufferobject.html#attachment">attachment</a>().</p>
<!-- @@@QGLFramebufferObject -->
<!-- $$$QGLFramebufferObject$$$QGLFramebufferObjectintintGLenum -->
<h3 class="fn"><a name="QGLFramebufferObject-2"></a>QGLFramebufferObject::<span class="name">QGLFramebufferObject</span> ( <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, <span class="type">GLenum</span> <i>target</i> = GL_TEXTURE_2D )</h3>
<p>This is an overloaded function.</p>
<p>Constructs an OpenGL framebuffer object and binds a 2D GL texture to the buffer of the given <i>width</i> and <i>height</i>.</p>
<p><b>See also </b><a href="qglframebufferobject.html#size">size</a>() and <a href="qglframebufferobject.html#texture">texture</a>().</p>
<!-- @@@QGLFramebufferObject -->
<!-- $$$QGLFramebufferObject$$$QGLFramebufferObjectconstQSize&constQGLFramebufferObjectFormat& -->
<h3 class="fn"><a name="QGLFramebufferObject-3"></a>QGLFramebufferObject::<span class="name">QGLFramebufferObject</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> & <i>size</i>, const <span class="type"><a href="qglframebufferobjectformat.html">QGLFramebufferObjectFormat</a></span> & <i>format</i> )</h3>
<p>This is an overloaded function.</p>
<p>Constructs an OpenGL framebuffer object of the given <i>size</i> based on the supplied <i>format</i>.</p>
<!-- @@@QGLFramebufferObject -->
<!-- $$$QGLFramebufferObject$$$QGLFramebufferObjectintintconstQGLFramebufferObjectFormat& -->
<h3 class="fn"><a name="QGLFramebufferObject-4"></a>QGLFramebufferObject::<span class="name">QGLFramebufferObject</span> ( <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="qglframebufferobjectformat.html">QGLFramebufferObjectFormat</a></span> & <i>format</i> )</h3>
<p>This is an overloaded function.</p>
<p>Constructs an OpenGL framebuffer object of the given <i>width</i> and <i>height</i> based on the supplied <i>format</i>.</p>
<!-- @@@QGLFramebufferObject -->
<!-- $$$QGLFramebufferObject$$$QGLFramebufferObjectintintAttachmentGLenumGLenum -->
<h3 class="fn"><a name="QGLFramebufferObject-5"></a>QGLFramebufferObject::<span class="name">QGLFramebufferObject</span> ( <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, <span class="type"><a href="qglframebufferobject.html#Attachment-enum">Attachment</a></span> <i>attachment</i>, <span class="type">GLenum</span> <i>target</i> = GL_TEXTURE_2D, <span class="type">GLenum</span> <i>internal_format</i> = GL_RGBA8 )</h3>
<p>This is an overloaded function.</p>
<p>Constructs an OpenGL framebuffer object and binds a texture to the buffer of the given <i>width</i> and <i>height</i>.</p>
<p>The <i>attachment</i> parameter describes the depth/stencil buffer configuration, <i>target</i> the texture target and <i>internal_format</i> the internal texture format. The default texture target is <tt>GL_TEXTURE_2D</tt>, while the default internal format is <tt>GL_RGBA8</tt> for desktop OpenGL and <tt>GL_RGBA</tt> for OpenGL/ES.</p>
<p><b>See also </b><a href="qglframebufferobject.html#size">size</a>(), <a href="qglframebufferobject.html#texture">texture</a>(), and <a href="qglframebufferobject.html#attachment">attachment</a>().</p>
<!-- @@@QGLFramebufferObject -->
<!-- $$$QGLFramebufferObject$$$QGLFramebufferObjectconstQSize&AttachmentGLenumGLenum -->
<h3 class="fn"><a name="QGLFramebufferObject-6"></a>QGLFramebufferObject::<span class="name">QGLFramebufferObject</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> & <i>size</i>, <span class="type"><a href="qglframebufferobject.html#Attachment-enum">Attachment</a></span> <i>attachment</i>, <span class="type">GLenum</span> <i>target</i> = GL_TEXTURE_2D, <span class="type">GLenum</span> <i>internal_format</i> = GL_RGBA8 )</h3>
<p>This is an overloaded function.</p>
<p>Constructs an OpenGL framebuffer object and binds a texture to the buffer of the given <i>size</i>.</p>
<p>The <i>attachment</i> parameter describes the depth/stencil buffer configuration, <i>target</i> the texture target and <i>internal_format</i> the internal texture format. The default texture target is <tt>GL_TEXTURE_2D</tt>, while the default internal format is <tt>GL_RGBA8</tt> for desktop OpenGL and <tt>GL_RGBA</tt> for OpenGL/ES.</p>
<p><b>See also </b><a href="qglframebufferobject.html#size">size</a>(), <a href="qglframebufferobject.html#texture">texture</a>(), and <a href="qglframebufferobject.html#attachment">attachment</a>().</p>
<!-- @@@QGLFramebufferObject -->
<!-- $$$~QGLFramebufferObject[overload1]$$$~QGLFramebufferObject -->
<h3 class="fn"><a name="dtor.QGLFramebufferObject"></a>QGLFramebufferObject::<span class="name">~QGLFramebufferObject</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the framebuffer object and frees any allocated resources.</p>
<!-- @@@~QGLFramebufferObject -->
<!-- $$$attachment[overload1]$$$attachment -->
<h3 class="fn"><a name="attachment"></a><span class="type"><a href="qglframebufferobject.html#Attachment-enum">Attachment</a></span> QGLFramebufferObject::<span class="name">attachment</span> () const</h3>
<p>Returns the status of the depth and stencil buffers attached to this framebuffer object.</p>
<!-- @@@attachment -->
<!-- $$$bind[overload1]$$$bind -->
<h3 class="fn"><a name="bind"></a><span class="type">bool</span> QGLFramebufferObject::<span class="name">bind</span> ()</h3>
<p>Switches rendering from the default, windowing system provided framebuffer to this framebuffer object. Returns true upon success, false otherwise.</p>
<p><b>See also </b><a href="qglframebufferobject.html#release">release</a>().</p>
<!-- @@@bind -->
<!-- $$$blitFramebuffer[overload1]$$$blitFramebufferQGLFramebufferObject*constQRect&QGLFramebufferObject*constQRect&GLbitfieldGLenum -->
<h3 class="fn"><a name="blitFramebuffer"></a><span class="type">void</span> QGLFramebufferObject::<span class="name">blitFramebuffer</span> ( <span class="type">QGLFramebufferObject</span> * <i>target</i>, const <span class="type"><a href="qrect.html">QRect</a></span> & <i>targetRect</i>, <span class="type">QGLFramebufferObject</span> * <i>source</i>, const <span class="type"><a href="qrect.html">QRect</a></span> & <i>sourceRect</i>, <span class="type">GLbitfield</span> <i>buffers</i> = GL_COLOR_BUFFER_BIT, <span class="type">GLenum</span> <i>filter</i> = GL_NEAREST )<tt> [static]</tt></h3>
<p>Blits from the <i>sourceRect</i> rectangle in the <i>source</i> framebuffer object to the <i>targetRect</i> rectangle in the <i>target</i> framebuffer object.</p>
<p>If <i>source</i> or <i>target</i> is 0, the default framebuffer will be used instead of a framebuffer object as source or target respectively.</p>
<p>The <i>buffers</i> parameter should be a mask consisting of any combination of <tt>GL_COLOR_BUFFER_BIT</tt>, <tt>GL_DEPTH_BUFFER_BIT</tt>, and <tt>GL_STENCIL_BUFFER_BIT</tt>. Any buffer type that is not present both in the source and target buffers is ignored.</p>
<p>The <i>sourceRect</i> and <i>targetRect</i> rectangles may have different sizes; in this case <i>buffers</i> should not contain <tt>GL_DEPTH_BUFFER_BIT</tt> or <tt>GL_STENCIL_BUFFER_BIT</tt>. The <i>filter</i> parameter should be set to <tt>GL_LINEAR</tt> or <tt>GL_NEAREST</tt>, and specifies whether linear or nearest interpolation should be used when scaling is performed.</p>
<p>If <i>source</i> equals <i>target</i> a copy is performed within the same buffer. Results are undefined if the source and target rectangles overlap and have different sizes. The sizes must also be the same if any of the framebuffer objects are multisample framebuffers.</p>
<p>Note that the scissor test will restrict the blit area if enabled.</p>
<p>This function will have no effect unless <a href="qglframebufferobject.html#hasOpenGLFramebufferBlit">hasOpenGLFramebufferBlit</a>() returns true.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qglframebufferobject.html#hasOpenGLFramebufferBlit">hasOpenGLFramebufferBlit</a>().</p>
<!-- @@@blitFramebuffer -->
<!-- $$$drawTexture[overload1]$$$drawTextureconstQRectF&GLuintGLenum -->
<h3 class="fn"><a name="drawTexture"></a><span class="type">void</span> QGLFramebufferObject::<span class="name">drawTexture</span> ( const <span class="type"><a href="qrectf.html">QRectF</a></span> & <i>target</i>, <span class="type">GLuint</span> <i>textureId</i>, <span class="type">GLenum</span> <i>textureTarget</i> = GL_TEXTURE_2D )</h3>
<p>Draws the given texture, <i>textureId</i>, to the given target rectangle, <i>target</i>, in OpenGL model space. The <i>textureTarget</i> should be a 2D texture target.</p>
<p>The framebuffer object should be bound when calling this function.</p>
<p>Equivalent to the corresponding <a href="qglcontext.html#drawTexture">QGLContext::drawTexture</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@drawTexture -->
<!-- $$$drawTexture$$$drawTextureconstQPointF&GLuintGLenum -->
<h3 class="fn"><a name="drawTexture-2"></a><span class="type">void</span> QGLFramebufferObject::<span class="name">drawTexture</span> ( const <span class="type"><a href="qpointf.html">QPointF</a></span> & <i>point</i>, <span class="type">GLuint</span> <i>textureId</i>, <span class="type">GLenum</span> <i>textureTarget</i> = GL_TEXTURE_2D )</h3>
<p>Draws the given texture, <i>textureId</i>, at the given <i>point</i> in OpenGL model space. The <i>textureTarget</i> should be a 2D texture target.</p>
<p>The framebuffer object should be bound when calling this function.</p>
<p>Equivalent to the corresponding <a href="qglcontext.html#drawTexture">QGLContext::drawTexture</a>().</p>
<p>This function was introduced in Qt 4.4.</p>
<!-- @@@drawTexture -->
<!-- $$$format[overload1]$$$format -->
<h3 class="fn"><a name="format"></a><span class="type"><a href="qglframebufferobjectformat.html">QGLFramebufferObjectFormat</a></span> QGLFramebufferObject::<span class="name">format</span> () const</h3>
<p>Returns the format of this framebuffer object.</p>
<!-- @@@format -->
<!-- $$$handle[overload1]$$$handle -->
<h3 class="fn"><a name="handle"></a><span class="type">GLuint</span> QGLFramebufferObject::<span class="name">handle</span> () const</h3>
<p>Returns the GL framebuffer object handle for this framebuffer object (returned by the <tt>glGenFrameBuffersEXT()</tt> function). This handle can be used to attach new images or buffers to the framebuffer. The user is responsible for cleaning up and destroying these objects.</p>
<!-- @@@handle -->
<!-- $$$hasOpenGLFramebufferBlit[overload1]$$$hasOpenGLFramebufferBlit -->
<h3 class="fn"><a name="hasOpenGLFramebufferBlit"></a><span class="type">bool</span> QGLFramebufferObject::<span class="name">hasOpenGLFramebufferBlit</span> ()<tt> [static]</tt></h3>
<p>Returns true if the OpenGL <tt>GL_EXT_framebuffer_blit</tt> extension is present on this system; otherwise returns false.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qglframebufferobject.html#blitFramebuffer">blitFramebuffer</a>().</p>
<!-- @@@hasOpenGLFramebufferBlit -->
<!-- $$$hasOpenGLFramebufferObjects[overload1]$$$hasOpenGLFramebufferObjects -->
<h3 class="fn"><a name="hasOpenGLFramebufferObjects"></a><span class="type">bool</span> QGLFramebufferObject::<span class="name">hasOpenGLFramebufferObjects</span> ()<tt> [static]</tt></h3>
<p>Returns true if the OpenGL <tt>GL_EXT_framebuffer_object</tt> extension is present on this system; otherwise returns false.</p>
<!-- @@@hasOpenGLFramebufferObjects -->
<!-- $$$isBound[overload1]$$$isBound -->
<h3 class="fn"><a name="isBound"></a><span class="type">bool</span> QGLFramebufferObject::<span class="name">isBound</span> () const</h3>
<p>Returns true if the framebuffer object is currently bound to a context, otherwise false is returned.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@isBound -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QGLFramebufferObject::<span class="name">isValid</span> () const</h3>
<p>Returns true if the framebuffer object is valid.</p>
<p>The framebuffer can become invalid if the initialization process fails, the user attaches an invalid buffer to the framebuffer object, or a non-power of two width/height is specified as the texture size if the texture target is <tt>GL_TEXTURE_2D</tt>. The non-power of two limitation does not apply if the OpenGL version is 2.0 or higher, or if the GL_ARB_texture_non_power_of_two extension is present.</p>
<p>The framebuffer can also become invalid if the <a href="qglcontext.html">QGLContext</a> that the framebuffer was created within is destroyed and there are no other shared contexts that can take over ownership of the framebuffer.</p>
<!-- @@@isValid -->
<!-- $$$metric[overload1]$$$metricPaintDeviceMetric -->
<h3 class="fn"><a name="metric"></a><span class="type">int</span> QGLFramebufferObject::<span class="name">metric</span> ( <span class="type"><a href="qpaintdevice.html#PaintDeviceMetric-enum">PaintDeviceMetric</a></span> <i>metric</i> ) const<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qpaintdevice.html#metric">QPaintDevice::metric</a>().</p>
<!-- @@@metric -->
<!-- $$$paintEngine[overload1]$$$paintEngine -->
<h3 class="fn"><a name="paintEngine"></a><span class="type"><a href="qpaintengine.html">QPaintEngine</a></span> * QGLFramebufferObject::<span class="name">paintEngine</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qpaintdevice.html#paintEngine">QPaintDevice::paintEngine</a>().</p>
<!-- @@@paintEngine -->
<!-- $$$release[overload1]$$$release -->
<h3 class="fn"><a name="release"></a><span class="type">bool</span> QGLFramebufferObject::<span class="name">release</span> ()</h3>
<p>Switches rendering back to the default, windowing system provided framebuffer. Returns true upon success, false otherwise.</p>
<p><b>See also </b><a href="qglframebufferobject.html#bind">bind</a>().</p>
<!-- @@@release -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type"><a href="qsize.html">QSize</a></span> QGLFramebufferObject::<span class="name">size</span> () const</h3>
<p>Returns the size of the texture attached to this framebuffer object.</p>
<!-- @@@size -->
<!-- $$$texture[overload1]$$$texture -->
<h3 class="fn"><a name="texture"></a><span class="type">GLuint</span> QGLFramebufferObject::<span class="name">texture</span> () const</h3>
<p>Returns the texture id for the texture attached as the default rendering target in this framebuffer object. This texture id can be bound as a normal texture in your own GL code.</p>
<p>If a multisample framebuffer object is used then the value returned from this function will be invalid.</p>
<!-- @@@texture -->
<!-- $$$toImage[overload1]$$$toImage -->
<h3 class="fn"><a name="toImage"></a><span class="type"><a href="qimage.html">QImage</a></span> QGLFramebufferObject::<span class="name">toImage</span> () const</h3>
<p>Returns the contents of this framebuffer object as a <a href="qimage.html">QImage</a>.</p>
<!-- @@@toImage -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|