Sophie

Sophie

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

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" />
<!-- qglshaderprogram.cpp -->
  <title>QGLShader 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 >QGLShader</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="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QGLShader Class</h1>
<!-- $$$QGLShader-brief -->
<p>The <a href="qglshader.html">QGLShader</a> class allows OpenGL shaders to be compiled. <a href="#details">More...</a></p>
<!-- @@@QGLShader -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGLShader&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += opengl</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.6</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></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="qglshader-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"> flags </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#ShaderTypeBit-enum">ShaderType</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#ShaderTypeBit-enum">ShaderTypeBit</a></b> { Vertex, Fragment, Geometry }</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="qglshader.html#QGLShader">QGLShader</a></b>(QGLShader::ShaderType <i>type</i>, QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#QGLShader-1">QGLShader</a></b>(QGLShader::ShaderType <i>type</i>, const QGLContext *<i>context</i>, QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#dtor.QGLShader">~QGLShader</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#compileSourceCode">compileSourceCode</a></b>(const char *<i>source</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#compileSourceCode-1">compileSourceCode</a></b>(const QByteArray &amp;<i>source</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#compileSourceCode-2">compileSourceCode</a></b>(const QString &amp;<i>source</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#compileSourceFile">compileSourceFile</a></b>(const QString &amp;<i>fileName</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#isCompiled">isCompiled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#log">log</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> GLuint </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#shaderId">shaderId</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGLShader::ShaderType </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#shaderType">shaderType</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#sourceCode">sourceCode</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<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"> bool </td><td class="memItemRight bottomAlign"><b><a href="qglshader.html#hasOpenGLShaders">hasOpenGLShaders</a></b>(ShaderType <i>type</i>, const QGLContext *<i>context</i> = Q_NULLPTR)</td></tr>
</table></div>
<ul>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGLShader-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qglshader.html">QGLShader</a> class allows OpenGL shaders to be compiled.</p>
<p>This class supports shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES).</p>
<p><a href="qglshader.html">QGLShader</a> and <a href="qglshaderprogram.html">QGLShaderProgram</a> shelter the programmer from the details of compiling and linking vertex and fragment shaders.</p>
<p><b>Note: </b>This class has been deprecated in favor of <a href="../qtgui/qopenglshader.html">QOpenGLShader</a>.</p></div>
<p><b>See also </b><a href="qglshaderprogram.html">QGLShaderProgram</a>.</p>
<!-- @@@QGLShader -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ShaderTypeBit$$$Vertex$$$Fragment$$$Geometry -->
<h3 class="flags" id="ShaderTypeBit-enum"><a name="ShaderTypeBit-enum"></a>enum QGLShader::<span class="name">ShaderTypeBit</span><br/>flags QGLShader::<span class="name">ShaderType</span></h3>
<p>This enum specifies the type of <a href="qglshader.html" class="obsolete">QGLShader</a> that is being created.</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>QGLShader::Vertex</code></td><td class="topAlign tblval"><code>0x0001</code></td><td class="topAlign">Vertex shader written in the OpenGL Shading Language (GLSL).</td></tr>
<tr><td class="topAlign"><code>QGLShader::Fragment</code></td><td class="topAlign tblval"><code>0x0002</code></td><td class="topAlign">Fragment shader written in the OpenGL Shading Language (GLSL).</td></tr>
<tr><td class="topAlign"><code>QGLShader::Geometry</code></td><td class="topAlign tblval"><code>0x0004</code></td><td class="topAlign">Geometry shaders written in the OpenGL Shading Language (GLSL), based on the GL_EXT_geometry_shader4 extension.</td></tr>
</table></div>
<p>The ShaderType type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;ShaderTypeBit&gt;. It stores an OR combination of ShaderTypeBit values.</p>
<!-- @@@ShaderTypeBit -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGLShader[overload1]$$$QGLShaderQGLShader::ShaderTypeQObject* -->
<h3 class="fn" id="QGLShader"><a name="QGLShader"></a>QGLShader::<span class="name">QGLShader</span>(<span class="type"><a href="qglshader.html#ShaderTypeBit-enum">QGLShader::ShaderType</a></span> <i>type</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a new <a href="qglshader.html" class="obsolete">QGLShader</a> object of the specified <i>type</i> and attaches it to <i>parent</i>. If shader programs are not supported, <a href="qglshaderprogram.html#hasOpenGLShaderPrograms">QGLShaderProgram::hasOpenGLShaderPrograms</a>() will return false.</p>
<p>This constructor is normally followed by a call to <a href="qglshader.html#compileSourceCode">compileSourceCode</a>() or <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<p>The shader will be associated with the current QGLContext.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<!-- @@@QGLShader -->
<!-- $$$QGLShader$$$QGLShaderQGLShader::ShaderTypeconstQGLContext*QObject* -->
<h3 class="fn" id="QGLShader-1"><a name="QGLShader-1"></a>QGLShader::<span class="name">QGLShader</span>(<span class="type"><a href="qglshader.html#ShaderTypeBit-enum">QGLShader::ShaderType</a></span> <i>type</i>, const <span class="type"><a href="qglcontext.html">QGLContext</a></span> *<i>context</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a new <a href="qglshader.html" class="obsolete">QGLShader</a> object of the specified <i>type</i> and attaches it to <i>parent</i>. If shader programs are not supported, then <a href="qglshaderprogram.html#hasOpenGLShaderPrograms">QGLShaderProgram::hasOpenGLShaderPrograms</a>() will return false.</p>
<p>This constructor is normally followed by a call to <a href="qglshader.html#compileSourceCode">compileSourceCode</a>() or <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<p>The shader will be associated with <i>context</i>.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<!-- @@@QGLShader -->
<!-- $$$~QGLShader[overload1]$$$~QGLShader -->
<h3 class="fn" id="dtor.QGLShader"><a name="dtor.QGLShader"></a><code>[virtual] </code>QGLShader::<span class="name">~QGLShader</span>()</h3>
<p>Deletes this shader. If the shader has been attached to a QGLShaderProgram object, then the actual shader will stay around until the QGLShaderProgram is destroyed.</p>
<!-- @@@~QGLShader -->
<!-- $$$compileSourceCode[overload1]$$$compileSourceCodeconstchar* -->
<h3 class="fn" id="compileSourceCode"><a name="compileSourceCode"></a><span class="type">bool</span> QGLShader::<span class="name">compileSourceCode</span>(const <span class="type">char</span> *<i>source</i>)</h3>
<p>Sets the <i>source</i> code for this shader and compiles it. Returns <code>true</code> if the source was successfully compiled, false otherwise.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<!-- @@@compileSourceCode -->
<!-- $$$compileSourceCode$$$compileSourceCodeconstQByteArray& -->
<h3 class="fn" id="compileSourceCode-1"><a name="compileSourceCode-1"></a><span class="type">bool</span> QGLShader::<span class="name">compileSourceCode</span>(const <span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> &amp;<i>source</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the <i>source</i> code for this shader and compiles it. Returns <code>true</code> if the source was successfully compiled, false otherwise.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<!-- @@@compileSourceCode -->
<!-- $$$compileSourceCode$$$compileSourceCodeconstQString& -->
<h3 class="fn" id="compileSourceCode-2"><a name="compileSourceCode-2"></a><span class="type">bool</span> QGLShader::<span class="name">compileSourceCode</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>source</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the <i>source</i> code for this shader and compiles it. Returns <code>true</code> if the source was successfully compiled, false otherwise.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<!-- @@@compileSourceCode -->
<!-- $$$compileSourceFile[overload1]$$$compileSourceFileconstQString& -->
<h3 class="fn" id="compileSourceFile"><a name="compileSourceFile"></a><span class="type">bool</span> QGLShader::<span class="name">compileSourceFile</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>fileName</i>)</h3>
<p>Sets the source code for this shader to the contents of <i>fileName</i> and compiles it. Returns <code>true</code> if the file could be opened and the source compiled, false otherwise.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceCode">compileSourceCode</a>().</p>
<!-- @@@compileSourceFile -->
<!-- $$$hasOpenGLShaders[overload1]$$$hasOpenGLShadersShaderTypeconstQGLContext* -->
<h3 class="fn" id="hasOpenGLShaders"><a name="hasOpenGLShaders"></a><code>[static] </code><span class="type">bool</span> QGLShader::<span class="name">hasOpenGLShaders</span>(<span class="type"><a href="qglshader.html#ShaderTypeBit-enum">ShaderType</a></span> <i>type</i>, const <span class="type"><a href="qglcontext.html">QGLContext</a></span> *<i>context</i> = Q_NULLPTR)</h3>
<p>Returns <code>true</code> if shader programs of type <i>type</i> are supported on this system; false otherwise.</p>
<p>The <i>context</i> is used to resolve the GLSL extensions. If <i>context</i> is null, then <a href="qglcontext.html#currentContext">QGLContext::currentContext</a>() is used.</p>
<p>This function was introduced in  Qt 4.7.</p>
<!-- @@@hasOpenGLShaders -->
<!-- $$$isCompiled[overload1]$$$isCompiled -->
<h3 class="fn" id="isCompiled"><a name="isCompiled"></a><span class="type">bool</span> QGLShader::<span class="name">isCompiled</span>() const</h3>
<p>Returns <code>true</code> if this shader has been compiled; false otherwise.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<!-- @@@isCompiled -->
<!-- $$$log[overload1]$$$log -->
<h3 class="fn" id="log"><a name="log"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QGLShader::<span class="name">log</span>() const</h3>
<p>Returns the errors and warnings that occurred during the last compile.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<!-- @@@log -->
<!-- $$$shaderId[overload1]$$$shaderId -->
<h3 class="fn" id="shaderId"><a name="shaderId"></a><span class="type">GLuint</span> QGLShader::<span class="name">shaderId</span>() const</h3>
<p>Returns the OpenGL identifier associated with this shader.</p>
<p><b>See also </b><a href="qglshaderprogram.html#programId">QGLShaderProgram::programId</a>().</p>
<!-- @@@shaderId -->
<!-- $$$shaderType[overload1]$$$shaderType -->
<h3 class="fn" id="shaderType"><a name="shaderType"></a><span class="type"><a href="qglshader.html#ShaderTypeBit-enum">QGLShader::ShaderType</a></span> QGLShader::<span class="name">shaderType</span>() const</h3>
<p>Returns the type of this shader.</p>
<!-- @@@shaderType -->
<!-- $$$sourceCode[overload1]$$$sourceCode -->
<h3 class="fn" id="sourceCode"><a name="sourceCode"></a><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QGLShader::<span class="name">sourceCode</span>() const</h3>
<p>Returns the source code for this shader.</p>
<p><b>See also </b><a href="qglshader.html#compileSourceCode">compileSourceCode</a>().</p>
<!-- @@@sourceCode -->
</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>