include more low-level bindings
[clinton/guile-figl.git] / upstream-man-pages / man4 / glGetShaderSource.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="glGetShaderSource">
5 <refmeta>
6 <refentrytitle>glGetShaderSource</refentrytitle>
7 <manvolnum>3G</manvolnum>
8 </refmeta>
9 <refnamediv>
10 <refname>glGetShaderSource</refname>
11 <refpurpose>Returns the source code string from a shader object</refpurpose>
12 </refnamediv>
13 <refsynopsisdiv><title>C Specification</title>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>void <function>glGetShaderSource</function></funcdef>
17 <paramdef>GLuint <parameter>shader</parameter></paramdef>
18 <paramdef>GLsizei <parameter>bufSize</parameter></paramdef>
19 <paramdef>GLsizei *<parameter>length</parameter></paramdef>
20 <paramdef>GLchar *<parameter>source</parameter></paramdef>
21 </funcprototype>
22 </funcsynopsis>
23 </refsynopsisdiv>
24 <refsect1 id="parameters"><title>Parameters</title>
25 <variablelist>
26 <varlistentry>
27 <term><parameter>shader</parameter></term>
28 <listitem>
29 <para>Specifies the shader object to be
30 queried.</para>
31 </listitem>
32 </varlistentry>
33 <varlistentry>
34 <term><parameter>bufSize</parameter></term>
35 <listitem>
36 <para>Specifies the size of the character buffer for
37 storing the returned source code string.</para>
38 </listitem>
39 </varlistentry>
40 <varlistentry>
41 <term><parameter>length</parameter></term>
42 <listitem>
43 <para>Returns the length of the string returned in
44 <parameter>source</parameter> (excluding the null
45 terminator).</para>
46 </listitem>
47 </varlistentry>
48 <varlistentry>
49 <term><parameter>source</parameter></term>
50 <listitem>
51 <para>Specifies an array of characters that is used
52 to return the source code string.</para>
53 </listitem>
54 </varlistentry>
55 </variablelist>
56 </refsect1>
57 <refsect1 id="description"><title>Description</title>
58 <para><function>glGetShaderSource</function> returns the
59 concatenation of the source code strings from the shader object
60 specified by <parameter>shader</parameter>. The source code
61 strings for a shader object are the result of a previous call to
62 <citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry>.
63 The string returned by the function will be null
64 terminated.</para>
65
66 <para><function>glGetShaderSource</function> returns in
67 <parameter>source</parameter> as much of the source code string
68 as it can, up to a maximum of <parameter>bufSize</parameter>
69 characters. The number of characters actually returned,
70 excluding the null termination character, is specified by
71 <parameter>length</parameter>. If the length of the returned
72 string is not required, a value of <constant>NULL</constant> can
73 be passed in the <parameter>length</parameter> argument. The
74 size of the buffer required to store the returned source code
75 string can be obtained by calling
76 <citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
77 with the value
78 <constant>GL_SHADER_SOURCE_LENGTH</constant>.</para>
79 </refsect1>
80 <refsect1 id="errors"><title>Errors</title>
81 <para><constant>GL_INVALID_VALUE</constant> is generated if
82 <parameter>shader</parameter> is not a value generated by
83 OpenGL.</para>
84
85 <para><constant>GL_INVALID_OPERATION</constant> is generated if
86 <parameter>shader</parameter> is not a shader object.</para>
87
88 <para><constant>GL_INVALID_VALUE</constant> is generated if
89 <parameter>bufSize</parameter> is less than 0.</para>
90
91 </refsect1>
92 <refsect1 id="associatedgets"><title>Associated Gets</title>
93 <para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
94 with argument
95 <constant>GL_SHADER_SOURCE_LENGTH</constant></para>
96
97 <para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
98 </refsect1>
99 <refsect1 id="seealso"><title>See Also</title>
100 <para><citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
101 <citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry></para>
102 </refsect1>
103 <refsect1 id="Copyright"><title>Copyright</title>
104 <para>
105 Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd.
106 This material may be distributed subject to the terms and conditions set forth in
107 the Open Publication License, v 1.0, 8 June 1999.
108 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
109 </para>
110 </refsect1>
111 </refentry>