[MSHTML_WINETEST]
[reactos.git] / reactos / dll / opengl / mesa / vbo / vbo_attrib_tmp.h
1 /**************************************************************************
2
3 Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
4 Copyright 2011 Dave Airlie (ARB_vertex_type_2_10_10_10_rev support)
5 All Rights Reserved.
6
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the "Software"),
9 to deal in the Software without restriction, including without limitation
10 on the rights to use, copy, modify, merge, publish, distribute, sub
11 license, and/or sell copies of the Software, and to permit persons to whom
12 the Software is furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice (including the next
15 paragraph) shall be included in all copies or substantial portions of the
16 Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26 **************************************************************************/
27
28 /* float */
29 #define ATTR1FV( A, V ) ATTR( A, 1, (V)[0], 0, 0, 1 )
30 #define ATTR2FV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
31 #define ATTR3FV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
32 #define ATTR4FV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
33
34 #define ATTR1F( A, X ) ATTR( A, 1, X, 0, 0, 1 )
35 #define ATTR2F( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
36 #define ATTR3F( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
37 #define ATTR4F( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
38
39 /* int */
40 #define ATTR2IV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
41 #define ATTR3IV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
42 #define ATTR4IV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
43
44 #define ATTR1I( A, X ) ATTR( A, 1, X, 0, 0, 1 )
45 #define ATTR2I( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
46 #define ATTR3I( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
47 #define ATTR4I( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
48
49
50 /* uint */
51 #define ATTR2UIV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 )
52 #define ATTR3UIV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 )
53 #define ATTR4UIV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] )
54
55 #define ATTR1UI( A, X ) ATTR( A, 1, X, 0, 0, 1 )
56 #define ATTR2UI( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 )
57 #define ATTR3UI( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 )
58 #define ATTR4UI( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W )
59
60 #define MAT_ATTR( A, N, V ) ATTR( A, N, (V)[0], (V)[1], (V)[2], (V)[3] )
61
62 static void GLAPIENTRY
63 TAG(Vertex2f)(GLfloat x, GLfloat y)
64 {
65 GET_CURRENT_CONTEXT(ctx);
66 ATTR2F(VBO_ATTRIB_POS, x, y);
67 }
68
69 static void GLAPIENTRY
70 TAG(Vertex2fv)(const GLfloat * v)
71 {
72 GET_CURRENT_CONTEXT(ctx);
73 ATTR2FV(VBO_ATTRIB_POS, v);
74 }
75
76 static void GLAPIENTRY
77 TAG(Vertex3f)(GLfloat x, GLfloat y, GLfloat z)
78 {
79 GET_CURRENT_CONTEXT(ctx);
80 ATTR3F(VBO_ATTRIB_POS, x, y, z);
81 }
82
83 static void GLAPIENTRY
84 TAG(Vertex3fv)(const GLfloat * v)
85 {
86 GET_CURRENT_CONTEXT(ctx);
87 ATTR3FV(VBO_ATTRIB_POS, v);
88 }
89
90 static void GLAPIENTRY
91 TAG(Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
92 {
93 GET_CURRENT_CONTEXT(ctx);
94 ATTR4F(VBO_ATTRIB_POS, x, y, z, w);
95 }
96
97 static void GLAPIENTRY
98 TAG(Vertex4fv)(const GLfloat * v)
99 {
100 GET_CURRENT_CONTEXT(ctx);
101 ATTR4FV(VBO_ATTRIB_POS, v);
102 }
103
104
105
106 static void GLAPIENTRY
107 TAG(TexCoord1f)(GLfloat x)
108 {
109 GET_CURRENT_CONTEXT(ctx);
110 ATTR1F(VBO_ATTRIB_TEX, x);
111 }
112
113 static void GLAPIENTRY
114 TAG(TexCoord1fv)(const GLfloat * v)
115 {
116 GET_CURRENT_CONTEXT(ctx);
117 ATTR1FV(VBO_ATTRIB_TEX, v);
118 }
119
120 static void GLAPIENTRY
121 TAG(TexCoord2f)(GLfloat x, GLfloat y)
122 {
123 GET_CURRENT_CONTEXT(ctx);
124 ATTR2F(VBO_ATTRIB_TEX, x, y);
125 }
126
127 static void GLAPIENTRY
128 TAG(TexCoord2fv)(const GLfloat * v)
129 {
130 GET_CURRENT_CONTEXT(ctx);
131 ATTR2FV(VBO_ATTRIB_TEX, v);
132 }
133
134 static void GLAPIENTRY
135 TAG(TexCoord3f)(GLfloat x, GLfloat y, GLfloat z)
136 {
137 GET_CURRENT_CONTEXT(ctx);
138 ATTR3F(VBO_ATTRIB_TEX, x, y, z);
139 }
140
141 static void GLAPIENTRY
142 TAG(TexCoord3fv)(const GLfloat * v)
143 {
144 GET_CURRENT_CONTEXT(ctx);
145 ATTR3FV(VBO_ATTRIB_TEX, v);
146 }
147
148 static void GLAPIENTRY
149 TAG(TexCoord4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
150 {
151 GET_CURRENT_CONTEXT(ctx);
152 ATTR4F(VBO_ATTRIB_TEX, x, y, z, w);
153 }
154
155 static void GLAPIENTRY
156 TAG(TexCoord4fv)(const GLfloat * v)
157 {
158 GET_CURRENT_CONTEXT(ctx);
159 ATTR4FV(VBO_ATTRIB_TEX, v);
160 }
161
162
163
164 static void GLAPIENTRY
165 TAG(Normal3f)(GLfloat x, GLfloat y, GLfloat z)
166 {
167 GET_CURRENT_CONTEXT(ctx);
168 ATTR3F(VBO_ATTRIB_NORMAL, x, y, z);
169 }
170
171 static void GLAPIENTRY
172 TAG(Normal3fv)(const GLfloat * v)
173 {
174 GET_CURRENT_CONTEXT(ctx);
175 ATTR3FV(VBO_ATTRIB_NORMAL, v);
176 }
177
178
179
180 static void GLAPIENTRY
181 TAG(FogCoordfEXT)(GLfloat x)
182 {
183 GET_CURRENT_CONTEXT(ctx);
184 ATTR1F(VBO_ATTRIB_FOG, x);
185 }
186
187
188
189 static void GLAPIENTRY
190 TAG(FogCoordfvEXT)(const GLfloat * v)
191 {
192 GET_CURRENT_CONTEXT(ctx);
193 ATTR1FV(VBO_ATTRIB_FOG, v);
194 }
195
196 static void GLAPIENTRY
197 TAG(Color3f)(GLfloat x, GLfloat y, GLfloat z)
198 {
199 GET_CURRENT_CONTEXT(ctx);
200 ATTR3F(VBO_ATTRIB_COLOR0, x, y, z);
201 }
202
203 static void GLAPIENTRY
204 TAG(Color3fv)(const GLfloat * v)
205 {
206 GET_CURRENT_CONTEXT(ctx);
207 ATTR3FV(VBO_ATTRIB_COLOR0, v);
208 }
209
210 static void GLAPIENTRY
211 TAG(Color4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
212 {
213 GET_CURRENT_CONTEXT(ctx);
214 ATTR4F(VBO_ATTRIB_COLOR0, x, y, z, w);
215 }
216
217 static void GLAPIENTRY
218 TAG(Color4fv)(const GLfloat * v)
219 {
220 GET_CURRENT_CONTEXT(ctx);
221 ATTR4FV(VBO_ATTRIB_COLOR0, v);
222 }
223
224
225
226 static void GLAPIENTRY
227 TAG(SecondaryColor3fEXT)(GLfloat x, GLfloat y, GLfloat z)
228 {
229 GET_CURRENT_CONTEXT(ctx);
230 ATTR3F(VBO_ATTRIB_COLOR1, x, y, z);
231 }
232
233 static void GLAPIENTRY
234 TAG(SecondaryColor3fvEXT)(const GLfloat * v)
235 {
236 GET_CURRENT_CONTEXT(ctx);
237 ATTR3FV(VBO_ATTRIB_COLOR1, v);
238 }
239
240
241
242 static void GLAPIENTRY
243 TAG(EdgeFlag)(GLboolean b)
244 {
245 GET_CURRENT_CONTEXT(ctx);
246 ATTR1F(VBO_ATTRIB_EDGEFLAG, (GLfloat) b);
247 }
248
249
250
251 static void GLAPIENTRY
252 TAG(Indexf)(GLfloat f)
253 {
254 GET_CURRENT_CONTEXT(ctx);
255 ATTR1F(VBO_ATTRIB_INDEX, f);
256 }
257
258 static void GLAPIENTRY
259 TAG(Indexfv)(const GLfloat * f)
260 {
261 GET_CURRENT_CONTEXT(ctx);
262 ATTR1FV(VBO_ATTRIB_INDEX, f);
263 }
264
265
266
267 /* In addition to supporting NV_vertex_program, these entrypoints are
268 * used by the display list and other code specifically because of
269 * their property of aliasing with other attributes. (See
270 * vbo_save_loopback.c)
271 */
272 static void GLAPIENTRY
273 TAG(VertexAttrib1fNV)(GLuint index, GLfloat x)
274 {
275 GET_CURRENT_CONTEXT(ctx);
276 if (index < VBO_ATTRIB_MAX)
277 ATTR1F(index, x);
278 }
279
280 static void GLAPIENTRY
281 TAG(VertexAttrib1fvNV)(GLuint index, const GLfloat * v)
282 {
283 GET_CURRENT_CONTEXT(ctx);
284 if (index < VBO_ATTRIB_MAX)
285 ATTR1FV(index, v);
286 }
287
288 static void GLAPIENTRY
289 TAG(VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y)
290 {
291 GET_CURRENT_CONTEXT(ctx);
292 if (index < VBO_ATTRIB_MAX)
293 ATTR2F(index, x, y);
294 }
295
296 static void GLAPIENTRY
297 TAG(VertexAttrib2fvNV)(GLuint index, const GLfloat * v)
298 {
299 GET_CURRENT_CONTEXT(ctx);
300 if (index < VBO_ATTRIB_MAX)
301 ATTR2FV(index, v);
302 }
303
304 static void GLAPIENTRY
305 TAG(VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z)
306 {
307 GET_CURRENT_CONTEXT(ctx);
308 if (index < VBO_ATTRIB_MAX)
309 ATTR3F(index, x, y, z);
310 }
311
312 static void GLAPIENTRY
313 TAG(VertexAttrib3fvNV)(GLuint index,
314 const GLfloat * v)
315 {
316 GET_CURRENT_CONTEXT(ctx);
317 if (index < VBO_ATTRIB_MAX)
318 ATTR3FV(index, v);
319 }
320
321 static void GLAPIENTRY
322 TAG(VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
323 {
324 GET_CURRENT_CONTEXT(ctx);
325 if (index < VBO_ATTRIB_MAX)
326 ATTR4F(index, x, y, z, w);
327 }
328
329 static void GLAPIENTRY
330 TAG(VertexAttrib4fvNV)(GLuint index, const GLfloat * v)
331 {
332 GET_CURRENT_CONTEXT(ctx);
333 if (index < VBO_ATTRIB_MAX)
334 ATTR4FV(index, v);
335 }
336
337
338 #undef ATTR1FV
339 #undef ATTR2FV
340 #undef ATTR3FV
341 #undef ATTR4FV
342
343 #undef ATTR1F
344 #undef ATTR2F
345 #undef ATTR3F
346 #undef ATTR4F
347
348 #undef MAT