Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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="glCreateShader"> | |
5 | <refmeta> | |
6 | <refentrytitle>glCreateShader</refentrytitle> | |
7 | <manvolnum>3G</manvolnum> | |
8 | </refmeta> | |
9 | <refnamediv> | |
10 | <refname>glCreateShader</refname> | |
11 | <refpurpose>Creates a shader object</refpurpose> | |
12 | </refnamediv> | |
13 | <refsynopsisdiv><title>C Specification</title> | |
14 | <funcsynopsis> | |
15 | <funcprototype> | |
16 | <funcdef>GLuint <function>glCreateShader</function></funcdef> | |
17 | <paramdef>GLenum <parameter>shaderType</parameter></paramdef> | |
18 | </funcprototype> | |
19 | </funcsynopsis> | |
20 | </refsynopsisdiv> | |
21 | <refsect1 id="parameters"><title>Parameters</title> | |
22 | <variablelist> | |
23 | <varlistentry> | |
24 | <term><parameter>shaderType</parameter></term> | |
25 | <listitem> | |
26 | <para>Specifies the type of shader to be created. | |
27 | Must be one of <constant>GL_VERTEX_SHADER</constant>, | |
28 | <constant>GL_TESS_CONTROL_SHADER</constant>, | |
29 | <constant>GL_TESS_EVALUATION_SHADER</constant>, | |
30 | <constant>GL_GEOMETRY_SHADER</constant>, | |
31 | or <constant>GL_FRAGMENT_SHADER</constant>.</para> | |
32 | </listitem> | |
33 | </varlistentry> | |
34 | </variablelist> | |
35 | </refsect1> | |
36 | <refsect1 id="description"><title>Description</title> | |
37 | <para><function>glCreateShader</function> creates an empty | |
38 | shader object and returns a non-zero value by which it can be | |
39 | referenced. A shader object is used to maintain the source code | |
40 | strings that define a shader. <parameter>shaderType</parameter> | |
41 | indicates the type of shader to be created. Five types of shader | |
42 | are supported. A shader of type | |
43 | <constant>GL_VERTEX_SHADER</constant> is a shader that is | |
44 | intended to run on the programmable vertex processor. | |
45 | A shader of type <constant>GL_TESS_CONTROL_SHADER</constant> is a shader that | |
46 | is intended to run on the programmable tessellation processor in the control stage. | |
47 | A shader of type <constant>GL_TESS_EVALUATION_SHADER</constant> is a shader that | |
48 | is intended to run on the programmable tessellation processor in the evaluation stage. | |
49 | A shader of type | |
50 | <constant>GL_GEOMETRY_SHADER</constant> is a shader that is intended to | |
51 | run on the programmable geometry processor. A shader of | |
52 | type <constant>GL_FRAGMENT_SHADER</constant> is a shader that is | |
53 | intended to run on the programmable fragment processor.</para> | |
54 | ||
55 | <para>When created, a shader object's | |
56 | <constant>GL_SHADER_TYPE</constant> parameter is set to either | |
57 | <constant>GL_VERTEX_SHADER</constant>, <constant>GL_TESS_CONTROL_SHADER</constant>, | |
58 | <constant>GL_TESS_EVALUATION_SHADER</constant>, <constant>GL_GEOMETRY_SHADER</constant> | |
59 | or <constant>GL_FRAGMENT_SHADER</constant>, depending on the value | |
60 | of <parameter>shaderType</parameter>.</para> | |
61 | </refsect1> | |
62 | <refsect1 id="notes"><title>Notes</title> | |
63 | <para>Like buffer and texture objects, the name space for | |
64 | shader objects may be shared across a set of contexts, as long | |
65 | as the server sides of the contexts share the same address | |
66 | space. If the name space is shared across contexts, any attached | |
67 | objects and the data associated with those attached objects are | |
68 | shared as well.</para> | |
69 | ||
70 | <para>Applications are responsible for providing the | |
71 | synchronization across API calls when objects are accessed from | |
72 | different execution threads.</para> | |
73 | </refsect1> | |
74 | <refsect1 id="errors"><title>Errors</title> | |
75 | <para>This function returns 0 if an error occurs creating the | |
76 | shader object.</para> | |
77 | ||
78 | <para><constant>GL_INVALID_ENUM</constant> is generated if | |
79 | <parameter>shaderType</parameter> is not an accepted value.</para> | |
80 | ||
81 | </refsect1> | |
82 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
83 | <para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry> | |
84 | with a valid shader object and the parameter to be queried</para> | |
85 | ||
86 | <para><citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry> | |
87 | with a valid shader object</para> | |
88 | ||
89 | <para><citerefentry><refentrytitle>glGetShaderSource</refentrytitle></citerefentry> | |
90 | with a valid shader object</para> | |
91 | ||
92 | <para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para> | |
93 | </refsect1> | |
94 | <refsect1 id="seealso"><title>See Also</title> | |
95 | <para><citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry>, | |
96 | <citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>, | |
97 | <citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry>, | |
98 | <citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>, | |
99 | <citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry> | |
100 | </para> | |
101 | </refsect1> | |
102 | <refsect1 id="Copyright"><title>Copyright</title> | |
103 | <para> | |
104 | Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd. | |
105 | This material may be distributed subject to the terms and conditions set forth in | |
106 | the Open Publication License, v 1.0, 8 June 1999. | |
107 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
108 | </para> | |
109 | </refsect1> | |
110 | </refentry> |