rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / glCreateProgram.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="glCreateProgram">
5 <refmeta>
6 <refentrytitle>glCreateProgram</refentrytitle>
7 <manvolnum>3G</manvolnum>
8 </refmeta>
9 <refnamediv>
10 <refname>glCreateProgram</refname>
11 <refpurpose>Creates a program object</refpurpose>
12 </refnamediv>
13 <refsynopsisdiv><title>C Specification</title>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>GLuint <function>glCreateProgram</function></funcdef>
17 <paramdef><parameter>void</parameter></paramdef>
18 </funcprototype>
19 </funcsynopsis>
20 </refsynopsisdiv>
21 <refsect1 id="description"><title>Description</title>
22 <para><function>glCreateProgram</function> creates an empty
23 program object and returns a non-zero value by which it can be
24 referenced. A program object is an object to which shader
25 objects can be attached. This provides a mechanism to specify
26 the shader objects that will be linked to create a program. It
27 also provides a means for checking the compatibility of the
28 shaders that will be used to create a program (for instance,
29 checking the compatibility between a vertex shader and a
30 fragment shader). When no longer needed as part of a program
31 object, shader objects can be detached.</para>
32
33 <para>One or more executables are created in a program object by
34 successfully attaching shader objects to it with
35 <citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry>,
36 successfully compiling the shader objects with
37 <citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>,
38 and successfully linking the program object with
39 <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>.
40 These executables are made part of current state when
41 <citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>
42 is called. Program objects can be deleted by calling
43 <citerefentry><refentrytitle>glDeleteProgram</refentrytitle></citerefentry>.
44 The memory associated with the program object will be deleted
45 when it is no longer part of current rendering state for any
46 context.</para>
47 </refsect1>
48 <refsect1 id="notes"><title>Notes</title>
49 <para>Like buffer and texture objects, the name space for
50 program objects may be shared across a set of contexts, as long
51 as the server sides of the contexts share the same address
52 space. If the name space is shared across contexts, any attached
53 objects and the data associated with those attached objects are
54 shared as well.</para>
55
56 <para>Applications are responsible for providing the
57 synchronization across API calls when objects are accessed from
58 different execution threads.</para>
59 </refsect1>
60 <refsect1 id="errors"><title>Errors</title>
61 <para>This function returns 0 if an error occurs creating the program object.</para>
62
63 </refsect1>
64 <refsect1 id="associatedgets"><title>Associated Gets</title>
65 <para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
66 with the argument <constant>GL_CURRENT_PROGRAM</constant></para>
67
68 <para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry>
69 with a valid program object and the index of an active attribute
70 variable</para>
71
72 <para><citerefentry><refentrytitle>glGetActiveUniform</refentrytitle></citerefentry>
73 with a valid program object and the index of an active uniform
74 variable</para>
75
76 <para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
77 with a valid program object</para>
78
79 <para><citerefentry><refentrytitle>glGetAttribLocation</refentrytitle></citerefentry>
80 with a valid program object and the name of an attribute
81 variable</para>
82
83 <para><citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>
84 with a valid program object and the parameter to be queried</para>
85
86 <para><citerefentry><refentrytitle>glGetProgramInfoLog</refentrytitle></citerefentry>
87 with a valid program object</para>
88
89 <para><citerefentry><refentrytitle>glGetUniform</refentrytitle></citerefentry>
90 with a valid program object and the location of a uniform
91 variable</para>
92
93 <para><citerefentry><refentrytitle>glGetUniformLocation</refentrytitle></citerefentry>
94 with a valid program object and the name of a uniform
95 variable</para>
96
97 <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
98 </refsect1>
99 <refsect1 id="seealso"><title>See Also</title>
100 <para><citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry>,
101 <citerefentry><refentrytitle>glBindAttribLocation</refentrytitle></citerefentry>,
102 <citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
103 <citerefentry><refentrytitle>glDeleteProgram</refentrytitle></citerefentry>,
104 <citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
105 <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
106 <citerefentry><refentrytitle>glUniform</refentrytitle></citerefentry>,
107 <citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
108 <citerefentry><refentrytitle>glValidateProgram</refentrytitle></citerefentry></para>
109 </refsect1>
110 <refsect1 id="Copyright"><title>Copyright</title>
111 <para>
112 Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd.
113 This material may be distributed subject to the terms and conditions set forth in
114 the Open Publication License, v 1.0, 8 June 1999.
115 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
116 </para>
117 </refsect1>
118 </refentry>