424 lines
32 KiB
HTML
424 lines
32 KiB
HTML
<?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" />
|
|
<!-- qglpixelbuffer.cpp -->
|
|
<title>Qt 4.8: QGLPixelBuffer 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 & 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> 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 & 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>QGLPixelBuffer</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-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">QGLPixelBuffer Class Reference</h1>
|
|
<!-- $$$QGLPixelBuffer-brief -->
|
|
<p>The QGLPixelBuffer class encapsulates an OpenGL pbuffer. <a href="#details">More...</a></p>
|
|
<!-- @@@QGLPixelBuffer -->
|
|
<pre class="cpp"> <span class="preprocessor">#include <QGLPixelBuffer></span></pre><p><b>Inherits: </b><a href="qpaintdevice.html">QPaintDevice</a>.</p>
|
|
<p>This class was introduced in Qt 4.1.</p>
|
|
<ul>
|
|
<li><a href="qglpixelbuffer-members.html">List of all members, including inherited members</a></li>
|
|
</ul>
|
|
<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="qglpixelbuffer.html#QGLPixelBuffer">QGLPixelBuffer</a></b> ( const QSize & <i>size</i>, const QGLFormat & <i>format</i> = QGLFormat::defaultFormat(), QGLWidget * <i>shareWidget</i> = 0 )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#QGLPixelBuffer-2">QGLPixelBuffer</a></b> ( int <i>width</i>, int <i>height</i>, const QGLFormat & <i>format</i> = QGLFormat::defaultFormat(), QGLWidget * <i>shareWidget</i> = 0 )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#dtor.QGLPixelBuffer">~QGLPixelBuffer</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> GLuint </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#bindTexture">bindTexture</a></b> ( const QImage & <i>image</i>, GLenum <i>target</i> = GL_TEXTURE_2D )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> GLuint </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#bindTexture-2">bindTexture</a></b> ( const QPixmap & <i>pixmap</i>, GLenum <i>target</i> = GL_TEXTURE_2D )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> GLuint </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#bindTexture-3">bindTexture</a></b> ( const QString & <i>fileName</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#bindToDynamicTexture">bindToDynamicTexture</a></b> ( GLuint <i>texture_id</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#deleteTexture">deleteTexture</a></b> ( GLuint <i>texture_id</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#doneCurrent">doneCurrent</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.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="qglpixelbuffer.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"> QGLFormat </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#format">format</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> GLuint </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#generateDynamicTexture">generateDynamicTexture</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> Qt::HANDLE </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#handle">handle</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#isValid">isValid</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#makeCurrent">makeCurrent</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#releaseFromDynamicTexture">releaseFromDynamicTexture</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#size">size</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QImage </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#toImage">toImage</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#updateDynamicTexture">updateDynamicTexture</a></b> ( GLuint <i>texture_id</i> ) 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="qglpixelbuffer.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"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglpixelbuffer.html#hasOpenGLPbuffers">hasOpenGLPbuffers</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="qglpixelbuffer.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>
|
|
<!-- $$$QGLPixelBuffer-description -->
|
|
<div class="descr">
|
|
<h2>Detailed Description</h2>
|
|
<p>The QGLPixelBuffer class encapsulates an OpenGL pbuffer.</p>
|
|
<p>Rendering into a pbuffer is normally done using full hardware acceleration. This can be significantly faster than rendering into a <a href="qpixmap.html">QPixmap</a>.</p>
|
|
<p>There are three approaches to using this class:</p>
|
|
<ol class="1">
|
|
<li><b>We can draw into the pbuffer and convert it to a <a href="qimage.html">QImage</a> using <a href="qglpixelbuffer.html#toImage">toImage</a>().</b> This is normally much faster than calling <a href="qglwidget.html#renderPixmap">QGLWidget::renderPixmap</a>().</li>
|
|
<li><b>We can draw into the pbuffer and copy the contents into an OpenGL texture using <a href="qglpixelbuffer.html#updateDynamicTexture">updateDynamicTexture</a>().</b> This allows us to create dynamic textures and works on all systems with pbuffer support.</li>
|
|
<li><b>On systems that support it, we can bind the pbuffer to an OpenGL texture.</b> The texture is then updated automatically when the pbuffer contents change, eliminating the need for additional copy operations. This is supported only on Windows and Mac OS X systems that provide the <tt>render_texture</tt> extension. Note that under Windows, a multi-sampled pbuffer can't be used in conjunction with the <tt>render_texture</tt> extension. If a multi-sampled pbuffer is requested under Windows, the <tt>render_texture</tt> extension is turned off for that pbuffer.</li>
|
|
</ol>
|
|
<a name="threading"></a>
|
|
<h3>Threading</h3>
|
|
<p>As of Qt 4.8, it's possible to render into a QGLPixelBuffer 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>
|
|
<p>Pbuffers are provided by the OpenGL <tt>pbuffer</tt> extension; call hasOpenGLPbuffer() to find out if the system provides pbuffers.</p>
|
|
</div>
|
|
<p><b>See also </b><a href="opengl-pbuffers.html">Pbuffers Example</a>.</p>
|
|
<!-- @@@QGLPixelBuffer -->
|
|
<div class="func">
|
|
<h2>Member Function Documentation</h2>
|
|
<!-- $$$QGLPixelBuffer[overload1]$$$QGLPixelBufferconstQSize&constQGLFormat&QGLWidget* -->
|
|
<h3 class="fn"><a name="QGLPixelBuffer"></a>QGLPixelBuffer::<span class="name">QGLPixelBuffer</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> & <i>size</i>, const <span class="type"><a href="qglformat.html">QGLFormat</a></span> & <i>format</i> = QGLFormat::defaultFormat(), <span class="type"><a href="qglwidget.html">QGLWidget</a></span> * <i>shareWidget</i> = 0 )</h3>
|
|
<p>Constructs an OpenGL pbuffer of the given <i>size</i>. If no <i>format</i> is specified, the <a href="qglformat.html#defaultFormat">default format</a> is used. If the <i>shareWidget</i> parameter points to a valid <a href="qglwidget.html">QGLWidget</a>, the pbuffer will share its context with <i>shareWidget</i>.</p>
|
|
<p>If you intend to bind this pbuffer as a dynamic texture, the width and height components of <tt>size</tt> must be powers of two (e.g., 512 x 128).</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#size">size</a>() and <a href="qglpixelbuffer.html#format">format</a>().</p>
|
|
<!-- @@@QGLPixelBuffer -->
|
|
<!-- $$$QGLPixelBuffer$$$QGLPixelBufferintintconstQGLFormat&QGLWidget* -->
|
|
<h3 class="fn"><a name="QGLPixelBuffer-2"></a>QGLPixelBuffer::<span class="name">QGLPixelBuffer</span> ( <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="qglformat.html">QGLFormat</a></span> & <i>format</i> = QGLFormat::defaultFormat(), <span class="type"><a href="qglwidget.html">QGLWidget</a></span> * <i>shareWidget</i> = 0 )</h3>
|
|
<p>This is an overloaded function.</p>
|
|
<p>Constructs an OpenGL pbuffer with the <i>width</i> and <i>height</i>. If no <i>format</i> is specified, the <a href="qglformat.html#defaultFormat">default format</a> is used. If the <i>shareWidget</i> parameter points to a valid <a href="qglwidget.html">QGLWidget</a>, the pbuffer will share its context with <i>shareWidget</i>.</p>
|
|
<p>If you intend to bind this pbuffer as a dynamic texture, the width and height components of <tt>size</tt> must be powers of two (e.g., 512 x 128).</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#size">size</a>() and <a href="qglpixelbuffer.html#format">format</a>().</p>
|
|
<!-- @@@QGLPixelBuffer -->
|
|
<!-- $$$~QGLPixelBuffer[overload1]$$$~QGLPixelBuffer -->
|
|
<h3 class="fn"><a name="dtor.QGLPixelBuffer"></a>QGLPixelBuffer::<span class="name">~QGLPixelBuffer</span> ()<tt> [virtual]</tt></h3>
|
|
<p>Destroys the pbuffer and frees any allocated resources.</p>
|
|
<!-- @@@~QGLPixelBuffer -->
|
|
<!-- $$$bindTexture[overload1]$$$bindTextureconstQImage&GLenum -->
|
|
<h3 class="fn"><a name="bindTexture"></a><span class="type">GLuint</span> QGLPixelBuffer::<span class="name">bindTexture</span> ( const <span class="type"><a href="qimage.html">QImage</a></span> & <i>image</i>, <span class="type">GLenum</span> <i>target</i> = GL_TEXTURE_2D )</h3>
|
|
<p>Generates and binds a 2D GL texture to the current context, based on <i>image</i>. The generated texture id is returned and can be used in later glBindTexture() calls.</p>
|
|
<p>The <i>target</i> parameter specifies the texture target.</p>
|
|
<p>Equivalent to calling <a href="qglcontext.html#bindTexture">QGLContext::bindTexture</a>().</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#deleteTexture">deleteTexture</a>().</p>
|
|
<!-- @@@bindTexture -->
|
|
<!-- $$$bindTexture$$$bindTextureconstQPixmap&GLenum -->
|
|
<h3 class="fn"><a name="bindTexture-2"></a><span class="type">GLuint</span> QGLPixelBuffer::<span class="name">bindTexture</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> & <i>pixmap</i>, <span class="type">GLenum</span> <i>target</i> = GL_TEXTURE_2D )</h3>
|
|
<p>This is an overloaded function.</p>
|
|
<p>Generates and binds a 2D GL texture based on <i>pixmap</i>.</p>
|
|
<p>Equivalent to calling <a href="qglcontext.html#bindTexture">QGLContext::bindTexture</a>().</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#deleteTexture">deleteTexture</a>().</p>
|
|
<!-- @@@bindTexture -->
|
|
<!-- $$$bindTexture$$$bindTextureconstQString& -->
|
|
<h3 class="fn"><a name="bindTexture-3"></a><span class="type">GLuint</span> QGLPixelBuffer::<span class="name">bindTexture</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>fileName</i> )</h3>
|
|
<p>This is an overloaded function.</p>
|
|
<p>Reads the DirectDrawSurface (DDS) compressed file <i>fileName</i> and generates a 2D GL texture from it.</p>
|
|
<p>Equivalent to calling <a href="qglcontext.html#bindTexture">QGLContext::bindTexture</a>().</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#deleteTexture">deleteTexture</a>().</p>
|
|
<!-- @@@bindTexture -->
|
|
<!-- $$$bindToDynamicTexture[overload1]$$$bindToDynamicTextureGLuint -->
|
|
<h3 class="fn"><a name="bindToDynamicTexture"></a><span class="type">bool</span> QGLPixelBuffer::<span class="name">bindToDynamicTexture</span> ( <span class="type">GLuint</span> <i>texture_id</i> )</h3>
|
|
<p>Binds the texture specified by <i>texture_id</i> to this pbuffer. Returns true on success; otherwise returns false.</p>
|
|
<p>The texture must be of the same size and format as the pbuffer.</p>
|
|
<p>To unbind the texture, call <a href="qglpixelbuffer.html#releaseFromDynamicTexture">releaseFromDynamicTexture</a>(). While the texture is bound, it is updated automatically when the pbuffer contents change, eliminating the need for additional copy operations.</p>
|
|
<p>Example:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qglpixelbuffer.html">QGLPixelBuffer</a></span> pbuffer(<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
|
|
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
|
|
pbuffer<span class="operator">.</span><a href="qglpixelbuffer.html#makeCurrent">makeCurrent</a>();
|
|
GLuint dynamicTexture <span class="operator">=</span> pbuffer<span class="operator">.</span><a href="qglpixelbuffer.html#generateDynamicTexture">generateDynamicTexture</a>();
|
|
pbuffer<span class="operator">.</span>bindToDynamicTexture(dynamicTexture);
|
|
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
|
|
pbuffer<span class="operator">.</span><a href="qglpixelbuffer.html#releaseFromDynamicTexture">releaseFromDynamicTexture</a>();</pre>
|
|
<p><b>Warning:</b> This function uses the <tt>render_texture</tt> extension, which is currently not supported under X11. An alternative that works on all systems (including X11) is to manually copy the pbuffer contents to a texture using <a href="qglpixelbuffer.html#updateDynamicTexture">updateDynamicTexture</a>().</p>
|
|
<p><b>Warning:</b> For the bindToDynamicTexture() call to succeed on the Mac OS X, the pbuffer needs a shared context, i.e. the <a href="qglpixelbuffer.html">QGLPixelBuffer</a> must be created with a share widget.</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#generateDynamicTexture">generateDynamicTexture</a>() and <a href="qglpixelbuffer.html#releaseFromDynamicTexture">releaseFromDynamicTexture</a>().</p>
|
|
<!-- @@@bindToDynamicTexture -->
|
|
<!-- $$$deleteTexture[overload1]$$$deleteTextureGLuint -->
|
|
<h3 class="fn"><a name="deleteTexture"></a><span class="type">void</span> QGLPixelBuffer::<span class="name">deleteTexture</span> ( <span class="type">GLuint</span> <i>texture_id</i> )</h3>
|
|
<p>Removes the texture identified by <i>texture_id</i> from the texture cache.</p>
|
|
<p>Equivalent to calling <a href="qglcontext.html#deleteTexture">QGLContext::deleteTexture</a>().</p>
|
|
<!-- @@@deleteTexture -->
|
|
<!-- $$$doneCurrent[overload1]$$$doneCurrent -->
|
|
<h3 class="fn"><a name="doneCurrent"></a><span class="type">bool</span> QGLPixelBuffer::<span class="name">doneCurrent</span> ()</h3>
|
|
<p>Makes no context the current OpenGL context. Returns true on success; otherwise returns false.</p>
|
|
<!-- @@@doneCurrent -->
|
|
<!-- $$$drawTexture[overload1]$$$drawTextureconstQRectF&GLuintGLenum -->
|
|
<h3 class="fn"><a name="drawTexture"></a><span class="type">void</span> QGLPixelBuffer::<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>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> QGLPixelBuffer::<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 textureTarget parameter should be a 2D texture target.</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="qglformat.html">QGLFormat</a></span> QGLPixelBuffer::<span class="name">format</span> () const</h3>
|
|
<p>Returns the format of the pbuffer. The format may be different from the one that was requested.</p>
|
|
<!-- @@@format -->
|
|
<!-- $$$generateDynamicTexture[overload1]$$$generateDynamicTexture -->
|
|
<h3 class="fn"><a name="generateDynamicTexture"></a><span class="type">GLuint</span> QGLPixelBuffer::<span class="name">generateDynamicTexture</span> () const</h3>
|
|
<p>Generates and binds a 2D GL texture that is the same size as the pbuffer, and returns the texture's ID. This can be used in conjunction with <a href="qglpixelbuffer.html#bindToDynamicTexture">bindToDynamicTexture</a>() and <a href="qglpixelbuffer.html#updateDynamicTexture">updateDynamicTexture</a>().</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#size">size</a>().</p>
|
|
<!-- @@@generateDynamicTexture -->
|
|
<!-- $$$handle[overload1]$$$handle -->
|
|
<h3 class="fn"><a name="handle"></a><span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> QGLPixelBuffer::<span class="name">handle</span> () const</h3>
|
|
<p>Returns the native pbuffer handle.</p>
|
|
<!-- @@@handle -->
|
|
<!-- $$$hasOpenGLPbuffers[overload1]$$$hasOpenGLPbuffers -->
|
|
<h3 class="fn"><a name="hasOpenGLPbuffers"></a><span class="type">bool</span> QGLPixelBuffer::<span class="name">hasOpenGLPbuffers</span> ()<tt> [static]</tt></h3>
|
|
<p>Returns true if the OpenGL <tt>pbuffer</tt> extension is present on this system; otherwise returns false.</p>
|
|
<!-- @@@hasOpenGLPbuffers -->
|
|
<!-- $$$isValid[overload1]$$$isValid -->
|
|
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QGLPixelBuffer::<span class="name">isValid</span> () const</h3>
|
|
<p>Returns true if this pbuffer is valid; otherwise returns false.</p>
|
|
<!-- @@@isValid -->
|
|
<!-- $$$makeCurrent[overload1]$$$makeCurrent -->
|
|
<h3 class="fn"><a name="makeCurrent"></a><span class="type">bool</span> QGLPixelBuffer::<span class="name">makeCurrent</span> ()</h3>
|
|
<p>Makes this pbuffer the current OpenGL rendering context. Returns true on success; otherwise returns false.</p>
|
|
<p><b>See also </b><a href="qglcontext.html#makeCurrent">QGLContext::makeCurrent</a>() and <a href="qglpixelbuffer.html#doneCurrent">doneCurrent</a>().</p>
|
|
<!-- @@@makeCurrent -->
|
|
<!-- $$$metric[overload1]$$$metricPaintDeviceMetric -->
|
|
<h3 class="fn"><a name="metric"></a><span class="type">int</span> QGLPixelBuffer::<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> * QGLPixelBuffer::<span class="name">paintEngine</span> () const<tt> [virtual]</tt></h3>
|
|
<p>Reimplemented from <a href="qpaintdevice.html#paintEngine">QPaintDevice::paintEngine</a>().</p>
|
|
<!-- @@@paintEngine -->
|
|
<!-- $$$releaseFromDynamicTexture[overload1]$$$releaseFromDynamicTexture -->
|
|
<h3 class="fn"><a name="releaseFromDynamicTexture"></a><span class="type">void</span> QGLPixelBuffer::<span class="name">releaseFromDynamicTexture</span> ()</h3>
|
|
<p>Releases the pbuffer from any previously bound texture.</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#bindToDynamicTexture">bindToDynamicTexture</a>().</p>
|
|
<!-- @@@releaseFromDynamicTexture -->
|
|
<!-- $$$size[overload1]$$$size -->
|
|
<h3 class="fn"><a name="size"></a><span class="type"><a href="qsize.html">QSize</a></span> QGLPixelBuffer::<span class="name">size</span> () const</h3>
|
|
<p>Returns the size of the pbuffer.</p>
|
|
<!-- @@@size -->
|
|
<!-- $$$toImage[overload1]$$$toImage -->
|
|
<h3 class="fn"><a name="toImage"></a><span class="type"><a href="qimage.html">QImage</a></span> QGLPixelBuffer::<span class="name">toImage</span> () const</h3>
|
|
<p>Returns the contents of the pbuffer as a <a href="qimage.html">QImage</a>.</p>
|
|
<!-- @@@toImage -->
|
|
<!-- $$$updateDynamicTexture[overload1]$$$updateDynamicTextureGLuint -->
|
|
<h3 class="fn"><a name="updateDynamicTexture"></a><span class="type">void</span> QGLPixelBuffer::<span class="name">updateDynamicTexture</span> ( <span class="type">GLuint</span> <i>texture_id</i> ) const</h3>
|
|
<p>Copies the pbuffer contents into the texture specified with <i>texture_id</i>.</p>
|
|
<p>The texture must be of the same size and format as the pbuffer.</p>
|
|
<p>Example:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qglpixelbuffer.html">QGLPixelBuffer</a></span> pbuffer(<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
|
|
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
|
|
pbuffer<span class="operator">.</span><a href="qglpixelbuffer.html#makeCurrent">makeCurrent</a>();
|
|
GLuint dynamicTexture <span class="operator">=</span> pbuffer<span class="operator">.</span><a href="qglpixelbuffer.html#generateDynamicTexture">generateDynamicTexture</a>();
|
|
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
|
|
pbuffer<span class="operator">.</span>updateDynamicTexture(dynamicTexture);</pre>
|
|
<p>An alternative on Windows and Mac OS X systems that support the <tt>render_texture</tt> extension is to use <a href="qglpixelbuffer.html#bindToDynamicTexture">bindToDynamicTexture</a>() to get dynamic updates of the texture.</p>
|
|
<p><b>See also </b><a href="qglpixelbuffer.html#generateDynamicTexture">generateDynamicTexture</a>() and <a href="qglpixelbuffer.html#bindToDynamicTexture">bindToDynamicTexture</a>().</p>
|
|
<!-- @@@updateDynamicTexture -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="ft">
|
|
<span></span>
|
|
</div>
|
|
</div>
|
|
<div class="footer">
|
|
<p>
|
|
<acronym title="Copyright">©</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>
|