Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5363

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?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/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <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 class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></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 &lt;QGLFramebufferObject&gt;</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 &amp; <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 &amp; <i>size</i>, const QGLFramebufferObjectFormat &amp; <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 &amp; <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 &amp; <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 &amp; <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 &amp; <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 &amp; <i>targetRect</i>, QGLFramebufferObject * <i>source</i>, const QRect &amp; <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&#x2e; 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> &amp; <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&#x2e; 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> &amp; <i>size</i>, const <span class="type"><a href="qglframebufferobjectformat.html">QGLFramebufferObjectFormat</a></span> &amp; <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> &amp; <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> &amp; <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> &amp; <i>targetRect</i>, <span class="type">QGLFramebufferObject</span> * <i>source</i>, const <span class="type"><a href="qrect.html">QRect</a></span> &amp; <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> &amp; <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> &amp; <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>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      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>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      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>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>