File: qglshader.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (51 lines) | stat: -rw-r--r-- 9,410 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGLShader Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGLShader Class Reference<br /><sup><sup>[<a href="qtopengl.html">QtOpenGL</a> module]</sup></sup></h1><p>The QGLShader class allows OpenGL shaders to be compiled. <a href="#details">More...</a></p>
<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Types</h3><ul><li><div class="fn" />class <b><a href="qglshader-shadertype.html">ShaderType</a></b></li><li><div class="fn" />enum <b><a href="qglshader.html#ShaderTypeBit-enum">ShaderTypeBit</a></b> { Vertex, Fragment }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qglshader.html#QGLShader">__init__</a></b> (<i>self</i>, ShaderType, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qglshader.html#QGLShader-2">__init__</a></b> (<i>self</i>, ShaderType, QGLContext, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qglshader.html#compileSourceCode">compileSourceCode</a></b> (<i>self</i>, QByteArray)</li><li><div class="fn" />bool <b><a href="qglshader.html#compileSourceCode-2">compileSourceCode</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qglshader.html#compileSourceFile">compileSourceFile</a></b> (<i>self</i>, QString)</li><li><div class="fn" />bool <b><a href="qglshader.html#isCompiled">isCompiled</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qglshader.html#log">log</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qglshader.html#shaderId">shaderId</a></b> (<i>self</i>)</li><li><div class="fn" />ShaderType <b><a href="qglshader.html#shaderType">shaderType</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qglshader.html#sourceCode">sourceCode</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGLShader 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>QGLShader and <a href="qglshaderprogram.html">QGLShaderProgram</a> shelter the programmer from the details of compiling and linking vertex and fragment shaders.</p>
<p>See also <a href="qglshaderprogram.html">QGLShaderProgram</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ShaderTypeBit-enum" />QGLShader.ShaderTypeBit</h3><p>This enum specifies the type of <a href="qglshader.html">QGLShader</a> that is being created.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QGLShader.Vertex</tt></td><td align="center" valign="top"><tt>0x0001</tt></td><td valign="top">Vertex shader written in the OpenGL Shading Language (GLSL).</td></tr>
<tr><td valign="top"><tt>QGLShader.Fragment</tt></td><td align="center" valign="top"><tt>0x0002</tt></td><td valign="top">Fragment shader written in the OpenGL Shading Language (GLSL).</td></tr>
</table></p>
<p>The ShaderType type is a typedef for <a href="qflags.html">QFlags</a>&lt;ShaderTypeBit&gt;. It stores an OR combination of ShaderTypeBit values.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGLShader" />QGLShader.__init__ (<i>self</i>, <a href="qglshader-shadertype.html">ShaderType</a>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new <a href="qglshader.html">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 <a href="qglcontext.html">QGLContext</a>.</p>
<p>See also <a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<h3 class="fn"><a name="QGLShader-2" />QGLShader.__init__ (<i>self</i>, <a href="qglshader-shadertype.html">ShaderType</a>, <a href="qglcontext.html">QGLContext</a>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new <a href="qglshader.html">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>See also <a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<a name="//apple_ref/cpp/instm/QGLShader/~QGLShader" />
<h3 class="fn"><a name="compileSourceCode" />bool QGLShader.compileSourceCode (<i>self</i>, <a href="qbytearray.html">QByteArray</a>)</h3><p>Sets the <i>source</i> code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.</p>
<p>See also <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<h3 class="fn"><a name="compileSourceCode-2" />bool QGLShader.compileSourceCode (<i>self</i>, QString)</h3><p>This is an overloaded function.</p>
<p>Sets the <i>source</i> code for this shader and compiles it. Returns true if the source was successfully compiled, false otherwise.</p>
<p>See also <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<h3 class="fn"><a name="compileSourceFile" />bool QGLShader.compileSourceFile (<i>self</i>, QString)</h3><p>Sets the source code for this shader to the contents of <i>fileName</i> and compiles it. Returns true if the file could be opened and the source compiled, false otherwise.</p>
<p>See also <a href="qglshader.html#compileSourceCode">compileSourceCode</a>().</p>
<a name="//apple_ref/cpp/instm/QGLShader/isCompiled" />
<h3 class="fn"><a name="isCompiled" />bool QGLShader.isCompiled (<i>self</i>)</h3><p>Returns true if this shader has been compiled; false otherwise.</p>
<p>See also <a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<a name="//apple_ref/cpp/instm/QGLShader/log" />
<h3 class="fn"><a name="log" />QString QGLShader.log (<i>self</i>)</h3><p>Returns the errors and warnings that occurred during the last compile.</p>
<p>See also <a href="qglshader.html#compileSourceCode">compileSourceCode</a>() and <a href="qglshader.html#compileSourceFile">compileSourceFile</a>().</p>
<a name="//apple_ref/cpp/instm/QGLShader/shaderId" />
<h3 class="fn"><a name="shaderId" />int QGLShader.shaderId (<i>self</i>)</h3><p>Returns the OpenGL identifier associated with this shader.</p>
<p>See also <a href="qglshaderprogram.html#programId">QGLShaderProgram.programId</a>().</p>
<a name="//apple_ref/cpp/instm/QGLShader/shaderType" />
<h3 class="fn"><a name="shaderType" /><a href="qglshader-shadertype.html">ShaderType</a> QGLShader.shaderType (<i>self</i>)</h3><p>Returns the type of this shader.</p>
<a name="//apple_ref/cpp/instm/QGLShader/sourceCode" />
<h3 class="fn"><a name="sourceCode" /><a href="qbytearray.html">QByteArray</a> QGLShader.sourceCode (<i>self</i>)</h3><p>Returns the source code for this shader.</p>
<p>See also <a href="qglshader.html#compileSourceCode">compileSourceCode</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>