More generic vtxfmt template, useful for creating neutral tnl module as
[mesa.git] / src / mesa / main / vtxfmt_tmp.h
1 /* $Id: vtxfmt_tmp.h,v 1.1 2001/03/09 16:08:13 gareth Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
6 *
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 * Author:
27 * Gareth Hughes <gareth@valinux.com>
28 */
29
30 #ifndef PRE_LOOPBACK
31 #define PRE_LOOPBACK( FUNC )
32 #endif
33
34 static void TAG(ArrayElement)( GLint i )
35 {
36 PRE_LOOPBACK( ArrayElement );
37 glArrayElement( i );
38 }
39
40 static void TAG(Color3f)( GLfloat a, GLfloat b, GLfloat c )
41 {
42 PRE_LOOPBACK( Color3f );
43 glColor3f( a, b, c );
44 }
45
46 static void TAG(Color3fv)( const GLfloat *v )
47 {
48 PRE_LOOPBACK( Color3fv );
49 glColor3fv( v );
50 }
51
52 static void TAG(Color3ub)( GLubyte a, GLubyte b, GLubyte c )
53 {
54 PRE_LOOPBACK( Color3ub );
55 glColor3ub( a, b, c );
56 }
57
58 static void TAG(Color3ubv)( const GLubyte *v )
59 {
60 PRE_LOOPBACK( Color3ubv );
61 glColor( 3ubv );
62 }
63
64 static void TAG(Color4f)( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
65 {
66 PRE_LOOPBACK( Color4f );
67 glColor4f( a, b, c, d );
68 }
69
70 static void TAG(Color4fv)( const GLfloat *v )
71 {
72 PRE_LOOPBACK( Color4fv );
73 glColor4fv( v );
74 }
75
76 static void TAG(Color4ub)( GLubyte a, GLubyte b, GLubyte c, GLubyte d )
77 {
78 PRE_LOOPBACK( Color4ub );
79 glColor4ub( a, b, c, d );
80 }
81
82 static void TAG(Color4ubv)( const GLubyte *v )
83 {
84 PRE_LOOPBACK( Color4ubv );
85 glColor4ubv( v );
86 }
87
88 static void TAG(EdgeFlag)( GLboolean a )
89 {
90 PRE_LOOPBACK( EdgeFlag );
91 glEdgeFlag( a );
92 }
93
94 static void TAG(EdgeFlagv)( const GLboolean *v )
95 {
96 PRE_LOOPBACK( EdgeFlagv );
97 glEdgeFlagv( v );
98 }
99
100 static void TAG(EvalCoord1f)( GLfloat a )
101 {
102 PRE_LOOPBACK( EvalCoord1f );
103 glEvalCoord1f( a );
104 }
105
106 static void TAG(EvalCoord1fv)( const GLfloat *v )
107 {
108 PRE_LOOPBACK( EvalCoord1fv );
109 glEvalCoord1fv( v );
110 }
111
112 static void TAG(EvalCoord2f)( GLfloat a, GLfloat b )
113 {
114 PRE_LOOPBACK( EvalCoord2f );
115 glEvalCoord2f( a, b );
116 }
117
118 static void TAG(EvalCoord2fv)( const GLfloat *v )
119 {
120 PRE_LOOPBACK( EvalCoord2fv );
121 glEvalCoord2fv( v );
122 }
123
124 static void TAG(EvalPoint1)( GLint a )
125 {
126 PRE_LOOPBACK( EvalPoint1 );
127 glEvalPoint1( a );
128 }
129
130 static void TAG(EvalPoint2)( GLint a, GLint b )
131 {
132 PRE_LOOPBACK( EvalPoint2 );
133 glEvalPoint2( a, b );
134 }
135
136 static void TAG(FogCoordfEXT)( GLfloat a )
137 {
138 PRE_LOOPBACK( FogCoordfEXT );
139 glFogCordfEXT( a );
140 }
141
142 static void TAG(FogCoordfvEXT)( const GLfloat *v )
143 {
144 PRE_LOOPBACK( FogCoordfvEXT );
145 glFogCoordfvEXT( v );
146 }
147
148 static void TAG(Indexi)( GLint a )
149 {
150 PRE_LOOPBACK( Indexi );
151 glIndexi( a );
152 }
153
154 static void TAG(Indexiv)( const GLint *v )
155 {
156 PRE_LOOPBACK( Indexiv );
157 glIndexiv( v );
158 }
159
160 static void TAG(Materialfv)( GLenum face, GLenum pname, const GLfloat *v )
161 {
162 PRE_LOOPBACK( Materialfv );
163 glMaterialfv( face, pname, v );
164 }
165
166 static void TAG(MultiTexCoord1fARB)( GLenum target, GLfloat a );
167 {
168 PRE_LOOPBACK( MultiTexCoord1fARB );
169 glMultiTexCoord1fARB( target, a );
170 }
171
172 static void TAG(MultiTexCoord1fvARB)( GLenum target, const GLfloat *tc )
173 {
174 PRE_LOOPBACK( MultiTexCoord1fvARB );
175 glMultiTexCoord1fvARB( target, tc );
176 }
177
178 static void TAG(MultiTexCoord2fARB)( GLenum target, GLfloat a, GLfloat b )
179 {
180 PRE_LOOPBACK( MultiTexCoord2fARB );
181 glMultiTexCoord2fARB( target, a, b );
182 }
183
184 static void TAG(MultiTexCoord2fvARB)( GLenum target, const GLfloat *tc )
185 {
186 PRE_LOOPBACK( MultiTexCoord2fvARB );
187 glMultiTexCoord2fvARB( target, tc );
188 }
189
190 static void TAG(MultiTexCoord3fARB)( GLenum target, GLfloat a,
191 GLfloat b, GLfloat c )
192 {
193 PRE_LOOPBACK( MultiTexCoord3fARB );
194 glMultiTexCoord3fARB( target, a, b, c );
195 }
196
197 static void TAG(MultiTexCoord3fvARB)( GLenum target, const GLfloat *tc )
198 {
199 PRE_LOOPBACK( MultiTexCoord3fvARB );
200 glMultiTexCoord3fvARB( target, tc );
201 }
202
203 static void TAG(MultiTexCoord4fARB)( GLenum target, GLfloat a,
204 GLfloat b, GLfloat c, GLfloat d )
205 {
206 PRE_LOOPBACK( MultiTexCoord4fARB );
207 glMultiTexCoord4fARB( target, a, b, c, d );
208 }
209
210 static void TAG(MultiTexCoord4fvARB)( GLenum target, const GLfloat *tc )
211 {
212 PRE_LOOPBACK( MultiTexCoord4fvARB );
213 glMultiTexCoord4fvARB( target, tc );
214 }
215
216 static void TAG(TexCoord1f)( GLfloat a )
217 {
218 PRE_LOOPBACK( TexCoord1f );
219 glTexCoord1f( a );
220 }
221
222 static void TAG(TexCoord1fv)( const GLfloat *tc )
223 {
224 PRE_LOOPBACK( TexCoord1fv );
225 glTexCoord1fv( tc );
226 }
227
228 static void TAG(TexCoord2f)( GLfloat a, GLfloat b )
229 {
230 PRE_LOOPBACK( TexCoord2f );
231 glTexCoord2f( a, b );
232 }
233
234 static void TAG(TexCoord2fv)( const GLfloat *tc )
235 {
236 PRE_LOOPBACK( TexCoord2fv );
237 glTexCoord2fv( tc );
238 }
239
240 static void TAG(TexCoord3f)( GLfloat a, GLfloat b, GLfloat c )
241 {
242 PRE_LOOPBACK( TexCoord3f );
243 glTexCoord3f( a, b, c );
244 }
245
246 static void TAG(TexCoord3fv)( const GLfloat *tc )
247 {
248 PRE_LOOPBACK( TexCoord3fv );
249 glTexCoord3fv( tc );
250 }
251
252 static void TAG(TexCoord4f)( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
253 {
254 PRE_LOOPBACK( TexCoord4f );
255 glTexCoord4f( a, b, c, d );
256 }
257
258 static void TAG(TexCoord4fv)( const GLfloat *tc )
259 {
260 PRE_LOOPBACK( TexCoord4fv );
261 glTexCoord4fv( tc );
262 }
263
264 static void TAG(Vertex2f)( GLfloat a, GLfloat b )
265 {
266 PRE_LOOPBACK( Vertex2f );
267 glVertex2f( a, b );
268 }
269
270 static void TAG(Vertex2fv)( const GLfloat *obj )
271 {
272 PRE_LOOPBACK( Vertex2fv );
273 glVertex2fv( obj );
274 }
275
276 static void TAG(Vertex3f)( GLfloat a, GLfloat b, GLfloat c )
277 {
278 PRE_LOOPBACK( Vertex3f );
279 glVertex3f( a, b, c );
280 }
281
282 static void TAG(Vertex3fv)( const GLfloat *obj )
283 {
284 PRE_LOOPBACK( Vertex3fv );
285 glVertex3fv( obj );
286 }
287
288 static void TAG(Vertex4f)( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
289 {
290 PRE_LOOPBACK( Vertex4f );
291 glVertex4f( a, b, c, d );
292 }
293
294 static void TAG(Vertex4fv)( const GLfloat *obj )
295 {
296 PRE_LOOPBACK( Vertex4fv );
297 glVertex4fv( obj );
298 }
299
300 static void TAG(CallList)( GLuint i )
301 {
302 PRE_LOOPBACK( CallList );
303 glCallList( i );
304 }
305
306 static void TAG(Begin)( GLenum mode )
307 {
308 PRE_LOOPBACK( Begin );
309 glBegin( mode );
310 }
311
312 static void TAG(End)( void )
313 {
314 PRE_LOOPBACK( End );
315 glEnd();
316 }
317
318 static void TAG(DrawArrays)( GLenum mode, GLint start, GLsizei count )
319 {
320 PRE_LOOPBACK( DrawArrays );
321 glDrawArrays( mode, start, count );
322 }
323
324 static void TAG(DrawElements)( GLenum mode, GLsizei count, GLenum type,
325 const void *indices )
326 {
327 PRE_LOOPBACK( DrawElements );
328 glDrawElements( mode, count, type, indices );
329 }
330
331 static void TAG(DrawRangeElements)( GLenum mode, GLuint start,
332 GLuint end, GLsizei count,
333 GLenum type, const void *indices )
334 {
335 PRE_LOOPBACK( DrawRangeElements );
336 glDrawRangeElements( mode, start, end, count, type, indices );
337 }
338
339 static void TAG(EvalMesh1)( GLenum mode, GLint i1, GLint i2 )
340 {
341 PRE_LOOPBACK( EvalMesh1 );
342 glEvalMesh1( mode, i1, i2 );
343 }
344
345 static void TAG(EvalMesh2)( GLenum mode, GLint i1, GLint i2,
346 GLint j1, GLint j2 )
347 {
348 PRE_LOOPBACK( EvalMesh2 );
349 glEvalMesh2( mode, i1, i2, j1, j2 );
350 }
351
352
353
354 /* Hack from hell:
355 * Call or reference this function to stop unused symbol warnings...
356 */
357 static void TAG(silence_compiler)( void )
358 {
359 (void)TAG(ArrayElement);
360 (void)TAG(Color3f);
361 (void)TAG(Color3fv);
362 (void)TAG(Color3ub);
363 (void)TAG(Color3ubv);
364 (void)TAG(Color4f);
365 (void)TAG(Color4fv);
366 (void)TAG(Color4ub);
367 (void)TAG(Color4ubv);
368 (void)TAG(EdgeFlag);
369 (void)TAG(EdgeFlagv);
370 (void)TAG(EvalCoord1f);
371 (void)TAG(EvalCoord1fv);
372 (void)TAG(EvalCoord2f);
373 (void)TAG(EvalCoord2fv);
374 (void)TAG(EvalPoint1);
375 (void)TAG(EvalPoint2);
376 (void)TAG(FogCoordfEXT);
377 (void)TAG(FogCoordfvEXT);
378 (void)TAG(Indexi);
379 (void)TAG(Indexiv);
380 (void)TAG(Materialfv);
381 (void)TAG(MultiTexCoord1fARB);
382 (void)TAG(MultiTexCoord1fvARB);
383 (void)TAG(MultiTexCoord2fARB);
384 (void)TAG(MultiTexCoord2fvARB);
385 (void)TAG(MultiTexCoord3fARB);
386 (void)TAG(MultiTexCoord3fvARB);
387 (void)TAG(MultiTexCoord4fARB);
388 (void)TAG(MultiTexCoord4fvARB);
389 (void)TAG(Normal3f);
390 (void)TAG(Normal3fv);
391 (void)TAG(SecondaryColor3fEXT);
392 (void)TAG(SecondaryColor3fvEXT);
393 (void)TAG(SecondaryColor3ubEXT);
394 (void)TAG(SecondaryColor3ubvEXT);
395 (void)TAG(TexCoord1f);
396 (void)TAG(TexCoord1fv);
397 (void)TAG(TexCoord2f);
398 (void)TAG(TexCoord2fv);
399 (void)TAG(TexCoord3f);
400 (void)TAG(TexCoord3fv);
401 (void)TAG(TexCoord4f);
402 (void)TAG(TexCoord4fv);
403 (void)TAG(Vertex2f);
404 (void)TAG(Vertex2fv);
405 (void)TAG(Vertex3f);
406 (void)TAG(Vertex3fv);
407 (void)TAG(Vertex4f);
408 (void)TAG(Vertex4fv);
409 (void)TAG(CallList);
410 (void)TAG(Begin);
411 (void)TAG(End);
412 (void)TAG(Rectf);
413 (void)TAG(DrawArrays);
414 (void)TAG(DrawElements);
415 (void)TAG(DrawRangeElements);
416 (void)TAG(EvalMesh1);
417 (void)TAG(EvalMesh2);
418 }
419
420 #undef TAG
421 #undef PRE_LOOPBACK