1 /**
2  * \file api_loopback.c
3  *
4  * \author Keith Whitwell <keith@tungstengraphics.com>
5  */
6 
7 /*
8  * Mesa 3-D graphics library
9  * Version:  6.3
10  *
11  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
26  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
27  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29  */
30 
31 
32 #include "glheader.h"
33 #include "macros.h"
34 #include "api_loopback.h"
35 #include "mtypes.h"
36 #include "glapi/glapi.h"
37 #include "glapi/glthread.h"
38 #include "main/dispatch.h"
39 #include "mfeatures.h"
40 
41 /* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
42  * calls to a smaller set of driver-provided formats.  Currently just
43  * go back to dispatch to find these (eg. call glNormal3f directly),
44  * hence 'loopback'.
45  *
46  * The driver must supply all of the remaining entry points, which are
47  * listed in dd.h.  The easiest way for a driver to do this is to
48  * install the supplied software t&l module.
49  */
50 #define COLORF(r,g,b,a)             CALL_Color4f(GET_DISPATCH(), (r,g,b,a))
51 #define VERTEX2(x,y)	            CALL_Vertex2f(GET_DISPATCH(), (x,y))
52 #define VERTEX3(x,y,z)	            CALL_Vertex3f(GET_DISPATCH(), (x,y,z))
53 #define VERTEX4(x,y,z,w)            CALL_Vertex4f(GET_DISPATCH(), (x,y,z,w))
54 #define NORMAL(x,y,z)               CALL_Normal3f(GET_DISPATCH(), (x,y,z))
55 #define TEXCOORD1(s)                CALL_TexCoord1f(GET_DISPATCH(), (s))
56 #define TEXCOORD2(s,t)              CALL_TexCoord2f(GET_DISPATCH(), (s,t))
57 #define TEXCOORD3(s,t,u)            CALL_TexCoord3f(GET_DISPATCH(), (s,t,u))
58 #define TEXCOORD4(s,t,u,v)          CALL_TexCoord4f(GET_DISPATCH(), (s,t,u,v))
59 #define INDEX(c)		    CALL_Indexf(GET_DISPATCH(), (c))
60 #define MULTI_TEXCOORD1(z,s)	    CALL_MultiTexCoord1fARB(GET_DISPATCH(), (z,s))
61 #define MULTI_TEXCOORD2(z,s,t)	    CALL_MultiTexCoord2fARB(GET_DISPATCH(), (z,s,t))
62 #define MULTI_TEXCOORD3(z,s,t,u)    CALL_MultiTexCoord3fARB(GET_DISPATCH(), (z,s,t,u))
63 #define MULTI_TEXCOORD4(z,s,t,u,v)  CALL_MultiTexCoord4fARB(GET_DISPATCH(), (z,s,t,u,v))
64 #define EVALCOORD1(x)               CALL_EvalCoord1f(GET_DISPATCH(), (x))
65 #define EVALCOORD2(x,y)             CALL_EvalCoord2f(GET_DISPATCH(), (x,y))
66 #define MATERIALFV(a,b,c)           CALL_Materialfv(GET_DISPATCH(), (a,b,c))
67 #define RECTF(a,b,c,d)              CALL_Rectf(GET_DISPATCH(), (a,b,c,d))
68 
69 #define FOGCOORDF(x)                CALL_FogCoordfEXT(GET_DISPATCH(), (x))
70 #define SECONDARYCOLORF(a,b,c)      CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c))
71 
72 #define ATTRIB1NV(index,x)          CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x))
73 #define ATTRIB2NV(index,x,y)        CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y))
74 #define ATTRIB3NV(index,x,y,z)      CALL_VertexAttrib3fNV(GET_DISPATCH(), (index,x,y,z))
75 #define ATTRIB4NV(index,x,y,z,w)    CALL_VertexAttrib4fNV(GET_DISPATCH(), (index,x,y,z,w))
76 
77 #define ATTRIB1ARB(index,x)         CALL_VertexAttrib1fARB(GET_DISPATCH(), (index,x))
78 #define ATTRIB2ARB(index,x,y)       CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,x,y))
79 #define ATTRIB3ARB(index,x,y,z)     CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,x,y,z))
80 #define ATTRIB4ARB(index,x,y,z,w)   CALL_VertexAttrib4fARB(GET_DISPATCH(), (index,x,y,z,w))
81 
82 #define ATTRIBI_1I(index,x)   CALL_VertexAttribI1iEXT(GET_DISPATCH(), (index,x))
83 #define ATTRIBI_1UI(index,x)   CALL_VertexAttribI1uiEXT(GET_DISPATCH(), (index,x))
84 #define ATTRIBI_4I(index,x,y,z,w)   CALL_VertexAttribI4iEXT(GET_DISPATCH(), (index,x,y,z,w))
85 
86 #define ATTRIBI_4UI(index,x,y,z,w)   CALL_VertexAttribI4uiEXT(GET_DISPATCH(), (index,x,y,z,w))
87 
88 
89 #if FEATURE_beginend
90 
91 
92 static void GLAPIENTRY
loopback_Color3b_f(GLbyte red,GLbyte green,GLbyte blue)93 loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue )
94 {
95    COLORF( BYTE_TO_FLOAT(red),
96 	   BYTE_TO_FLOAT(green),
97 	   BYTE_TO_FLOAT(blue),
98 	   1.0 );
99 }
100 
101 static void GLAPIENTRY
loopback_Color3d_f(GLdouble red,GLdouble green,GLdouble blue)102 loopback_Color3d_f( GLdouble red, GLdouble green, GLdouble blue )
103 {
104    COLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue, 1.0 );
105 }
106 
107 static void GLAPIENTRY
loopback_Color3i_f(GLint red,GLint green,GLint blue)108 loopback_Color3i_f( GLint red, GLint green, GLint blue )
109 {
110    COLORF( INT_TO_FLOAT(red), INT_TO_FLOAT(green),
111 	   INT_TO_FLOAT(blue), 1.0);
112 }
113 
114 static void GLAPIENTRY
loopback_Color3s_f(GLshort red,GLshort green,GLshort blue)115 loopback_Color3s_f( GLshort red, GLshort green, GLshort blue )
116 {
117    COLORF( SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green),
118 	   SHORT_TO_FLOAT(blue), 1.0);
119 }
120 
121 static void GLAPIENTRY
loopback_Color3ui_f(GLuint red,GLuint green,GLuint blue)122 loopback_Color3ui_f( GLuint red, GLuint green, GLuint blue )
123 {
124    COLORF( UINT_TO_FLOAT(red), UINT_TO_FLOAT(green),
125 	   UINT_TO_FLOAT(blue), 1.0 );
126 }
127 
128 static void GLAPIENTRY
loopback_Color3us_f(GLushort red,GLushort green,GLushort blue)129 loopback_Color3us_f( GLushort red, GLushort green, GLushort blue )
130 {
131    COLORF( USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green),
132 	   USHORT_TO_FLOAT(blue), 1.0 );
133 }
134 
135 static void GLAPIENTRY
loopback_Color3ub_f(GLubyte red,GLubyte green,GLubyte blue)136 loopback_Color3ub_f( GLubyte red, GLubyte green, GLubyte blue )
137 {
138    COLORF( UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green),
139 	   UBYTE_TO_FLOAT(blue), 1.0 );
140 }
141 
142 
143 static void GLAPIENTRY
loopback_Color3bv_f(const GLbyte * v)144 loopback_Color3bv_f( const GLbyte *v )
145 {
146    COLORF( BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]),
147 	   BYTE_TO_FLOAT(v[2]), 1.0 );
148 }
149 
150 static void GLAPIENTRY
loopback_Color3dv_f(const GLdouble * v)151 loopback_Color3dv_f( const GLdouble *v )
152 {
153    COLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0 );
154 }
155 
156 static void GLAPIENTRY
loopback_Color3iv_f(const GLint * v)157 loopback_Color3iv_f( const GLint *v )
158 {
159    COLORF( INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]),
160 	   INT_TO_FLOAT(v[2]), 1.0 );
161 }
162 
163 static void GLAPIENTRY
loopback_Color3sv_f(const GLshort * v)164 loopback_Color3sv_f( const GLshort *v )
165 {
166    COLORF( SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]),
167 	   SHORT_TO_FLOAT(v[2]), 1.0 );
168 }
169 
170 static void GLAPIENTRY
loopback_Color3uiv_f(const GLuint * v)171 loopback_Color3uiv_f( const GLuint *v )
172 {
173    COLORF( UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]),
174 	   UINT_TO_FLOAT(v[2]), 1.0 );
175 }
176 
177 static void GLAPIENTRY
loopback_Color3usv_f(const GLushort * v)178 loopback_Color3usv_f( const GLushort *v )
179 {
180    COLORF( USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]),
181 	   USHORT_TO_FLOAT(v[2]), 1.0 );
182 }
183 
184 static void GLAPIENTRY
loopback_Color3ubv_f(const GLubyte * v)185 loopback_Color3ubv_f( const GLubyte *v )
186 {
187    COLORF( UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
188 	   UBYTE_TO_FLOAT(v[2]), 1.0 );
189 }
190 
191 
192 static void GLAPIENTRY
loopback_Color4b_f(GLbyte red,GLbyte green,GLbyte blue,GLbyte alpha)193 loopback_Color4b_f( GLbyte red, GLbyte green, GLbyte blue,
194 			      GLbyte alpha )
195 {
196    COLORF( BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green),
197 	   BYTE_TO_FLOAT(blue), BYTE_TO_FLOAT(alpha) );
198 }
199 
200 static void GLAPIENTRY
loopback_Color4d_f(GLdouble red,GLdouble green,GLdouble blue,GLdouble alpha)201 loopback_Color4d_f( GLdouble red, GLdouble green, GLdouble blue,
202 			      GLdouble alpha )
203 {
204    COLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue, (GLfloat) alpha );
205 }
206 
207 static void GLAPIENTRY
loopback_Color4i_f(GLint red,GLint green,GLint blue,GLint alpha)208 loopback_Color4i_f( GLint red, GLint green, GLint blue, GLint alpha )
209 {
210    COLORF( INT_TO_FLOAT(red), INT_TO_FLOAT(green),
211 	   INT_TO_FLOAT(blue), INT_TO_FLOAT(alpha) );
212 }
213 
214 static void GLAPIENTRY
loopback_Color4s_f(GLshort red,GLshort green,GLshort blue,GLshort alpha)215 loopback_Color4s_f( GLshort red, GLshort green, GLshort blue,
216 			      GLshort alpha )
217 {
218    COLORF( SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green),
219 	   SHORT_TO_FLOAT(blue), SHORT_TO_FLOAT(alpha) );
220 }
221 
222 static void GLAPIENTRY
loopback_Color4ui_f(GLuint red,GLuint green,GLuint blue,GLuint alpha)223 loopback_Color4ui_f( GLuint red, GLuint green, GLuint blue, GLuint alpha )
224 {
225    COLORF( UINT_TO_FLOAT(red), UINT_TO_FLOAT(green),
226 	   UINT_TO_FLOAT(blue), UINT_TO_FLOAT(alpha) );
227 }
228 
229 static void GLAPIENTRY
loopback_Color4us_f(GLushort red,GLushort green,GLushort blue,GLushort alpha)230 loopback_Color4us_f( GLushort red, GLushort green, GLushort blue, GLushort alpha )
231 {
232    COLORF( USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green),
233 	   USHORT_TO_FLOAT(blue), USHORT_TO_FLOAT(alpha) );
234 }
235 
236 static void GLAPIENTRY
loopback_Color4ub_f(GLubyte red,GLubyte green,GLubyte blue,GLubyte alpha)237 loopback_Color4ub_f( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
238 {
239    COLORF( UBYTE_TO_FLOAT(red), UBYTE_TO_FLOAT(green),
240 	   UBYTE_TO_FLOAT(blue), UBYTE_TO_FLOAT(alpha) );
241 }
242 
243 
244 static void GLAPIENTRY
loopback_Color4iv_f(const GLint * v)245 loopback_Color4iv_f( const GLint *v )
246 {
247    COLORF( INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]),
248 	   INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]) );
249 }
250 
251 
252 static void GLAPIENTRY
loopback_Color4bv_f(const GLbyte * v)253 loopback_Color4bv_f( const GLbyte *v )
254 {
255    COLORF( BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]),
256 	   BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]) );
257 }
258 
259 static void GLAPIENTRY
loopback_Color4dv_f(const GLdouble * v)260 loopback_Color4dv_f( const GLdouble *v )
261 {
262    COLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3] );
263 }
264 
265 
266 static void GLAPIENTRY
loopback_Color4sv_f(const GLshort * v)267 loopback_Color4sv_f( const GLshort *v)
268 {
269    COLORF( SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]),
270 	   SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]) );
271 }
272 
273 
274 static void GLAPIENTRY
loopback_Color4uiv_f(const GLuint * v)275 loopback_Color4uiv_f( const GLuint *v)
276 {
277    COLORF( UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]),
278 	   UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]) );
279 }
280 
281 static void GLAPIENTRY
loopback_Color4usv_f(const GLushort * v)282 loopback_Color4usv_f( const GLushort *v)
283 {
284    COLORF( USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]),
285 	   USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]) );
286 }
287 
288 static void GLAPIENTRY
loopback_Color4ubv_f(const GLubyte * v)289 loopback_Color4ubv_f( const GLubyte *v)
290 {
291    COLORF( UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
292 	   UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]) );
293 }
294 
295 
296 static void GLAPIENTRY
loopback_FogCoorddEXT(GLdouble d)297 loopback_FogCoorddEXT( GLdouble d )
298 {
299    FOGCOORDF( (GLfloat) d );
300 }
301 
302 static void GLAPIENTRY
loopback_FogCoorddvEXT(const GLdouble * v)303 loopback_FogCoorddvEXT( const GLdouble *v )
304 {
305    FOGCOORDF( (GLfloat) *v );
306 }
307 
308 
309 static void GLAPIENTRY
loopback_Indexd(GLdouble c)310 loopback_Indexd( GLdouble c )
311 {
312    INDEX( (GLfloat) c );
313 }
314 
315 static void GLAPIENTRY
loopback_Indexi(GLint c)316 loopback_Indexi( GLint c )
317 {
318    INDEX( (GLfloat) c );
319 }
320 
321 static void GLAPIENTRY
loopback_Indexs(GLshort c)322 loopback_Indexs( GLshort c )
323 {
324    INDEX( (GLfloat) c );
325 }
326 
327 static void GLAPIENTRY
loopback_Indexub(GLubyte c)328 loopback_Indexub( GLubyte c )
329 {
330    INDEX( (GLfloat) c );
331 }
332 
333 static void GLAPIENTRY
loopback_Indexdv(const GLdouble * c)334 loopback_Indexdv( const GLdouble *c )
335 {
336    INDEX( (GLfloat) *c );
337 }
338 
339 static void GLAPIENTRY
loopback_Indexiv(const GLint * c)340 loopback_Indexiv( const GLint *c )
341 {
342    INDEX( (GLfloat) *c );
343 }
344 
345 static void GLAPIENTRY
loopback_Indexsv(const GLshort * c)346 loopback_Indexsv( const GLshort *c )
347 {
348    INDEX( (GLfloat) *c );
349 }
350 
351 static void GLAPIENTRY
loopback_Indexubv(const GLubyte * c)352 loopback_Indexubv( const GLubyte *c )
353 {
354    INDEX( (GLfloat) *c );
355 }
356 
357 
358 static void GLAPIENTRY
loopback_EdgeFlagv(const GLboolean * flag)359 loopback_EdgeFlagv(const GLboolean *flag)
360 {
361    CALL_EdgeFlag(GET_DISPATCH(), (*flag));
362 }
363 
364 
365 static void GLAPIENTRY
loopback_Normal3b(GLbyte nx,GLbyte ny,GLbyte nz)366 loopback_Normal3b( GLbyte nx, GLbyte ny, GLbyte nz )
367 {
368    NORMAL( BYTE_TO_FLOAT(nx), BYTE_TO_FLOAT(ny), BYTE_TO_FLOAT(nz) );
369 }
370 
371 static void GLAPIENTRY
loopback_Normal3d(GLdouble nx,GLdouble ny,GLdouble nz)372 loopback_Normal3d( GLdouble nx, GLdouble ny, GLdouble nz )
373 {
374    NORMAL((GLfloat) nx, (GLfloat) ny, (GLfloat) nz);
375 }
376 
377 static void GLAPIENTRY
loopback_Normal3i(GLint nx,GLint ny,GLint nz)378 loopback_Normal3i( GLint nx, GLint ny, GLint nz )
379 {
380    NORMAL( INT_TO_FLOAT(nx), INT_TO_FLOAT(ny), INT_TO_FLOAT(nz) );
381 }
382 
383 static void GLAPIENTRY
loopback_Normal3s(GLshort nx,GLshort ny,GLshort nz)384 loopback_Normal3s( GLshort nx, GLshort ny, GLshort nz )
385 {
386    NORMAL( SHORT_TO_FLOAT(nx), SHORT_TO_FLOAT(ny), SHORT_TO_FLOAT(nz) );
387 }
388 
389 static void GLAPIENTRY
loopback_Normal3bv(const GLbyte * v)390 loopback_Normal3bv( const GLbyte *v )
391 {
392    NORMAL( BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]) );
393 }
394 
395 static void GLAPIENTRY
loopback_Normal3dv(const GLdouble * v)396 loopback_Normal3dv( const GLdouble *v )
397 {
398    NORMAL( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
399 }
400 
401 static void GLAPIENTRY
loopback_Normal3iv(const GLint * v)402 loopback_Normal3iv( const GLint *v )
403 {
404    NORMAL( INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]) );
405 }
406 
407 static void GLAPIENTRY
loopback_Normal3sv(const GLshort * v)408 loopback_Normal3sv( const GLshort *v )
409 {
410    NORMAL( SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]) );
411 }
412 
413 static void GLAPIENTRY
loopback_TexCoord1d(GLdouble s)414 loopback_TexCoord1d( GLdouble s )
415 {
416    TEXCOORD1((GLfloat) s);
417 }
418 
419 static void GLAPIENTRY
loopback_TexCoord1i(GLint s)420 loopback_TexCoord1i( GLint s )
421 {
422    TEXCOORD1((GLfloat) s);
423 }
424 
425 static void GLAPIENTRY
loopback_TexCoord1s(GLshort s)426 loopback_TexCoord1s( GLshort s )
427 {
428    TEXCOORD1((GLfloat) s);
429 }
430 
431 static void GLAPIENTRY
loopback_TexCoord2d(GLdouble s,GLdouble t)432 loopback_TexCoord2d( GLdouble s, GLdouble t )
433 {
434    TEXCOORD2((GLfloat) s,(GLfloat) t);
435 }
436 
437 static void GLAPIENTRY
loopback_TexCoord2s(GLshort s,GLshort t)438 loopback_TexCoord2s( GLshort s, GLshort t )
439 {
440    TEXCOORD2((GLfloat) s,(GLfloat) t);
441 }
442 
443 static void GLAPIENTRY
loopback_TexCoord2i(GLint s,GLint t)444 loopback_TexCoord2i( GLint s, GLint t )
445 {
446    TEXCOORD2((GLfloat) s,(GLfloat) t);
447 }
448 
449 static void GLAPIENTRY
loopback_TexCoord3d(GLdouble s,GLdouble t,GLdouble r)450 loopback_TexCoord3d( GLdouble s, GLdouble t, GLdouble r )
451 {
452    TEXCOORD3((GLfloat) s,(GLfloat) t,(GLfloat) r);
453 }
454 
455 static void GLAPIENTRY
loopback_TexCoord3i(GLint s,GLint t,GLint r)456 loopback_TexCoord3i( GLint s, GLint t, GLint r )
457 {
458    TEXCOORD3((GLfloat) s,(GLfloat) t,(GLfloat) r);
459 }
460 
461 static void GLAPIENTRY
loopback_TexCoord3s(GLshort s,GLshort t,GLshort r)462 loopback_TexCoord3s( GLshort s, GLshort t, GLshort r )
463 {
464    TEXCOORD3((GLfloat) s,(GLfloat) t,(GLfloat) r);
465 }
466 
467 static void GLAPIENTRY
loopback_TexCoord4d(GLdouble s,GLdouble t,GLdouble r,GLdouble q)468 loopback_TexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q )
469 {
470    TEXCOORD4((GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
471 }
472 
473 static void GLAPIENTRY
loopback_TexCoord4i(GLint s,GLint t,GLint r,GLint q)474 loopback_TexCoord4i( GLint s, GLint t, GLint r, GLint q )
475 {
476    TEXCOORD4((GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
477 }
478 
479 static void GLAPIENTRY
loopback_TexCoord4s(GLshort s,GLshort t,GLshort r,GLshort q)480 loopback_TexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q )
481 {
482    TEXCOORD4((GLfloat) s,(GLfloat) t,(GLfloat) r,(GLfloat) q);
483 }
484 
485 static void GLAPIENTRY
loopback_TexCoord1dv(const GLdouble * v)486 loopback_TexCoord1dv( const GLdouble *v )
487 {
488    TEXCOORD1((GLfloat) v[0]);
489 }
490 
491 static void GLAPIENTRY
loopback_TexCoord1iv(const GLint * v)492 loopback_TexCoord1iv( const GLint *v )
493 {
494    TEXCOORD1((GLfloat) v[0]);
495 }
496 
497 static void GLAPIENTRY
loopback_TexCoord1sv(const GLshort * v)498 loopback_TexCoord1sv( const GLshort *v )
499 {
500    TEXCOORD1((GLfloat) v[0]);
501 }
502 
503 static void GLAPIENTRY
loopback_TexCoord2dv(const GLdouble * v)504 loopback_TexCoord2dv( const GLdouble *v )
505 {
506    TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]);
507 }
508 
509 static void GLAPIENTRY
loopback_TexCoord2iv(const GLint * v)510 loopback_TexCoord2iv( const GLint *v )
511 {
512    TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]);
513 }
514 
515 static void GLAPIENTRY
loopback_TexCoord2sv(const GLshort * v)516 loopback_TexCoord2sv( const GLshort *v )
517 {
518    TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]);
519 }
520 
521 static void GLAPIENTRY
loopback_TexCoord3dv(const GLdouble * v)522 loopback_TexCoord3dv( const GLdouble *v )
523 {
524    TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
525 }
526 
527 static void GLAPIENTRY
loopback_TexCoord3iv(const GLint * v)528 loopback_TexCoord3iv( const GLint *v )
529 {
530    TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
531 }
532 
533 static void GLAPIENTRY
loopback_TexCoord3sv(const GLshort * v)534 loopback_TexCoord3sv( const GLshort *v )
535 {
536    TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
537 }
538 
539 static void GLAPIENTRY
loopback_TexCoord4dv(const GLdouble * v)540 loopback_TexCoord4dv( const GLdouble *v )
541 {
542    TEXCOORD4((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
543 }
544 
545 static void GLAPIENTRY
loopback_TexCoord4iv(const GLint * v)546 loopback_TexCoord4iv( const GLint *v )
547 {
548    TEXCOORD4((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
549 }
550 
551 static void GLAPIENTRY
loopback_TexCoord4sv(const GLshort * v)552 loopback_TexCoord4sv( const GLshort *v )
553 {
554    TEXCOORD4((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2],(GLfloat) v[3]);
555 }
556 
557 static void GLAPIENTRY
loopback_Vertex2d(GLdouble x,GLdouble y)558 loopback_Vertex2d( GLdouble x, GLdouble y )
559 {
560    VERTEX2( (GLfloat) x, (GLfloat) y );
561 }
562 
563 static void GLAPIENTRY
loopback_Vertex2i(GLint x,GLint y)564 loopback_Vertex2i( GLint x, GLint y )
565 {
566    VERTEX2( (GLfloat) x, (GLfloat) y );
567 }
568 
569 static void GLAPIENTRY
loopback_Vertex2s(GLshort x,GLshort y)570 loopback_Vertex2s( GLshort x, GLshort y )
571 {
572    VERTEX2( (GLfloat) x, (GLfloat) y );
573 }
574 
575 static void GLAPIENTRY
loopback_Vertex3d(GLdouble x,GLdouble y,GLdouble z)576 loopback_Vertex3d( GLdouble x, GLdouble y, GLdouble z )
577 {
578    VERTEX3( (GLfloat) x, (GLfloat) y, (GLfloat) z );
579 }
580 
581 static void GLAPIENTRY
loopback_Vertex3i(GLint x,GLint y,GLint z)582 loopback_Vertex3i( GLint x, GLint y, GLint z )
583 {
584    VERTEX3( (GLfloat) x, (GLfloat) y, (GLfloat) z );
585 }
586 
587 static void GLAPIENTRY
loopback_Vertex3s(GLshort x,GLshort y,GLshort z)588 loopback_Vertex3s( GLshort x, GLshort y, GLshort z )
589 {
590    VERTEX3( (GLfloat) x, (GLfloat) y, (GLfloat) z );
591 }
592 
593 static void GLAPIENTRY
loopback_Vertex4d(GLdouble x,GLdouble y,GLdouble z,GLdouble w)594 loopback_Vertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
595 {
596    VERTEX4( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
597 }
598 
599 static void GLAPIENTRY
loopback_Vertex4i(GLint x,GLint y,GLint z,GLint w)600 loopback_Vertex4i( GLint x, GLint y, GLint z, GLint w )
601 {
602    VERTEX4( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
603 }
604 
605 static void GLAPIENTRY
loopback_Vertex4s(GLshort x,GLshort y,GLshort z,GLshort w)606 loopback_Vertex4s( GLshort x, GLshort y, GLshort z, GLshort w )
607 {
608    VERTEX4( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
609 }
610 
611 static void GLAPIENTRY
loopback_Vertex2dv(const GLdouble * v)612 loopback_Vertex2dv( const GLdouble *v )
613 {
614    VERTEX2( (GLfloat) v[0], (GLfloat) v[1] );
615 }
616 
617 static void GLAPIENTRY
loopback_Vertex2iv(const GLint * v)618 loopback_Vertex2iv( const GLint *v )
619 {
620    VERTEX2( (GLfloat) v[0], (GLfloat) v[1] );
621 }
622 
623 static void GLAPIENTRY
loopback_Vertex2sv(const GLshort * v)624 loopback_Vertex2sv( const GLshort *v )
625 {
626    VERTEX2( (GLfloat) v[0], (GLfloat) v[1] );
627 }
628 
629 static void GLAPIENTRY
loopback_Vertex3dv(const GLdouble * v)630 loopback_Vertex3dv( const GLdouble *v )
631 {
632    VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
633 }
634 
635 static void GLAPIENTRY
loopback_Vertex3iv(const GLint * v)636 loopback_Vertex3iv( const GLint *v )
637 {
638    VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
639 }
640 
641 static void GLAPIENTRY
loopback_Vertex3sv(const GLshort * v)642 loopback_Vertex3sv( const GLshort *v )
643 {
644    VERTEX3( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
645 }
646 
647 static void GLAPIENTRY
loopback_Vertex4dv(const GLdouble * v)648 loopback_Vertex4dv( const GLdouble *v )
649 {
650    VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
651 	    (GLfloat) v[2], (GLfloat) v[3] );
652 }
653 
654 static void GLAPIENTRY
loopback_Vertex4iv(const GLint * v)655 loopback_Vertex4iv( const GLint *v )
656 {
657    VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
658 	    (GLfloat) v[2], (GLfloat) v[3] );
659 }
660 
661 static void GLAPIENTRY
loopback_Vertex4sv(const GLshort * v)662 loopback_Vertex4sv( const GLshort *v )
663 {
664    VERTEX4( (GLfloat) v[0], (GLfloat) v[1],
665 	    (GLfloat) v[2], (GLfloat) v[3] );
666 }
667 
668 static void GLAPIENTRY
loopback_MultiTexCoord1dARB(GLenum target,GLdouble s)669 loopback_MultiTexCoord1dARB(GLenum target, GLdouble s)
670 {
671    MULTI_TEXCOORD1( target, (GLfloat) s );
672 }
673 
674 static void GLAPIENTRY
loopback_MultiTexCoord1dvARB(GLenum target,const GLdouble * v)675 loopback_MultiTexCoord1dvARB(GLenum target, const GLdouble *v)
676 {
677    MULTI_TEXCOORD1( target, (GLfloat) v[0] );
678 }
679 
680 static void GLAPIENTRY
loopback_MultiTexCoord1iARB(GLenum target,GLint s)681 loopback_MultiTexCoord1iARB(GLenum target, GLint s)
682 {
683    MULTI_TEXCOORD1( target, (GLfloat) s );
684 }
685 
686 static void GLAPIENTRY
loopback_MultiTexCoord1ivARB(GLenum target,const GLint * v)687 loopback_MultiTexCoord1ivARB(GLenum target, const GLint *v)
688 {
689    MULTI_TEXCOORD1( target, (GLfloat) v[0] );
690 }
691 
692 static void GLAPIENTRY
loopback_MultiTexCoord1sARB(GLenum target,GLshort s)693 loopback_MultiTexCoord1sARB(GLenum target, GLshort s)
694 {
695    MULTI_TEXCOORD1( target, (GLfloat) s );
696 }
697 
698 static void GLAPIENTRY
loopback_MultiTexCoord1svARB(GLenum target,const GLshort * v)699 loopback_MultiTexCoord1svARB(GLenum target, const GLshort *v)
700 {
701    MULTI_TEXCOORD1( target, (GLfloat) v[0] );
702 }
703 
704 static void GLAPIENTRY
loopback_MultiTexCoord2dARB(GLenum target,GLdouble s,GLdouble t)705 loopback_MultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t)
706 {
707    MULTI_TEXCOORD2( target, (GLfloat) s, (GLfloat) t );
708 }
709 
710 static void GLAPIENTRY
loopback_MultiTexCoord2dvARB(GLenum target,const GLdouble * v)711 loopback_MultiTexCoord2dvARB(GLenum target, const GLdouble *v)
712 {
713    MULTI_TEXCOORD2( target, (GLfloat) v[0], (GLfloat) v[1] );
714 }
715 
716 static void GLAPIENTRY
loopback_MultiTexCoord2iARB(GLenum target,GLint s,GLint t)717 loopback_MultiTexCoord2iARB(GLenum target, GLint s, GLint t)
718 {
719    MULTI_TEXCOORD2( target, (GLfloat) s, (GLfloat) t );
720 }
721 
722 static void GLAPIENTRY
loopback_MultiTexCoord2ivARB(GLenum target,const GLint * v)723 loopback_MultiTexCoord2ivARB(GLenum target, const GLint *v)
724 {
725    MULTI_TEXCOORD2( target, (GLfloat) v[0], (GLfloat) v[1] );
726 }
727 
728 static void GLAPIENTRY
loopback_MultiTexCoord2sARB(GLenum target,GLshort s,GLshort t)729 loopback_MultiTexCoord2sARB(GLenum target, GLshort s, GLshort t)
730 {
731    MULTI_TEXCOORD2( target, (GLfloat) s, (GLfloat) t );
732 }
733 
734 static void GLAPIENTRY
loopback_MultiTexCoord2svARB(GLenum target,const GLshort * v)735 loopback_MultiTexCoord2svARB(GLenum target, const GLshort *v)
736 {
737    MULTI_TEXCOORD2( target, (GLfloat) v[0], (GLfloat) v[1] );
738 }
739 
740 static void GLAPIENTRY
loopback_MultiTexCoord3dARB(GLenum target,GLdouble s,GLdouble t,GLdouble r)741 loopback_MultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r)
742 {
743    MULTI_TEXCOORD3( target, (GLfloat) s, (GLfloat) t, (GLfloat) r );
744 }
745 
746 static void GLAPIENTRY
loopback_MultiTexCoord3dvARB(GLenum target,const GLdouble * v)747 loopback_MultiTexCoord3dvARB(GLenum target, const GLdouble *v)
748 {
749    MULTI_TEXCOORD3( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
750 }
751 
752 static void GLAPIENTRY
loopback_MultiTexCoord3iARB(GLenum target,GLint s,GLint t,GLint r)753 loopback_MultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r)
754 {
755    MULTI_TEXCOORD3( target, (GLfloat) s, (GLfloat) t, (GLfloat) r );
756 }
757 
758 static void GLAPIENTRY
loopback_MultiTexCoord3ivARB(GLenum target,const GLint * v)759 loopback_MultiTexCoord3ivARB(GLenum target, const GLint *v)
760 {
761    MULTI_TEXCOORD3( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
762 }
763 
764 static void GLAPIENTRY
loopback_MultiTexCoord3sARB(GLenum target,GLshort s,GLshort t,GLshort r)765 loopback_MultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r)
766 {
767    MULTI_TEXCOORD3( target, (GLfloat) s, (GLfloat) t, (GLfloat) r );
768 }
769 
770 static void GLAPIENTRY
loopback_MultiTexCoord3svARB(GLenum target,const GLshort * v)771 loopback_MultiTexCoord3svARB(GLenum target, const GLshort *v)
772 {
773    MULTI_TEXCOORD3( target, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
774 }
775 
776 static void GLAPIENTRY
loopback_MultiTexCoord4dARB(GLenum target,GLdouble s,GLdouble t,GLdouble r,GLdouble q)777 loopback_MultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
778 {
779    MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t,
780 		    (GLfloat) r, (GLfloat) q );
781 }
782 
783 static void GLAPIENTRY
loopback_MultiTexCoord4dvARB(GLenum target,const GLdouble * v)784 loopback_MultiTexCoord4dvARB(GLenum target, const GLdouble *v)
785 {
786    MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1],
787 		    (GLfloat) v[2], (GLfloat) v[3] );
788 }
789 
790 static void GLAPIENTRY
loopback_MultiTexCoord4iARB(GLenum target,GLint s,GLint t,GLint r,GLint q)791 loopback_MultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q)
792 {
793    MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t,
794 		    (GLfloat) r, (GLfloat) q );
795 }
796 
797 static void GLAPIENTRY
loopback_MultiTexCoord4ivARB(GLenum target,const GLint * v)798 loopback_MultiTexCoord4ivARB(GLenum target, const GLint *v)
799 {
800    MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1],
801 		    (GLfloat) v[2], (GLfloat) v[3] );
802 }
803 
804 static void GLAPIENTRY
loopback_MultiTexCoord4sARB(GLenum target,GLshort s,GLshort t,GLshort r,GLshort q)805 loopback_MultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
806 {
807    MULTI_TEXCOORD4( target, (GLfloat) s, (GLfloat) t,
808 		    (GLfloat) r, (GLfloat) q );
809 }
810 
811 static void GLAPIENTRY
loopback_MultiTexCoord4svARB(GLenum target,const GLshort * v)812 loopback_MultiTexCoord4svARB(GLenum target, const GLshort *v)
813 {
814    MULTI_TEXCOORD4( target, (GLfloat) v[0], (GLfloat) v[1],
815 		    (GLfloat) v[2], (GLfloat) v[3] );
816 }
817 
818 static void GLAPIENTRY
loopback_EvalCoord2dv(const GLdouble * u)819 loopback_EvalCoord2dv( const GLdouble *u )
820 {
821    EVALCOORD2( (GLfloat) u[0], (GLfloat) u[1] );
822 }
823 
824 static void GLAPIENTRY
loopback_EvalCoord2fv(const GLfloat * u)825 loopback_EvalCoord2fv( const GLfloat *u )
826 {
827    EVALCOORD2( u[0], u[1] );
828 }
829 
830 static void GLAPIENTRY
loopback_EvalCoord2d(GLdouble u,GLdouble v)831 loopback_EvalCoord2d( GLdouble u, GLdouble v )
832 {
833    EVALCOORD2( (GLfloat) u, (GLfloat) v );
834 }
835 
836 static void GLAPIENTRY
loopback_EvalCoord1dv(const GLdouble * u)837 loopback_EvalCoord1dv( const GLdouble *u )
838 {
839    EVALCOORD1( (GLfloat) *u );
840 }
841 
842 static void GLAPIENTRY
loopback_EvalCoord1fv(const GLfloat * u)843 loopback_EvalCoord1fv( const GLfloat *u )
844 {
845    EVALCOORD1( (GLfloat) *u );
846 }
847 
848 static void GLAPIENTRY
loopback_EvalCoord1d(GLdouble u)849 loopback_EvalCoord1d( GLdouble u )
850 {
851    EVALCOORD1( (GLfloat) u );
852 }
853 
854 static void GLAPIENTRY
loopback_Materialf(GLenum face,GLenum pname,GLfloat param)855 loopback_Materialf( GLenum face, GLenum pname, GLfloat param )
856 {
857    GLfloat fparam[4];
858    fparam[0] = param;
859    MATERIALFV( face, pname, fparam );
860 }
861 
862 static void GLAPIENTRY
loopback_Materiali(GLenum face,GLenum pname,GLint param)863 loopback_Materiali(GLenum face, GLenum pname, GLint param )
864 {
865    GLfloat p = (GLfloat) param;
866    MATERIALFV(face, pname, &p);
867 }
868 
869 static void GLAPIENTRY
loopback_Materialiv(GLenum face,GLenum pname,const GLint * params)870 loopback_Materialiv(GLenum face, GLenum pname, const GLint *params )
871 {
872    GLfloat fparam[4];
873    switch (pname) {
874    case GL_AMBIENT:
875    case GL_DIFFUSE:
876    case GL_SPECULAR:
877    case GL_EMISSION:
878    case GL_AMBIENT_AND_DIFFUSE:
879       fparam[0] = INT_TO_FLOAT( params[0] );
880       fparam[1] = INT_TO_FLOAT( params[1] );
881       fparam[2] = INT_TO_FLOAT( params[2] );
882       fparam[3] = INT_TO_FLOAT( params[3] );
883       break;
884    case GL_SHININESS:
885       fparam[0] = (GLfloat) params[0];
886       break;
887    case GL_COLOR_INDEXES:
888       fparam[0] = (GLfloat) params[0];
889       fparam[1] = (GLfloat) params[1];
890       fparam[2] = (GLfloat) params[2];
891       break;
892    default:
893       ;
894    }
895    MATERIALFV(face, pname, fparam);
896 }
897 
898 
899 static void GLAPIENTRY
loopback_Rectd(GLdouble x1,GLdouble y1,GLdouble x2,GLdouble y2)900 loopback_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
901 {
902    RECTF((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
903 }
904 
905 static void GLAPIENTRY
loopback_Rectdv(const GLdouble * v1,const GLdouble * v2)906 loopback_Rectdv(const GLdouble *v1, const GLdouble *v2)
907 {
908    RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
909 }
910 
911 static void GLAPIENTRY
loopback_Rectfv(const GLfloat * v1,const GLfloat * v2)912 loopback_Rectfv(const GLfloat *v1, const GLfloat *v2)
913 {
914    RECTF(v1[0], v1[1], v2[0], v2[1]);
915 }
916 
917 static void GLAPIENTRY
loopback_Recti(GLint x1,GLint y1,GLint x2,GLint y2)918 loopback_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
919 {
920    RECTF((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
921 }
922 
923 static void GLAPIENTRY
loopback_Rectiv(const GLint * v1,const GLint * v2)924 loopback_Rectiv(const GLint *v1, const GLint *v2)
925 {
926    RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
927 }
928 
929 static void GLAPIENTRY
loopback_Rects(GLshort x1,GLshort y1,GLshort x2,GLshort y2)930 loopback_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
931 {
932    RECTF((GLfloat) x1, (GLfloat) y1, (GLfloat) x2, (GLfloat) y2);
933 }
934 
935 static void GLAPIENTRY
loopback_Rectsv(const GLshort * v1,const GLshort * v2)936 loopback_Rectsv(const GLshort *v1, const GLshort *v2)
937 {
938    RECTF((GLfloat) v1[0], (GLfloat) v1[1], (GLfloat) v2[0], (GLfloat) v2[1]);
939 }
940 
941 static void GLAPIENTRY
loopback_SecondaryColor3bEXT_f(GLbyte red,GLbyte green,GLbyte blue)942 loopback_SecondaryColor3bEXT_f( GLbyte red, GLbyte green, GLbyte blue )
943 {
944    SECONDARYCOLORF( BYTE_TO_FLOAT(red),
945 		    BYTE_TO_FLOAT(green),
946 		    BYTE_TO_FLOAT(blue) );
947 }
948 
949 static void GLAPIENTRY
loopback_SecondaryColor3dEXT_f(GLdouble red,GLdouble green,GLdouble blue)950 loopback_SecondaryColor3dEXT_f( GLdouble red, GLdouble green, GLdouble blue )
951 {
952    SECONDARYCOLORF( (GLfloat) red, (GLfloat) green, (GLfloat) blue );
953 }
954 
955 static void GLAPIENTRY
loopback_SecondaryColor3iEXT_f(GLint red,GLint green,GLint blue)956 loopback_SecondaryColor3iEXT_f( GLint red, GLint green, GLint blue )
957 {
958    SECONDARYCOLORF( INT_TO_FLOAT(red),
959 		    INT_TO_FLOAT(green),
960 		    INT_TO_FLOAT(blue));
961 }
962 
963 static void GLAPIENTRY
loopback_SecondaryColor3sEXT_f(GLshort red,GLshort green,GLshort blue)964 loopback_SecondaryColor3sEXT_f( GLshort red, GLshort green, GLshort blue )
965 {
966    SECONDARYCOLORF(SHORT_TO_FLOAT(red),
967                    SHORT_TO_FLOAT(green),
968                    SHORT_TO_FLOAT(blue));
969 }
970 
971 static void GLAPIENTRY
loopback_SecondaryColor3uiEXT_f(GLuint red,GLuint green,GLuint blue)972 loopback_SecondaryColor3uiEXT_f( GLuint red, GLuint green, GLuint blue )
973 {
974    SECONDARYCOLORF(UINT_TO_FLOAT(red),
975                    UINT_TO_FLOAT(green),
976                    UINT_TO_FLOAT(blue));
977 }
978 
979 static void GLAPIENTRY
loopback_SecondaryColor3usEXT_f(GLushort red,GLushort green,GLushort blue)980 loopback_SecondaryColor3usEXT_f( GLushort red, GLushort green, GLushort blue )
981 {
982    SECONDARYCOLORF(USHORT_TO_FLOAT(red),
983                    USHORT_TO_FLOAT(green),
984                    USHORT_TO_FLOAT(blue));
985 }
986 
987 static void GLAPIENTRY
loopback_SecondaryColor3ubEXT_f(GLubyte red,GLubyte green,GLubyte blue)988 loopback_SecondaryColor3ubEXT_f( GLubyte red, GLubyte green, GLubyte blue )
989 {
990    SECONDARYCOLORF(UBYTE_TO_FLOAT(red),
991                    UBYTE_TO_FLOAT(green),
992                    UBYTE_TO_FLOAT(blue));
993 }
994 
995 static void GLAPIENTRY
loopback_SecondaryColor3bvEXT_f(const GLbyte * v)996 loopback_SecondaryColor3bvEXT_f( const GLbyte *v )
997 {
998    SECONDARYCOLORF(BYTE_TO_FLOAT(v[0]),
999                    BYTE_TO_FLOAT(v[1]),
1000                    BYTE_TO_FLOAT(v[2]));
1001 }
1002 
1003 static void GLAPIENTRY
loopback_SecondaryColor3dvEXT_f(const GLdouble * v)1004 loopback_SecondaryColor3dvEXT_f( const GLdouble *v )
1005 {
1006    SECONDARYCOLORF( (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
1007 }
1008 static void GLAPIENTRY
loopback_SecondaryColor3ivEXT_f(const GLint * v)1009 loopback_SecondaryColor3ivEXT_f( const GLint *v )
1010 {
1011    SECONDARYCOLORF(INT_TO_FLOAT(v[0]),
1012                    INT_TO_FLOAT(v[1]),
1013                    INT_TO_FLOAT(v[2]));
1014 }
1015 
1016 static void GLAPIENTRY
loopback_SecondaryColor3svEXT_f(const GLshort * v)1017 loopback_SecondaryColor3svEXT_f( const GLshort *v )
1018 {
1019    SECONDARYCOLORF(SHORT_TO_FLOAT(v[0]),
1020                    SHORT_TO_FLOAT(v[1]),
1021                    SHORT_TO_FLOAT(v[2]));
1022 }
1023 
1024 static void GLAPIENTRY
loopback_SecondaryColor3uivEXT_f(const GLuint * v)1025 loopback_SecondaryColor3uivEXT_f( const GLuint *v )
1026 {
1027    SECONDARYCOLORF(UINT_TO_FLOAT(v[0]),
1028                    UINT_TO_FLOAT(v[1]),
1029                    UINT_TO_FLOAT(v[2]));
1030 }
1031 
1032 static void GLAPIENTRY
loopback_SecondaryColor3usvEXT_f(const GLushort * v)1033 loopback_SecondaryColor3usvEXT_f( const GLushort *v )
1034 {
1035    SECONDARYCOLORF(USHORT_TO_FLOAT(v[0]),
1036                    USHORT_TO_FLOAT(v[1]),
1037                    USHORT_TO_FLOAT(v[2]));
1038 }
1039 
1040 static void GLAPIENTRY
loopback_SecondaryColor3ubvEXT_f(const GLubyte * v)1041 loopback_SecondaryColor3ubvEXT_f( const GLubyte *v )
1042 {
1043    SECONDARYCOLORF(UBYTE_TO_FLOAT(v[0]),
1044                    UBYTE_TO_FLOAT(v[1]),
1045                    UBYTE_TO_FLOAT(v[2]));
1046 }
1047 
1048 
1049 /*
1050  * GL_NV_vertex_program:
1051  * Always loop-back to one of the VertexAttrib[1234]f[v]NV functions.
1052  * Note that attribute indexes DO alias conventional vertex attributes.
1053  */
1054 
1055 static void GLAPIENTRY
loopback_VertexAttrib1sNV(GLuint index,GLshort x)1056 loopback_VertexAttrib1sNV(GLuint index, GLshort x)
1057 {
1058    ATTRIB1NV(index, (GLfloat) x);
1059 }
1060 
1061 static void GLAPIENTRY
loopback_VertexAttrib1dNV(GLuint index,GLdouble x)1062 loopback_VertexAttrib1dNV(GLuint index, GLdouble x)
1063 {
1064    ATTRIB1NV(index, (GLfloat) x);
1065 }
1066 
1067 static void GLAPIENTRY
loopback_VertexAttrib2sNV(GLuint index,GLshort x,GLshort y)1068 loopback_VertexAttrib2sNV(GLuint index, GLshort x, GLshort y)
1069 {
1070    ATTRIB2NV(index, (GLfloat) x, y);
1071 }
1072 
1073 static void GLAPIENTRY
loopback_VertexAttrib2dNV(GLuint index,GLdouble x,GLdouble y)1074 loopback_VertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
1075 {
1076    ATTRIB2NV(index, (GLfloat) x, (GLfloat) y);
1077 }
1078 
1079 static void GLAPIENTRY
loopback_VertexAttrib3sNV(GLuint index,GLshort x,GLshort y,GLshort z)1080 loopback_VertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z)
1081 {
1082    ATTRIB3NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
1083 }
1084 
1085 static void GLAPIENTRY
loopback_VertexAttrib3dNV(GLuint index,GLdouble x,GLdouble y,GLdouble z)1086 loopback_VertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z)
1087 {
1088    ATTRIB4NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
1089 }
1090 
1091 static void GLAPIENTRY
loopback_VertexAttrib4sNV(GLuint index,GLshort x,GLshort y,GLshort z,GLshort w)1092 loopback_VertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
1093 {
1094    ATTRIB4NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
1095 }
1096 
1097 static void GLAPIENTRY
loopback_VertexAttrib4dNV(GLuint index,GLdouble x,GLdouble y,GLdouble z,GLdouble w)1098 loopback_VertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
1099 {
1100    ATTRIB4NV(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
1101 }
1102 
1103 static void GLAPIENTRY
loopback_VertexAttrib4ubNV(GLuint index,GLubyte x,GLubyte y,GLubyte z,GLubyte w)1104 loopback_VertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
1105 {
1106    ATTRIB4NV(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y),
1107 	UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
1108 }
1109 
1110 static void GLAPIENTRY
loopback_VertexAttrib1svNV(GLuint index,const GLshort * v)1111 loopback_VertexAttrib1svNV(GLuint index, const GLshort *v)
1112 {
1113    ATTRIB1NV(index, (GLfloat) v[0]);
1114 }
1115 
1116 static void GLAPIENTRY
loopback_VertexAttrib1dvNV(GLuint index,const GLdouble * v)1117 loopback_VertexAttrib1dvNV(GLuint index, const GLdouble *v)
1118 {
1119    ATTRIB1NV(index, (GLfloat) v[0]);
1120 }
1121 
1122 static void GLAPIENTRY
loopback_VertexAttrib2svNV(GLuint index,const GLshort * v)1123 loopback_VertexAttrib2svNV(GLuint index, const GLshort *v)
1124 {
1125    ATTRIB2NV(index, (GLfloat) v[0], (GLfloat) v[1]);
1126 }
1127 
1128 static void GLAPIENTRY
loopback_VertexAttrib2dvNV(GLuint index,const GLdouble * v)1129 loopback_VertexAttrib2dvNV(GLuint index, const GLdouble *v)
1130 {
1131    ATTRIB2NV(index, (GLfloat) v[0], (GLfloat) v[1]);
1132 }
1133 
1134 static void GLAPIENTRY
loopback_VertexAttrib3svNV(GLuint index,const GLshort * v)1135 loopback_VertexAttrib3svNV(GLuint index, const GLshort *v)
1136 {
1137    ATTRIB3NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
1138 }
1139 
1140 static void GLAPIENTRY
loopback_VertexAttrib3dvNV(GLuint index,const GLdouble * v)1141 loopback_VertexAttrib3dvNV(GLuint index, const GLdouble *v)
1142 {
1143    ATTRIB3NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
1144 }
1145 
1146 static void GLAPIENTRY
loopback_VertexAttrib4svNV(GLuint index,const GLshort * v)1147 loopback_VertexAttrib4svNV(GLuint index, const GLshort *v)
1148 {
1149    ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2],
1150 	  (GLfloat)v[3]);
1151 }
1152 
1153 static void GLAPIENTRY
loopback_VertexAttrib4dvNV(GLuint index,const GLdouble * v)1154 loopback_VertexAttrib4dvNV(GLuint index, const GLdouble *v)
1155 {
1156    ATTRIB4NV(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1157 }
1158 
1159 static void GLAPIENTRY
loopback_VertexAttrib4ubvNV(GLuint index,const GLubyte * v)1160 loopback_VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
1161 {
1162    ATTRIB4NV(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
1163           UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
1164 }
1165 
1166 
1167 static void GLAPIENTRY
loopback_VertexAttribs1svNV(GLuint index,GLsizei n,const GLshort * v)1168 loopback_VertexAttribs1svNV(GLuint index, GLsizei n, const GLshort *v)
1169 {
1170    GLint i;
1171    for (i = n - 1; i >= 0; i--)
1172       loopback_VertexAttrib1svNV(index + i, v + i);
1173 }
1174 
1175 static void GLAPIENTRY
loopback_VertexAttribs1fvNV(GLuint index,GLsizei n,const GLfloat * v)1176 loopback_VertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat *v)
1177 {
1178    GLint i;
1179    for (i = n - 1; i >= 0; i--)
1180       ATTRIB1NV(index + i, v[i]);
1181 }
1182 
1183 static void GLAPIENTRY
loopback_VertexAttribs1dvNV(GLuint index,GLsizei n,const GLdouble * v)1184 loopback_VertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble *v)
1185 {
1186    GLint i;
1187    for (i = n - 1; i >= 0; i--)
1188       loopback_VertexAttrib1dvNV(index + i, v + i);
1189 }
1190 
1191 static void GLAPIENTRY
loopback_VertexAttribs2svNV(GLuint index,GLsizei n,const GLshort * v)1192 loopback_VertexAttribs2svNV(GLuint index, GLsizei n, const GLshort *v)
1193 {
1194    GLint i;
1195    for (i = n - 1; i >= 0; i--)
1196       loopback_VertexAttrib2svNV(index + i, v + 2 * i);
1197 }
1198 
1199 static void GLAPIENTRY
loopback_VertexAttribs2fvNV(GLuint index,GLsizei n,const GLfloat * v)1200 loopback_VertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat *v)
1201 {
1202    GLint i;
1203    for (i = n - 1; i >= 0; i--)
1204       ATTRIB2NV(index + i, v[2 * i], v[2 * i + 1]);
1205 }
1206 
1207 static void GLAPIENTRY
loopback_VertexAttribs2dvNV(GLuint index,GLsizei n,const GLdouble * v)1208 loopback_VertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble *v)
1209 {
1210    GLint i;
1211    for (i = n - 1; i >= 0; i--)
1212       loopback_VertexAttrib2dvNV(index + i, v + 2 * i);
1213 }
1214 
1215 static void GLAPIENTRY
loopback_VertexAttribs3svNV(GLuint index,GLsizei n,const GLshort * v)1216 loopback_VertexAttribs3svNV(GLuint index, GLsizei n, const GLshort *v)
1217 {
1218    GLint i;
1219    for (i = n - 1; i >= 0; i--)
1220       loopback_VertexAttrib3svNV(index + i, v + 3 * i);
1221 }
1222 
1223 static void GLAPIENTRY
loopback_VertexAttribs3fvNV(GLuint index,GLsizei n,const GLfloat * v)1224 loopback_VertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat *v)
1225 {
1226    GLint i;
1227    for (i = n - 1; i >= 0; i--)
1228       ATTRIB3NV(index + i, v[3 * i], v[3 * i + 1], v[3 * i + 2]);
1229 }
1230 
1231 static void GLAPIENTRY
loopback_VertexAttribs3dvNV(GLuint index,GLsizei n,const GLdouble * v)1232 loopback_VertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble *v)
1233 {
1234    GLint i;
1235    for (i = n - 1; i >= 0; i--)
1236       loopback_VertexAttrib3dvNV(index + i, v + 3 * i);
1237 }
1238 
1239 static void GLAPIENTRY
loopback_VertexAttribs4svNV(GLuint index,GLsizei n,const GLshort * v)1240 loopback_VertexAttribs4svNV(GLuint index, GLsizei n, const GLshort *v)
1241 {
1242    GLint i;
1243    for (i = n - 1; i >= 0; i--)
1244       loopback_VertexAttrib4svNV(index + i, v + 4 * i);
1245 }
1246 
1247 static void GLAPIENTRY
loopback_VertexAttribs4fvNV(GLuint index,GLsizei n,const GLfloat * v)1248 loopback_VertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat *v)
1249 {
1250    GLint i;
1251    for (i = n - 1; i >= 0; i--)
1252       ATTRIB4NV(index + i, v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3]);
1253 }
1254 
1255 static void GLAPIENTRY
loopback_VertexAttribs4dvNV(GLuint index,GLsizei n,const GLdouble * v)1256 loopback_VertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble *v)
1257 {
1258    GLint i;
1259    for (i = n - 1; i >= 0; i--)
1260       loopback_VertexAttrib4dvNV(index + i, v + 4 * i);
1261 }
1262 
1263 static void GLAPIENTRY
loopback_VertexAttribs4ubvNV(GLuint index,GLsizei n,const GLubyte * v)1264 loopback_VertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v)
1265 {
1266    GLint i;
1267    for (i = n - 1; i >= 0; i--)
1268       loopback_VertexAttrib4ubvNV(index + i, v + 4 * i);
1269 }
1270 
1271 
1272 /*
1273  * GL_ARB_vertex_program
1274  * Always loop-back to one of the VertexAttrib[1234]f[v]ARB functions.
1275  * Note that attribute indexes do NOT alias conventional attributes.
1276  */
1277 
1278 static void GLAPIENTRY
loopback_VertexAttrib1sARB(GLuint index,GLshort x)1279 loopback_VertexAttrib1sARB(GLuint index, GLshort x)
1280 {
1281    ATTRIB1ARB(index, (GLfloat) x);
1282 }
1283 
1284 static void GLAPIENTRY
loopback_VertexAttrib1dARB(GLuint index,GLdouble x)1285 loopback_VertexAttrib1dARB(GLuint index, GLdouble x)
1286 {
1287    ATTRIB1ARB(index, (GLfloat) x);
1288 }
1289 
1290 static void GLAPIENTRY
loopback_VertexAttrib2sARB(GLuint index,GLshort x,GLshort y)1291 loopback_VertexAttrib2sARB(GLuint index, GLshort x, GLshort y)
1292 {
1293    ATTRIB2ARB(index, (GLfloat) x, y);
1294 }
1295 
1296 static void GLAPIENTRY
loopback_VertexAttrib2dARB(GLuint index,GLdouble x,GLdouble y)1297 loopback_VertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y)
1298 {
1299    ATTRIB2ARB(index, (GLfloat) x, (GLfloat) y);
1300 }
1301 
1302 static void GLAPIENTRY
loopback_VertexAttrib3sARB(GLuint index,GLshort x,GLshort y,GLshort z)1303 loopback_VertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z)
1304 {
1305    ATTRIB3ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z);
1306 }
1307 
1308 static void GLAPIENTRY
loopback_VertexAttrib3dARB(GLuint index,GLdouble x,GLdouble y,GLdouble z)1309 loopback_VertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z)
1310 {
1311    ATTRIB4ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
1312 }
1313 
1314 static void GLAPIENTRY
loopback_VertexAttrib4sARB(GLuint index,GLshort x,GLshort y,GLshort z,GLshort w)1315 loopback_VertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
1316 {
1317    ATTRIB4ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
1318 }
1319 
1320 static void GLAPIENTRY
loopback_VertexAttrib4dARB(GLuint index,GLdouble x,GLdouble y,GLdouble z,GLdouble w)1321 loopback_VertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
1322 {
1323    ATTRIB4ARB(index, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
1324 }
1325 
1326 static void GLAPIENTRY
loopback_VertexAttrib1svARB(GLuint index,const GLshort * v)1327 loopback_VertexAttrib1svARB(GLuint index, const GLshort *v)
1328 {
1329    ATTRIB1ARB(index, (GLfloat) v[0]);
1330 }
1331 
1332 static void GLAPIENTRY
loopback_VertexAttrib1dvARB(GLuint index,const GLdouble * v)1333 loopback_VertexAttrib1dvARB(GLuint index, const GLdouble *v)
1334 {
1335    ATTRIB1ARB(index, (GLfloat) v[0]);
1336 }
1337 
1338 static void GLAPIENTRY
loopback_VertexAttrib2svARB(GLuint index,const GLshort * v)1339 loopback_VertexAttrib2svARB(GLuint index, const GLshort *v)
1340 {
1341    ATTRIB2ARB(index, (GLfloat) v[0], (GLfloat) v[1]);
1342 }
1343 
1344 static void GLAPIENTRY
loopback_VertexAttrib2dvARB(GLuint index,const GLdouble * v)1345 loopback_VertexAttrib2dvARB(GLuint index, const GLdouble *v)
1346 {
1347    ATTRIB2ARB(index, (GLfloat) v[0], (GLfloat) v[1]);
1348 }
1349 
1350 static void GLAPIENTRY
loopback_VertexAttrib3svARB(GLuint index,const GLshort * v)1351 loopback_VertexAttrib3svARB(GLuint index, const GLshort *v)
1352 {
1353    ATTRIB3ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
1354 }
1355 
1356 static void GLAPIENTRY
loopback_VertexAttrib3dvARB(GLuint index,const GLdouble * v)1357 loopback_VertexAttrib3dvARB(GLuint index, const GLdouble *v)
1358 {
1359    ATTRIB3ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2]);
1360 }
1361 
1362 static void GLAPIENTRY
loopback_VertexAttrib4svARB(GLuint index,const GLshort * v)1363 loopback_VertexAttrib4svARB(GLuint index, const GLshort *v)
1364 {
1365    ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2],
1366 	  (GLfloat)v[3]);
1367 }
1368 
1369 static void GLAPIENTRY
loopback_VertexAttrib4dvARB(GLuint index,const GLdouble * v)1370 loopback_VertexAttrib4dvARB(GLuint index, const GLdouble *v)
1371 {
1372    ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1373 }
1374 
1375 static void GLAPIENTRY
loopback_VertexAttrib4bvARB(GLuint index,const GLbyte * v)1376 loopback_VertexAttrib4bvARB(GLuint index, const GLbyte * v)
1377 {
1378    ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1379 }
1380 
1381 static void GLAPIENTRY
loopback_VertexAttrib4ivARB(GLuint index,const GLint * v)1382 loopback_VertexAttrib4ivARB(GLuint index, const GLint * v)
1383 {
1384    ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1385 }
1386 
1387 static void GLAPIENTRY
loopback_VertexAttrib4ubvARB(GLuint index,const GLubyte * v)1388 loopback_VertexAttrib4ubvARB(GLuint index, const GLubyte * v)
1389 {
1390    ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1391 }
1392 
1393 static void GLAPIENTRY
loopback_VertexAttrib4usvARB(GLuint index,const GLushort * v)1394 loopback_VertexAttrib4usvARB(GLuint index, const GLushort * v)
1395 {
1396    ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1397 }
1398 
1399 static void GLAPIENTRY
loopback_VertexAttrib4uivARB(GLuint index,const GLuint * v)1400 loopback_VertexAttrib4uivARB(GLuint index, const GLuint * v)
1401 {
1402    ATTRIB4ARB(index, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]);
1403 }
1404 
1405 static void GLAPIENTRY
loopback_VertexAttrib4NbvARB(GLuint index,const GLbyte * v)1406 loopback_VertexAttrib4NbvARB(GLuint index, const GLbyte * v)
1407 {
1408    ATTRIB4ARB(index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]),
1409           BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]));
1410 }
1411 
1412 static void GLAPIENTRY
loopback_VertexAttrib4NsvARB(GLuint index,const GLshort * v)1413 loopback_VertexAttrib4NsvARB(GLuint index, const GLshort * v)
1414 {
1415    ATTRIB4ARB(index, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]),
1416           SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]));
1417 }
1418 
1419 static void GLAPIENTRY
loopback_VertexAttrib4NivARB(GLuint index,const GLint * v)1420 loopback_VertexAttrib4NivARB(GLuint index, const GLint * v)
1421 {
1422    ATTRIB4ARB(index, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]),
1423           INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]));
1424 }
1425 
1426 static void GLAPIENTRY
loopback_VertexAttrib4NubARB(GLuint index,GLubyte x,GLubyte y,GLubyte z,GLubyte w)1427 loopback_VertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
1428 {
1429    ATTRIB4ARB(index, UBYTE_TO_FLOAT(x), UBYTE_TO_FLOAT(y),
1430               UBYTE_TO_FLOAT(z), UBYTE_TO_FLOAT(w));
1431 }
1432 
1433 static void GLAPIENTRY
loopback_VertexAttrib4NubvARB(GLuint index,const GLubyte * v)1434 loopback_VertexAttrib4NubvARB(GLuint index, const GLubyte * v)
1435 {
1436    ATTRIB4ARB(index, UBYTE_TO_FLOAT(v[0]), UBYTE_TO_FLOAT(v[1]),
1437           UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]));
1438 }
1439 
1440 static void GLAPIENTRY
loopback_VertexAttrib4NusvARB(GLuint index,const GLushort * v)1441 loopback_VertexAttrib4NusvARB(GLuint index, const GLushort * v)
1442 {
1443    ATTRIB4ARB(index, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]),
1444           USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]));
1445 }
1446 
1447 static void GLAPIENTRY
loopback_VertexAttrib4NuivARB(GLuint index,const GLuint * v)1448 loopback_VertexAttrib4NuivARB(GLuint index, const GLuint * v)
1449 {
1450    ATTRIB4ARB(index, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]),
1451           UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]));
1452 }
1453 
1454 
1455 
1456 /**
1457  * GL_EXT_gpu_shader / GL 3.0 signed/unsigned integer-valued attributes.
1458  * Note that attribute indexes do NOT alias conventional attributes.
1459  */
1460 
1461 static void GLAPIENTRY
loopback_VertexAttribI1iv(GLuint index,const GLint * v)1462 loopback_VertexAttribI1iv(GLuint index, const GLint *v)
1463 {
1464    ATTRIBI_1I(index, v[0]);
1465 }
1466 
1467 static void GLAPIENTRY
loopback_VertexAttribI1uiv(GLuint index,const GLuint * v)1468 loopback_VertexAttribI1uiv(GLuint index, const GLuint *v)
1469 {
1470    ATTRIBI_1UI(index, v[0]);
1471 }
1472 
1473 static void GLAPIENTRY
loopback_VertexAttribI4bv(GLuint index,const GLbyte * v)1474 loopback_VertexAttribI4bv(GLuint index, const GLbyte *v)
1475 {
1476    ATTRIBI_4I(index, v[0], v[1], v[2], v[3]);
1477 }
1478 
1479 static void GLAPIENTRY
loopback_VertexAttribI4sv(GLuint index,const GLshort * v)1480 loopback_VertexAttribI4sv(GLuint index, const GLshort *v)
1481 {
1482    ATTRIBI_4I(index, v[0], v[1], v[2], v[3]);
1483 }
1484 
1485 static void GLAPIENTRY
loopback_VertexAttribI4ubv(GLuint index,const GLubyte * v)1486 loopback_VertexAttribI4ubv(GLuint index, const GLubyte *v)
1487 {
1488    ATTRIBI_4UI(index, v[0], v[1], v[2], v[3]);
1489 }
1490 
1491 static void GLAPIENTRY
loopback_VertexAttribI4usv(GLuint index,const GLushort * v)1492 loopback_VertexAttribI4usv(GLuint index, const GLushort *v)
1493 {
1494    ATTRIBI_4UI(index, v[0], v[1], v[2], v[3]);
1495 }
1496 
1497 
1498 
1499 
1500 /*
1501  * This code never registers handlers for any of the entry points
1502  * listed in vtxfmt.h.
1503  */
1504 void
_mesa_loopback_init_api_table(const struct gl_context * ctx,struct _glapi_table * dest)1505 _mesa_loopback_init_api_table(const struct gl_context *ctx,
1506                               struct _glapi_table *dest)
1507 {
1508    if (ctx->API != API_OPENGL_CORE && ctx->API != API_OPENGLES2) {
1509       SET_Color3b(dest, loopback_Color3b_f);
1510       SET_Color3d(dest, loopback_Color3d_f);
1511       SET_Color3i(dest, loopback_Color3i_f);
1512       SET_Color3s(dest, loopback_Color3s_f);
1513       SET_Color3ui(dest, loopback_Color3ui_f);
1514       SET_Color3us(dest, loopback_Color3us_f);
1515       SET_Color3ub(dest, loopback_Color3ub_f);
1516       SET_Color4b(dest, loopback_Color4b_f);
1517       SET_Color4d(dest, loopback_Color4d_f);
1518       SET_Color4i(dest, loopback_Color4i_f);
1519       SET_Color4s(dest, loopback_Color4s_f);
1520       SET_Color4ui(dest, loopback_Color4ui_f);
1521       SET_Color4us(dest, loopback_Color4us_f);
1522       SET_Color4ub(dest, loopback_Color4ub_f);
1523       SET_Color3bv(dest, loopback_Color3bv_f);
1524       SET_Color3dv(dest, loopback_Color3dv_f);
1525       SET_Color3iv(dest, loopback_Color3iv_f);
1526       SET_Color3sv(dest, loopback_Color3sv_f);
1527       SET_Color3uiv(dest, loopback_Color3uiv_f);
1528       SET_Color3usv(dest, loopback_Color3usv_f);
1529       SET_Color3ubv(dest, loopback_Color3ubv_f);
1530       SET_Color4bv(dest, loopback_Color4bv_f);
1531       SET_Color4dv(dest, loopback_Color4dv_f);
1532       SET_Color4iv(dest, loopback_Color4iv_f);
1533       SET_Color4sv(dest, loopback_Color4sv_f);
1534       SET_Color4uiv(dest, loopback_Color4uiv_f);
1535       SET_Color4usv(dest, loopback_Color4usv_f);
1536       SET_Color4ubv(dest, loopback_Color4ubv_f);
1537 
1538       SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f);
1539       SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f);
1540       SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f);
1541       SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f);
1542       SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f);
1543       SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f);
1544       SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f);
1545       SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f);
1546       SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f);
1547       SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f);
1548       SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f);
1549       SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f);
1550       SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f);
1551       SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f);
1552 
1553       SET_EdgeFlagv(dest, loopback_EdgeFlagv);
1554 
1555       SET_Indexd(dest, loopback_Indexd);
1556       SET_Indexi(dest, loopback_Indexi);
1557       SET_Indexs(dest, loopback_Indexs);
1558       SET_Indexub(dest, loopback_Indexub);
1559       SET_Indexdv(dest, loopback_Indexdv);
1560       SET_Indexiv(dest, loopback_Indexiv);
1561       SET_Indexsv(dest, loopback_Indexsv);
1562       SET_Indexubv(dest, loopback_Indexubv);
1563       SET_Normal3b(dest, loopback_Normal3b);
1564       SET_Normal3d(dest, loopback_Normal3d);
1565       SET_Normal3i(dest, loopback_Normal3i);
1566       SET_Normal3s(dest, loopback_Normal3s);
1567       SET_Normal3bv(dest, loopback_Normal3bv);
1568       SET_Normal3dv(dest, loopback_Normal3dv);
1569       SET_Normal3iv(dest, loopback_Normal3iv);
1570       SET_Normal3sv(dest, loopback_Normal3sv);
1571       SET_TexCoord1d(dest, loopback_TexCoord1d);
1572       SET_TexCoord1i(dest, loopback_TexCoord1i);
1573       SET_TexCoord1s(dest, loopback_TexCoord1s);
1574       SET_TexCoord2d(dest, loopback_TexCoord2d);
1575       SET_TexCoord2s(dest, loopback_TexCoord2s);
1576       SET_TexCoord2i(dest, loopback_TexCoord2i);
1577       SET_TexCoord3d(dest, loopback_TexCoord3d);
1578       SET_TexCoord3i(dest, loopback_TexCoord3i);
1579       SET_TexCoord3s(dest, loopback_TexCoord3s);
1580       SET_TexCoord4d(dest, loopback_TexCoord4d);
1581       SET_TexCoord4i(dest, loopback_TexCoord4i);
1582       SET_TexCoord4s(dest, loopback_TexCoord4s);
1583       SET_TexCoord1dv(dest, loopback_TexCoord1dv);
1584       SET_TexCoord1iv(dest, loopback_TexCoord1iv);
1585       SET_TexCoord1sv(dest, loopback_TexCoord1sv);
1586       SET_TexCoord2dv(dest, loopback_TexCoord2dv);
1587       SET_TexCoord2iv(dest, loopback_TexCoord2iv);
1588       SET_TexCoord2sv(dest, loopback_TexCoord2sv);
1589       SET_TexCoord3dv(dest, loopback_TexCoord3dv);
1590       SET_TexCoord3iv(dest, loopback_TexCoord3iv);
1591       SET_TexCoord3sv(dest, loopback_TexCoord3sv);
1592       SET_TexCoord4dv(dest, loopback_TexCoord4dv);
1593       SET_TexCoord4iv(dest, loopback_TexCoord4iv);
1594       SET_TexCoord4sv(dest, loopback_TexCoord4sv);
1595       SET_Vertex2d(dest, loopback_Vertex2d);
1596       SET_Vertex2i(dest, loopback_Vertex2i);
1597       SET_Vertex2s(dest, loopback_Vertex2s);
1598       SET_Vertex3d(dest, loopback_Vertex3d);
1599       SET_Vertex3i(dest, loopback_Vertex3i);
1600       SET_Vertex3s(dest, loopback_Vertex3s);
1601       SET_Vertex4d(dest, loopback_Vertex4d);
1602       SET_Vertex4i(dest, loopback_Vertex4i);
1603       SET_Vertex4s(dest, loopback_Vertex4s);
1604       SET_Vertex2dv(dest, loopback_Vertex2dv);
1605       SET_Vertex2iv(dest, loopback_Vertex2iv);
1606       SET_Vertex2sv(dest, loopback_Vertex2sv);
1607       SET_Vertex3dv(dest, loopback_Vertex3dv);
1608       SET_Vertex3iv(dest, loopback_Vertex3iv);
1609       SET_Vertex3sv(dest, loopback_Vertex3sv);
1610       SET_Vertex4dv(dest, loopback_Vertex4dv);
1611       SET_Vertex4iv(dest, loopback_Vertex4iv);
1612       SET_Vertex4sv(dest, loopback_Vertex4sv);
1613       SET_MultiTexCoord1dARB(dest, loopback_MultiTexCoord1dARB);
1614       SET_MultiTexCoord1dvARB(dest, loopback_MultiTexCoord1dvARB);
1615       SET_MultiTexCoord1iARB(dest, loopback_MultiTexCoord1iARB);
1616       SET_MultiTexCoord1ivARB(dest, loopback_MultiTexCoord1ivARB);
1617       SET_MultiTexCoord1sARB(dest, loopback_MultiTexCoord1sARB);
1618       SET_MultiTexCoord1svARB(dest, loopback_MultiTexCoord1svARB);
1619       SET_MultiTexCoord2dARB(dest, loopback_MultiTexCoord2dARB);
1620       SET_MultiTexCoord2dvARB(dest, loopback_MultiTexCoord2dvARB);
1621       SET_MultiTexCoord2iARB(dest, loopback_MultiTexCoord2iARB);
1622       SET_MultiTexCoord2ivARB(dest, loopback_MultiTexCoord2ivARB);
1623       SET_MultiTexCoord2sARB(dest, loopback_MultiTexCoord2sARB);
1624       SET_MultiTexCoord2svARB(dest, loopback_MultiTexCoord2svARB);
1625       SET_MultiTexCoord3dARB(dest, loopback_MultiTexCoord3dARB);
1626       SET_MultiTexCoord3dvARB(dest, loopback_MultiTexCoord3dvARB);
1627       SET_MultiTexCoord3iARB(dest, loopback_MultiTexCoord3iARB);
1628       SET_MultiTexCoord3ivARB(dest, loopback_MultiTexCoord3ivARB);
1629       SET_MultiTexCoord3sARB(dest, loopback_MultiTexCoord3sARB);
1630       SET_MultiTexCoord3svARB(dest, loopback_MultiTexCoord3svARB);
1631       SET_MultiTexCoord4dARB(dest, loopback_MultiTexCoord4dARB);
1632       SET_MultiTexCoord4dvARB(dest, loopback_MultiTexCoord4dvARB);
1633       SET_MultiTexCoord4iARB(dest, loopback_MultiTexCoord4iARB);
1634       SET_MultiTexCoord4ivARB(dest, loopback_MultiTexCoord4ivARB);
1635       SET_MultiTexCoord4sARB(dest, loopback_MultiTexCoord4sARB);
1636       SET_MultiTexCoord4svARB(dest, loopback_MultiTexCoord4svARB);
1637       SET_EvalCoord2dv(dest, loopback_EvalCoord2dv);
1638       SET_EvalCoord2fv(dest, loopback_EvalCoord2fv);
1639       SET_EvalCoord2d(dest, loopback_EvalCoord2d);
1640       SET_EvalCoord1dv(dest, loopback_EvalCoord1dv);
1641       SET_EvalCoord1fv(dest, loopback_EvalCoord1fv);
1642       SET_EvalCoord1d(dest, loopback_EvalCoord1d);
1643       SET_Materialf(dest, loopback_Materialf);
1644       SET_Materiali(dest, loopback_Materiali);
1645       SET_Materialiv(dest, loopback_Materialiv);
1646       SET_Rectd(dest, loopback_Rectd);
1647       SET_Rectdv(dest, loopback_Rectdv);
1648       SET_Rectfv(dest, loopback_Rectfv);
1649       SET_Recti(dest, loopback_Recti);
1650       SET_Rectiv(dest, loopback_Rectiv);
1651       SET_Rects(dest, loopback_Rects);
1652       SET_Rectsv(dest, loopback_Rectsv);
1653       SET_FogCoorddEXT(dest, loopback_FogCoorddEXT);
1654       SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT);
1655    }
1656 
1657    if (ctx->API == API_OPENGL) {
1658       SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV);
1659       SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV);
1660       SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV);
1661       SET_VertexAttrib2dNV(dest, loopback_VertexAttrib2dNV);
1662       SET_VertexAttrib3sNV(dest, loopback_VertexAttrib3sNV);
1663       SET_VertexAttrib3dNV(dest, loopback_VertexAttrib3dNV);
1664       SET_VertexAttrib4sNV(dest, loopback_VertexAttrib4sNV);
1665       SET_VertexAttrib4dNV(dest, loopback_VertexAttrib4dNV);
1666       SET_VertexAttrib4ubNV(dest, loopback_VertexAttrib4ubNV);
1667       SET_VertexAttrib1svNV(dest, loopback_VertexAttrib1svNV);
1668       SET_VertexAttrib1dvNV(dest, loopback_VertexAttrib1dvNV);
1669       SET_VertexAttrib2svNV(dest, loopback_VertexAttrib2svNV);
1670       SET_VertexAttrib2dvNV(dest, loopback_VertexAttrib2dvNV);
1671       SET_VertexAttrib3svNV(dest, loopback_VertexAttrib3svNV);
1672       SET_VertexAttrib3dvNV(dest, loopback_VertexAttrib3dvNV);
1673       SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV);
1674       SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV);
1675       SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV);
1676       SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV);
1677       SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV);
1678       SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV);
1679       SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV);
1680       SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV);
1681       SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV);
1682       SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV);
1683       SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV);
1684       SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV);
1685       SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV);
1686       SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV);
1687       SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV);
1688       SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV);
1689    }
1690 
1691    if (ctx->API != API_OPENGLES2) {
1692       SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB);
1693       SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB);
1694       SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB);
1695       SET_VertexAttrib2dARB(dest, loopback_VertexAttrib2dARB);
1696       SET_VertexAttrib3sARB(dest, loopback_VertexAttrib3sARB);
1697       SET_VertexAttrib3dARB(dest, loopback_VertexAttrib3dARB);
1698       SET_VertexAttrib4sARB(dest, loopback_VertexAttrib4sARB);
1699       SET_VertexAttrib4dARB(dest, loopback_VertexAttrib4dARB);
1700       SET_VertexAttrib1svARB(dest, loopback_VertexAttrib1svARB);
1701       SET_VertexAttrib1dvARB(dest, loopback_VertexAttrib1dvARB);
1702       SET_VertexAttrib2svARB(dest, loopback_VertexAttrib2svARB);
1703       SET_VertexAttrib2dvARB(dest, loopback_VertexAttrib2dvARB);
1704       SET_VertexAttrib3svARB(dest, loopback_VertexAttrib3svARB);
1705       SET_VertexAttrib3dvARB(dest, loopback_VertexAttrib3dvARB);
1706       SET_VertexAttrib4svARB(dest, loopback_VertexAttrib4svARB);
1707       SET_VertexAttrib4dvARB(dest, loopback_VertexAttrib4dvARB);
1708       SET_VertexAttrib4NubARB(dest, loopback_VertexAttrib4NubARB);
1709       SET_VertexAttrib4NubvARB(dest, loopback_VertexAttrib4NubvARB);
1710       SET_VertexAttrib4bvARB(dest, loopback_VertexAttrib4bvARB);
1711       SET_VertexAttrib4ivARB(dest, loopback_VertexAttrib4ivARB);
1712       SET_VertexAttrib4ubvARB(dest, loopback_VertexAttrib4ubvARB);
1713       SET_VertexAttrib4usvARB(dest, loopback_VertexAttrib4usvARB);
1714       SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB);
1715       SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB);
1716       SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB);
1717       SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB);
1718       SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB);
1719       SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB);
1720 
1721       /* GL_EXT_gpu_shader4, GL 3.0 */
1722       SET_VertexAttribI1ivEXT(dest, loopback_VertexAttribI1iv);
1723       SET_VertexAttribI1uivEXT(dest, loopback_VertexAttribI1uiv);
1724       SET_VertexAttribI4bvEXT(dest, loopback_VertexAttribI4bv);
1725       SET_VertexAttribI4svEXT(dest, loopback_VertexAttribI4sv);
1726       SET_VertexAttribI4ubvEXT(dest, loopback_VertexAttribI4ubv);
1727       SET_VertexAttribI4usvEXT(dest, loopback_VertexAttribI4usv);
1728    }
1729 }
1730 
1731 
1732 #endif /* FEATURE_beginend */
1733