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">
6 <refentrytitle>glGetShaderSource
</refentrytitle>
7 <manvolnum>3G
</manvolnum>
10 <refname>glGetShaderSource
</refname>
11 <refpurpose>Returns the source code string from a shader object
</refpurpose>
13 <refsynopsisdiv><title>C Specification
</title>
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>
24 <refsect1 id=
"parameters"><title>Parameters
</title>
27 <term><parameter>shader
</parameter></term>
29 <para>Specifies the shader object to be
34 <term><parameter>bufSize
</parameter></term>
36 <para>Specifies the size of the character buffer for
37 storing the returned source code string.
</para>
41 <term><parameter>length
</parameter></term>
43 <para>Returns the length of the string returned in
44 <parameter>source
</parameter> (excluding the null
49 <term><parameter>source
</parameter></term>
51 <para>Specifies an array of characters that is used
52 to return the source code string.
</para>
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
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>
78 <constant>GL_SHADER_SOURCE_LENGTH
</constant>.
</para>
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
85 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
86 <parameter>shader
</parameter> is not a shader object.
</para>
88 <para><constant>GL_INVALID_VALUE
</constant> is generated if
89 <parameter>bufSize
</parameter> is less than
0.
</para>
92 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
93 <para><citerefentry><refentrytitle>glGetShader
</refentrytitle></citerefentry>
95 <constant>GL_SHADER_SOURCE_LENGTH
</constant></para>
97 <para><citerefentry><refentrytitle>glIsShader
</refentrytitle></citerefentry></para>
99 <refsect1 id=
"seealso"><title>See Also
</title>
100 <para><citerefentry><refentrytitle>glCreateShader
</refentrytitle></citerefentry>,
101 <citerefentry><refentrytitle>glShaderSource
</refentrytitle></citerefentry></para>
103 <refsect1 id=
"Copyright"><title>Copyright
</title>
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>.