Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 2052

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qgl.cpp -->
  <title>QGLFormat Class | Qt OpenGL</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtopengl-index.html">Qt OpenGL</a></td><td ><a href="qtopengl-module.html">C++ Classes</a></td><td >QGLFormat</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QGLFormat Class</h1>
<!-- $$$QGLFormat-brief -->
<p>The <a href="qglformat.html">QGLFormat</a> class specifies the display format of an OpenGL rendering context. <a href="#details">More...</a></p>
<!-- @@@QGLFormat -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGLFormat&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += opengl</td></tr></table></div><p><b>This class is obsolete.</b> It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<ul>
<li><a href="qglformat-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a></b> { NoProfile, CoreProfile, CompatibilityProfile }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#OpenGLVersionFlag-enum">OpenGLVersionFlag</a></b> { OpenGL_Version_None, OpenGL_Version_1_1, OpenGL_Version_1_2, OpenGL_Version_1_3, ..., OpenGL_ES_Version_2_0 }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#OpenGLVersionFlag-enum">OpenGLVersionFlags</a></b></td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#QGLFormat">QGLFormat</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#QGLFormat-1">QGLFormat</a></b>(QGL::FormatOptions <i>options</i>, int <i>plane</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#QGLFormat-2">QGLFormat</a></b>(const QGLFormat &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#dtor.QGLFormat">~QGLFormat</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#accum">accum</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#accumBufferSize">accumBufferSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#alpha">alpha</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#alphaBufferSize">alphaBufferSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#blueBufferSize">blueBufferSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#depth">depth</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#depthBufferSize">depthBufferSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#directRendering">directRendering</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#doubleBuffer">doubleBuffer</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#greenBufferSize">greenBufferSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#hasOverlay">hasOverlay</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#majorVersion">majorVersion</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#minorVersion">minorVersion</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#plane">plane</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenGLContextProfile </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#profile">profile</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#redBufferSize">redBufferSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#rgba">rgba</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#sampleBuffers">sampleBuffers</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#samples">samples</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAccum">setAccum</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAlpha">setAlpha</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDepth">setDepth</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDirectRendering">setDirectRendering</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setOption">setOption</a></b>(QGL::FormatOptions <i>opt</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setOverlay">setOverlay</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setPlane">setPlane</a></b>(int <i>plane</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setProfile">setProfile</a></b>(OpenGLContextProfile <i>profile</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setRedBufferSize">setRedBufferSize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setRgba">setRgba</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setSampleBuffers">setSampleBuffers</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setSamples">setSamples</a></b>(int <i>numSamples</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setStencil">setStencil</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setStereo">setStereo</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setSwapInterval">setSwapInterval</a></b>(int <i>interval</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setVersion">setVersion</a></b>(int <i>major</i>, int <i>minor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#stencil">stencil</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#stencilBufferSize">stencilBufferSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#stereo">stereo</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#swapInterval">swapInterval</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#testOption">testOption</a></b>(QGL::FormatOptions <i>opt</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat &amp;</td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#operator-eq">operator=</a></b>(const QGLFormat &amp;<i>other</i>)</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#defaultFormat">defaultFormat</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#fromSurfaceFormat">fromSurfaceFormat</a></b>(const QSurfaceFormat &amp;<i>format</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#hasOpenGL">hasOpenGL</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#hasOpenGLOverlays">hasOpenGLOverlays</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenGLVersionFlags </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#openGLVersionFlags">openGLVersionFlags</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDefaultFormat">setDefaultFormat</a></b>(const QGLFormat &amp;<i>f</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#setDefaultOverlayFormat">setDefaultOverlayFormat</a></b>(const QGLFormat &amp;<i>f</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSurfaceFormat </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#toSurfaceFormat">toSurfaceFormat</a></b>(const QGLFormat &amp;<i>format</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#operator-not-eq">operator!=</a></b>(const QGLFormat &amp;<i>a</i>, const QGLFormat &amp;<i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglformat.html#operator-eq-eq">operator==</a></b>(const QGLFormat &amp;<i>a</i>, const QGLFormat &amp;<i>b</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QGLFormat-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qglformat.html">QGLFormat</a> class specifies the display format of an OpenGL rendering context.</p>
<p>A display format has several characteristics:</p>
<ul>
<li><a href="qglformat.html#setDoubleBuffer">Double or single buffering.</a></li>
<li><a href="qglformat.html#setDepth">Depth buffer.</a></li>
<li><a href="qglformat.html#setRgba">RGBA or color index mode.</a></li>
<li><a href="qglformat.html#setAlpha">Alpha channel.</a></li>
<li><a href="qglformat.html#setAccum">Accumulation buffer.</a></li>
<li><a href="qglformat.html#setStencil">Stencil buffer.</a></li>
<li><a href="qglformat.html#setStereo">Stereo buffers.</a></li>
<li><a href="qglformat.html#setDirectRendering">Direct rendering.</a></li>
<li><a href="qglformat.html#setOverlay">Presence of an overlay.</a></li>
<li><a href="qglformat.html#setPlane">Plane of an overlay.</a></li>
<li><a href="qglformat.html#setSampleBuffers">Multisample buffers.</a></li>
</ul>
<p>You can also specify preferred bit depths for the color buffer, depth buffer, alpha buffer, accumulation buffer and the stencil buffer with the functions: <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(), <a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>(), <a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>(), <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>(), <a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>() and <a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<p>Note that even if you specify that you prefer a 32 bit depth buffer (e.g&#x2e; with <a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>(32)), the format that is chosen may not have a 32 bit depth buffer, even if there is a format available with a 32 bit depth buffer. The main reason for this is how the system dependant picking algorithms work on the different platforms, and some format options may have higher precedence than others.</p>
<p>You create and tell a <a href="qglformat.html">QGLFormat</a> object what rendering options you want from an OpenGL rendering context.</p>
<p>OpenGL drivers or accelerated hardware may or may not support advanced features such as alpha channel or stereographic viewing. If you request some features that the driver/hardware does not provide when you create a <a href="qglwidget.html">QGLWidget</a>, you will get a rendering context with the nearest subset of features.</p>
<p>There are different ways to define the display characteristics of a rendering context. One is to create a <a href="qglformat.html">QGLFormat</a> and make it the default for the entire application:</p>
<pre class="cpp">

  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> fmt;
  fmt<span class="operator">.</span>setAlpha(<span class="keyword">true</span>);
  fmt<span class="operator">.</span>setStereo(<span class="keyword">true</span>);
  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span><span class="operator">::</span>setDefaultFormat(fmt);

</pre>
<p>Or you can specify the desired format when creating an object of your <a href="qglwidget.html">QGLWidget</a> subclass:</p>
<pre class="cpp">

  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> fmt;
  fmt<span class="operator">.</span>setDoubleBuffer(<span class="keyword">false</span>);                 <span class="comment">// single buffer</span>
  fmt<span class="operator">.</span>setDirectRendering(<span class="keyword">false</span>);              <span class="comment">// software rendering</span>
  MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(fmt<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);

</pre>
<p>After the widget has been created, you can find out which of the requested features the system was able to provide:</p>
<pre class="cpp">

  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> fmt;
  fmt<span class="operator">.</span>setOverlay(<span class="keyword">true</span>);
  fmt<span class="operator">.</span>setStereo(<span class="keyword">true</span>);
  MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(fmt<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
  <span class="keyword">if</span> (<span class="operator">!</span>myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>stereo()) {
      <span class="comment">// ok, goggles off</span>
      <span class="keyword">if</span> (<span class="operator">!</span>myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>hasOverlay()) {
          <a href="../qtcore/qtglobal.html#qFatal">qFatal</a>(<span class="string">&quot;Cool hardware required&quot;</span>);
      }
  }

</pre>
<div class="LegaleseLeft"><p>OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.</p>
</div></div>
<p><b>See also </b><a href="qglcontext.html">QGLContext</a> and <a href="qglwidget.html">QGLWidget</a>.</p>
<!-- @@@QGLFormat -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$OpenGLContextProfile$$$NoProfile$$$CoreProfile$$$CompatibilityProfile -->
<h3 class="fn" id="OpenGLContextProfile-enum"><a name="OpenGLContextProfile-enum"></a>enum QGLFormat::<span class="name">OpenGLContextProfile</span></h3>
<p>This enum describes the OpenGL context profiles that can be specified for contexts implementing OpenGL version 3.2 or higher. These profiles are different from OpenGL ES profiles.</p>
<div class="table"><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"><code>QGLFormat::NoProfile</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">OpenGL version is lower than 3.2&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGLFormat::CoreProfile</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Functionality deprecated in OpenGL version 3.0 is not available.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::CompatibilityProfile</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Functionality from earlier OpenGL versions is available.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 4.7.</p>
<!-- @@@OpenGLContextProfile -->
<!-- $$$OpenGLVersionFlag$$$OpenGL_Version_None$$$OpenGL_Version_1_1$$$OpenGL_Version_1_2$$$OpenGL_Version_1_3$$$OpenGL_Version_1_4$$$OpenGL_Version_1_5$$$OpenGL_Version_2_0$$$OpenGL_Version_2_1$$$OpenGL_ES_Common_Version_1_0$$$OpenGL_ES_CommonLite_Version_1_0$$$OpenGL_ES_Common_Version_1_1$$$OpenGL_ES_CommonLite_Version_1_1$$$OpenGL_ES_Version_2_0$$$OpenGL_Version_3_0$$$OpenGL_Version_3_1$$$OpenGL_Version_3_2$$$OpenGL_Version_3_3$$$OpenGL_Version_4_0$$$OpenGL_Version_4_1$$$OpenGL_Version_4_2$$$OpenGL_Version_4_3 -->
<h3 class="flags" id="OpenGLVersionFlag-enum"><a name="OpenGLVersionFlag-enum"></a>enum QGLFormat::<span class="name">OpenGLVersionFlag</span><br/>flags QGLFormat::<span class="name">OpenGLVersionFlags</span></h3>
<p>This enum describes the various OpenGL versions that are recognized by Qt. Use the <a href="qglformat.html#openGLVersionFlags">QGLFormat::openGLVersionFlags</a>() function to identify which versions that are supported at runtime.</p>
<div class="table"><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"><code>QGLFormat::OpenGL_Version_None</code></td><td class="topAlign tblval"><code>0x00000000</code></td><td class="topAlign">If no OpenGL is present or if no OpenGL context is current.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_1_1</code></td><td class="topAlign tblval"><code>0x00000001</code></td><td class="topAlign">OpenGL version 1.1 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_1_2</code></td><td class="topAlign tblval"><code>0x00000002</code></td><td class="topAlign">OpenGL version 1.2 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_1_3</code></td><td class="topAlign tblval"><code>0x00000004</code></td><td class="topAlign">OpenGL version 1.3 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_1_4</code></td><td class="topAlign tblval"><code>0x00000008</code></td><td class="topAlign">OpenGL version 1.4 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_1_5</code></td><td class="topAlign tblval"><code>0x00000010</code></td><td class="topAlign">OpenGL version 1.5 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_2_0</code></td><td class="topAlign tblval"><code>0x00000020</code></td><td class="topAlign">OpenGL version 2.0 or higher is present. Note that version 2.0 supports all the functionality of version 1.5&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_2_1</code></td><td class="topAlign tblval"><code>0x00000040</code></td><td class="topAlign">OpenGL version 2.1 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_3_0</code></td><td class="topAlign tblval"><code>0x00001000</code></td><td class="topAlign">OpenGL version 3.0 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_3_1</code></td><td class="topAlign tblval"><code>0x00002000</code></td><td class="topAlign">OpenGL version 3.1 or higher is present. Note that OpenGL version 3.1 or higher does not necessarily support all the features of version 3.0 and lower.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_3_2</code></td><td class="topAlign tblval"><code>0x00004000</code></td><td class="topAlign">OpenGL version 3.2 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_3_3</code></td><td class="topAlign tblval"><code>0x00008000</code></td><td class="topAlign">OpenGL version 3.3 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_4_0</code></td><td class="topAlign tblval"><code>0x00010000</code></td><td class="topAlign">OpenGL version 4.0 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_4_1</code></td><td class="topAlign tblval"><code>0x00020000</code></td><td class="topAlign">OpenGL version 4.1 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_4_2</code></td><td class="topAlign tblval"><code>0x00040000</code></td><td class="topAlign">OpenGL version 4.2 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_Version_4_3</code></td><td class="topAlign tblval"><code>0x00080000</code></td><td class="topAlign">OpenGL version 4.3 or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_ES_CommonLite_Version_1_0</code></td><td class="topAlign tblval"><code>0x00000100</code></td><td class="topAlign">OpenGL ES version 1.0 Common Lite or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_ES_Common_Version_1_0</code></td><td class="topAlign tblval"><code>0x00000080</code></td><td class="topAlign">OpenGL ES version 1.0 Common or higher is present. The Common profile supports all the features of Common Lite.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_ES_CommonLite_Version_1_1</code></td><td class="topAlign tblval"><code>0x00000400</code></td><td class="topAlign">OpenGL ES version 1.1 Common Lite or higher is present.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_ES_Common_Version_1_1</code></td><td class="topAlign tblval"><code>0x00000200</code></td><td class="topAlign">OpenGL ES version 1.1 Common or higher is present. The Common profile supports all the features of Common Lite.</td></tr>
<tr><td class="topAlign"><code>QGLFormat::OpenGL_ES_Version_2_0</code></td><td class="topAlign tblval"><code>0x00000800</code></td><td class="topAlign">OpenGL ES version 2.0 or higher is present. Note that OpenGL ES version 2.0 does not support all the features of OpenGL ES 1.x&#x2e; So if OpenGL_ES_Version_2_0 is returned, none of the ES 1.x flags are returned.</td></tr>
</table></div>
<p>See also <a href="http://www.opengl.org">http://www.opengl.org</a> for more information about the different revisions of OpenGL.</p>
<p>This enum was introduced or modified in  Qt 4.2.</p>
<p>The OpenGLVersionFlags type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;OpenGLVersionFlag&gt;. It stores an OR combination of OpenGLVersionFlag values.</p>
<p><b>See also </b><a href="qglformat.html#openGLVersionFlags">openGLVersionFlags</a>().</p>
<!-- @@@OpenGLVersionFlag -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGLFormat[overload1]$$$QGLFormat -->
<h3 class="fn" id="QGLFormat"><a name="QGLFormat"></a>QGLFormat::<span class="name">QGLFormat</span>()</h3>
<p>Constructs a <a href="qglformat.html" class="obsolete">QGLFormat</a> object with the following default settings:</p>
<ul>
<li><a href="qglformat.html#setDoubleBuffer">Double buffer:</a> Enabled.</li>
<li><a href="qglformat.html#setDepth">Depth buffer:</a> Enabled.</li>
<li><a href="qglformat.html#setRgba">RGBA:</a> Enabled (i.e&#x2e;, color index disabled).</li>
<li><a href="qglformat.html#setAlpha">Alpha channel:</a> Disabled.</li>
<li><a href="qglformat.html#setAccum">Accumulator buffer:</a> Disabled.</li>
<li><a href="qglformat.html#setStencil">Stencil buffer:</a> Enabled.</li>
<li><a href="qglformat.html#setStereo">Stereo:</a> Disabled.</li>
<li><a href="qglformat.html#setDirectRendering">Direct rendering:</a> Enabled.</li>
<li><a href="qglformat.html#setOverlay">Overlay:</a> Disabled.</li>
<li><a href="qglformat.html#setPlane">Plane:</a> 0 (i.e&#x2e;, normal plane).</li>
<li><a href="qglformat.html#setSampleBuffers">Multisample buffers:</a> Disabled.</li>
</ul>
<!-- @@@QGLFormat -->
<!-- $$$QGLFormat$$$QGLFormatQGL::FormatOptionsint -->
<h3 class="fn" id="QGLFormat-1"><a name="QGLFormat-1"></a>QGLFormat::<span class="name">QGLFormat</span>(<span class="type"><a href="qgl.html#FormatOption-enum">QGL::FormatOptions</a></span> <i>options</i>, <span class="type">int</span> <i>plane</i> = 0)</h3>
<p>Creates a <a href="qglformat.html" class="obsolete">QGLFormat</a> object that is a copy of the current <a href="qglformat.html#defaultFormat">defaultFormat</a>().</p>
<p>If <i>options</i> is not 0, the default format is modified by the specified format options. The <i>options</i> parameter should be <a href="qgl.html#FormatOption-enum">QGL::FormatOption</a> values OR'ed together.</p>
<p>This constructor makes it easy to specify a certain desired format in classes derived from QGLWidget, for example:</p>
<pre class="cpp">

  <span class="comment">// The rendering in MyGLWidget depends on using</span>
  <span class="comment">// stencil buffer and alpha channel</span>
  MyGLWidget<span class="operator">::</span>MyGLWidget(<span class="type"><a href="../qtwidgets/qwidget.html">QWidget</a></span><span class="operator">*</span> parent)
      : <span class="type"><a href="qglwidget.html">QGLWidget</a></span>(<span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span>(QGL<span class="operator">::</span>StencilBuffer <span class="operator">|</span> QGL<span class="operator">::</span>AlphaChannel)<span class="operator">,</span> parent)
  {
      <span class="keyword">if</span> (<span class="operator">!</span>format()<span class="operator">.</span>stencil())
          <a href="../qtcore/qtglobal.html#qWarning">qWarning</a>(<span class="string">&quot;Could not get stencil buffer; results will be suboptimal&quot;</span>);
      <span class="keyword">if</span> (<span class="operator">!</span>format()<span class="operator">.</span>alpha())
          <a href="../qtcore/qtglobal.html#qWarning">qWarning</a>(<span class="string">&quot;Could not get alpha channel; results will be suboptimal&quot;</span>);
      <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
  }

</pre>
<p>Note that there are <a href="qgl.html#FormatOption-enum">QGL::FormatOption</a> values to turn format settings both on and off, e.g&#x2e; <a href="qgl.html#FormatOption-enum">QGL::DepthBuffer</a> and <a href="qgl.html#FormatOption-enum">QGL::NoDepthBuffer</a>, <a href="qgl.html#FormatOption-enum">QGL::DirectRendering</a> and <a href="qgl.html#FormatOption-enum">QGL::IndirectRendering</a>, etc.</p>
<p>The <i>plane</i> parameter defaults to 0 and is the plane which this format should be associated with. Not all OpenGL implementations supports overlay/underlay rendering planes.</p>
<p><b>See also </b><a href="qglformat.html#defaultFormat">defaultFormat</a>(), <a href="qglformat.html#setOption">setOption</a>(), and <a href="qglformat.html#setPlane">setPlane</a>().</p>
<!-- @@@QGLFormat -->
<!-- $$$QGLFormat$$$QGLFormatconstQGLFormat& -->
<h3 class="fn" id="QGLFormat-2"><a name="QGLFormat-2"></a>QGLFormat::<span class="name">QGLFormat</span>(const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>other</i>)</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QGLFormat -->
<!-- $$$~QGLFormat[overload1]$$$~QGLFormat -->
<h3 class="fn" id="dtor.QGLFormat"><a name="dtor.QGLFormat"></a>QGLFormat::<span class="name">~QGLFormat</span>()</h3>
<p>Destroys the <a href="qglformat.html" class="obsolete">QGLFormat</a>.</p>
<!-- @@@~QGLFormat -->
<!-- $$$accum[overload1]$$$accum -->
<h3 class="fn" id="accum"><a name="accum"></a><span class="type">bool</span> QGLFormat::<span class="name">accum</span>() const</h3>
<p>Returns <code>true</code> if the accumulation buffer is enabled; otherwise returns <code>false</code>. The accumulation buffer is disabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setAccum">setAccum</a>() and <a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>().</p>
<!-- @@@accum -->
<!-- $$$accumBufferSize[overload1]$$$accumBufferSize -->
<h3 class="fn" id="accumBufferSize"><a name="accumBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">accumBufferSize</span>() const</h3>
<p>Returns the accumulation buffer size.</p>
<p><b>See also </b><a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>(), <a href="qglformat.html#accum">accum</a>(), and <a href="qglformat.html#setAccum">setAccum</a>().</p>
<!-- @@@accumBufferSize -->
<!-- $$$alpha[overload1]$$$alpha -->
<h3 class="fn" id="alpha"><a name="alpha"></a><span class="type">bool</span> QGLFormat::<span class="name">alpha</span>() const</h3>
<p>Returns <code>true</code> if the alpha buffer in the framebuffer is enabled; otherwise returns <code>false</code>. The alpha buffer is disabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setAlpha">setAlpha</a>() and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@alpha -->
<!-- $$$alphaBufferSize[overload1]$$$alphaBufferSize -->
<h3 class="fn" id="alphaBufferSize"><a name="alphaBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">alphaBufferSize</span>() const</h3>
<p>Returns the alpha buffer size.</p>
<p><b>See also </b><a href="qglformat.html#alpha">alpha</a>(), <a href="qglformat.html#setAlpha">setAlpha</a>(), and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@alphaBufferSize -->
<!-- $$$blueBufferSize[overload1]$$$blueBufferSize -->
<h3 class="fn" id="blueBufferSize"><a name="blueBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">blueBufferSize</span>() const</h3>
<p>Returns the blue buffer size.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>().</p>
<!-- @@@blueBufferSize -->
<!-- $$$defaultFormat[overload1]$$$defaultFormat -->
<h3 class="fn" id="defaultFormat"><a name="defaultFormat"></a><code>[static] </code><span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> QGLFormat::<span class="name">defaultFormat</span>()</h3>
<p>Returns the default <a href="qglformat.html" class="obsolete">QGLFormat</a> for the application. All QGLWidget objects that are created use this format unless another format is specified, e.g&#x2e; when they are constructed.</p>
<p>If no special default format has been set using <a href="qglformat.html#setDefaultFormat">setDefaultFormat</a>(), the default format is the same as that created with <a href="qglformat.html#QGLFormat">QGLFormat</a>().</p>
<p><b>See also </b><a href="qglformat.html#setDefaultFormat">setDefaultFormat</a>().</p>
<!-- @@@defaultFormat -->
<!-- $$$defaultOverlayFormat[overload1]$$$defaultOverlayFormat -->
<h3 class="fn" id="defaultOverlayFormat"><a name="defaultOverlayFormat"></a><code>[static] </code><span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> QGLFormat::<span class="name">defaultOverlayFormat</span>()</h3>
<p>Returns the default <a href="qglformat.html" class="obsolete">QGLFormat</a> for overlay contexts.</p>
<p>The default overlay format is:</p>
<ul>
<li><a href="qglformat.html#setDoubleBuffer">Double buffer:</a> Disabled.</li>
<li><a href="qglformat.html#setDepth">Depth buffer:</a> Disabled.</li>
<li><a href="qglformat.html#setRgba">RGBA:</a> Disabled (i.e&#x2e;, color index enabled).</li>
<li><a href="qglformat.html#setAlpha">Alpha channel:</a> Disabled.</li>
<li><a href="qglformat.html#setAccum">Accumulator buffer:</a> Disabled.</li>
<li><a href="qglformat.html#setStencil">Stencil buffer:</a> Disabled.</li>
<li><a href="qglformat.html#setStereo">Stereo:</a> Disabled.</li>
<li><a href="qglformat.html#setDirectRendering">Direct rendering:</a> Enabled.</li>
<li><a href="qglformat.html#setOverlay">Overlay:</a> Disabled.</li>
<li><a href="qglformat.html#setSampleBuffers">Multisample buffers:</a> Disabled.</li>
<li><a href="qglformat.html#setPlane">Plane:</a> 1 (i.e&#x2e;, first overlay plane).</li>
</ul>
<p><b>See also </b><a href="qglformat.html#setDefaultOverlayFormat">setDefaultOverlayFormat</a>() and <a href="qglformat.html#setDefaultFormat">setDefaultFormat</a>().</p>
<!-- @@@defaultOverlayFormat -->
<!-- $$$depth[overload1]$$$depth -->
<h3 class="fn" id="depth"><a name="depth"></a><span class="type">bool</span> QGLFormat::<span class="name">depth</span>() const</h3>
<p>Returns <code>true</code> if the depth buffer is enabled; otherwise returns false. The depth buffer is enabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setDepth">setDepth</a>() and <a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>
<!-- @@@depth -->
<!-- $$$depthBufferSize[overload1]$$$depthBufferSize -->
<h3 class="fn" id="depthBufferSize"><a name="depthBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">depthBufferSize</span>() const</h3>
<p>Returns the depth buffer size.</p>
<p><b>See also </b><a href="qglformat.html#depth">depth</a>(), <a href="qglformat.html#setDepth">setDepth</a>(), and <a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>
<!-- @@@depthBufferSize -->
<!-- $$$directRendering[overload1]$$$directRendering -->
<h3 class="fn" id="directRendering"><a name="directRendering"></a><span class="type">bool</span> QGLFormat::<span class="name">directRendering</span>() const</h3>
<p>Returns <code>true</code> if direct rendering is enabled; otherwise returns false.</p>
<p>Direct rendering is enabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setDirectRendering">setDirectRendering</a>().</p>
<!-- @@@directRendering -->
<!-- $$$doubleBuffer[overload1]$$$doubleBuffer -->
<h3 class="fn" id="doubleBuffer"><a name="doubleBuffer"></a><span class="type">bool</span> QGLFormat::<span class="name">doubleBuffer</span>() const</h3>
<p>Returns <code>true</code> if double buffering is enabled; otherwise returns false. Double buffering is enabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setDoubleBuffer">setDoubleBuffer</a>().</p>
<!-- @@@doubleBuffer -->
<!-- $$$fromSurfaceFormat[overload1]$$$fromSurfaceFormatconstQSurfaceFormat& -->
<h3 class="fn" id="fromSurfaceFormat"><a name="fromSurfaceFormat"></a><code>[static] </code><span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> QGLFormat::<span class="name">fromSurfaceFormat</span>(const <span class="type"><a href="../qtgui/qsurfaceformat.html">QSurfaceFormat</a></span> &amp;<i>format</i>)</h3>
<p>Returns an OpenGL format for the window format specified by <i>format</i>.</p>
<!-- @@@fromSurfaceFormat -->
<!-- $$$greenBufferSize[overload1]$$$greenBufferSize -->
<h3 class="fn" id="greenBufferSize"><a name="greenBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">greenBufferSize</span>() const</h3>
<p>Returns the green buffer size.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>().</p>
<!-- @@@greenBufferSize -->
<!-- $$$hasOpenGL[overload1]$$$hasOpenGL -->
<h3 class="fn" id="hasOpenGL"><a name="hasOpenGL"></a><code>[static] </code><span class="type">bool</span> QGLFormat::<span class="name">hasOpenGL</span>()</h3>
<p>Returns <code>true</code> if the window system has any OpenGL support; otherwise returns <code>false</code>.</p>
<p><b>Warning:</b> This function must not be called until the <a href="../qtwidgets/qapplication.html">QApplication</a> object has been created.</p>
<!-- @@@hasOpenGL -->
<!-- $$$hasOpenGLOverlays[overload1]$$$hasOpenGLOverlays -->
<h3 class="fn" id="hasOpenGLOverlays"><a name="hasOpenGLOverlays"></a><code>[static] </code><span class="type">bool</span> QGLFormat::<span class="name">hasOpenGLOverlays</span>()</h3>
<p>Returns <code>true</code> if the window system supports OpenGL overlays; otherwise returns <code>false</code>.</p>
<p><b>Warning:</b> This function must not be called until the <a href="../qtwidgets/qapplication.html">QApplication</a> object has been created.</p>
<!-- @@@hasOpenGLOverlays -->
<!-- $$$hasOverlay[overload1]$$$hasOverlay -->
<h3 class="fn" id="hasOverlay"><a name="hasOverlay"></a><span class="type">bool</span> QGLFormat::<span class="name">hasOverlay</span>() const</h3>
<p>Returns <code>true</code> if overlay plane is enabled; otherwise returns <code>false</code>.</p>
<p>Overlay is disabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setOverlay">setOverlay</a>().</p>
<!-- @@@hasOverlay -->
<!-- $$$majorVersion[overload1]$$$majorVersion -->
<h3 class="fn" id="majorVersion"><a name="majorVersion"></a><span class="type">int</span> QGLFormat::<span class="name">majorVersion</span>() const</h3>
<p>Returns the OpenGL major version.</p>
<p>This function was introduced in  Qt 4.7.</p>
<p><b>See also </b><a href="qglformat.html#setVersion">setVersion</a>() and <a href="qglformat.html#minorVersion">minorVersion</a>().</p>
<!-- @@@majorVersion -->
<!-- $$$minorVersion[overload1]$$$minorVersion -->
<h3 class="fn" id="minorVersion"><a name="minorVersion"></a><span class="type">int</span> QGLFormat::<span class="name">minorVersion</span>() const</h3>
<p>Returns the OpenGL minor version.</p>
<p>This function was introduced in  Qt 4.7.</p>
<p><b>See also </b><a href="qglformat.html#setVersion">setVersion</a>() and <a href="qglformat.html#majorVersion">majorVersion</a>().</p>
<!-- @@@minorVersion -->
<!-- $$$openGLVersionFlags[overload1]$$$openGLVersionFlags -->
<h3 class="fn" id="openGLVersionFlags"><a name="openGLVersionFlags"></a><code>[static] </code><span class="type"><a href="qglformat.html#OpenGLVersionFlag-enum">OpenGLVersionFlags</a></span> QGLFormat::<span class="name">openGLVersionFlags</span>()</h3>
<p>Identifies, at runtime, which OpenGL versions that are supported by the current platform.</p>
<p>Note that if OpenGL version 1.5 is supported, its predecessors (i.e&#x2e;, version 1.4 and lower) are also supported. To identify the support of a particular feature, like multi texturing, test for the version in which the feature was first introduced (i.e&#x2e;, version 1.3 in the case of multi texturing) to adapt to the largest possible group of runtime platforms.</p>
<p>This function needs a valid current OpenGL context to work; otherwise it will return <a href="qglformat.html#OpenGLVersionFlag-enum">OpenGL_Version_None</a>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#hasOpenGL">hasOpenGL</a>() and <a href="qglformat.html#hasOpenGLOverlays">hasOpenGLOverlays</a>().</p>
<!-- @@@openGLVersionFlags -->
<!-- $$$plane[overload1]$$$plane -->
<h3 class="fn" id="plane"><a name="plane"></a><span class="type">int</span> QGLFormat::<span class="name">plane</span>() const</h3>
<p>Returns the plane of this format. The default for normal formats is 0, which means the normal plane. The default for overlay formats is 1, which is the first overlay plane.</p>
<p><b>See also </b><a href="qglformat.html#setPlane">setPlane</a>() and <a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a>().</p>
<!-- @@@plane -->
<!-- $$$profile[overload1]$$$profile -->
<h3 class="fn" id="profile"><a name="profile"></a><span class="type"><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a></span> QGLFormat::<span class="name">profile</span>() const</h3>
<p>Returns the OpenGL context profile.</p>
<p>This function was introduced in  Qt 4.7.</p>
<p><b>See also </b><a href="qglformat.html#setProfile">setProfile</a>().</p>
<!-- @@@profile -->
<!-- $$$redBufferSize[overload1]$$$redBufferSize -->
<h3 class="fn" id="redBufferSize"><a name="redBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">redBufferSize</span>() const</h3>
<p>Returns the red buffer size.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>().</p>
<!-- @@@redBufferSize -->
<!-- $$$rgba[overload1]$$$rgba -->
<h3 class="fn" id="rgba"><a name="rgba"></a><span class="type">bool</span> QGLFormat::<span class="name">rgba</span>() const</h3>
<p>Returns <code>true</code> if RGBA color mode is set. Returns <code>false</code> if color index mode is set. The default color mode is RGBA.</p>
<p><b>See also </b><a href="qglformat.html#setRgba">setRgba</a>().</p>
<!-- @@@rgba -->
<!-- $$$sampleBuffers[overload1]$$$sampleBuffers -->
<h3 class="fn" id="sampleBuffers"><a name="sampleBuffers"></a><span class="type">bool</span> QGLFormat::<span class="name">sampleBuffers</span>() const</h3>
<p>Returns <code>true</code> if multisample buffer support is enabled; otherwise returns <code>false</code>.</p>
<p>The multisample buffer is disabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setSampleBuffers">setSampleBuffers</a>().</p>
<!-- @@@sampleBuffers -->
<!-- $$$samples[overload1]$$$samples -->
<h3 class="fn" id="samples"><a name="samples"></a><span class="type">int</span> QGLFormat::<span class="name">samples</span>() const</h3>
<p>Returns the number of samples per pixel when multisampling is enabled. By default, the highest number of samples that is available is used.</p>
<p><b>See also </b><a href="qglformat.html#setSampleBuffers">setSampleBuffers</a>(), <a href="qglformat.html#sampleBuffers">sampleBuffers</a>(), and <a href="qglformat.html#setSamples">setSamples</a>().</p>
<!-- @@@samples -->
<!-- $$$setAccum[overload1]$$$setAccumbool -->
<h3 class="fn" id="setAccum"><a name="setAccum"></a><span class="type">void</span> QGLFormat::<span class="name">setAccum</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true enables the accumulation buffer; otherwise disables the accumulation buffer.</p>
<p>The accumulation buffer is disabled by default.</p>
<p>The accumulation buffer is used to create blur effects and multiple exposures.</p>
<p><b>See also </b><a href="qglformat.html#accum">accum</a>() and <a href="qglformat.html#setAccumBufferSize">setAccumBufferSize</a>().</p>
<!-- @@@setAccum -->
<!-- $$$setAccumBufferSize[overload1]$$$setAccumBufferSizeint -->
<h3 class="fn" id="setAccumBufferSize"><a name="setAccumBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setAccumBufferSize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Set the preferred accumulation buffer size, where <i>size</i> is the bit depth for each RGBA component.</p>
<p><b>See also </b><a href="qglformat.html#accum">accum</a>(), <a href="qglformat.html#setAccum">setAccum</a>(), and <a href="qglformat.html#accumBufferSize">accumBufferSize</a>().</p>
<!-- @@@setAccumBufferSize -->
<!-- $$$setAlpha[overload1]$$$setAlphabool -->
<h3 class="fn" id="setAlpha"><a name="setAlpha"></a><span class="type">void</span> QGLFormat::<span class="name">setAlpha</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true enables the alpha buffer; otherwise disables the alpha buffer.</p>
<p>The alpha buffer is disabled by default.</p>
<p>The alpha buffer is typically used for implementing transparency or translucency. The A in RGBA specifies the transparency of a pixel.</p>
<p><b>See also </b><a href="qglformat.html#alpha">alpha</a>() and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setAlpha -->
<!-- $$$setAlphaBufferSize[overload1]$$$setAlphaBufferSizeint -->
<h3 class="fn" id="setAlphaBufferSize"><a name="setAlphaBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setAlphaBufferSize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Set the preferred alpha buffer size to <i>size</i>. This function implicitly enables the alpha channel.</p>
<p><b>See also </b><a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(), and <a href="qglformat.html#alphaBufferSize">alphaBufferSize</a>().</p>
<!-- @@@setAlphaBufferSize -->
<!-- $$$setBlueBufferSize[overload1]$$$setBlueBufferSizeint -->
<h3 class="fn" id="setBlueBufferSize"><a name="setBlueBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setBlueBufferSize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Set the preferred blue buffer size to <i>size</i>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#blueBufferSize">blueBufferSize</a>(), <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(), and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setBlueBufferSize -->
<!-- $$$setDefaultFormat[overload1]$$$setDefaultFormatconstQGLFormat& -->
<h3 class="fn" id="setDefaultFormat"><a name="setDefaultFormat"></a><code>[static] </code><span class="type">void</span> QGLFormat::<span class="name">setDefaultFormat</span>(const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>f</i>)</h3>
<p>Sets a new default <a href="qglformat.html" class="obsolete">QGLFormat</a> for the application to <i>f</i>. For example, to set single buffering as the default instead of double buffering, your main() might contain code like this:</p>
<pre class="cpp">

  <span class="type"><a href="../qtwidgets/qapplication.html">QApplication</a></span> a(argc<span class="operator">,</span> argv);
  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> f;
  f<span class="operator">.</span>setDoubleBuffer(<span class="keyword">false</span>);
  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span><span class="operator">::</span>setDefaultFormat(f);

</pre>
<p><b>See also </b><a href="qglformat.html#defaultFormat">defaultFormat</a>().</p>
<!-- @@@setDefaultFormat -->
<!-- $$$setDefaultOverlayFormat[overload1]$$$setDefaultOverlayFormatconstQGLFormat& -->
<h3 class="fn" id="setDefaultOverlayFormat"><a name="setDefaultOverlayFormat"></a><code>[static] </code><span class="type">void</span> QGLFormat::<span class="name">setDefaultOverlayFormat</span>(const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>f</i>)</h3>
<p>Sets a new default <a href="qglformat.html" class="obsolete">QGLFormat</a> for overlay contexts to <i>f</i>. This format is used whenever a QGLWidget is created with a format that <a href="qglformat.html#hasOverlay">hasOverlay</a>() enabled.</p>
<p>For example, to get a double buffered overlay context (if available), use code like this:</p>
<pre class="cpp">

  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> f <span class="operator">=</span> <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span><span class="operator">::</span>defaultOverlayFormat();
  f<span class="operator">.</span>setDoubleBuffer(<span class="keyword">true</span>);
  <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span><span class="operator">::</span>setDefaultOverlayFormat(f);

</pre>
<p>As usual, you can find out after widget creation whether the underlying OpenGL system was able to provide the requested specification:</p>
<pre class="cpp">

  <span class="comment">// ...continued from above</span>
  MyGLWidget<span class="operator">*</span> myWidget <span class="operator">=</span> <span class="keyword">new</span> MyGLWidget(<span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span>(QGL<span class="operator">::</span>HasOverlay)<span class="operator">,</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>);
  <span class="keyword">if</span> (myWidget<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>hasOverlay()) {
      <span class="comment">// Yes, we got an overlay, let's check _its_ format:</span>
      <span class="type"><a href="qglcontext.html">QGLContext</a></span><span class="operator">*</span> olContext <span class="operator">=</span> myWidget<span class="operator">-</span><span class="operator">&gt;</span>overlayContext();
      <span class="keyword">if</span> (olContext<span class="operator">-</span><span class="operator">&gt;</span>format()<span class="operator">.</span>doubleBuffer())
          ; <span class="comment">// yes, we got a double buffered overlay</span>
      <span class="keyword">else</span>
          ; <span class="comment">// no, only single buffered overlays are available</span>
  }

</pre>
<p><b>See also </b><a href="qglformat.html#defaultOverlayFormat">defaultOverlayFormat</a>().</p>
<!-- @@@setDefaultOverlayFormat -->
<!-- $$$setDepth[overload1]$$$setDepthbool -->
<h3 class="fn" id="setDepth"><a name="setDepth"></a><span class="type">void</span> QGLFormat::<span class="name">setDepth</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true enables the depth buffer; otherwise disables the depth buffer.</p>
<p>The depth buffer is enabled by default.</p>
<p>The purpose of a depth buffer (or Z-buffering) is to remove hidden surfaces. Pixels are assigned Z values based on the distance to the viewer. A pixel with a high Z value is closer to the viewer than a pixel with a low Z value. This information is used to decide whether to draw a pixel or not.</p>
<p><b>See also </b><a href="qglformat.html#depth">depth</a>() and <a href="qglformat.html#setDepthBufferSize">setDepthBufferSize</a>().</p>
<!-- @@@setDepth -->
<!-- $$$setDepthBufferSize[overload1]$$$setDepthBufferSizeint -->
<h3 class="fn" id="setDepthBufferSize"><a name="setDepthBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setDepthBufferSize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Set the minimum depth buffer size to <i>size</i>.</p>
<p><b>See also </b><a href="qglformat.html#depthBufferSize">depthBufferSize</a>(), <a href="qglformat.html#setDepth">setDepth</a>(), and <a href="qglformat.html#depth">depth</a>().</p>
<!-- @@@setDepthBufferSize -->
<!-- $$$setDirectRendering[overload1]$$$setDirectRenderingbool -->
<h3 class="fn" id="setDirectRendering"><a name="setDirectRendering"></a><span class="type">void</span> QGLFormat::<span class="name">setDirectRendering</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true enables direct rendering; otherwise disables direct rendering.</p>
<p>Direct rendering is enabled by default.</p>
<p>Enabling this option will make OpenGL bypass the underlying window system and render directly from hardware to the screen, if this is supported by the system.</p>
<p><b>See also </b><a href="qglformat.html#directRendering">directRendering</a>().</p>
<!-- @@@setDirectRendering -->
<!-- $$$setDoubleBuffer[overload1]$$$setDoubleBufferbool -->
<h3 class="fn" id="setDoubleBuffer"><a name="setDoubleBuffer"></a><span class="type">void</span> QGLFormat::<span class="name">setDoubleBuffer</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true sets double buffering; otherwise sets single buffering.</p>
<p>Double buffering is enabled by default.</p>
<p>Double buffering is a technique where graphics are rendered on an off-screen buffer and not directly to the screen. When the drawing has been completed, the program calls a swapBuffers() function to exchange the screen contents with the buffer. The result is flicker-free drawing and often better performance.</p>
<p>Note that single buffered contexts are currently not supported with EGL.</p>
<p><b>See also </b><a href="qglformat.html#doubleBuffer">doubleBuffer</a>(), <a href="qglcontext.html#swapBuffers">QGLContext::swapBuffers</a>(), and <a href="qglwidget.html#swapBuffers">QGLWidget::swapBuffers</a>().</p>
<!-- @@@setDoubleBuffer -->
<!-- $$$setGreenBufferSize[overload1]$$$setGreenBufferSizeint -->
<h3 class="fn" id="setGreenBufferSize"><a name="setGreenBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setGreenBufferSize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Set the preferred green buffer size to <i>size</i>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#greenBufferSize">greenBufferSize</a>(), <a href="qglformat.html#setRedBufferSize">setRedBufferSize</a>(), <a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>(), and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setGreenBufferSize -->
<!-- $$$setOption[overload1]$$$setOptionQGL::FormatOptions -->
<h3 class="fn" id="setOption"><a name="setOption"></a><span class="type">void</span> QGLFormat::<span class="name">setOption</span>(<span class="type"><a href="qgl.html#FormatOption-enum">QGL::FormatOptions</a></span> <i>opt</i>)</h3>
<p>Sets the format option to <i>opt</i>.</p>
<p><b>See also </b><a href="qglformat.html#testOption">testOption</a>().</p>
<!-- @@@setOption -->
<!-- $$$setOverlay[overload1]$$$setOverlaybool -->
<h3 class="fn" id="setOverlay"><a name="setOverlay"></a><span class="type">void</span> QGLFormat::<span class="name">setOverlay</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true enables an overlay plane; otherwise disables the overlay plane.</p>
<p>Enabling the overlay plane will cause QGLWidget to create an additional context in an overlay plane. See the QGLWidget documentation for further information.</p>
<p><b>See also </b><a href="qglformat.html#hasOverlay">hasOverlay</a>().</p>
<!-- @@@setOverlay -->
<!-- $$$setPlane[overload1]$$$setPlaneint -->
<h3 class="fn" id="setPlane"><a name="setPlane"></a><span class="type">void</span> QGLFormat::<span class="name">setPlane</span>(<span class="type">int</span> <i>plane</i>)</h3>
<p>Sets the requested plane to <i>plane</i>. 0 is the normal plane, 1 is the first overlay plane, 2 is the second overlay plane, etc.; -1, -2, etc. are underlay planes.</p>
<p>Note that in contrast to other format specifications, the plane specifications will be matched exactly. This means that if you specify a plane that the underlying OpenGL system cannot provide, an <a href="qglwidget.html#isValid">invalid</a> QGLWidget will be created.</p>
<p><b>See also </b><a href="qglformat.html#plane">plane</a>().</p>
<!-- @@@setPlane -->
<!-- $$$setProfile[overload1]$$$setProfileOpenGLContextProfile -->
<h3 class="fn" id="setProfile"><a name="setProfile"></a><span class="type">void</span> QGLFormat::<span class="name">setProfile</span>(<span class="type"><a href="qglformat.html#OpenGLContextProfile-enum">OpenGLContextProfile</a></span> <i>profile</i>)</h3>
<p>Set the OpenGL context profile to <i>profile</i>. The <i>profile</i> is ignored if the requested OpenGL version is less than 3.2&#x2e;</p>
<p>This function was introduced in  Qt 4.7.</p>
<p><b>See also </b><a href="qglformat.html#profile">profile</a>().</p>
<!-- @@@setProfile -->
<!-- $$$setRedBufferSize[overload1]$$$setRedBufferSizeint -->
<h3 class="fn" id="setRedBufferSize"><a name="setRedBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setRedBufferSize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Set the preferred red buffer size to <i>size</i>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#redBufferSize">redBufferSize</a>(), <a href="qglformat.html#setGreenBufferSize">setGreenBufferSize</a>(), <a href="qglformat.html#setBlueBufferSize">setBlueBufferSize</a>(), and <a href="qglformat.html#setAlphaBufferSize">setAlphaBufferSize</a>().</p>
<!-- @@@setRedBufferSize -->
<!-- $$$setRgba[overload1]$$$setRgbabool -->
<h3 class="fn" id="setRgba"><a name="setRgba"></a><span class="type">void</span> QGLFormat::<span class="name">setRgba</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true sets RGBA mode. If <i>enable</i> is false sets color index mode.</p>
<p>The default color mode is RGBA.</p>
<p>RGBA is the preferred mode for most OpenGL applications. In RGBA color mode you specify colors as red + green + blue + alpha quadruplets.</p>
<p>In color index mode you specify an index into a color lookup table.</p>
<p><b>See also </b><a href="qglformat.html#rgba">rgba</a>().</p>
<!-- @@@setRgba -->
<!-- $$$setSampleBuffers[overload1]$$$setSampleBuffersbool -->
<h3 class="fn" id="setSampleBuffers"><a name="setSampleBuffers"></a><span class="type">void</span> QGLFormat::<span class="name">setSampleBuffers</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true, a GL context with multisample buffer support is picked; otherwise ignored.</p>
<p><b>See also </b><a href="qglformat.html#sampleBuffers">sampleBuffers</a>(), <a href="qglformat.html#setSamples">setSamples</a>(), and <a href="qglformat.html#samples">samples</a>().</p>
<!-- @@@setSampleBuffers -->
<!-- $$$setSamples[overload1]$$$setSamplesint -->
<h3 class="fn" id="setSamples"><a name="setSamples"></a><span class="type">void</span> QGLFormat::<span class="name">setSamples</span>(<span class="type">int</span> <i>numSamples</i>)</h3>
<p>Set the preferred number of samples per pixel when multisampling is enabled to <i>numSamples</i>. By default, the highest number of samples available is used.</p>
<p><b>See also </b><a href="qglformat.html#setSampleBuffers">setSampleBuffers</a>(), <a href="qglformat.html#sampleBuffers">sampleBuffers</a>(), and <a href="qglformat.html#samples">samples</a>().</p>
<!-- @@@setSamples -->
<!-- $$$setStencil[overload1]$$$setStencilbool -->
<h3 class="fn" id="setStencil"><a name="setStencil"></a><span class="type">void</span> QGLFormat::<span class="name">setStencil</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true enables the stencil buffer; otherwise disables the stencil buffer.</p>
<p>The stencil buffer is enabled by default.</p>
<p>The stencil buffer masks certain parts of the drawing area so that masked parts are not drawn on.</p>
<p><b>See also </b><a href="qglformat.html#stencil">stencil</a>() and <a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<!-- @@@setStencil -->
<!-- $$$setStencilBufferSize[overload1]$$$setStencilBufferSizeint -->
<h3 class="fn" id="setStencilBufferSize"><a name="setStencilBufferSize"></a><span class="type">void</span> QGLFormat::<span class="name">setStencilBufferSize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Set the preferred stencil buffer size to <i>size</i>.</p>
<p><b>See also </b><a href="qglformat.html#stencilBufferSize">stencilBufferSize</a>(), <a href="qglformat.html#setStencil">setStencil</a>(), and <a href="qglformat.html#stencil">stencil</a>().</p>
<!-- @@@setStencilBufferSize -->
<!-- $$$setStereo[overload1]$$$setStereobool -->
<h3 class="fn" id="setStereo"><a name="setStereo"></a><span class="type">void</span> QGLFormat::<span class="name">setStereo</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>If <i>enable</i> is true enables stereo buffering; otherwise disables stereo buffering.</p>
<p>Stereo buffering is disabled by default.</p>
<p>Stereo buffering provides extra color buffers to generate left-eye and right-eye images.</p>
<p><b>See also </b><a href="qglformat.html#stereo">stereo</a>().</p>
<!-- @@@setStereo -->
<!-- $$$setSwapInterval[overload1]$$$setSwapIntervalint -->
<h3 class="fn" id="setSwapInterval"><a name="setSwapInterval"></a><span class="type">void</span> QGLFormat::<span class="name">setSwapInterval</span>(<span class="type">int</span> <i>interval</i>)</h3>
<p>Set the preferred swap interval. This can be used to sync the GL drawing into a system window to the vertical refresh of the screen. Setting an <i>interval</i> value of 0 will turn the vertical refresh syncing off, any value higher than 0 will turn the vertical syncing on.</p>
<p>Under Windows and under X11, where the <code>WGL_EXT_swap_control</code> and <code>GLX_SGI_video_sync</code> extensions are used, the <i>interval</i> parameter can be used to set the minimum number of video frames that are displayed before a buffer swap will occur. In effect, setting the <i>interval</i> to 10, means there will be 10 vertical retraces between every buffer swap.</p>
<p>Under Windows the <code>WGL_EXT_swap_control</code> extension has to be present, and under X11 the <code>GLX_SGI_video_sync</code> extension has to be present.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#swapInterval">swapInterval</a>().</p>
<!-- @@@setSwapInterval -->
<!-- $$$setVersion[overload1]$$$setVersionintint -->
<h3 class="fn" id="setVersion"><a name="setVersion"></a><span class="type">void</span> QGLFormat::<span class="name">setVersion</span>(<span class="type">int</span> <i>major</i>, <span class="type">int</span> <i>minor</i>)</h3>
<p>Set the OpenGL version to the <i>major</i> and <i>minor</i> numbers. If a context compatible with the requested OpenGL version cannot be created, a context compatible with version 1.x is created instead.</p>
<p>This function was introduced in  Qt 4.7.</p>
<p><b>See also </b><a href="qglformat.html#majorVersion">majorVersion</a>() and <a href="qglformat.html#minorVersion">minorVersion</a>().</p>
<!-- @@@setVersion -->
<!-- $$$stencil[overload1]$$$stencil -->
<h3 class="fn" id="stencil"><a name="stencil"></a><span class="type">bool</span> QGLFormat::<span class="name">stencil</span>() const</h3>
<p>Returns <code>true</code> if the stencil buffer is enabled; otherwise returns false. The stencil buffer is enabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setStencil">setStencil</a>() and <a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<!-- @@@stencil -->
<!-- $$$stencilBufferSize[overload1]$$$stencilBufferSize -->
<h3 class="fn" id="stencilBufferSize"><a name="stencilBufferSize"></a><span class="type">int</span> QGLFormat::<span class="name">stencilBufferSize</span>() const</h3>
<p>Returns the stencil buffer size.</p>
<p><b>See also </b><a href="qglformat.html#stencil">stencil</a>(), <a href="qglformat.html#setStencil">setStencil</a>(), and <a href="qglformat.html#setStencilBufferSize">setStencilBufferSize</a>().</p>
<!-- @@@stencilBufferSize -->
<!-- $$$stereo[overload1]$$$stereo -->
<h3 class="fn" id="stereo"><a name="stereo"></a><span class="type">bool</span> QGLFormat::<span class="name">stereo</span>() const</h3>
<p>Returns <code>true</code> if stereo buffering is enabled; otherwise returns false. Stereo buffering is disabled by default.</p>
<p><b>See also </b><a href="qglformat.html#setStereo">setStereo</a>().</p>
<!-- @@@stereo -->
<!-- $$$swapInterval[overload1]$$$swapInterval -->
<h3 class="fn" id="swapInterval"><a name="swapInterval"></a><span class="type">int</span> QGLFormat::<span class="name">swapInterval</span>() const</h3>
<p>Returns the currently set swap interval. -1 is returned if setting the swap interval isn't supported in the system GL implementation.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qglformat.html#setSwapInterval">setSwapInterval</a>().</p>
<!-- @@@swapInterval -->
<!-- $$$testOption[overload1]$$$testOptionQGL::FormatOptions -->
<h3 class="fn" id="testOption"><a name="testOption"></a><span class="type">bool</span> QGLFormat::<span class="name">testOption</span>(<span class="type"><a href="qgl.html#FormatOption-enum">QGL::FormatOptions</a></span> <i>opt</i>) const</h3>
<p>Returns <code>true</code> if format option <i>opt</i> is set; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qglformat.html#setOption">setOption</a>().</p>
<!-- @@@testOption -->
<!-- $$$toSurfaceFormat[overload1]$$$toSurfaceFormatconstQGLFormat& -->
<h3 class="fn" id="toSurfaceFormat"><a name="toSurfaceFormat"></a><code>[static] </code><span class="type"><a href="../qtgui/qsurfaceformat.html">QSurfaceFormat</a></span> QGLFormat::<span class="name">toSurfaceFormat</span>(const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>format</i>)</h3>
<p>Returns a window format for the OpenGL format specified by <i>format</i>.</p>
<!-- @@@toSurfaceFormat -->
<!-- $$$operator=[overload1]$$$operator=constQGLFormat& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;QGLFormat::<span class="name">operator=</span>(const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>other</i>)</h3>
<p>Assigns <i>other</i> to this object.</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator!=[overload1]$$$operator!=constQGLFormat&constQGLFormat& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> <span class="name">operator!=</span>(const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>a</i>, const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>b</i>)</h3>
<p>Returns <code>false</code> if all the options of the two QGLFormat objects <i>a</i> and <i>b</i> are equal; otherwise returns <code>true</code>.</p>
<!-- @@@operator!= -->
<!-- $$$operator==[overload1]$$$operator==constQGLFormat&constQGLFormat& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> <span class="name">operator==</span>(const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>a</i>, const <span class="type"><a href="qglformat.html#QGLFormat">QGLFormat</a></span> &amp;<i>b</i>)</h3>
<p>Returns <code>true</code> if all the options of the two QGLFormat objects <i>a</i> and <i>b</i> are equal; otherwise returns <code>false</code>.</p>
<!-- @@@operator== -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    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. </p>
</div>
</body>
</html>