rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / glVertexAttribFormat.xml
CommitLineData
7faf1d71
AW
1<?xml version="1.0" encoding="UTF-8"?>\r
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r
4<refentry id="glVertexAttribFormat">\r
5 <refmeta>\r
6 <refmetainfo>\r
7 <copyright>\r
8 <year>2012</year>\r
9 <holder>Khronos Group</holder>\r
10 </copyright>\r
11 </refmetainfo>\r
12 <refentrytitle>glVertexAttribFormat</refentrytitle>\r
13 <manvolnum>3G</manvolnum>\r
14 </refmeta>\r
15 <refnamediv>\r
16 <refname>glVertexAttribFormat</refname>\r
17 <refpurpose>specify the organization of vertex arrays</refpurpose>\r
18 </refnamediv>\r
19 <refsynopsisdiv><title>C Specification</title>\r
20 <funcsynopsis>\r
21 <funcprototype>\r
22 <funcdef>void <function>glVertexAttribFormat</function></funcdef>\r
23 <paramdef>GLuint <parameter>attribindex</parameter></paramdef>\r
24 <paramdef>GLint <parameter>size</parameter></paramdef>\r
25 <paramdef>GLenum <parameter>type</parameter></paramdef>\r
26 <paramdef>GLboolean <parameter>normalized</parameter></paramdef>\r
27 <paramdef>GLuint <parameter>relativeoffset</parameter></paramdef>\r
28 </funcprototype>\r
29 </funcsynopsis>\r
30 <funcsynopsis>\r
31 <funcprototype>\r
32 <funcdef>void <function>glVertexAttribIFormat</function></funcdef>\r
33 <paramdef>GLuint <parameter>attribindex</parameter></paramdef>\r
34 <paramdef>GLint <parameter>size</parameter></paramdef>\r
35 <paramdef>GLenum <parameter>type</parameter></paramdef>\r
36 <paramdef>GLuint <parameter>relativeoffset</parameter></paramdef>\r
37 </funcprototype>\r
38 </funcsynopsis>\r
39 <funcsynopsis>\r
40 <funcprototype>\r
41 <funcdef>void <function>glVertexAttribLFormat</function></funcdef>\r
42 <paramdef>GLuint <parameter>attribindex</parameter></paramdef>\r
43 <paramdef>GLint <parameter>size</parameter></paramdef>\r
44 <paramdef>GLenum <parameter>type</parameter></paramdef>\r
45 <paramdef>GLuint <parameter>relativeoffset</parameter></paramdef>\r
46 </funcprototype>\r
47 </funcsynopsis>\r
48 </refsynopsisdiv>\r
49 <refsect1 id="parameters"><title>Parameters</title>\r
50 <variablelist>\r
51 <varlistentry>\r
52 <term><parameter>attribindex</parameter></term>\r
53 <listitem>\r
54 <para>\r
55 The generic vertex attribute array being described.\r
56 </para>\r
57 </listitem>\r
58 </varlistentry>\r
59 <varlistentry>\r
60 <term><parameter>size</parameter></term>\r
61 <listitem>\r
62 <para>\r
63 The number of values per vertex that are stored in the array.\r
64 </para>\r
65 </listitem>\r
66 </varlistentry>\r
67 <varlistentry>\r
68 <term><parameter>type</parameter></term>\r
69 <listitem>\r
70 <para>\r
71 The type of the data stored in the array.\r
72 </para>\r
73 </listitem>\r
74 </varlistentry>\r
75 <varlistentry>\r
76 <term><parameter>normalized</parameter></term>\r
77 <listitem>\r
78 <para>\r
79 The distance between elements within the buffer.\r
80 </para>\r
81 </listitem>\r
82 </varlistentry>\r
83 <varlistentry>\r
84 <term><parameter>relativeoffset</parameter></term>\r
85 <listitem>\r
86 <para>\r
87 The distance between elements within the buffer.\r
88 </para>\r
89 </listitem>\r
90 </varlistentry>\r
91 </variablelist>\r
92 </refsect1>\r
93 <refsect1 id="description"><title>Description</title>\r
94 <para>\r
95 <function>glVertexAttribFormat</function>, <function>glVertexAttribIFormat</function> and\r
96 <function>glVertexAttribLFormat</function> specify the organization of data in vertex arrays.\r
97 <parameter>attribindex</parameter> specifies the index of the generic vertex attribute\r
98 array whose data layout is being described, and must be less\r
99 than the value of <constant>GL_MAX_VERTEX_ATTRIBS</constant>.\r
100 </para>\r
101 <para>\r
102 <parameter>size</parameter> determines the number of components per vertex are allocated\r
103 to the specifed attribute and must be 1, 2, 3 or 4. <parameter>type</parameter> indicates\r
104 the type of the data. If <parameter>type</parameter> is one of <constant>GL_BYTE</constant>,\r
105 <constant>GL_SHORT</constant>, <constant>GL_INT</constant>, <constant>GL_FIXED</constant>,\r
106 <constant>GL_FLOAT</constant>, <constant>GL_HALF_FLOAT</constant>, and\r
107 <constant>GL_DOUBLE</constant> indicate types <code>GLbyte</code>, <code>GLshort</code>,\r
108 <code>GLint</code>, <code>GLfixed</code>, <code>GLfloat</code>, <code>GLhalf</code>, and\r
109 <code>GLdouble</code>, respectively; the values <constant>GL_UNSIGNED_BYTE</constant>,\r
110 <constant>GL_UNSIGNED_SHORT</constant>, and <constant>GL_UNSIGNED_INT</constant> indicate types\r
111 <code>GLubyte</code>, <code>GLushort</code>, and <code>GLuint</code>, \r
112 respectively; and the values <constant>GL_INT_2_10_10_10_REV</constant> and\r
113 <constant>GL_UNSIGNED_INT_2_10_10_10_REV</constant> indicating respectively four signed or\r
114 unsigned elements packed into a single <code>GLuint</code>.\r
115 </para>\r
116 <para>\r
117 <function>glVertexAttribLFormat</function> is used to specify layout for\r
118 data associated with a generic attribute variable declared as 64-bit double precision\r
119 components. For <function>glVertexAttribLFormat</function>, <parameter>type</parameter>\r
120 must be <constant>GL_DOUBLE</constant>. In contrast to <function>glVertexAttribFormat</function>,\r
121 which will cause data declared as <constant>GL_DOUBLE</constant> to be converted to 32-bit\r
122 representation, <function>glVertexAttribLFormat</function> causes such data to be left\r
123 in its natural, 64-bit representation.\r
124 </para>\r
125 <para>\r
126 For <function>glVertexAttribFormat</function>, if <parameter>normalized</parameter> is\r
127 <constant>GL_TRUE</constant>, then integer data is normalized to the range [-1, 1] or\r
128 [0, 1] if it is signed or unsigned, respectively. If <parameter>noramlized</parameter> is\r
129 <constant>GL_FALSE</constant> then integer data is directly converted to floating point.\r
130 </para>\r
131 <para>\r
132 <parameter>relativeoffset</parameter> is the offset, measured in basic machine units\r
133 of the first element relative to the start of the vertex buffer binding this attribute\r
134 fetches from.\r
135 </para>\r
136 <para>\r
137 <function>glVertexAttribFormat</function> should be used to describe vertex attribute\r
138 layout for floating-point vertex attributes, <function>glVertexAttribIFormat</function>\r
139 should be used to describe vertex attribute layout for integer vertex attribute\r
140 and <function>glVertexAttribLFormat</function> should be used to describe the layout\r
141 for 64-bit vertex attributes. Data for an array specified by \r
142 <function>glVertexAttribIFormat</function> will always be left as integer values;\r
143 such data are referred to as pure integers.\r
144 </para>\r
145 </refsect1>\r
146 <refsect1 id="errors"><title>Errors</title>\r
147 <para>\r
148 <constant>GL_INVAILD_VALUE</constant> is generated if <parameter>attribindex</parameter> is greater than\r
149 or equal to the value of <constant>GL_MAX_VERTEX_ATTRIBS</constant>.\r
150 </para>\r
151 <para>\r
152 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>size</parameter> is not\r
153 one of the accepted values.\r
154 </para>\r
155 <para>\r
156 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>relativeoffset</parameter> is greater\r
157 than the value of <constant>GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET</constant>.\r
158 </para>\r
159 <para>\r
160 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>type</parameter> is not\r
161 one of the accepted tokens.\r
162 </para>\r
163 <para>\r
164 <constant>GL_INVALID_OPERATION</constant> is generated if no vertex array object is bound.\r
165 </para>\r
166 </refsect1>\r
167 <refsect1 id="associatedgets"><title>Associated Gets</title>\r
168 <para>\r
169 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with arguments <constant>GL_MAX_VERTEX_ATTRIB_BINDINGS</constant>,\r
170 or <constant>GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET</constant>.\r
171 </para>\r
172 <para>\r
173 <citerefentry><refentrytitle>glGetVertexAttrib</refentrytitle></citerefentry> with argument <constant>GL_VERTEX_ATTRIB_RELATIVE_OFFSET</constant>.\r
174 </para>\r
175 </refsect1>\r
176 <refsect1 id="seealso"><title>See Also</title>\r
177 <para>\r
178 <citerefentry><refentrytitle>glBindVertexBuffer</refentrytitle></citerefentry>,\r
179 <citerefentry><refentrytitle>glVertexAttribBinding</refentrytitle></citerefentry>,\r
180 <citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry>,\r
181 <citerefentry><refentrytitle>glVertexBindingDivisor</refentrytitle></citerefentry>,\r
182 <citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry>.\r
183 </para>\r
184 </refsect1>\r
185 <refsect1 id="Copyright"><title>Copyright</title>\r
186 <para>\r
187 Copyright <trademark class="copyright"></trademark> 2012 Khronos Group. \r
188 This material may be distributed subject to the terms and conditions set forth in \r
189 the Open Publication License, v 1.0, 8 June 1999.\r
190 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
191 </para>\r
192 </refsect1>\r
193</refentry>\r