2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice including the dates of first publication and
13 * either this permission notice or a reference to
14 * http://oss.sgi.com/projects/FreeB/
15 * shall be included in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * Except as contained in this notice, the name of Silicon Graphics, Inc.
26 * shall not be used in advertising or otherwise to promote the sale, use or
27 * other dealings in this Software without prior written authorization from
28 * Silicon Graphics, Inc.
35 __glFogiv_size(GLenum pname
)
56 __glFogfv_size(GLenum pname
)
58 return __glFogiv_size(pname
);
62 __glCallLists_size(GLsizei n
, GLenum type
)
72 case GL_UNSIGNED_BYTE
:
78 case GL_UNSIGNED_SHORT
:
106 __glDrawPixels_size(GLenum format
, GLenum type
, GLsizei w
, GLsizei h
)
108 GLint elements
, esize
;
112 case GL_STENCIL_INDEX
:
113 case GL_DEPTH_COMPONENT
:
123 case GL_LUMINANCE_ALPHA
:
138 if (format
== GL_COLOR_INDEX
|| format
== GL_STENCIL_INDEX
) {
139 return (h
* ((w
+ 7) / 8));
145 case GL_UNSIGNED_BYTE
:
148 case GL_UNSIGNED_BYTE_3_3_2
:
149 case GL_UNSIGNED_BYTE_2_3_3_REV
:
154 case GL_UNSIGNED_SHORT
:
157 case GL_UNSIGNED_SHORT_5_6_5
:
158 case GL_UNSIGNED_SHORT_5_6_5_REV
:
159 case GL_UNSIGNED_SHORT_4_4_4_4
:
160 case GL_UNSIGNED_SHORT_4_4_4_4_REV
:
161 case GL_UNSIGNED_SHORT_5_5_5_1
:
162 case GL_UNSIGNED_SHORT_1_5_5_5_REV
:
167 case GL_UNSIGNED_INT
:
171 case GL_UNSIGNED_INT_8_8_8_8
:
172 case GL_UNSIGNED_INT_8_8_8_8_REV
:
173 case GL_UNSIGNED_INT_10_10_10_2
:
174 case GL_UNSIGNED_INT_2_10_10_10_REV
:
181 return elements
* esize
* w
* h
;
185 __glBitmap_size(GLsizei w
, GLsizei h
)
187 return __glDrawPixels_size(GL_COLOR_INDEX
, GL_BITMAP
, w
, h
);
191 __glTexGendv_size(GLenum e
)
194 case GL_TEXTURE_GEN_MODE
:
196 case GL_OBJECT_PLANE
:
205 __glTexGenfv_size(GLenum e
)
207 return __glTexGendv_size(e
);
211 __glTexGeniv_size(GLenum e
)
213 return __glTexGendv_size(e
);
217 __glTexParameterfv_size(GLenum e
)
220 case GL_TEXTURE_WRAP_S
:
221 case GL_TEXTURE_WRAP_T
:
222 case GL_TEXTURE_WRAP_R
:
223 case GL_TEXTURE_MIN_FILTER
:
224 case GL_TEXTURE_MAG_FILTER
:
226 case GL_TEXTURE_BORDER_COLOR
:
228 case GL_TEXTURE_PRIORITY
:
230 case GL_TEXTURE_MIN_LOD
:
231 case GL_TEXTURE_MAX_LOD
:
232 case GL_TEXTURE_BASE_LEVEL
:
233 case GL_TEXTURE_MAX_LEVEL
:
241 __glTexParameteriv_size(GLenum e
)
243 return __glTexParameterfv_size(e
);
247 __glTexEnvfv_size(GLenum e
)
250 case GL_TEXTURE_ENV_MODE
:
252 case GL_TEXTURE_ENV_COLOR
:
260 __glTexEnviv_size(GLenum e
)
262 return __glTexEnvfv_size(e
);
266 __glTexImage1D_size(GLenum format
, GLenum type
, GLsizei w
)
268 GLint elements
, esize
;
283 case GL_LUMINANCE_ALPHA
:
298 if (format
== GL_COLOR_INDEX
) {
305 case GL_UNSIGNED_BYTE
:
308 case GL_UNSIGNED_BYTE_3_3_2
:
309 case GL_UNSIGNED_BYTE_2_3_3_REV
:
314 case GL_UNSIGNED_SHORT
:
317 case GL_UNSIGNED_SHORT_5_6_5
:
318 case GL_UNSIGNED_SHORT_5_6_5_REV
:
319 case GL_UNSIGNED_SHORT_4_4_4_4
:
320 case GL_UNSIGNED_SHORT_4_4_4_4_REV
:
321 case GL_UNSIGNED_SHORT_5_5_5_1
:
322 case GL_UNSIGNED_SHORT_1_5_5_5_REV
:
327 case GL_UNSIGNED_INT
:
331 case GL_UNSIGNED_INT_8_8_8_8
:
332 case GL_UNSIGNED_INT_8_8_8_8_REV
:
333 case GL_UNSIGNED_INT_10_10_10_2
:
334 case GL_UNSIGNED_INT_2_10_10_10_REV
:
341 return elements
* esize
* w
;
345 __glTexImage2D_size(GLenum format
, GLenum type
, GLsizei w
, GLsizei h
)
347 GLint elements
, esize
;
364 case GL_LUMINANCE_ALPHA
:
379 if (format
== GL_COLOR_INDEX
) {
380 return (h
* ((w
+ 7) / 8));
386 case GL_UNSIGNED_BYTE
:
389 case GL_UNSIGNED_BYTE_3_3_2
:
390 case GL_UNSIGNED_BYTE_2_3_3_REV
:
395 case GL_UNSIGNED_SHORT
:
398 case GL_UNSIGNED_SHORT_5_6_5
:
399 case GL_UNSIGNED_SHORT_5_6_5_REV
:
400 case GL_UNSIGNED_SHORT_4_4_4_4
:
401 case GL_UNSIGNED_SHORT_4_4_4_4_REV
:
402 case GL_UNSIGNED_SHORT_5_5_5_1
:
403 case GL_UNSIGNED_SHORT_1_5_5_5_REV
:
408 case GL_UNSIGNED_INT
:
412 case GL_UNSIGNED_INT_8_8_8_8
:
413 case GL_UNSIGNED_INT_8_8_8_8_REV
:
414 case GL_UNSIGNED_INT_10_10_10_2
:
415 case GL_UNSIGNED_INT_2_10_10_10_REV
:
422 return elements
* esize
* w
* h
;
426 __glTexImage3D_size(GLenum format
, GLenum type
, GLsizei w
, GLsizei h
, GLsizei d
)
428 GLint elements
, esize
;
447 case GL_LUMINANCE_ALPHA
:
462 if (format
== GL_COLOR_INDEX
) {
463 return (d
* (h
* ((w
+ 7) / 8)));
469 case GL_UNSIGNED_BYTE
:
472 case GL_UNSIGNED_BYTE_3_3_2
:
473 case GL_UNSIGNED_BYTE_2_3_3_REV
:
478 case GL_UNSIGNED_SHORT
:
481 case GL_UNSIGNED_SHORT_5_6_5
:
482 case GL_UNSIGNED_SHORT_5_6_5_REV
:
483 case GL_UNSIGNED_SHORT_4_4_4_4
:
484 case GL_UNSIGNED_SHORT_4_4_4_4_REV
:
485 case GL_UNSIGNED_SHORT_5_5_5_1
:
486 case GL_UNSIGNED_SHORT_1_5_5_5_REV
:
491 case GL_UNSIGNED_INT
:
495 case GL_UNSIGNED_INT_8_8_8_8
:
496 case GL_UNSIGNED_INT_8_8_8_8_REV
:
497 case GL_UNSIGNED_INT_10_10_10_2
:
498 case GL_UNSIGNED_INT_2_10_10_10_REV
:
505 return elements
* esize
* w
* h
* d
;
509 __glLightfv_size(GLenum pname
)
512 case GL_SPOT_EXPONENT
:
524 case GL_SPOT_DIRECTION
:
526 case GL_CONSTANT_ATTENUATION
:
528 case GL_LINEAR_ATTENUATION
:
530 case GL_QUADRATIC_ATTENUATION
:
538 __glLightiv_size(GLenum pname
)
540 return __glLightfv_size(pname
);
544 __glLightModelfv_size(GLenum pname
)
547 case GL_LIGHT_MODEL_AMBIENT
:
549 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
551 case GL_LIGHT_MODEL_TWO_SIDE
:
553 case GL_LIGHT_MODEL_COLOR_CONTROL
:
561 __glLightModeliv_size(GLenum pname
)
563 return __glLightModelfv_size(pname
);
567 __glMaterialfv_size(GLenum pname
)
580 case GL_AMBIENT_AND_DIFFUSE
:
582 case GL_COLOR_INDEXES
:
590 __glMaterialiv_size(GLenum pname
)
592 return __glMaterialfv_size(pname
);
596 __glColorTableParameterfv_size(GLenum pname
)
599 case GL_COLOR_TABLE_FORMAT
:
600 case GL_COLOR_TABLE_WIDTH
:
601 case GL_COLOR_TABLE_RED_SIZE
:
602 case GL_COLOR_TABLE_GREEN_SIZE
:
603 case GL_COLOR_TABLE_BLUE_SIZE
:
604 case GL_COLOR_TABLE_ALPHA_SIZE
:
605 case GL_COLOR_TABLE_LUMINANCE_SIZE
:
606 case GL_COLOR_TABLE_INTENSITY_SIZE
:
608 case GL_COLOR_TABLE_SCALE
:
609 case GL_COLOR_TABLE_BIAS
:
617 __glColorTableParameteriv_size(GLenum pname
)
619 return __glColorTableParameterfv_size(pname
);
623 __glConvolutionParameterfv_size(GLenum pname
)
626 case GL_CONVOLUTION_BORDER_MODE
:
628 case GL_CONVOLUTION_BORDER_COLOR
:
629 case GL_CONVOLUTION_FILTER_SCALE
:
630 case GL_CONVOLUTION_FILTER_BIAS
:
632 default: /* error: bad enum value */
638 __glConvolutionParameteriv_size(GLenum pname
)
640 return __glConvolutionParameterfv_size(pname
);