• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
2 
3 /*
4  * (C) Copyright IBM Corporation 2004
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  * the rights to use, copy, modify, merge, publish, distribute, sub license,
11  * and/or sell copies of the Software, and to permit persons to whom the
12  * 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  * IBM,
22  * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  */
27 
28 
29 #include <X11/Xfuncproto.h>
30 #include <GL/gl.h>
31 #include "indirect_size.h"
32 
33 #  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
34 #    define PURE __attribute__((pure))
35 #  else
36 #    define PURE
37 #  endif
38 
39 #  if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__)
40 #    define FASTCALL __attribute__((fastcall))
41 #  else
42 #    define FASTCALL
43 #  endif
44 
45 
46 #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(GLX_USE_APPLEGL)
47 #  undef HAVE_ALIAS
48 #endif
49 #ifdef HAVE_ALIAS
50 #  define ALIAS2(from,to) \
51     _X_INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \
52         __attribute__ ((alias( # to )));
53 #  define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )
54 #else
55 #  define ALIAS(from,to) \
56     _X_INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \
57     { return __gl ## to ## _size( e ); }
58 #endif
59 
60 
61 _X_INTERNAL PURE FASTCALL GLint
__glCallLists_size(GLenum e)62 __glCallLists_size( GLenum e )
63 {
64     switch( e ) {
65         case GL_BYTE:
66         case GL_UNSIGNED_BYTE:
67             return 1;
68         case GL_SHORT:
69         case GL_UNSIGNED_SHORT:
70         case GL_2_BYTES:
71         case GL_HALF_FLOAT:
72             return 2;
73         case GL_3_BYTES:
74             return 3;
75         case GL_INT:
76         case GL_UNSIGNED_INT:
77         case GL_FLOAT:
78         case GL_4_BYTES:
79             return 4;
80         default: return 0;
81     }
82 }
83 
84 _X_INTERNAL PURE FASTCALL GLint
__glFogfv_size(GLenum e)85 __glFogfv_size( GLenum e )
86 {
87     switch( e ) {
88         case GL_FOG_INDEX:
89         case GL_FOG_DENSITY:
90         case GL_FOG_START:
91         case GL_FOG_END:
92         case GL_FOG_MODE:
93         case GL_FOG_OFFSET_VALUE_SGIX:
94         case GL_FOG_DISTANCE_MODE_NV:
95             return 1;
96         case GL_FOG_COLOR:
97             return 4;
98         default: return 0;
99     }
100 }
101 
102 _X_INTERNAL PURE FASTCALL GLint
__glLightfv_size(GLenum e)103 __glLightfv_size( GLenum e )
104 {
105     switch( e ) {
106         case GL_SPOT_EXPONENT:
107         case GL_SPOT_CUTOFF:
108         case GL_CONSTANT_ATTENUATION:
109         case GL_LINEAR_ATTENUATION:
110         case GL_QUADRATIC_ATTENUATION:
111             return 1;
112         case GL_SPOT_DIRECTION:
113             return 3;
114         case GL_AMBIENT:
115         case GL_DIFFUSE:
116         case GL_SPECULAR:
117         case GL_POSITION:
118             return 4;
119         default: return 0;
120     }
121 }
122 
123 _X_INTERNAL PURE FASTCALL GLint
__glLightModelfv_size(GLenum e)124 __glLightModelfv_size( GLenum e )
125 {
126     switch( e ) {
127         case GL_LIGHT_MODEL_LOCAL_VIEWER:
128         case GL_LIGHT_MODEL_TWO_SIDE:
129         case GL_LIGHT_MODEL_COLOR_CONTROL:
130 /*      case GL_LIGHT_MODEL_COLOR_CONTROL_EXT:*/
131             return 1;
132         case GL_LIGHT_MODEL_AMBIENT:
133             return 4;
134         default: return 0;
135     }
136 }
137 
138 _X_INTERNAL PURE FASTCALL GLint
__glMaterialfv_size(GLenum e)139 __glMaterialfv_size( GLenum e )
140 {
141     switch( e ) {
142         case GL_SHININESS:
143             return 1;
144         case GL_COLOR_INDEXES:
145             return 3;
146         case GL_AMBIENT:
147         case GL_DIFFUSE:
148         case GL_SPECULAR:
149         case GL_EMISSION:
150         case GL_AMBIENT_AND_DIFFUSE:
151             return 4;
152         default: return 0;
153     }
154 }
155 
156 _X_INTERNAL PURE FASTCALL GLint
__glTexParameterfv_size(GLenum e)157 __glTexParameterfv_size( GLenum e )
158 {
159     switch( e ) {
160         case GL_TEXTURE_MAG_FILTER:
161         case GL_TEXTURE_MIN_FILTER:
162         case GL_TEXTURE_WRAP_S:
163         case GL_TEXTURE_WRAP_T:
164         case GL_TEXTURE_PRIORITY:
165         case GL_TEXTURE_WRAP_R:
166         case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
167 /*      case GL_SHADOW_AMBIENT_SGIX:*/
168         case GL_TEXTURE_MIN_LOD:
169         case GL_TEXTURE_MAX_LOD:
170         case GL_TEXTURE_BASE_LEVEL:
171         case GL_TEXTURE_MAX_LEVEL:
172         case GL_TEXTURE_CLIPMAP_FRAME_SGIX:
173         case GL_TEXTURE_LOD_BIAS_S_SGIX:
174         case GL_TEXTURE_LOD_BIAS_T_SGIX:
175         case GL_TEXTURE_LOD_BIAS_R_SGIX:
176         case GL_GENERATE_MIPMAP:
177 /*      case GL_GENERATE_MIPMAP_SGIS:*/
178         case GL_TEXTURE_COMPARE_SGIX:
179         case GL_TEXTURE_COMPARE_OPERATOR_SGIX:
180         case GL_TEXTURE_MAX_CLAMP_S_SGIX:
181         case GL_TEXTURE_MAX_CLAMP_T_SGIX:
182         case GL_TEXTURE_MAX_CLAMP_R_SGIX:
183         case GL_TEXTURE_MAX_ANISOTROPY_EXT:
184         case GL_TEXTURE_LOD_BIAS:
185 /*      case GL_TEXTURE_LOD_BIAS_EXT:*/
186         case GL_TEXTURE_STORAGE_HINT_APPLE:
187         case GL_STORAGE_PRIVATE_APPLE:
188         case GL_STORAGE_CACHED_APPLE:
189         case GL_STORAGE_SHARED_APPLE:
190         case GL_DEPTH_TEXTURE_MODE:
191 /*      case GL_DEPTH_TEXTURE_MODE_ARB:*/
192         case GL_TEXTURE_COMPARE_MODE:
193 /*      case GL_TEXTURE_COMPARE_MODE_ARB:*/
194         case GL_TEXTURE_COMPARE_FUNC:
195 /*      case GL_TEXTURE_COMPARE_FUNC_ARB:*/
196         case GL_TEXTURE_UNSIGNED_REMAP_MODE_NV:
197             return 1;
198         case GL_TEXTURE_CLIPMAP_CENTER_SGIX:
199         case GL_TEXTURE_CLIPMAP_OFFSET_SGIX:
200             return 2;
201         case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX:
202             return 3;
203         case GL_TEXTURE_BORDER_COLOR:
204         case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
205         case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
206             return 4;
207         default: return 0;
208     }
209 }
210 
211 _X_INTERNAL PURE FASTCALL GLint
__glTexEnvfv_size(GLenum e)212 __glTexEnvfv_size( GLenum e )
213 {
214     switch( e ) {
215         case GL_ALPHA_SCALE:
216         case GL_TEXTURE_ENV_MODE:
217         case GL_TEXTURE_LOD_BIAS:
218         case GL_COMBINE_RGB:
219         case GL_COMBINE_ALPHA:
220         case GL_RGB_SCALE:
221         case GL_SOURCE0_RGB:
222         case GL_SOURCE1_RGB:
223         case GL_SOURCE2_RGB:
224         case GL_SOURCE3_RGB_NV:
225         case GL_SOURCE0_ALPHA:
226         case GL_SOURCE1_ALPHA:
227         case GL_SOURCE2_ALPHA:
228         case GL_SOURCE3_ALPHA_NV:
229         case GL_OPERAND0_RGB:
230         case GL_OPERAND1_RGB:
231         case GL_OPERAND2_RGB:
232         case GL_OPERAND3_RGB_NV:
233         case GL_OPERAND0_ALPHA:
234         case GL_OPERAND1_ALPHA:
235         case GL_OPERAND2_ALPHA:
236         case GL_OPERAND3_ALPHA_NV:
237         case GL_BUMP_TARGET_ATI:
238         case GL_COORD_REPLACE_ARB:
239 /*      case GL_COORD_REPLACE_NV:*/
240             return 1;
241         case GL_TEXTURE_ENV_COLOR:
242             return 4;
243         default: return 0;
244     }
245 }
246 
247 _X_INTERNAL PURE FASTCALL GLint
__glTexGendv_size(GLenum e)248 __glTexGendv_size( GLenum e )
249 {
250     switch( e ) {
251         case GL_TEXTURE_GEN_MODE:
252             return 1;
253         case GL_OBJECT_PLANE:
254         case GL_EYE_PLANE:
255             return 4;
256         default: return 0;
257     }
258 }
259 
260 _X_INTERNAL PURE FASTCALL GLint
__glMap1d_size(GLenum e)261 __glMap1d_size( GLenum e )
262 {
263     switch( e ) {
264         case GL_MAP1_INDEX:
265         case GL_MAP1_TEXTURE_COORD_1:
266             return 1;
267         case GL_MAP1_TEXTURE_COORD_2:
268             return 2;
269         case GL_MAP1_NORMAL:
270         case GL_MAP1_TEXTURE_COORD_3:
271         case GL_MAP1_VERTEX_3:
272             return 3;
273         case GL_MAP1_COLOR_4:
274         case GL_MAP1_TEXTURE_COORD_4:
275         case GL_MAP1_VERTEX_4:
276             return 4;
277         default: return 0;
278     }
279 }
280 
281 _X_INTERNAL PURE FASTCALL GLint
__glMap2d_size(GLenum e)282 __glMap2d_size( GLenum e )
283 {
284     switch( e ) {
285         case GL_MAP2_INDEX:
286         case GL_MAP2_TEXTURE_COORD_1:
287             return 1;
288         case GL_MAP2_TEXTURE_COORD_2:
289             return 2;
290         case GL_MAP2_NORMAL:
291         case GL_MAP2_TEXTURE_COORD_3:
292         case GL_MAP2_VERTEX_3:
293             return 3;
294         case GL_MAP2_COLOR_4:
295         case GL_MAP2_TEXTURE_COORD_4:
296         case GL_MAP2_VERTEX_4:
297             return 4;
298         default: return 0;
299     }
300 }
301 
302 _X_INTERNAL PURE FASTCALL GLint
__glColorTableParameterfv_size(GLenum e)303 __glColorTableParameterfv_size( GLenum e )
304 {
305     switch( e ) {
306         case GL_COLOR_TABLE_SCALE:
307         case GL_COLOR_TABLE_BIAS:
308             return 4;
309         default: return 0;
310     }
311 }
312 
313 _X_INTERNAL PURE FASTCALL GLint
__glConvolutionParameterfv_size(GLenum e)314 __glConvolutionParameterfv_size( GLenum e )
315 {
316     switch( e ) {
317         case GL_CONVOLUTION_BORDER_MODE:
318 /*      case GL_CONVOLUTION_BORDER_MODE_EXT:*/
319             return 1;
320         case GL_CONVOLUTION_FILTER_SCALE:
321 /*      case GL_CONVOLUTION_FILTER_SCALE_EXT:*/
322         case GL_CONVOLUTION_FILTER_BIAS:
323 /*      case GL_CONVOLUTION_FILTER_BIAS_EXT:*/
324         case GL_CONVOLUTION_BORDER_COLOR:
325 /*      case GL_CONVOLUTION_BORDER_COLOR_HP:*/
326             return 4;
327         default: return 0;
328     }
329 }
330 
331 _X_INTERNAL PURE FASTCALL GLint
__glPointParameterfvEXT_size(GLenum e)332 __glPointParameterfvEXT_size( GLenum e )
333 {
334     switch( e ) {
335         case GL_POINT_SIZE_MIN:
336 /*      case GL_POINT_SIZE_MIN_ARB:*/
337 /*      case GL_POINT_SIZE_MIN_SGIS:*/
338         case GL_POINT_SIZE_MAX:
339 /*      case GL_POINT_SIZE_MAX_ARB:*/
340 /*      case GL_POINT_SIZE_MAX_SGIS:*/
341         case GL_POINT_FADE_THRESHOLD_SIZE:
342 /*      case GL_POINT_FADE_THRESHOLD_SIZE_ARB:*/
343 /*      case GL_POINT_FADE_THRESHOLD_SIZE_SGIS:*/
344         case GL_POINT_SPRITE_R_MODE_NV:
345         case GL_POINT_SPRITE_COORD_ORIGIN:
346             return 1;
347         case GL_POINT_DISTANCE_ATTENUATION:
348 /*      case GL_POINT_DISTANCE_ATTENUATION_ARB:*/
349 /*      case GL_POINT_DISTANCE_ATTENUATION_SGIS:*/
350             return 3;
351         default: return 0;
352     }
353 }
354 
355 ALIAS( Fogiv, Fogfv )
356 ALIAS( Lightiv, Lightfv )
357 ALIAS( LightModeliv, LightModelfv )
358 ALIAS( Materialiv, Materialfv )
359 ALIAS( TexParameteriv, TexParameterfv )
360 ALIAS( TexEnviv, TexEnvfv )
361 ALIAS( TexGenfv, TexGendv )
362 ALIAS( TexGeniv, TexGendv )
363 ALIAS( Map1f, Map1d )
364 ALIAS( Map2f, Map2d )
365 ALIAS( ColorTableParameteriv, ColorTableParameterfv )
366 ALIAS( ConvolutionParameteriv, ConvolutionParameterfv )
367 ALIAS( PointParameterivNV, PointParameterfvEXT )
368 
369 #  undef PURE
370 #  undef FASTCALL
371