23.6 OpenGLlib Interface

ORIGIN '~beta/basiclib/betaenv';
--LIB: attributes--

(* Disclaimer:
 * This is a prelease version of the openGL
 * library interface for BETA. It may be 
 * changed later, and there is some inconviniences.
 * 
 * Fell free to ask questions and come with proposals to
 * support@mjolner.dk
 * 
 * OpenGL operates with a large number of types, these
 * are mapped to beta types as follows:
 * |----------------------------------------------------------|
 * |c-type        | openGL       | Beta        | size in bytes|
 * |----------------------------------------------------------|
 * |void          | GLvoid       |             |              |
 * |unsigned char | GLboolean    | int8u       |  1           |
 * |signed char   | GLbyte       | int8        |  1           |
 * |short         | GLshort      | int16       |  2           |
 * |int           | GLint        | int32       |  4           |
 * |unsigned char | GLubyte      | int8u       |  1           |
 * |unsigned char*| GLubyte*     | [0]@char    |  1           |
 * |unsigned short| GLushort     | int16u      |  2           |
 * |unsigned int  | GLuint       | int32u      |  4           |
 * |         int  | GLsizei      | int32       |  4           |
 * |float         | GLfloat      | real        |  8           |
 * |float         | GLclampf     | real        |  8           |
 * |double        | GLdouble     | real        |  8           |
 * |double        | GLclampd     | real        |  8           |
 * |unsigned int  | GLbitfield   | int32u      |  4           |
 * |unsigned int  | GLenum       | int32u      |  4           |
 * |xxx*          | xxx*         | int32       |  4           |
 * |xxx**         | xxx**        | int32       |  4           |
 * -----------------------------------------------------------|
 * 
 * Original GL-types are shown as comments in patterns.
 * 
 * Notice that GLfloat's are mapped to reals. These reals
 * are converted to floats in a c program, just before
 * actually calling the openGL routines. This is of 
 * course expensive. Use the GLdouble routines when 
 * they are available.
 * 
 * Also functions that float arrays are expensive
 * because the BETA repetion of reals is copied and
 * and converted to a c-array of floats. In this prelease
 * this is only done when absolutely necessary. That is 
 * glVertex3fv is not working, as you can use glVertex3f.
 * But glLightf does converting. Allways use repetitions, 
 * that is as long as the longest parameter ever. (4 in glLightfv)
 * 
 * Functions that return arrays are generally not
 * working. This will be better later.
 * 
 * Some funtions are defined equally. eg. glRotatef is the
 * same pattern as glRotated. There is no need for a 
 * glRotatef as you can not have any floats in your
 * beta program. So they are defined:
 * glRotated:(# ... #);
 * glRotatef:glRotated(# #);
 * This is done only to ease porting of c-programs.
 * 
 * logical or '|' is not part of the "highlevel" BETA syntax.
 * eg.  c:
 * glEnable(GL_LIGHTING|GL_CULLFACE);
 * in BETA:
 * GL_LIGHTING->glEnable;
 * GL_CULLFACE->glEnable;
 * or
 * GL_LIGHTING %Bor GL_CULLFACE -> glEnable;
 *)

(*
 *
 * Enumerations
 *
 *)

GL_FALSE:                        (# exit 0 #);
GL_TRUE:                         (# exit 1 #);

(* Data types *)
GL_BYTE:                         (# exit 0x1400 #);
GL_UNSIGNED_BYTE:                (# exit 0x1401 #);
GL_SHORT:                        (# exit 0x1402 #);
GL_UNSIGNED_SHORT:               (# exit 0x1403 #);
GL_INT:                          (# exit 0x1404 #);
GL_UNSIGNED_INT:                 (# exit 0x1405 #);
GL_FLOAT:                        (# exit 0x1406 #);
GL_DOUBLE:                       (# exit 0x140A #);
GL_2_BYTES:                      (# exit 0x1407 #);
GL_3_BYTES:                      (# exit 0x1408 #);
GL_4_BYTES:                      (# exit 0x1409 #);

(* Primitives *)
GL_LINES:                        (# exit 0x0001 #);
GL_POINTS:                       (# exit 0x0000 #);
GL_LINE_STRIP:                   (# exit 0x0003 #);
GL_LINE_LOOP:                    (# exit 0x0002 #);
GL_TRIANGLES:                    (# exit 0x0004 #);
GL_TRIANGLE_STRIP:               (# exit 0x0005 #);
GL_TRIANGLE_FAN:                 (# exit 0x0006 #);
GL_QUADS:                        (# exit 0x0007 #);
GL_QUAD_STRIP:                   (# exit 0x0008 #);
GL_POLYGON:                      (# exit 0x0009 #);
GL_EDGE_FLAG:                    (# exit 0x0B43 #);

(* Vertex Arrays *)
GL_VERTEX_ARRAY:                 (# exit 0x8074 #);
GL_NORMAL_ARRAY:                 (# exit 0x8075 #);
GL_COLOR_ARRAY:                  (# exit 0x8076 #);
GL_INDEX_ARRAY:                  (# exit 0x8077 #);
GL_TEXTURE_COORD_ARRAY:          (# exit 0x8078 #);
GL_EDGE_FLAG_ARRAY:              (# exit 0x8079 #);
GL_VERTEX_ARRAY_SIZE:            (# exit 0x807A #);
GL_VERTEX_ARRAY_TYPE:            (# exit 0x807B #);
GL_VERTEX_ARRAY_STRIDE:          (# exit 0x807C #);
GL_NORMAL_ARRAY_TYPE:            (# exit 0x807E #);
GL_NORMAL_ARRAY_STRIDE:          (# exit 0x807F #);
GL_COLOR_ARRAY_SIZE:             (# exit 0x8081 #);
GL_COLOR_ARRAY_TYPE:             (# exit 0x8082 #);
GL_COLOR_ARRAY_STRIDE:           (# exit 0x8083 #);
GL_INDEX_ARRAY_TYPE:             (# exit 0x8085 #);
GL_INDEX_ARRAY_STRIDE:           (# exit 0x8086 #);
GL_TEXTURE_COORD_ARRAY_SIZE:     (# exit 0x8088 #);
GL_TEXTURE_COORD_ARRAY_TYPE:     (# exit 0x8089 #);
GL_TEXTURE_COORD_ARRAY_STRIDE:   (# exit 0x808A #);
GL_EDGE_FLAG_ARRAY_STRIDE:       (# exit 0x808C #);
GL_VERTEX_ARRAY_POINTER:         (# exit 0x808E #);
GL_NORMAL_ARRAY_POINTER:         (# exit 0x808F #);
GL_COLOR_ARRAY_POINTER:          (# exit 0x8090 #);
GL_INDEX_ARRAY_POINTER:          (# exit 0x8091 #);
GL_TEXTURE_COORD_ARRAY_POINTER:  (# exit 0x8092 #);
GL_EDGE_FLAG_ARRAY_POINTER:      (# exit 0x8093 #);
GL_V2F:                          (# exit 0x2A20 #);
GL_V3F:                          (# exit 0x2A21 #);
GL_C4UB_V2F:                     (# exit 0x2A22 #);
GL_C4UB_V3F:                     (# exit 0x2A23 #);
GL_C3F_V3F:                      (# exit 0x2A24 #);
GL_N3F_V3F:                      (# exit 0x2A25 #);
GL_C4F_N3F_V3F:                  (# exit 0x2A26 #);
GL_T2F_V3F:                      (# exit 0x2A27 #);
GL_T4F_V4F:                      (# exit 0x2A28 #);
GL_T2F_C4UB_V3F:                 (# exit 0x2A29 #);
GL_T2F_C3F_V3F:                  (# exit 0x2A2A #);
GL_T2F_N3F_V3F:                  (# exit 0x2A2B #);
GL_T2F_C4F_N3F_V3F:              (# exit 0x2A2C #);
GL_T4F_C4F_N3F_V4F:              (# exit 0x2A2D #);

(* Matrix Mode *)
GL_MATRIX_MODE:                  (# exit 0x0BA0 #);
GL_MODELVIEW:                    (# exit 0x1700 #);
GL_PROJECTION:                   (# exit 0x1701 #);
GL_TEXTURE:                      (# exit 0x1702 #);

(* Points *)
GL_POINT_SMOOTH:                 (# exit 0x0B10 #);
GL_POINT_SIZE:                   (# exit 0x0B11 #);
GL_POINT_SIZE_GRANULARITY:       (# exit 0x0B13 #);
GL_POINT_SIZE_RANGE:             (# exit 0x0B12 #);

(* Lines *)
GL_LINE_SMOOTH:                  (# exit 0x0B20 #);
GL_LINE_STIPPLE:                 (# exit 0x0B24 #);
GL_LINE_STIPPLE_PATTERN:         (# exit 0x0B25 #);
GL_LINE_STIPPLE_REPEAT:          (# exit 0x0B26 #);
GL_LINE_WIDTH:                   (# exit 0x0B21 #);
GL_LINE_WIDTH_GRANULARITY:       (# exit 0x0B23 #);
GL_LINE_WIDTH_RANGE:             (# exit 0x0B22 #);

(* Polygons *)
GL_POINT:                        (# exit 0x1B00 #);
GL_LINE:                         (# exit 0x1B01 #);
GL_FILL:                         (# exit 0x1B02 #);
GL_CCW:                          (# exit 0x0901 #);
GL_CW:                           (# exit 0x0900 #);
GL_FRONT:                        (# exit 0x0404 #);
GL_BACK:                         (# exit 0x0405 #);
GL_CULL_FACE:                    (# exit 0x0B44 #);
GL_CULL_FACE_MODE:               (# exit 0x0B45 #);
GL_POLYGON_SMOOTH:               (# exit 0x0B41 #);
GL_POLYGON_STIPPLE:              (# exit 0x0B42 #);
GL_FRONT_FACE:                   (# exit 0x0B46 #);
GL_POLYGON_MODE:                 (# exit 0x0B40 #);
GL_POLYGON_OFFSET_FACTOR:        (# exit 0x8038 #);
GL_POLYGON_OFFSET_UNITS:         (# exit 0x2A00 #);
GL_POLYGON_OFFSET_POINT:         (# exit 0x2A01 #);
GL_POLYGON_OFFSET_LINE:          (# exit 0x2A02 #);
GL_POLYGON_OFFSET_FILL:          (# exit 0x8037 #);

(* Display Lists *)
GL_COMPILE:                      (# exit 0x1300 #);
GL_COMPILE_AND_EXECUTE:          (# exit 0x1301 #);
GL_LIST_BASE:                    (# exit 0x0B32 #);
GL_LIST_INDEX:                   (# exit 0x0B33 #);
GL_LIST_MODE:                    (# exit 0x0B30 #);

(* Depth buffer *)
GL_NEVER:                        (# exit 0x0200 #);
GL_LESS:                         (# exit 0x0201 #);
GL_GEQUAL:                       (# exit 0x0206 #);
GL_LEQUAL:                       (# exit 0x0203 #);
GL_GREATER:                      (# exit 0x0204 #);
GL_NOTEQUAL:                     (# exit 0x0205 #);
GL_EQUAL:                        (# exit 0x0202 #);
GL_ALWAYS:                       (# exit 0x0207 #);
GL_DEPTH_TEST:                   (# exit 0x0B71 #);
GL_DEPTH_BITS:                   (# exit 0x0D56 #);
GL_DEPTH_CLEAR_VALUE:            (# exit 0x0B73 #);
GL_DEPTH_FUNC:                   (# exit 0x0B74 #);
GL_DEPTH_RANGE:                  (# exit 0x0B70 #);
GL_DEPTH_WRITEMASK:              (# exit 0x0B72 #);
GL_DEPTH_COMPONENT:              (# exit 0x1902 #);

(* Lighting *)
GL_LIGHTING:                     (# exit 0x0B50 #);
GL_LIGHT0:                       (# exit 0x4000 #);
GL_LIGHT1:                       (# exit 0x4001 #);
GL_LIGHT2:                       (# exit 0x4002 #);
GL_LIGHT3:                       (# exit 0x4003 #);
GL_LIGHT4:                       (# exit 0x4004 #);
GL_LIGHT5:                       (# exit 0x4005 #);
GL_LIGHT6:                       (# exit 0x4006 #);
GL_LIGHT7:                       (# exit 0x4007 #);
GL_SPOT_EXPONENT:                (# exit 0x1205 #);
GL_SPOT_CUTOFF:                  (# exit 0x1206 #);
GL_CONSTANT_ATTENUATION:         (# exit 0x1207 #);
GL_LINEAR_ATTENUATION:           (# exit 0x1208 #);
GL_QUADRATIC_ATTENUATION:        (# exit 0x1209 #);
GL_AMBIENT:                      (# exit 0x1200 #);
GL_DIFFUSE:                      (# exit 0x1201 #);
GL_SPECULAR:                     (# exit 0x1202 #);
GL_SHININESS:                    (# exit 0x1601 #);
GL_EMISSION:                     (# exit 0x1600 #);
GL_POSITION:                     (# exit 0x1203 #);
GL_SPOT_DIRECTION:               (# exit 0x1204 #);
GL_AMBIENT_AND_DIFFUSE:          (# exit 0x1602 #);
GL_COLOR_INDEXES:                (# exit 0x1603 #);
GL_LIGHT_MODEL_TWO_SIDE:         (# exit 0x0B52 #);
GL_LIGHT_MODEL_LOCAL_VIEWER:     (# exit 0x0B51 #);
GL_LIGHT_MODEL_AMBIENT:          (# exit 0x0B53 #);
GL_FRONT_AND_BACK:               (# exit 0x0408 #);
GL_SHADE_MODEL:                  (# exit 0x0B54 #);
GL_FLAT:                         (# exit 0x1D00 #);
GL_SMOOTH:                       (# exit 0x1D01 #);
GL_COLOR_MATERIAL:               (# exit 0x0B57 #);
GL_COLOR_MATERIAL_FACE:          (# exit 0x0B55 #);
GL_COLOR_MATERIAL_PARAMETER:     (# exit 0x0B56 #);
GL_NORMALIZE:                    (# exit 0x0BA1 #);

(* User clipping planes *)
GL_CLIP_PLANE0:                  (# exit 0x3000 #);
GL_CLIP_PLANE1:                  (# exit 0x3001 #);
GL_CLIP_PLANE2:                  (# exit 0x3002 #);
GL_CLIP_PLANE3:                  (# exit 0x3003 #);
GL_CLIP_PLANE4:                  (# exit 0x3004 #);
GL_CLIP_PLANE5:                  (# exit 0x3005 #);

(* Accumulation buffer *)
GL_ACCUM_RED_BITS:               (# exit 0x0D58 #);
GL_ACCUM_GREEN_BITS:             (# exit 0x0D59 #);
GL_ACCUM_BLUE_BITS:              (# exit 0x0D5A #);
GL_ACCUM_ALPHA_BITS:             (# exit 0x0D5B #);
GL_ACCUM_CLEAR_VALUE:            (# exit 0x0B80 #);
GL_ACCUM:                        (# exit 0x0100 #);
GL_ADD:                          (# exit 0x0104 #);
GL_LOAD:                         (# exit 0x0101 #);
GL_MULT:                         (# exit 0x0103 #);
GL_RETURN:                       (# exit 0x0102 #);

(* Alpha testing *)
GL_ALPHA_TEST:                   (# exit 0x0BC0 #);
GL_ALPHA_TEST_REF:               (# exit 0x0BC2 #);
GL_ALPHA_TEST_FUNC:              (# exit 0x0BC1 #);

(* Blending *)
GL_BLEND:                        (# exit 0x0BE2 #);
GL_BLEND_SRC:                    (# exit 0x0BE1 #);
GL_BLEND_DST:                    (# exit 0x0BE0 #);
GL_ZERO:                         (# exit 0 #);
GL_ONE:                          (# exit 1 #);
GL_SRC_COLOR:                    (# exit 0x0300 #);
GL_ONE_MINUS_SRC_COLOR:          (# exit 0x0301 #);
GL_DST_COLOR:                    (# exit 0x0306 #);
GL_ONE_MINUS_DST_COLOR:          (# exit 0x0307 #);
GL_SRC_ALPHA:                    (# exit 0x0302 #);
GL_ONE_MINUS_SRC_ALPHA:          (# exit 0x0303 #);
GL_DST_ALPHA:                    (# exit 0x0304 #);
GL_ONE_MINUS_DST_ALPHA:          (# exit 0x0305 #);
GL_SRC_ALPHA_SATURATE:           (# exit 0x0308 #);
GL_CONSTANT_COLOR:               (# exit 0x8001 #);
GL_ONE_MINUS_CONSTANT_COLOR:     (# exit 0x8002 #);
GL_CONSTANT_ALPHA:               (# exit 0x8003 #);
GL_ONE_MINUS_CONSTANT_ALPHA:     (# exit 0x8004 #);

(* Render Mode *)
GL_FEEDBACK:                     (# exit 0x1C01 #);
GL_RENDER:                       (# exit 0x1C00 #);
GL_SELECT:                       (# exit 0x1C02 #);

(* Feedback *)
GL_2D:                           (# exit 0x0600 #);
GL_3D:                           (# exit 0x0601 #);
GL_3D_COLOR:                     (# exit 0x0602 #);
GL_3D_COLOR_TEXTURE:             (# exit 0x0603 #);
GL_4D_COLOR_TEXTURE:             (# exit 0x0604 #);
GL_POINT_TOKEN:                  (# exit 0x0701 #);
GL_LINE_TOKEN:                   (# exit 0x0702 #);
GL_LINE_RESET_TOKEN:             (# exit 0x0707 #);
GL_POLYGON_TOKEN:                (# exit 0x0703 #);
GL_BITMAP_TOKEN:                 (# exit 0x0704 #);
GL_DRAW_PIXEL_TOKEN:             (# exit 0x0705 #);
GL_COPY_PIXEL_TOKEN:             (# exit 0x0706 #);
GL_PASS_THROUGH_TOKEN:           (# exit 0x0700 #);
GL_FEEDBACK_BUFFER_POINTER:      (# exit 0x0DF0 #);
GL_FEEDBACK_BUFFER_SIZE:         (# exit 0x0DF1 #);
GL_FEEDBACK_BUFFER_TYPE:         (# exit 0x0DF2 #);


(* Fog *)
GL_FOG:                          (# exit 0x0B60 #);
GL_FOG_MODE:                     (# exit 0x0B65 #);
GL_FOG_DENSITY:                  (# exit 0x0B62 #);
GL_FOG_COLOR:                    (# exit 0x0B66 #);
GL_FOG_INDEX:                    (# exit 0x0B61 #);
GL_FOG_START:                    (# exit 0x0B63 #);
GL_FOG_END:                      (# exit 0x0B64 #);
GL_LINEAR:                       (# exit 0x2601 #);
GL_EXP:                          (# exit 0x0800 #);
GL_EXP2:                         (# exit 0x0801 #);

(* Logic Ops *)
GL_LOGIC_OP:                     (# exit 0x0BF1 #);
GL_INDEX_LOGIC_OP:               (# exit 0x0BF1 #);
GL_COLOR_LOGIC_OP:               (# exit 0x0BF2 #);
GL_LOGIC_OP_MODE:                (# exit 0x0BF0 #);
GL_CLEAR:                        (# exit 0x1500 #);
GL_SET:                          (# exit 0x150F #);
GL_COPY:                         (# exit 0x1503 #);
GL_COPY_INVERTED:                (# exit 0x150C #);
GL_NOOP:                         (# exit 0x1505 #);
GL_INVERT:                       (# exit 0x150A #);
GL_AND:                          (# exit 0x1501 #);
GL_NAND:                         (# exit 0x150E #);
GL_OR:                           (# exit 0x1507 #);
GL_NOR:                          (# exit 0x1508 #);
GL_XOR:                          (# exit 0x1506 #);
GL_EQUIV:                        (# exit 0x1509 #);
GL_AND_REVERSE:                  (# exit 0x1502 #);
GL_AND_INVERTED:                 (# exit 0x1504 #);
GL_OR_REVERSE:                   (# exit 0x150B #);
GL_OR_INVERTED:                  (# exit 0x150D #);

(* Stencil *)
GL_STENCIL_TEST:                 (# exit 0x0B90 #);
GL_STENCIL_WRITEMASK:            (# exit 0x0B98 #);
GL_STENCIL_BITS:                 (# exit 0x0D57 #);
GL_STENCIL_FUNC:                 (# exit 0x0B92 #);
GL_STENCIL_VALUE_MASK:           (# exit 0x0B93 #);
GL_STENCIL_REF:                  (# exit 0x0B97 #);
GL_STENCIL_FAIL:                 (# exit 0x0B94 #);
GL_STENCIL_PASS_DEPTH_PASS:      (# exit 0x0B96 #);
GL_STENCIL_PASS_DEPTH_FAIL:      (# exit 0x0B95 #);
GL_STENCIL_CLEAR_VALUE:          (# exit 0x0B91 #);
GL_STENCIL_INDEX:                (# exit 0x1901 #);
GL_KEEP:                         (# exit 0x1E00 #);
GL_REPLACE:                      (# exit 0x1E01 #);
GL_INCR:                         (# exit 0x1E02 #);
GL_DECR:                         (# exit 0x1E03 #);

(* Buffers, Pixel Drawing/Reading *)
GL_NONE:                         (# exit 0 #);
GL_LEFT:                         (# exit 0x0406 #);
GL_RIGHT:                        (# exit 0x0407 #);

                                    (*GL_FRONT:                      (# exit 0x0404 #); *)
                                    (*GL_BACK:                       (# exit 0x0405 #); *)
                                    (*GL_FRONT_AND_BACK:             (# exit 0x0408 #); *)
GL_FRONT_LEFT:                   (# exit 0x0400 #);
GL_FRONT_RIGHT:                  (# exit 0x0401 #);
GL_BACK_LEFT:                    (# exit 0x0402 #);
GL_BACK_RIGHT:                   (# exit 0x0403 #);
GL_AUX0:                         (# exit 0x0409 #);
GL_AUX1:                         (# exit 0x040A #);
GL_AUX2:                         (# exit 0x040B #);
GL_AUX3:                         (# exit 0x040C #);
GL_COLOR_INDEX:                  (# exit 0x1900 #);
GL_RED:                          (# exit 0x1903 #);
GL_GREEN:                        (# exit 0x1904 #);
GL_BLUE:                         (# exit 0x1905 #);
GL_ALPHA:                        (# exit 0x1906 #);
GL_LUMINANCE:                    (# exit 0x1909 #);
GL_LUMINANCE_ALPHA:              (# exit 0x190A #);
GL_ALPHA_BITS:                   (# exit 0x0D55 #);
GL_RED_BITS:                     (# exit 0x0D52 #);
GL_GREEN_BITS:                   (# exit 0x0D53 #);
GL_BLUE_BITS:                    (# exit 0x0D54 #);
GL_INDEX_BITS:                   (# exit 0x0D51 #);
GL_SUBPIXEL_BITS:                (# exit 0x0D50 #);
GL_AUX_BUFFERS:                  (# exit 0x0C00 #);
GL_READ_BUFFER:                  (# exit 0x0C02 #);
GL_DRAW_BUFFER:                  (# exit 0x0C01 #);
GL_DOUBLEBUFFER:                 (# exit 0x0C32 #);
GL_STEREO:                       (# exit 0x0C33 #);
GL_BITMAP:                       (# exit 0x1A00 #);
GL_COLOR:                        (# exit 0x1800 #);
GL_DEPTH:                        (# exit 0x1801 #);
GL_STENCIL:                      (# exit 0x1802 #);
GL_DITHER:                       (# exit 0x0BD0 #);
GL_RGB:                          (# exit 0x1907 #);
GL_RGBA:                         (# exit 0x1908 #);

(* Implementation limits *)
GL_MAX_LIST_NESTING:             (# exit 0x0B31 #);
GL_MAX_ATTRIB_STACK_DEPTH:       (# exit 0x0D35 #);
GL_MAX_MODELVIEW_STACK_DEPTH:    (# exit 0x0D36 #);
GL_MAX_NAME_STACK_DEPTH:         (# exit 0x0D37 #);
GL_MAX_PROJECTION_STACK_DEPTH:   (# exit 0x0D38 #);
GL_MAX_TEXTURE_STACK_DEPTH:      (# exit 0x0D39 #);
GL_MAX_EVAL_ORDER:               (# exit 0x0D30 #);
GL_MAX_LIGHTS:                   (# exit 0x0D31 #);
GL_MAX_CLIP_PLANES:              (# exit 0x0D32 #);
GL_MAX_TEXTURE_SIZE:             (# exit 0x0D33 #);
GL_MAX_PIXEL_MAP_TABLE:          (# exit 0x0D34 #);
GL_MAX_VIEWPORT_DIMS:            (# exit 0x0D3A #);
GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: (# exit 0x0D3B #);

(* Gets *)
GL_ATTRIB_STACK_DEPTH:           (# exit 0x0BB0 #);
GL_CLIENT_ATTRIB_STACK_DEPTH:    (# exit 0x0BB1 #);
GL_COLOR_CLEAR_VALUE:            (# exit 0x0C22 #);
GL_COLOR_WRITEMASK:              (# exit 0x0C23 #);
GL_CURRENT_INDEX:                (# exit 0x0B01 #);
GL_CURRENT_COLOR:                (# exit 0x0B00 #);
GL_CURRENT_NORMAL:               (# exit 0x0B02 #);
GL_CURRENT_RASTER_COLOR:         (# exit 0x0B04 #);
GL_CURRENT_RASTER_DISTANCE:      (# exit 0x0B09 #);
GL_CURRENT_RASTER_INDEX:         (# exit 0x0B05 #);
GL_CURRENT_RASTER_POSITION:      (# exit 0x0B07 #);
GL_CURRENT_RASTER_TEXTURE_COORDS: (# exit 0x0B06 #);
GL_CURRENT_RASTER_POSITION_VALID: (# exit 0x0B08 #);
GL_CURRENT_TEXTURE_COORDS:       (# exit 0x0B03 #);
GL_INDEX_CLEAR_VALUE:            (# exit 0x0C20 #);
GL_INDEX_MODE:                   (# exit 0x0C30 #);
GL_INDEX_WRITEMASK:              (# exit 0x0C21 #);
GL_MODELVIEW_MATRIX:             (# exit 0x0BA6 #);
GL_MODELVIEW_STACK_DEPTH:        (# exit 0x0BA3 #);
GL_NAME_STACK_DEPTH:             (# exit 0x0D70 #);
GL_PROJECTION_MATRIX:            (# exit 0x0BA7 #);
GL_PROJECTION_STACK_DEPTH:       (# exit 0x0BA4 #);
GL_RENDER_MODE:                  (# exit 0x0C40 #);
GL_RGBA_MODE:                    (# exit 0x0C31 #);
GL_TEXTURE_MATRIX:               (# exit 0x0BA8 #);
GL_TEXTURE_STACK_DEPTH:          (# exit 0x0BA5 #);
GL_VIEWPORT:                     (# exit 0x0BA2 #);


(* Evaluators *)
GL_AUTO_NORMAL:                  (# exit 0x0D80 #);
GL_MAP1_COLOR_4:                 (# exit 0x0D90 #);
GL_MAP1_GRID_DOMAIN:             (# exit 0x0DD0 #);
GL_MAP1_GRID_SEGMENTS:           (# exit 0x0DD1 #);
GL_MAP1_INDEX:                   (# exit 0x0D91 #);
GL_MAP1_NORMAL:                  (# exit 0x0D92 #);
GL_MAP1_TEXTURE_COORD_1:         (# exit 0x0D93 #);
GL_MAP1_TEXTURE_COORD_2:         (# exit 0x0D94 #);
GL_MAP1_TEXTURE_COORD_3:         (# exit 0x0D95 #);
GL_MAP1_TEXTURE_COORD_4:         (# exit 0x0D96 #);
GL_MAP1_VERTEX_3:                (# exit 0x0D97 #);
GL_MAP1_VERTEX_4:                (# exit 0x0D98 #);
GL_MAP2_COLOR_4:                 (# exit 0x0DB0 #);
GL_MAP2_GRID_DOMAIN:             (# exit 0x0DD2 #);
GL_MAP2_GRID_SEGMENTS:           (# exit 0x0DD3 #);
GL_MAP2_INDEX:                   (# exit 0x0DB1 #);
GL_MAP2_NORMAL:                  (# exit 0x0DB2 #);
GL_MAP2_TEXTURE_COORD_1:         (# exit 0x0DB3 #);
GL_MAP2_TEXTURE_COORD_2:         (# exit 0x0DB4 #);
GL_MAP2_TEXTURE_COORD_3:         (# exit 0x0DB5 #);
GL_MAP2_TEXTURE_COORD_4:         (# exit 0x0DB6 #);
GL_MAP2_VERTEX_3:                (# exit 0x0DB7 #);
GL_MAP2_VERTEX_4:                (# exit 0x0DB8 #);
GL_COEFF:                        (# exit 0x0A00 #);
GL_DOMAIN:                       (# exit 0x0A02 #);
GL_ORDER:                        (# exit 0x0A01 #);

(* Hints *)
GL_FOG_HINT:                     (# exit 0x0C54 #);
GL_LINE_SMOOTH_HINT:             (# exit 0x0C52 #);
GL_PERSPECTIVE_CORRECTION_HINT:  (# exit 0x0C50 #);
GL_POINT_SMOOTH_HINT:            (# exit 0x0C51 #);
GL_POLYGON_SMOOTH_HINT:          (# exit 0x0C53 #);
GL_DONT_CARE:                    (# exit 0x1100 #);
GL_FASTEST:                      (# exit 0x1101 #);
GL_NICEST:                       (# exit 0x1102 #);

(* Scissor box *)
GL_SCISSOR_TEST:                 (# exit 0x0C11 #);
GL_SCISSOR_BOX:                  (# exit 0x0C10 #);

(* Pixel Mode / Transfer *)
GL_MAP_COLOR:                    (# exit 0x0D10 #);
GL_MAP_STENCIL:                  (# exit 0x0D11 #);
GL_INDEX_SHIFT:                  (# exit 0x0D12 #);
GL_INDEX_OFFSET:                 (# exit 0x0D13 #);
GL_RED_SCALE:                    (# exit 0x0D14 #);
GL_RED_BIAS:                     (# exit 0x0D15 #);
GL_GREEN_SCALE:                  (# exit 0x0D18 #);
GL_GREEN_BIAS:                   (# exit 0x0D19 #);
GL_BLUE_SCALE:                   (# exit 0x0D1A #);
GL_BLUE_BIAS:                    (# exit 0x0D1B #);
GL_ALPHA_SCALE:                  (# exit 0x0D1C #);
GL_ALPHA_BIAS:                   (# exit 0x0D1D #);
GL_DEPTH_SCALE:                  (# exit 0x0D1E #);
GL_DEPTH_BIAS:                   (# exit 0x0D1F #);
GL_PIXEL_MAP_S_TO_S_SIZE:        (# exit 0x0CB1 #);
GL_PIXEL_MAP_I_TO_I_SIZE:        (# exit 0x0CB0 #);
GL_PIXEL_MAP_I_TO_R_SIZE:        (# exit 0x0CB2 #);
GL_PIXEL_MAP_I_TO_G_SIZE:        (# exit 0x0CB3 #);
GL_PIXEL_MAP_I_TO_B_SIZE:        (# exit 0x0CB4 #);
GL_PIXEL_MAP_I_TO_A_SIZE:        (# exit 0x0CB5 #);
GL_PIXEL_MAP_R_TO_R_SIZE:        (# exit 0x0CB6 #);
GL_PIXEL_MAP_G_TO_G_SIZE:        (# exit 0x0CB7 #);
GL_PIXEL_MAP_B_TO_B_SIZE:        (# exit 0x0CB8 #);
GL_PIXEL_MAP_A_TO_A_SIZE:        (# exit 0x0CB9 #);
GL_PIXEL_MAP_S_TO_S:             (# exit 0x0C71 #);
GL_PIXEL_MAP_I_TO_I:             (# exit 0x0C70 #);
GL_PIXEL_MAP_I_TO_R:             (# exit 0x0C72 #);
GL_PIXEL_MAP_I_TO_G:             (# exit 0x0C73 #);
GL_PIXEL_MAP_I_TO_B:             (# exit 0x0C74 #);
GL_PIXEL_MAP_I_TO_A:             (# exit 0x0C75 #);
GL_PIXEL_MAP_R_TO_R:             (# exit 0x0C76 #);
GL_PIXEL_MAP_G_TO_G:             (# exit 0x0C77 #);
GL_PIXEL_MAP_B_TO_B:             (# exit 0x0C78 #);
GL_PIXEL_MAP_A_TO_A:             (# exit 0x0C79 #);
GL_PACK_ALIGNMENT:               (# exit 0x0D05 #);
GL_PACK_LSB_FIRST:               (# exit 0x0D01 #);
GL_PACK_ROW_LENGTH:              (# exit 0x0D02 #);
GL_PACK_SKIP_PIXELS:             (# exit 0x0D04 #);
GL_PACK_SKIP_ROWS:               (# exit 0x0D03 #);
GL_PACK_SWAP_BYTES:              (# exit 0x0D00 #);
GL_UNPACK_ALIGNMENT:             (# exit 0x0CF5 #);
GL_UNPACK_LSB_FIRST:             (# exit 0x0CF1 #);
GL_UNPACK_ROW_LENGTH:            (# exit 0x0CF2 #);
GL_UNPACK_SKIP_PIXELS:           (# exit 0x0CF4 #);
GL_UNPACK_SKIP_ROWS:             (# exit 0x0CF3 #);
GL_UNPACK_SWAP_BYTES:            (# exit 0x0CF0 #);
GL_ZOOM_X:                       (# exit 0x0D16 #);
GL_ZOOM_Y:                       (# exit 0x0D17 #);

(* Texture mapping *)
GL_TEXTURE_ENV:                  (# exit 0x2300 #);
GL_TEXTURE_ENV_MODE:             (# exit 0x2200 #);
GL_TEXTURE_1D:                   (# exit 0x0DE0 #);
GL_TEXTURE_2D:                   (# exit 0x0DE1 #);
GL_TEXTURE_WRAP_S:               (# exit 0x2802 #);
GL_TEXTURE_WRAP_T:               (# exit 0x2803 #);
GL_TEXTURE_MAG_FILTER:           (# exit 0x2800 #);
GL_TEXTURE_MIN_FILTER:           (# exit 0x2801 #);
GL_TEXTURE_ENV_COLOR:            (# exit 0x2201 #);
GL_TEXTURE_GEN_S:                (# exit 0x0C60 #);
GL_TEXTURE_GEN_T:                (# exit 0x0C61 #);
GL_TEXTURE_GEN_MODE:             (# exit 0x2500 #);
GL_TEXTURE_BORDER_COLOR:         (# exit 0x1004 #);
GL_TEXTURE_WIDTH:                (# exit 0x1000 #);
GL_TEXTURE_HEIGHT:               (# exit 0x1001 #);
GL_TEXTURE_BORDER:               (# exit 0x1005 #);
GL_TEXTURE_COMPONENTS:           (# exit 0x1003 #);
GL_TEXTURE_RED_SIZE:             (# exit 0x805C #);
GL_TEXTURE_GREEN_SIZE:           (# exit 0x805D #);
GL_TEXTURE_BLUE_SIZE:            (# exit 0x805E #);
GL_TEXTURE_ALPHA_SIZE:           (# exit 0x805F #);
GL_TEXTURE_LUMINANCE_SIZE:       (# exit 0x8060 #);
GL_TEXTURE_INTENSITY_SIZE:       (# exit 0x8061 #);
GL_NEAREST_MIPMAP_NEAREST:       (# exit 0x2700 #);
GL_NEAREST_MIPMAP_LINEAR:        (# exit 0x2702 #);
GL_LINEAR_MIPMAP_NEAREST:        (# exit 0x2701 #);
GL_LINEAR_MIPMAP_LINEAR:         (# exit 0x2703 #);
GL_OBJECT_LINEAR:                (# exit 0x2401 #);
GL_OBJECT_PLANE:                 (# exit 0x2501 #);
GL_EYE_LINEAR:                   (# exit 0x2400 #);
GL_EYE_PLANE:                    (# exit 0x2502 #);
GL_SPHERE_MAP:                   (# exit 0x2402 #);
GL_DECAL:                        (# exit 0x2101 #);
GL_MODULATE:                     (# exit 0x2100 #);
GL_NEAREST:                      (# exit 0x2600 #);
GL_REPEAT:                       (# exit 0x2901 #);
GL_CLAMP:                        (# exit 0x2900 #);
GL_S:                            (# exit 0x2000 #);
GL_T:                            (# exit 0x2001 #);
GL_R:                            (# exit 0x2002 #);
GL_Q:                            (# exit 0x2003 #);
GL_TEXTURE_GEN_R:                (# exit 0x0C62 #);
GL_TEXTURE_GEN_Q:                (# exit 0x0C63 #);

GL_PROXY_TEXTURE_1D:             (# exit 0x8063 #);
GL_PROXY_TEXTURE_2D:             (# exit 0x8064 #);
GL_TEXTURE_PRIORITY:             (# exit 0x8066 #);
GL_TEXTURE_RESIDENT:             (# exit 0x8067 #);
GL_TEXTURE_BINDING_1D:           (# exit 0x8068 #);
GL_TEXTURE_BINDING_2D:           (# exit 0x8069 #);

(* Internal texture formats *)
GL_ALPHA4:                       (# exit 0x803B #);
GL_ALPHA8:                       (# exit 0x803C #);
GL_ALPHA12:                      (# exit 0x803D #);
GL_ALPHA16:                      (# exit 0x803E #);
GL_LUMINANCE4:                   (# exit 0x803F #);
GL_LUMINANCE8:                   (# exit 0x8040 #);
GL_LUMINANCE12:                  (# exit 0x8041 #);
GL_LUMINANCE16:                  (# exit 0x8042 #);
GL_LUMINANCE4_ALPHA4:            (# exit 0x8043 #);
GL_LUMINANCE6_ALPHA2:            (# exit 0x8044 #);
GL_LUMINANCE8_ALPHA8:            (# exit 0x8045 #);
GL_LUMINANCE12_ALPHA4:           (# exit 0x8046 #);
GL_LUMINANCE12_ALPHA12:          (# exit 0x8047 #);
GL_LUMINANCE16_ALPHA16:          (# exit 0x8048 #);
GL_INTENSITY:                    (# exit 0x8049 #);
GL_INTENSITY4:                   (# exit 0x804A #);
GL_INTENSITY8:                   (# exit 0x804B #);
GL_INTENSITY12:                  (# exit 0x804C #);
GL_INTENSITY16:                  (# exit 0x804D #);
GL_R3_G3_B2:                     (# exit 0x2A10 #);
GL_RGB4:                         (# exit 0x804F #);
GL_RGB5:                         (# exit 0x8050 #);
GL_RGB8:                         (# exit 0x8051 #);
GL_RGB10:                        (# exit 0x8052 #);
GL_RGB12:                        (# exit 0x8053 #);
GL_RGB16:                        (# exit 0x8054 #);
GL_RGBA2:                        (# exit 0x8055 #);
GL_RGBA4:                        (# exit 0x8056 #);
GL_RGB5_A1:                      (# exit 0x8057 #);
GL_RGBA8:                        (# exit 0x8058 #);
GL_RGB10_A2:                     (# exit 0x8059 #);
GL_RGBA12:                       (# exit 0x805A #);
GL_RGBA16:                       (# exit 0x805B #);

(* Utility *)
GL_VENDOR:                       (# exit 0x1F00 #);
GL_RENDERER:                     (# exit 0x1F01 #);
GL_VERSION:                      (# exit 0x1F02 #);
GL_EXTENSIONS:                   (# exit 0x1F03 #);

(* Errors *)
GL_INVALID_VALUE:                (# exit 0x0501 #);
GL_INVALID_ENUM:                 (# exit 0x0500 #);
GL_INVALID_OPERATION:            (# exit 0x0502 #);
GL_STACK_OVERFLOW:               (# exit 0x0503 #);
GL_STACK_UNDERFLOW:              (# exit 0x0504 #);
GL_OUT_OF_MEMORY:                (# exit 0x0505 #);

(*
 * 1.0 Extensions
 *)
(* GL_EXT_blend_minmax and GL_EXT_blend_color *)
GL_CONSTANT_COLOR_EXT:           (# exit 0x8001 #);
GL_ONE_MINUS_CONSTANT_COLOR_EXT: (# exit 0x8002 #);
GL_CONSTANT_ALPHA_EXT:           (# exit 0x8003 #);
GL_ONE_MINUS_CONSTANT_ALPHA_EXT: (# exit 0x8004 #);
GL_BLEND_EQUATION_EXT:           (# exit 0x8009 #);
GL_MIN_EXT:                      (# exit 0x8007 #);
GL_MAX_EXT:                      (# exit 0x8008 #);
GL_FUNC_ADD_EXT:                 (# exit 0x8006 #);
GL_FUNC_SUBTRACT_EXT:            (# exit 0x800A #);
GL_FUNC_REVERSE_SUBTRACT_EXT:    (# exit 0x800B #);
GL_BLEND_COLOR_EXT:              (# exit 0x8005 #);

(* GL_EXT_polygon_offset *)
GL_POLYGON_OFFSET_EXT:           (# exit 0x8037 #);
GL_POLYGON_OFFSET_FACTOR_EXT:    (# exit 0x8038 #);
GL_POLYGON_OFFSET_BIAS_EXT:      (# exit 0x8039 #);

(* GL_EXT_vertex_array *)
GL_VERTEX_ARRAY_EXT:                     (# exit 0x8074 #);
GL_NORMAL_ARRAY_EXT:                     (# exit 0x8075 #);
GL_COLOR_ARRAY_EXT:                      (# exit 0x8076 #);
GL_INDEX_ARRAY_EXT:                      (# exit 0x8077 #);
GL_TEXTURE_COORD_ARRAY_EXT:              (# exit 0x8078 #);
GL_EDGE_FLAG_ARRAY_EXT:                  (# exit 0x8079 #);
GL_VERTEX_ARRAY_SIZE_EXT:                (# exit 0x807A #);
GL_VERTEX_ARRAY_TYPE_EXT:                (# exit 0x807B #);
GL_VERTEX_ARRAY_STRIDE_EXT:              (# exit 0x807C #);
GL_VERTEX_ARRAY_COUNT_EXT:               (# exit 0x807D #);
GL_NORMAL_ARRAY_TYPE_EXT:                (# exit 0x807E #);
GL_NORMAL_ARRAY_STRIDE_EXT:              (# exit 0x807F #);
GL_NORMAL_ARRAY_COUNT_EXT:               (# exit 0x8080 #);
GL_COLOR_ARRAY_SIZE_EXT:                 (# exit 0x8081 #);
GL_COLOR_ARRAY_TYPE_EXT:                 (# exit 0x8082 #);
GL_COLOR_ARRAY_STRIDE_EXT:               (# exit 0x8083 #);
GL_COLOR_ARRAY_COUNT_EXT:                (# exit 0x8084 #);
GL_INDEX_ARRAY_TYPE_EXT:                 (# exit 0x8085 #);
GL_INDEX_ARRAY_STRIDE_EXT:               (# exit 0x8086 #);
GL_INDEX_ARRAY_COUNT_EXT:                (# exit 0x8087 #);
GL_TEXTURE_COORD_ARRAY_SIZE_EXT:         (# exit 0x8088 #);
GL_TEXTURE_COORD_ARRAY_TYPE_EXT:         (# exit 0x8089 #);
GL_TEXTURE_COORD_ARRAY_STRIDE_EXT:       (# exit 0x808A #);
GL_TEXTURE_COORD_ARRAY_COUNT_EXT:        (# exit 0x808B #);
GL_EDGE_FLAG_ARRAY_STRIDE_EXT:           (# exit 0x808C #);
GL_EDGE_FLAG_ARRAY_COUNT_EXT:            (# exit 0x808D #);
GL_VERTEX_ARRAY_POINTER_EXT:             (# exit 0x808E #);
GL_NORMAL_ARRAY_POINTER_EXT:             (# exit 0x808F #);
GL_COLOR_ARRAY_POINTER_EXT:              (# exit 0x8090 #);
GL_INDEX_ARRAY_POINTER_EXT:              (# exit 0x8091 #);
GL_TEXTURE_COORD_ARRAY_POINTER_EXT:      (# exit 0x8092 #);
GL_EDGE_FLAG_ARRAY_POINTER_EXT:          (# exit 0x8093 #);

(* GL_EXT_texture_object *)
GL_TEXTURE_PRIORITY_EXT:         (# exit 0x8066 #);
GL_TEXTURE_RESIDENT_EXT:         (# exit 0x8067 #);
GL_TEXTURE_1D_BINDING_EXT:       (# exit 0x8068 #);
GL_TEXTURE_2D_BINDING_EXT:       (# exit 0x8069 #);

(* GL_EXT_texture3D *)
GL_PACK_SKIP_IMAGES_EXT:         (# exit 0x806B #);
GL_PACK_IMAGE_HEIGHT_EXT:        (# exit 0x806C #);
GL_UNPACK_SKIP_IMAGES_EXT:       (# exit 0x806D #);
GL_UNPACK_IMAGE_HEIGHT_EXT:      (# exit 0x806E #);
GL_TEXTURE_3D_EXT:               (# exit 0x806F #);
GL_PROXY_TEXTURE_3D_EXT:         (# exit 0x8070 #);
GL_TEXTURE_DEPTH_EXT:            (# exit 0x8071 #);
GL_TEXTURE_WRAP_R_EXT:           (# exit 0x8072 #);
GL_MAX_3D_TEXTURE_SIZE_EXT:      (# exit 0x8073 #);
GL_TEXTURE_3D_BINDING_EXT:       (# exit 0x806A #);

(* GL_EXT_paletted_texture *)
GL_TABLE_TOO_LARGE_EXT:                  (# exit 0x8031 #);
GL_COLOR_TABLE_FORMAT_EXT:               (# exit 0x80D8 #);
GL_COLOR_TABLE_WIDTH_EXT:                (# exit 0x80D9 #);
GL_COLOR_TABLE_RED_SIZE_EXT:             (# exit 0x80DA #);
GL_COLOR_TABLE_GREEN_SIZE_EXT:           (# exit 0x80DB #);
GL_COLOR_TABLE_BLUE_SIZE_EXT:            (# exit 0x80DC #);
GL_COLOR_TABLE_ALPHA_SIZE_EXT:           (# exit 0x80DD #);
GL_COLOR_TABLE_LUMINANCE_SIZE_EXT:       (# exit 0x80DE #);
GL_COLOR_TABLE_INTENSITY_SIZE_EXT:       (# exit 0x80DF #);
GL_TEXTURE_INDEX_SIZE_EXT:               (# exit 0x80E1 #); (*XXX right value??*)
GL_COLOR_INDEX1_EXT:                     (# exit 0x80E2 #);
GL_COLOR_INDEX2_EXT:                     (# exit 0x80E3 #);
GL_COLOR_INDEX4_EXT:                     (# exit 0x80E4 #);
GL_COLOR_INDEX8_EXT:                     (# exit 0x80E5 #);
GL_COLOR_INDEX12_EXT:                    (# exit 0x80E6 #);
GL_COLOR_INDEX16_EXT:                    (# exit 0x80E7 #);

(* GL_EXT_shared_texture_palette *)
GL_SHARED_TEXTURE_PALETTE_EXT:           (# exit 0x81FB #);


(* GL_EXT_point_parameters *)
GL_POINT_SIZE_MIN_EXT:                   (# exit 0x8126 #);
GL_POINT_SIZE_MAX_EXT:                   (# exit 0x8127 #);
GL_POINT_FADE_THRESHOLD_SIZE_EXT:        (# exit 0x8128 #);
GL_DISTANCE_ATTENUATION_EXT:             (# exit 0x8129 #);


(* GL_NO_ERROR must be zero *)
GL_NO_ERROR: (# exit 0 #);

GL_CURRENT_BIT:          (# exit 0x00000001 #);
GL_POINT_BIT:            (# exit 0x00000002 #);
GL_LINE_BIT:             (# exit 0x00000004 #);
GL_POLYGON_BIT:          (# exit 0x00000008 #);
GL_POLYGON_STIPPLE_BIT:  (# exit 0x00000010 #);
GL_PIXEL_MODE_BIT:       (# exit 0x00000020 #);
GL_LIGHTING_BIT:         (# exit 0x00000040 #);
GL_FOG_BIT:              (# exit 0x00000080 #);
GL_DEPTH_BUFFER_BIT:     (# exit 0x00000100 #);
GL_ACCUM_BUFFER_BIT:     (# exit 0x00000200 #);
GL_STENCIL_BUFFER_BIT:   (# exit 0x00000400 #);
GL_VIEWPORT_BIT:         (# exit 0x00000800 #);
GL_TRANSFORM_BIT:        (# exit 0x00001000 #);
GL_ENABLE_BIT:           (# exit 0x00002000 #);
GL_COLOR_BUFFER_BIT:     (# exit 0x00004000 #);
GL_HINT_BIT:             (# exit 0x00008000 #);
GL_EVAL_BIT:             (# exit 0x00010000 #);
GL_LIST_BIT:             (# exit 0x00020000 #);
GL_TEXTURE_BIT:          (# exit 0x00040000 #);
GL_SCISSOR_BIT:          (# exit 0x00080000 #);
GL_ALL_ATTRIB_BITS:      (# exit 0x000fffff #);


GL_CLIENT_PIXEL_STORE_BIT:       (# exit 0x00000001 #);
GL_CLIENT_VERTEX_ARRAY_BIT:      (# exit 0x00000002 #);
GL_CLIENT_ALL_ATTRIB_BITS:       (# exit 0x0000FFFF #);


(*
 * Miscellaneous
 *)

glClearIndex: External (* Wrapped *)
  (# c: @real (* GLfloat *) 
  enter (c)
  do 'wrapglClearIndex'->CallC;
  #);

glClearColor: (* Wrapped *)
  (#  
     wrapglClearColorfirst: External
       (# red,green: @real;
       enter (red,green)
       #);
     wrapglClearColorsecond: External
       (# blue,alpha: @real;
       enter (blue,alpha)
       #);
     red: @real (* GLclampf *);
     green: @real (* GLclampf *);
     blue: @real (* GLclampf *);
     alpha: @real (* GLclampf *) 
  enter (red, green, blue, alpha)
  do (red,green)->wrapglClearColorfirst;
     (blue,alpha)->wrapglClearColorsecond;  
  #);

glClear: External
  (# mask: @int32u (* GLbitfield *) 
  enter (mask)
  do callStd
  #);

glIndexMask: External
  (# mask: @int32u (* GLuint *) 
  enter (mask)
  do callStd
  #);

glColorMask: External
  (# red: @int8u (* GLboolean *); 
     green: @int8u (* GLboolean *);
     blue: @int8u (* GLboolean *); 
     alpha: @int8u (* GLboolean *) 
  enter (red, green, blue, alpha)
  do callStd
  #);

glAlphaFunc: External
  (# func: @int32u (* GLenum *);
     ref: @real (* GLclampf *) 
  enter (func, ref)
  do callStd
  #);

glBlendFunc: External
  (# sfactor: @int32u (* GLenum *);
     dfactor: @int32u (* GLenum *) 
  enter (sfactor, dfactor)
  do callStd
  #);

glLogicOp: External
  (# opcode: @int32u (* GLenum *) 
  enter (opcode)
  do callStd
  #);

glCullFace: External
  (# mode: @int32u (* GLenum *) 
  enter (mode)
  do callStd
  #);

glFrontFace: External
  (# mode: @int32u (* GLenum *) 
  enter (mode)
  do callStd
  #);

glPointSize: External
  (# size: @real (* GLfloat *);
  enter (size)
  do 'wrapglPointSize'->CallC;
  #);

glLineWidth: External
  (# width: @real (* GLfloat *); 
  enter (width)
  do 'wrapglLineWidth'->CallC;
  #);

glLineStipple: External
  (# factor: @int32 (* GLint *);
     pattern: @int16u (* GLushort *); 
  enter (factor, pattern)
  do callStd
  #);

glPolygonMode: External
  (# face: @int32u (* GLenum *);
     mode: @int32u (* GLenum *); 
  enter (face, mode)
  do callStd
  #);

glPolygonOffset: External  (* removed in gl1.2?*)
  (# factor: @real (* GLfloat *);
     units: @real (* GLfloat *); 
  enter (factor, units)
  do 'wrapglPolygonOffset'->CallC;
  #);

glPolygonStipple: External
  (# mask: @int8u (* GLubyte* *) 
  enter (mask)
  do callStd
  #);

glGetPolygonStipple: External
  (# mask: @int8u (* GLubyte* *) 
  enter (mask)
  do callStd
  #);

glEdgeFlag: External
  (# flag: @int8u (* GLboolean *) 
  enter (flag)
  do callStd
  #);

glEdgeFlagv: External
  (# flag: @int32 (* GLboolean* *) 
  enter (flag)
  do callStd
  #);

glScissor: External
  (# x: @int32 (* GLint *); 
     y: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);
  enter (x, y, width, height)
  do callStd
  #);

glClipPlane: External
  (# plane: @int32u (* GLenum *);
     equation: @int32 (* GLdouble* *); 
  enter (plane, equation)
  do callStd
  #);

glGetClipPlane: External
  (# plane: @int32u (* GLenum *);
     equation: @int32 (* GLdouble* *) 
  enter (plane, equation)
  do callStd
  #);

glDrawBuffer: External
  (# mode: @int32u (* GLenum *); 
  enter (mode)
  do callStd
  #);

glReadBuffer: External
  (# mode: @int32u (* GLenum *); 
  enter (mode)
  do callStd
  #);

glEnable: External
  (# cap: @int32u (* GLenum *) 
  enter (cap)
  do callStd
  #);

glDisable: External
  (# cap: @int32u (* GLenum *) 
  enter (cap)
  do callStd
  #);

glIsEnabled: External
  (# cap: @int32u (* GLenum *);
     result: @int8u (* GLboolean *);
  enter cap
  do callStd
  exit result
  #);


glEnableClientState: External
  (# cap: @int32u (* GLenum *) 
  enter (cap)
  do callStd
  #);  


glDisableClientState: External
  (# cap: @int32u (* GLenum *) 
  enter (cap)
  do callStd
  #);  

glGetBooleanv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLboolean* *); 
  enter (pname, params)
  do callStd
  #);

glGetDoublev: External
  (# pname: @int32u (* GLenum *); 
     params: @int32 (* GLdouble* *); 
  enter (pname, params)
  do callStd
  #);

glGetFloatv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *);
  enter (pname, params)
  do callStd
  #);

glGetIntegerv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (pname, params)
  do callStd
  #);


glPushAttrib: External
  (# mask: @int32u (* GLbitfield *) 
  enter (mask)
  do callStd
  #);

glPopAttrib: External
  (# 
  do callStd
  #);


glPushClientAttrib: External
  (# mask: @int32u (* GLbitfield *) 
  enter (mask)
  do callStd
  #);

glPopClientAttrib: External
  (# 
  do callStd
  #);


glRenderMode: External
  (# mode: @int32u (* GLenum *);
     result: @int32 (* GLint *);
  enter mode
  do callStd;
  exit result
  #);

glGetError: External
  (# error: @int32u (* GLenum *);
  do callStd;
  exit error
  #);

glGetString: External
  (# name: @int32 (* GLubyte* *);
     result: [0]@char (* GLubyte* *);
  enter name
  do callStd;
  exit result
  #);

glFinish: External
  (# 
  do callStd;
  #);

glFlush: External
  (# 
  do callStd;
  #);

glHint: External
  (# target: @int32u (* GLenum *);
     mode: @int32u (* GLenum *); 
  enter (target, mode)
  do callStd;
  #);



(*
 * Depth Buffer
 *)

glClearDepth: External
  (# depth: @real (* GLclampd *) 
  enter (depth)
  do callStd;
  #);

glDepthFunc: External
  (# func: @int32u (* GLenum *) 
  enter (func)
  do callStd;
  #);

glDepthMask: External
  (# flag: @int8u (* GLboolean *) 
  enter (flag)
  do callStd;
  #);

glDepthRange: External
  (# near_val: @real (* GLclampd *);
     far_val: @real (* GLclampd *); 
  enter (near_val, far_val)
  do callStd;
  #);


(*
 * Accumulation Buffer
 *)

glClearAccum: (* Wrapped *)
  (# wrapglClearAccumfirst: External
       (# red,green: @real;
       enter(red,green)
       #);
     wrapglClearAccumsecond: External
       (# blue,alpha: @real;
       enter (blue,alpha)
       #);
     red: @real (* GLfloat *);
     green: @real (* GLfloat *);
     blue: @real (* GLfloat *);
     alpha: @real (* GLfloat *); 
  enter (red, green, blue, alpha)
  do (red,green)->wrapglClearAccumfirst;
     (blue,alpha)->wrapglClearAccumsecond;
  #);

glAccum: External (* wrapped *)
  (# op: @int32u (* GLenum *);
     value: @real (* GLfloat *); 
  enter (op, value)
  do 'wrapglAccum'->CallC;
  #);



(*
 * Transformation
 *)

glMatrixMode: External
  (# mode: @int32u (* GLenum *) 
  enter (mode)
  do callStd;
  #);

glOrtho: (* Wrapped *)
  (# wrapglOrthofirst: External
       (# left,right,bottom: @real;
       enter (left,right,bottom)
       #);
     wrapglOrthosecond: External
       (# top,near,far: @real;
       enter (top,near,far)
       #);
     left: @real (* GLdouble *); 
     right: @real (* GLdouble *);
     bottom: @real (* GLdouble *); 
     top: @real (* GLdouble *);
     near_val: @real (* GLdouble *); 
     far_val: @real (* GLdouble *) 
  enter (left, right, bottom, top, near_val, far_val)
  do
     (left,right,bottom)->wrapglOrthofirst;
     (top,near_val,far_val)->wrapglOrthosecond;
  #);

glFrustum: (* Wrapped *)
  (# wrapglFrustumfirst: External
       (# left,right,bottom: @real;
       enter (left,right,bottom)
       #);
     wrapglFrustumsecond: External
       (# top,near,far: @real;
       enter (top,near,far)
       #);
     left: @real (* GLdouble *);
     right: @real (* GLdouble *);
     bottom: @real (* GLdouble *); 
     top: @real (* GLdouble *);
     near_val: @real (* GLdouble *);
     far_val: @real (* GLdouble *); 
  enter (left, right, bottom, top, near_val, far_val)
  do
     (left,right,bottom)->wrapglFrustumfirst;
     (top,near_val,far_val)->wrapglFrustumsecond;
  #);

glViewport: External
  (# x: @int32 (* GLint *); 
     y: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *); 
  enter (x, y, width, height)
  do callStd
  #);

glPushMatrix: External
  (# 
  do callStd;
  #);

glPopMatrix: External
  (# 
  do callStd;
  #);

glLoadIdentity: External
  (# 
  do callStd;
  #);

glLoadMatrixd: External
  (# m: @int32 (* GLdouble* *) 
  enter (m)
  do callStd;
  #);

glLoadMatrixf: External
  (# m: @int32 (* GLfloat* *) 
  enter (m)
  do callStd;
  #);

glMultMatrixd: External
  (# m: @int32 (* GLdouble* *) 
  enter (m)
  do callStd;
  #);

glMultMatrixf: External
  (# m: @int32 (* GLfloat* *) 
  enter (m)
  do callStd;
  #);

glRotated: (* Wrapped *)
  (# wrapglRotatedfirst: External
       (# angle,x: @real
       enter (angle,x)
       #);
     wrapglRotatedsecond: External
       (# y,z: @real;
       enter (y,z)
       #);
     angle: @real (* GLdouble *);
     x: @real (* GLdouble *);
     y: @real (* GLdouble *); 
     z: @real (* GLdouble *); 
  enter (angle, x, y, z) 
  do (angle,x)->wrapglRotatedfirst;
     (y,z)->wrapglRotatedsecond;
  #);

glRotatef:glRotated(# #);

glScaled: External
  (# x: @real (* GLdouble *); 
     y: @real (* GLdouble *);
     z: @real (* GLdouble *); 
  enter (x, y, z)
  do callStd;
  #);

glScalef:glScaled(# #);

glTranslated: External
  (# x: @real (* GLdouble *);
     y: @real (* GLdouble *); 
     z: @real (* GLdouble *); 
  enter (x, y, z)
  do callStd;
  #);

glTranslatef:glTranslated(# #);

(*
 * Display Lists
 *)

glIsList: External 
  (#  list: @int32 (* GLuint *);
     result: @int8u (* GLboolean *);
  enter list
  do callStd;
  exit result
  #);

glDeleteLists: External
  (# list: @int32 (* GLuint *);
     range: @int32 (* GLsizei *); 
  enter (list, range)
  do callStd;
  #);

glGenLists: External
  (# range: @int32 (* GLsizei *);
     result: @int32u (* GLuint *);
  enter range
  do callStd;
  exit result
  #);

glNewList: External
  (# list: @int32 (* GLuint *);
     mode: @int32u (* GLenum *); 
  enter (list, mode)
  do callStd;
  #);

glEndList: External
  (# 
  do callStd;
  #);

glCallList: External
  (# list: @int32 (* GLuint *); 
  enter (list)
  do callStd;
  #);

glCallLists: External
  (# n: @int32 (* GLsizei *);
     type: @int32u (* GLenum *);
     lists: @int32 (* GLvoid* *); 
  enter (n, type, lists)
  do callStd;
  #);

glListBase: External
  (# base: @int32u (* GLuint *) 
  enter (base)
  do callStd;
  #);



(*
 * Drawing Functions
 *)

glBegin: External
  (# mode: @int32u (* GLenum *) 
  enter (mode)
  do callStd;
  #);

glEnd: External
  (# 
  do callStd;
  #);


glVertex2d: External
  (# x: @real (* GLdouble *);
     y: @real (* GLdouble *); 
  enter (x, y)
  do callStd;
  #);

glVertex2f:glVertex2d(# #);

glVertex2i: External
  (# x: @int32 (* GLint *); 
     y: @int32 (* GLint *); 
  enter (x, y)
  do callStd;
  #);

glVertex2s: External
  (# x: @int16 (* GLshort *); 
     y: @int16 (* GLshort *); 
  enter (x, y)
  do callStd;
  #);

glVertex3d: External
  (# x: @real (* GLdouble *); 
     y: @real (* GLdouble *); 
     z: @real (* GLdouble *); 
  enter (x, y, z)
  do callStd;
  #);

glVertex3f:glVertex3d(# #);

glVertex3i: External
  (# x: @int32 (* GLint *); 
     y: @int32 (* GLint *); 
     z: @int32 (* GLint *); 
  enter (x, y, z)
  do callStd;
  #);

glVertex3s: External
  (# x: @int16 (* GLshort *); 
     y: @int16 (* GLshort *); 
     z: @int16 (* GLshort *); 
  enter (x, y, z)
  do callStd;
  #);

glVertex4d,glVertex4f:
  (# wrapglVertex4d: External
       (# w: @real;
       enter (w)
       #);
     x: @real (* GLdouble *); 
     y: @real (* GLdouble *); 
     z: @real (* GLdouble *); 
     w: @real (* GLdouble *); 
  enter (x, y, z, w)
  do (x,y,z)->wrapset3double;
     (w)->wrapglVertex4d;
  #);

glVertex4i: External
  (# x: @int32 (* GLint *); 
     y: @int32 (* GLint *); 
     z: @int32 (* GLint *); 
     w: @int32 (* GLint *); 
  enter (x, y, z, w)
  do callStd;
  #);

glVertex4s: External
  (# x: @int16 (* GLshort *); 
     y: @int16 (* GLshort *);
     z: @int16 (* GLshort *); 
     w: @int16 (* GLshort *); 
  enter (x, y, z, w)
  do callStd;
  #);

glVertex2dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glVertex2fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glVertex2iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glVertex2sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glVertex3dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glVertex3fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glVertex3iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glVertex3sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glVertex4dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glVertex4fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glVertex4iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glVertex4sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);


glNormal3b: External
  (# nx: @int8 (* GLbyte *); 
     ny: @int8 (* GLbyte *); 
     nz: @int8 (* GLbyte *); 
  enter (nx, ny, nz)
  do callStd;
  #);

glNormal3d: External
  (# nx: @real (* GLdouble *); 
     ny: @real (* GLdouble *); 
     nz: @real (* GLdouble *); 
  enter (nx, ny, nz)
  do callStd;
  #);

glNormal3f: glNormal3d(# #);

glNormal3i: External
  (# nx: @int32 (* GLint *); 
     ny: @int32 (* GLint *); 
     nz: @int32 (* GLint *); 
  enter (nx, ny, nz)
  do callStd;
  #);

glNormal3s: External
  (# nx: @int16 (* GLshort *); 
     ny: @int16 (* GLshort *); 
     nz: @int16 (* GLshort *); 
  enter (nx, ny, nz)
  do callStd;
  #);

glNormal3bv: External
  (# v: @int32 (* GLbyte* *) 
  enter (v)
  do callStd;
  #);

glNormal3dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glNormal3fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glNormal3iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glNormal3sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);


glIndexd: External
  (# c: @real (* GLdouble *) 
  enter (c)
  do callStd;
  #);

glIndexf: glIndexd(# #);

glIndexi: External
  (# c: @int32 (* GLint *); 
  enter (c)
  do callStd;
  #);

glIndexs: External
  (# c: @int16 (* GLshort *); 
  enter (c)
  do callStd;
  #);

glIndexub: External
  (# c: @int8u (* GLubyte *); 
  enter (c)
  do callStd;
  #); 

glIndexdv: External
  (# c: @int32 (* GLdouble* *); 
  enter (c)
  do callStd;
  #);

glIndexfv: External
  (# c: @int32 (* GLfloat* *); 
  enter (c)
  do callStd;
  #);

glIndexiv: External
  (# c: @int32 (* GLint* *); 
  enter (c)
  do callStd;
  #);

glIndexsv: External
  (# c: @int32 (* GLshort* *); 
  enter (c)
  do callStd;
  #);

glIndexubv: External
  (# c: @int32 (* GLubyte* *); 
  enter (c)
  do callStd;
  #);  (* 1.1 *)

glColor3b: External
  (# red: @int8 (* GLbyte *); 
     green: @int8 (* GLbyte *);
     blue: @int8 (* GLbyte *); 
  enter (red, green, blue)
  do callStd;
  #);

glColor3d: External
  (# red: @real (* GLdouble *); 
     green: @real (* GLdouble *); 
     blue: @real (* GLdouble *); 
  enter (red, green, blue)
  do callStd;
  #);

glColor3f: glColor3d(# #);

glColor3i: External
  (# red: @int32 (* GLint *);
     green: @int32 (* GLint *);
     blue: @int32 (* GLint *); 
  enter (red, green, blue)
  do callStd;
  #);

glColor3s: External
  (# red: @int16 (* GLshort *);
     green: @int16 (* GLshort *);
     blue: @int16 (* GLshort *); 
  enter (red, green, blue)
  do callStd;
  #);

glColor3ub: External
  (# red: @int8u (* GLubyte *);
     green: @int8u (* GLubyte *);
     blue: @int8u (* GLubyte *); 
  enter (red, green, blue)
  do callStd;
  #);

glColor3ui: External
  (# red: @int32 (* GLuint *);
     green: @int32 (* GLuint *);
     blue: @int32 (* GLuint *); 
  enter (red, green, blue)
  do callStd;
  #);

glColor3us: External
  (# red: @int16u (* GLushort *);
     green: @int16u (* GLushort *);
     blue: @int16u (* GLushort *); 
  enter (red, green, blue)
  do callStd;
  #);

glColor4b: External
  (# red: @int8 (* GLbyte *);
     green: @int8 (* GLbyte *);
     blue: @int8 (* GLbyte *);
     alpha: @int8 (* GLbyte *); 
  enter (red, green, blue, alpha)
  do callStd;
  #);

glColor4d: 
  (# wrapglColor4d: External
       (# alpha: @real;
       enter alpha
       #);
     red: @real (* GLdouble *);
     green: @real (* GLdouble *);
     blue: @real (* GLdouble *);
     alpha: @real (* GLdouble *); 
  enter (red, green, blue, alpha)
  do (red,green,blue)->wrapset3double;
     alpha->wrapglColor4d;
  #);

glColor4f: glColor4d(# #);

glColor4i: External
  (# red: @int32 (* GLint *);
     green: @int32 (* GLint *);
     blue: @int32 (* GLint *);
     alpha: @int32 (* GLint *); 
  enter (red, green, blue, alpha)
  do callStd;
  #);

glColor4s: External
  (# red: @int16 (* GLshort *);
     green: @int16 (* GLshort *);;
     blue: @int16 (* GLshort *);
     alpha: @int16 (* GLshort *); 
  enter (red, green, blue, alpha)
  do callStd;
  #);

glColor4ub: External
  (# red: @int8u (* GLubyte *);
     green: @int8u (* GLubyte *);;
     blue: @int8u (* GLubyte *);
     alpha: @int8u (* GLubyte *); 
  enter (red, green, blue, alpha)
  do callStd;
  #);

glColor4ui: External
  (# red: @int32 (* GLuint *);
     green: @int32 (* GLuint *);
     blue: @int32 (* GLuint *);
     alpha: @int32 (* GLuint *); 
  enter (red, green, blue, alpha)
  do callStd;
  #);

glColor4us: External
  (# red: @int16u (* GLushort *);
     green: @int16u (* GLushort *);;
     blue: @int16u (* GLushort *);
     alpha: @int16u (* GLushort *); 
  enter (red, green, blue, alpha)
  do callStd;
  #);

glColor3bv: External
  (# v: @int32 (* GLbyte* *) 
  enter (v)
  do callStd;
  #);

glColor3dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glColor3fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glColor3iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glColor3sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glColor3ubv: External
  (# v: @int8u (* GLubyte* *) 
  enter (v)
  do callStd;
  #);

glColor3uiv: External
  (# v: @int32 (* GLuint* *) 
  enter (v)
  do callStd;
  #);

glColor3usv: External
  (# v: @int32 (* GLushort* *) 
  enter (v)
  do callStd;
  #);

glColor4bv: External
  (# v: @int32 (* GLbyte* *) 
  enter (v)
  do callStd;
  #);

glColor4dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glColor4fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  #);

glColor4iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glColor4sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glColor4ubv: External
  (# v: @int8u (* GLubyte* *) 
  enter (v)
  do callStd;
  #);

glColor4uiv: External
  (# v: @int32 (* GLuint* *) 
  enter (v)
  do callStd;
  #);

glColor4usv: External
  (# v: @int32 (* GLushort* *) 
  enter (v)
  do callStd;
  #);


glTexCoord1d: External
  (# s: @real (* GLdouble *) 
  enter (s)
  do callStd;
  #);

glTexCoord1f: External (* Wrapped *)
  (# s: @real (* GLfloat *) 
  enter (s)
  do 'wrapglTexCoord1f'->CallC;
  #);

glTexCoord1i: External
  (# s: @int32 (* GLint *) 
  enter (s)
  do callStd;
  #);

glTexCoord1s: External
  (# s: @int16 (* GLshort *) 
  enter (s)
  do callStd;
  #);

glTexCoord2d: External
  (# s: @real (* GLdouble *);
     t: @real (* GLdouble *); 
  enter (s, t)
  do callStd;
  #);

glTexCoord2f: glTexCoord2d(# #);

glTexCoord2i: External
  (# s: @int32 (* GLint *);
     t: @int32 (* GLint *); 
  enter (s, t)
  do callStd;
  #);

glTexCoord2s: External
  (# s: @int16 (* GLshort *);
     t: @int16 (* GLshort *); 
  enter (s, t)
  do callStd;
  #);

glTexCoord3d: External
  (# s: @real (* GLdouble *);
     t: @real (* GLdouble *);
     r: @real (* GLdouble *); 
  enter (s, t, r)
  do callStd;
  #);

glTexCoord3f: glTexCoord3d(# #);

glTexCoord3i: External
  (# s: @int32 (* GLint *);
     t: @int32 (* GLint *);
     r: @int32 (* GLint *); 
  enter (s, t, r)
  do callStd;
  #);

glTexCoord3s: External
  (# s: @int16 (* GLshort *);
     t: @int16 (* GLshort *);
     r: @int16 (* GLshort *); 
  enter (s, t, r)
  do callStd;
  #);

glTexCoord4d: (*Wrapped*)
  (# wrapglTexCoord4d: External
       (# q: @real;
       enter q
       #);
     s: @real (* GLdouble *);
     t: @real (* GLdouble *);
     r: @real (* GLdouble *);
     q: @real (* GLdouble *); 
  enter (s, t, r, q)
  do (s,t,r)->wrapset3double;
     (q)->wrapglTexCoord4d;
  #);

glTexCoord4f: glTexCoord4d(# #);

glTexCoord4i: External
  (# s: @int32 (* GLint *);
     t: @int32 (* GLint *);
     r: @int32 (* GLint *);
     q: @int32 (* GLint *); 
  enter (s, t, r, q)
  do callStd;
  #);

glTexCoord4s: External
  (# s: @int16 (* GLshort *);
     t: @int16 (* GLshort *);
     r: @int16 (* GLshort *);
     q: @int16 (* GLshort *); 
  enter (s, t, r, q)
  do callStd;
  #);

glTexCoord1dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glTexCoord1fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glTexCoord1iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glTexCoord1sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glTexCoord2dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glTexCoord2fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glTexCoord2iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glTexCoord2sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glTexCoord3dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glTexCoord3fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glTexCoord3iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glTexCoord3sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glTexCoord4dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glTexCoord4fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glTexCoord4iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glTexCoord4sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);


glRasterPos2d: External
  (# x: @real (* GLdouble *);
     y: @real (* GLdouble *); 
  enter (x, y)
  do callStd;
  #);

glRasterPos2f: glRasterPos2d(# #);

glRasterPos2i: External
  (# x: @int32 (* GLint *);
     y: @int32 (* GLint *); 
  enter (x, y)
  do callStd;
  #);

glRasterPos2s: External
  (# x: @int16 (* GLshort *);
     y: @int16 (* GLshort *); 
  enter (x, y)
  do callStd;
  #);

glRasterPos3d: External
  (# x: @real (* GLdouble *);
     y: @real (* GLdouble *);
     z: @real (* GLdouble *); 
  enter (x, y, z)
  do callStd;
  #);

glRasterPos3f: glRasterPos3d(# #);

glRasterPos3i: External
  (# x: @int32 (* GLint *);
     y: @int32 (* GLint *);
     z: @int32 (* GLint *); 
  enter (x, y, z)
  do callStd;
  #);

glRasterPos3s: External
  (# x: @int16 (* GLshort *);
     y: @int16 (* GLshort *);
     z: @int16 (* GLshort *); 
  enter (x, y, z)
  do callStd;
  #);

glRasterPos4d: (* wrapped *)
  (# wrapglRasterPos4d: External
       (# w: @real;
       enter w
       #);
     x: @real (* GLdouble *);
     y: @real (* GLdouble *);
     z: @real (* GLdouble *);
     w: @real (* GLdouble *); 
  enter (x, y, z, w)
  do (x,y,z)->wrapset3double;
     (w)->wrapglRasterPos4d;
  #);

glRasterPos4f: glRasterPos4d(# #);

glRasterPos4i: External
  (# x: @int32 (* GLint *);
     y: @int32 (* GLint *);
     z: @int32 (* GLint *);
     w: @int32 (* GLint *); 
  enter (x, y, z, w)
  do callStd;
  #);

glRasterPos4s: External
  (# x: @int16 (* GLshort *);
     y: @int16 (* GLshort *);
     z: @int16 (* GLshort *);
     w: @int16 (* GLshort *); 
  enter (x, y, z, w)
  do callStd;
  #);

glRasterPos2dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glRasterPos2fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glRasterPos2iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glRasterPos2sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glRasterPos3dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glRasterPos3fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glRasterPos3iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glRasterPos3sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);

glRasterPos4dv: External
  (# v: @int32 (* GLdouble* *) 
  enter (v)
  do callStd;
  #);

glRasterPos4fv: External
  (# v: @int32 (* GLfloat* *) 
  enter (v)
  do callStd;
  #);

glRasterPos4iv: External
  (# v: @int32 (* GLint* *) 
  enter (v)
  do callStd;
  #);

glRasterPos4sv: External
  (# v: @int32 (* GLshort* *) 
  enter (v)
  do callStd;
  #);


glRectd: (* wrapped *)
  (# wrapglRectd: External
       (# y2: @real;
       enter y2
       #);
     x1: @real (* GLdouble *);
     y1: @real (* GLdouble *);
     x2: @real (* GLdouble *);
     y2: @real (* GLdouble *); 
  enter (x1, y1, x2, y2)
  do (x1,y1,x2)->wrapset3double;
     y2->wrapglRectd;
  #);

glRectf: glRectd(# #);

glRecti: External
  (# x1: @int32 (* GLint *);
     y1: @int32 (* GLint *);
     x2: @int32 (* GLint *);
     y2: @int32 (* GLint *); 
  enter (x1, y1, x2, y2)
  do callStd;
  #);

glRects: External
  (# x1: @int16 (* GLshort *);
     y1: @int16 (* GLshort *);
     x2: @int16 (* GLshort *);
     y2: @int16 (* GLshort *); 
  enter (x1, y1, x2, y2)
  do callStd;
  #);

glRectdv: External
  (# v1: @int32 (* GLdouble* *); v2: @int32 (* GLdouble* *) 
  enter (v1, v2)
  do callStd;
  #);

glRectfv: External
  (# v1: @int32 (* GLfloat* *); v2: @int32 (* GLfloat* *) 
  enter (v1, v2)
  do callStd;
  #);

glRectiv: External
  (# v1: @int32 (* GLint* *); v2: @int32 (* GLint* *) 
  enter (v1, v2)
  do callStd;
  #);

glRectsv: External
  (# v1: @int32 (* GLshort* *); v2: @int32 (* GLshort* *) 
  enter (v1,v2)
  #);



(*
 * Vertex Arrays  (1.1)
 *)

glVertexPointer: External
  (# size: @int32 (* GLint *);
     type: @int32u (* GLenum *); 
     stride: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (size, type, stride, ptr)
  do callStd;
  #);

glNormalPointer: External
  (# type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (type, stride, ptr)
  do callStd;
  #);

glColorPointer: External
  (# size: @int32 (* GLint *); 
     type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *) 
  enter (size, type, stride, ptr)
  do callStd;
  #);

glIndexPointer: External
  (# type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (type, stride, ptr)
  do callStd;
  #);

glTexCoordPointer: External
  (# size: @int32 (* GLint *); 
     type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (size, type, stride, ptr)
  do callStd;
  #);

glEdgeFlagPointer: External
  (# stride: @int32 (* GLsizei *);
     ptr: @int32 (* GLboolean* *); 
  enter (stride, ptr)
  do callStd;
  #);

glGetPointerv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* void** *); 
  enter (pname, params)
  do callStd;
  #);

glArrayElement: External
  (# i: @int32 (* GLint *) 
  enter (i)
  do callStd;
  #);

glDrawArrays: External
  (# mode: @int32u (* GLenum *); 
     first: @int32 (* GLint *);
     count: @int32 (* GLsizei *); 
  enter (mode, first, count)
  do callStd;
  #);

glDrawElements: External
  (# mode: @int32u (* GLenum *);; 
     count: @int32 (* GLsizei *);
     type: @int32u (* GLenum *);
     indices: @int32 (* GLvoid* *); 
  enter (mode, count, type, indices)
  do callStd;
  #);

glInterleavedArrays: External
  (# format: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     pointer: @int32 (* GLvoid* *); 
  enter (format, stride, pointer)
  do callStd;
  #);


(*
 * Lighting
 *)

glShadeModel: External
  (# mode: @int32u (* GLenum *) 
  enter (mode)
  do callStd;
  #);

glLightf: External (* Wrapped *)
  (# light: @int32u (* GLenum *);
     pname: @int32u (* GLenum *); 
     param: @real (* GLfloat *); 
  enter (light, pname, param)
  do 'wrapglLightf'->CallC;
  #);

glLighti: External
  (# light: @int32u (* GLenum *); 
     pname: @int32u (* GLenum *); 
     param: @int32 (* GLint *); 
  enter (light, pname, param)
  do callStd;
  #);

glLightfv: External
  (# light: @int32u (* GLenum *);
     pname: @int32u (* GLenum *); 
     params: @int32 (* GLfloat* *); 
  enter (light, pname, params)
  do 'wrapglLightfv'->CallC;
  #);

glLightiv: External
  (# light: @int32u (* GLenum *);
     pname: @int32u (* GLenum *); 
     params: @int32 (* GLint* *); 
  enter (light, pname, params)
  do callStd;
  #);

glGetLightfv: External
  (# light: @int32u (* GLenum *);
     pname: @int32u (* GLenum *); 
     params: @int32 (* GLfloat* *); 
  enter (light, pname, params)
  do callStd;
  #);

glGetLightiv: External
  (# light: @int32u (* GLenum *);
     pname: @int32u (* GLenum *); 
     params: @int32 (* GLint* *); 
  enter (light, pname, params)
  do callStd;
  #);

glLightModelf: External (* wrapped *)
  (# pname: @int32u (* GLenum *);
     param: @real (* GLfloat *);
  enter (pname, param)
  do 'wrapglLightModelf'->CallC;
  #);

glLightModeli: External
  (# pname: @int32u (* GLenum *);
     param: @int32 (* GLint *); 
  enter (pname, param)
  do callStd;
  #);

glLightModelfv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *); 
  enter (pname, params)
  do 'wrapglLightModelfv'->CallC;
  #);

glLightModeliv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (pname, params)
  do callStd;
  #);

glMaterialf: External (* wrapped *)
  (# face: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @real (* GLfloat *); 
  enter (face, pname, param)
  do 'wrapglMaterialf'->CallC;
  #);

glMateriali: External
  (# face: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @int32 (* GLint *); 
  enter (face, pname, param)
  do callStd;
  #);

glMaterialfv: External
  (# face: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *); 
  enter (face, pname, params)
  do 'wrapglMaterialfv'->CallC;
  #);

glMaterialiv: External
  (# face: @int32u (* GLenum *);; 
     pname: @int32u (* GLenum *);; 
     params: @int32 (* GLint* *); 
  enter (face, pname, params)
  do callStd;
  #);

glGetMaterialfv: External
  (# face: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *); 
  enter (face, pname, params)
  do callStd;
  #);

glGetMaterialiv: External
  (# face: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (face, pname, params)
  do callStd;
  #);

glColorMaterial: External
  (# face: @int32u (* GLenum *);
     mode: @int32u (* GLenum *); 
  enter (face, mode)
  do callStd;
  #);




(*
 * Raster functions
 *)

glPixelZoom: External (* wrapped *)
  (# xfactor: @real (* GLfloat *);
     yfactor: @real (* GLfloat *); 
  enter (xfactor, yfactor)
  do 'wrapglPixelZoom'->CallC;
  #);

glPixelStoref: External (* wrapped *)
  (# pname: @int32u (* GLenum *);
     param: @real (* GLfloat *); 
  enter (pname, param)
  do 'wrapglPixelStoref'->CallC;
  #);

glPixelStorei: External
  (# pname: @int32u (* GLenum *);
     param: @int32 (* GLint *); 
  enter (pname, param)
  do callStd;
  #);

glPixelTransferf: External (* wrapped *)
  (# pname: @int32u (* GLenum *);
     param: @real (* GLfloat *); 
  enter (pname, param)
  do 'wrapglPixelTransferf'->CallC;
  #);

glPixelTransferi: External
  (# pname: @int32u (* GLenum *); param: @int32 (* GLint *) 
  enter (pname, param)
  do callStd;
  #);

glPixelMapfv: External
  (# map: @int32u (* GLenum *);
     mapsize: @int32 (* GLint *);
     values: @int32 (* GLfloat* *) 
  enter (map, mapsize, values)
  do callStd;
  #);

glPixelMapuiv: External
  (# map: @int32u (* GLenum *);
     mapsize: @int32 (* GLint *);
     values: @int32 (* GLuint* *); 
  enter (map, mapsize, values)
  do callStd;
  #);

glPixelMapusv: External
  (# map: @int32u (* GLenum *);
     mapsize: @int32 (* GLint *);
     values: @int32 (* GLushort* *); 
  enter (map, mapsize, values)
  do callStd;
  #);

glGetPixelMapfv: External
  (# map: @int32u (* GLenum *);
     values: @int32 (* GLfloat* *); 
  enter (map, values)
  do callStd;
  #);

glGetPixelMapuiv: External
  (# map, values: @int32 (* GLuint* *) 
  enter (map, values)
  do callStd;
  #);

glGetPixelMapusv: External
  (# map: @int32u (* GLenum *);
     values: @int32 (* GLushort* *); 
  enter (map, values)
  do callStd;
  #);

glBitmap: (* wrapped *)
  (# wrapglBitmap: External
       (# width,height: @int32;
          ymove: @real;
          bitmap: @int32;
       enter (width,height,ymove,bitmap)
       #);
     
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);;
     xorig: @real (* GLfloat *);
     yorig: @real (* GLfloat *);;
     xmove: @real (* GLfloat *);
     ymove: @real (* GLfloat *);;
     bitmap: @int32 (* GLubyte* *); 
  enter (width, height, xorig, yorig, xmove, ymove, bitmap)
  do (xorig,yorig,xmove)->wrapset3double;
     (width,height,ymove,bitmap)->wrapglBitmap;
  #);

glReadPixels: External
  (# x: @int32 (* GLint *);
     y: @int32 (* GLint *);;
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);;
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);;
     pixels: @int32 (* GLvoid* *); 
  enter (x, y, width, height, format, type, pixels)
  do callStd;
  #);

glDrawPixels: External
  (# width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);;
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);;
     pixels: @int32 (* GLvoid* *) 
  enter (width, height, format, type, pixels)
  do callStd;
  #);

glCopyPixels: External
  (# x: @int32 (* GLint *);
     y: @int32 (* GLint *);;
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);;
     type: @int32u (* GLenum *); 
  enter (x, y, width, height, type)
  do callStd;
  #);



(*
 * Stenciling
 *)

glStencilFunc: External
  (# func: @int32u (* GLenum *);
     ref: @int32 (* GLint *); 
     mask: @int32 (* GLuint *); 
  enter (func, ref, mask)
  do callStd;
  #);

glStencilMask: External
  (# mask: @int32 (* GLuint *); 
  enter (mask)
  do callStd;
  #);

glStencilOp: External
  (# fail: @int32u (* GLenum *); 
     zfail: @int32u (* GLenum *); 
     zpass: @int32u (* GLenum *); 
  enter (fail, zfail, zpass)
  do callStd;
  #);

glClearStencil: External
  (# s: @int32 (* GLint *); 
  enter (s)
  do callStd;
  #);



(*
 * Texture mapping
 *)

glTexGend: External
  (# coord: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @real (* GLdouble *); 
  enter (coord, pname, param)
  do callStd;
  #);

glTexGenf: glTexGend(# #);

glTexGeni: External
  (# coord: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @int32 (* GLint *); 
  enter (coord, pname, param)
  do callStd;
  #);

glTexGendv: External
  (# coord: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLdouble* *); 
  enter (coord, pname, params)
  do callStd;
  #);

glTexGenfv: glTexGendv(# #);

glTexGeniv: External
  (# coord: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (coord, pname, params)
  do callStd;
  #);

glGetTexGendv: External
  (# coord: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLdouble* *); 
  enter (coord, pname, params)
  do callStd;
  #);

glGetTexGenfv: glGetTexGendv(# #);

glGetTexGeniv: External
  (# coord: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (coord, pname, params)
  do callStd;
  #);


glTexEnvf: External (* wrapped *)
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @real (* GLfloat *); 
  enter (target, pname, param)
     do 'wrapglTexEnvf'->CallC;
  #);

glTexEnvi: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @int32 (* GLint *); 
  enter (target, pname, param)
  do callStd;
  #);

glTexEnvfv: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *); 
  enter (target, pname, params)
  do callStd;
  #);

glTexEnviv: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (target, pname, params)
  do callStd;
  #);

glGetTexEnvfv: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *); 
  enter (target, pname, params)
  do callStd;
  #);

glGetTexEnviv: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (target, pname, params)
  do callStd;
  #);

glTexParameterf: External (* wrapped *)
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @real (* GLfloat *); 
  enter (target, pname, param)
  do 'wrapglTexParameterf'->CallC;
  #);

glTexParameteri: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     param: @int32 (* GLint *); 
  enter (target, pname, param)
  do callStd;
  #);

glTexParameterfv: External
  (# target: @int32u (* GLenum *); pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *) 
  enter (target, pname, params)
  do callStd;
  #);

glTexParameteriv: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);;
     params: @int32 (* GLint* *); 
  enter (target, pname, params)
  do callStd;
  #);

glGetTexParameterfv: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *); params: @int32 (* GLfloat* *)
  enter (target, pname, params)
  do callStd;
  #);

glGetTexParameteriv: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *); params: @int32 (* GLint* *) 
  enter (target, pname, params)
  do callStd;
  #);

glGetTexLevelParameterfv: External
  (# target: @int32u (* GLenum *); level: @int32 (* GLint *);
     pname: @int32u (* GLenum *); params: @int32 (* GLfloat* *) 
  enter (target, level, pname, params)
  do callStd;
  #);

glGetTexLevelParameteriv: External
  (# target: @int32u (* GLenum *); level: @int32 (* GLint *);
     pname: @int32u (* GLenum *); params: @int32 (* GLint* *) 
  enter (target, level, pname, params)
  do callStd;
  #);


glTexImage1D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);;
     internalFormat: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     border: @int32 (* GLint *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     pixels: @int32 (* GLvoid* *); 
  enter (target, level, internalFormat, width, border, format, type, pixels)
  do callStd;
  #);

glTexImage2D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     internalFormat: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);
     border: @int32 (* GLint *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     pixels: @int32 (* GLvoid* *); 
  enter (target, level, internalFormat, width, height, border, format, type, pixels)
  do callStd;
  #);

glGetTexImage: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     pixels: @int32 (* GLvoid* *); 
  enter (target, level, format, type, pixels)
  do callStd;
  #);



(* 1.1 functions *)

glGenTextures: External
  (# n: @int32 (* GLsizei *);
     textures: @int32 (* GLuint* *); 
  enter (n, textures)
  do callStd;
  #);

glDeleteTextures: External
  (# n: @int32 (* GLsizei *);
     textures: @int32 (* GLuint* *);
  enter (n, textures)
  do callStd;
  #);

glBindTexture: External
  (# target: @int32u (* GLenum *);
     texture: @int32 (* GLuint *); 
  enter (target, texture)
  do callStd;
  #);

glPrioritizeTextures: External
  (# n: @int32 (* GLsizei *);
     textures: @int32 (* GLuint* *);
     priorities: @int32 (* GLclampf* *) 
  enter (n, textures, priorities)
  do callStd;
  #);

glAreTexturesResident: External
  (# n: @int32 (* GLsizei *);
     textures: @int32 (* GLuint* *);
     residences: @int32 (* GLboolean* *); 
     result: @int8u (* GLboolean *);
  enter (n, textures, residences)
  do callStd;
  exit result
  #);

glIsTexture: External
  (# texture: @int32 (* GLuint *); 
     result: @int8u (* GLboolean *);
  enter texture
  do callStd;
  exit result
  #);


glTexSubImage1D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     xoffset: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     pixels: @int32 (* GLvoid* *); 
  enter (target, level, xoffset, width, format, type, pixels)
  do callStd;
  #);


glTexSubImage2D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     xoffset: @int32 (* GLint *);
     yoffset: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     pixels: @int32 (* GLvoid* *); 
  enter (target, level, xoffset, yoffset, width, height, format, type, pixels)
  do callStd;
  #);


glCopyTexImage1D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     internalformat: @int32u (* GLenum *);;
     x: @int32 (* GLint *);
     y: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     border: @int32 (* GLint *); 
  enter (target, level, internalformat, x, y, width, border)
  do callStd;
  #);


glCopyTexImage2D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     internalformat: @int32u (* GLenum *);;
     x: @int32 (* GLint *);
     y: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);
     border: @int32 (* GLint *); 
  enter (target, level, internalformat, x, y, width, height, border)
  do callStd;
  #);


glCopyTexSubImage1D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     xoffset: @int32 (* GLint *);
     x: @int32 (* GLint *);; 
     y: @int32 (* GLint *);
     width: @int32 (* GLsizei *); 
  enter (target, level, xoffset, x, y, width)
  do callStd;
  #);


glCopyTexSubImage2D: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     xoffset: @int32 (* GLint *);
     yoffset: @int32 (* GLint *);
     x: @int32 (* GLint *);
     y: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *); 
  enter (target, level, xoffset, yoffset, x, y, width, height)
  do callStd;
  #);




(*
 * Evaluators
 *)

glMap1d: External
  (# target: @int32u (* GLenum *);
     u1: @real (* GLdouble *);
     u2: @real (* GLdouble *);
     stride: @int32 (* GLint *);
     order: @int32 (* GLint *);
     points: @int32 (* GLdouble* *); 
  enter (target, u1, u2, stride, order, points)
  do callStd;
  #);

glMap1f: External
  (# target: @int32u (* GLenum *);
     u1: @real (* GLfloat *);
     u2: @real (* GLfloat *);
     stride: @int32 (* GLint *);
     order: @int32 (* GLint *);
     points: @int32 (* GLfloat* *); 
  enter (target, u1, u2, stride, order, points)
  do callStd;
  #);

glMap2d: (* wrapped *)
  (# wrapglMap2d: External
       (# v2: @real;
          target: @int32u;
          ustride: @int32;
          uorder: @int32;
          vstride: @int32;
          vorder: @int32;
          points: @int32;
       enter (v2,target,ustride,uorder,vstride,vorder,points)
       #);
     target: @int32u (* GLenum *);
     u1: @real (* GLdouble *);
     u2: @real (* GLdouble *);
     ustride: @int32 (* GLint *);
     uorder: @int32 (* GLint *);
     v1: @real (* GLdouble *);
     v2: @real (* GLdouble *);
     vstride: @int32 (* GLint *);
     vorder: @int32 (* GLint *);;
     points: @int32 (* GLdouble* *);
  enter (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points)
  do (u1,u2,v1)->wrapset3double;
     (v2,target,ustride,uorder,vstride,vorder,points)->wrapglMap2d;
  #);

glMap2f: glMap2d(# #);

glGetMapdv: External
  (# target: @int32u (* GLenum *);
     query: @int32u (* GLenum *);
     v: @int32 (* GLdouble* *); 
  enter (target, query, v)
  do callStd;
  #);

glGetMapfv: External
  (# target: @int32u (* GLenum *);
     query: @int32u (* GLenum *);
     v: @int32 (* GLfloat* *); 
  enter (target, query, v)
  do callStd;
  #);

glGetMapiv: External
  (# target: @int32u (* GLenum *);
     query: @int32u (* GLenum *);
     v: @int32 (* GLint* *); 
  enter (target, query, v)
  do callStd;
  #);

glEvalCoord1d: External
  (# u: @real (* GLdouble *); 
  enter (u)
  do callStd;
  #);

glEvalCoord1f: glEvalCoord1d(# #);

glEvalCoord1dv: External
  (# u: @int32 (* GLdouble* *) 
  enter (u)
  do callStd;
  #);

glEvalCoord1fv: glEvalCoord1dv(# #);

glEvalCoord2d: External
  (# u: @real (* GLdouble *);
     v: @real (* GLdouble *); 
  enter (u, v)
  do callStd;
  #);

glEvalCoord2f: glEvalCoord2d(# #);

glEvalCoord2dv: External
  (# u: @int32 (* GLdouble* *) 
  enter (u)
  do callStd;
  #);

glEvalCoord2fv: glEvalCoord2dv(# #);;

glMapGrid1d: External
  (# un: @int32 (* GLint *);
     u1: @real (* GLdouble *);
     u2: @real (* GLdouble *); 
  enter (un, u1, u2)
  do callStd;
  #);

glMapGrid1f: glMapGrid1d(# #);

glMapGrid2d: (*Wrapped*)
  (# wrapglMapGrid2d: External
       (# v2: @real;
          un: @int32;
          vn: @int32;
       enter(v2,un,vn)
       #);
     
     un: @int32 (* GLint *);
     u1: @real (* GLdouble *);
     u2: @real (* GLdouble *);
     vn: @int32 (* GLint *);
     v1: @real (* GLdouble *);
     v2: @real (* GLdouble *); 
  enter (un, u1, u2, vn, v1, v2)
  do (u1,u2,v1)->wrapset3double;
     (v2,un,vn)->wrapglMapGrid2d;
  #);

glMapGrid2f: glMapGrid2d(# #);

glEvalPoint1: External
  (# i: @int32 (* GLint *) 
  enter (i)
  do callStd;
  #);

glEvalPoint2: External
  (# i: @int32 (* GLint *);
     j: @int32 (* GLint *); 
  enter (i, j)
  do callStd;
  #);

glEvalMesh1: External
  (# mode: @int32u (* GLenum *);
     i1: @int32 (* GLint *);
     i2: @int32 (* GLint *); 
  enter (mode, i1, i2)
  do callStd;
  #);

glEvalMesh2: External
  (# mode: @int32u (* GLenum *);
     i1: @int32 (* GLint *);
     i2: @int32 (* GLint *);
     j1: @int32 (* GLint *);
     j2: @int32 (* GLint *); 
  enter (mode, i1, i2, j1, j2)
  do callStd;
  #);



(*
 * Fog
 *)

glFogf: External (* wrapped *)
  (# pname: @int32u (* GLenum *);
     param: @real (* GLfloat *); 
  enter (pname, param)
  do 'wrapglFogf'->CallC;
  #);

glFogi: External
  (# pname: @int32u (* GLenum *);
     param: @int32 (* GLint *); 
  enter (pname, param)
  do callStd;
  #);

glFogfv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *); 
  enter (pname, params)
  do callStd;
  #);

glFogiv: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *); 
  enter (pname, params)
  do callStd;
  #);



(*
 * Selection and Feedback
 *)

glFeedbackBuffer: External
  (# size: @int32 (* GLsizei *);
     type: @int32u (* GLenum *);
     buffer: @int32 (* GLfloat* *); 
  enter (size, type, buffer)
  do callStd;
  #);

glPassThrough: External (* wrapped *)
  (# token: @real (* GLfloat *); 
  enter (token)
  do 'wrapglPassThrough'->CallC;
  #);

glSelectBuffer: External
  (# size: @int32 (* GLsizei *);
     buffer: @int32 (* GLuint* *); 
  enter (size, buffer)
  do callStd;
  #);

glInitNames: External
  (# 
  do callStd;
  #);

glLoadName: External
  (# name: @int32 (* GLuint *); 
  enter (name)
  do callStd;
  #);

glPushName: External
  (# name: @int32 (* GLuint *); 
  enter (name)
  do callStd;
  #);

glPopName: External
  (# 
  do callStd;
  #);



(*
 * 1.0 Extensions
 *)

(* GL_EXT_blend_minmax *)
glBlendEquationEXT: External
  (# mode: @int32u (* GLenum *); 
  enter (mode)
  do callStd;
  #);



(* GL_EXT_blend_color *)
glBlendColorEXT: (* Wrapped *)
  (# wrapglBlendColorEXT: External
       (# alpha: @real;
       enter alpha
       #);
     red: @real (* GLclampf *);
     green: @real (* GLclampf *);;
     blue: @real (* GLclampf *);
     alpha: @real (* GLclampf *); 
  enter (red, green, blue, alpha)
  do (red,green,blue)->wrapset3double;
     (* alpha->wrapglBlendColorEXT; 
      * not supported on all platforms       
      *)
  #);



(* GL_EXT_polygon_offset *)
(* Don't work *)
glPolygonOffsetEXT: External (* Wrapped *)
  (# factor: @real (* GLfloat *);
     bias: @real (* GLfloat *); 
  enter (factor, bias)
  do (* 'wrapglPolygonOffsetEXT'->CallC; *)
  #);



(* GL_EXT_vertex_array *)

glVertexPointerEXT: External
  (# size: @int32 (* GLint *);
     type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     count: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (size, type, stride, count, ptr)
  do callStd;
  #);

glNormalPointerEXT: External
  (# type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     count: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (type, stride, count, ptr)
  do callStd;
  #);

glColorPointerEXT: External
  (# size: @int32 (* GLint *);
     type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     count: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (size, type, stride, count, ptr)
  do callStd;
  #);

glIndexPointerEXT: External
  (# type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     count: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (type, stride, count, ptr)
  do callStd;
  #);

glTexCoordPointerEXT: External
  (# size: @int32 (* GLint *);
     type: @int32u (* GLenum *);
     stride: @int32 (* GLsizei *);
     count: @int32 (* GLsizei *);
     ptr: @int32 (* GLvoid* *); 
  enter (size, type, stride, count, ptr)
  do callStd;
  #);

glEdgeFlagPointerEXT: External
  (# stride: @int32 (* GLsizei *);
     count: @int32 (* GLsizei *);
     ptr: @int32 (* GLboolean* *); 
  enter (stride, count, ptr)
  do callStd;
  #);

glGetPointervEXT: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* void** *); 
  enter (pname, params)
  do callStd;
  #);

glArrayElementEXT: External
  (# i: @int32 (* GLint *); 
  enter (i)
  do callStd;
  #);

glDrawArraysEXT: External
  (# mode: @int32u (* GLenum *);
     first: @int32 (* GLint *);
     count: @int32 (* GLsizei *); 
  enter (mode, first, count)
  do callStd;
  #);



(* GL_EXT_texture_object *)

glGenTexturesEXT: External
  (# n: @int32 (* GLsizei *);
     textures: @int32 (* GLuint* *); 
  enter (n, textures)
  do callStd;
  #);

glDeleteTexturesEXT: External
  (# n: @int32 (* GLsizei *);;
     textures: @int32 (* GLuint* *);
  enter (n, textures)
  do callStd;
  #);

glBindTextureEXT: External
  (# target: @int32u (* GLenum *);
     texture: @int32 (* GLuint *); 
  enter (target, texture)
  do callStd;
  #);

glPrioritizeTexturesEXT: External
  (# n: @int32 (* GLsizei *);
     textures: @int32 (* GLuint* *);
     priorities: @int32 (* GLclampf* *); 
  enter (n, priorities)
  do callStd;
  #);

glAreTexturesResidentEXT: External
  (#  n: @int32 (* GLsizei *);
     textures: @int32 (* GLuint* *);
     residences: @int32 (* GLboolean* *);
     result: @int8u (* GLboolean *)
  enter (n, textures, residences)
  do callStd;
  exit result
  #);

glIsTextureEXT: External
  (# texture: @int32 (* GLuint *);
     result: @int8u (* GLboolean *);
  enter (texture)
  do callStd;
  exit (result)
  #);


(* GL_EXT_texture3D *)

glTexImage3DEXT: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     internalFormat: @int32u (* GLenum *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);
     depth: @int32 (* GLsizei *);
     border: @int32 (* GLint *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     pixels: @int32 (* GLvoid* *);
  enter (target, level, internalFormat, width, height, depth, border, format, type, pixels)
  do callStd;
  #);

glTexSubImage3DEXT: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     xoffset: @int32 (* GLint *);
     yoffset: @int32 (* GLint *);
     zoffset: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);
     depth: @int32 (* GLsizei *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     pixels: @int32 (* GLvoid* *);
  enter (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels)
  do callStd;
  #);

glCopyTexSubImage3DEXT: External
  (# target: @int32u (* GLenum *);
     level: @int32 (* GLint *);
     xoffset: @int32 (* GLint *);
     yoffset: @int32 (* GLint *);
     zoffset: @int32 (* GLint *);
     x: @int32 (* GLint *);
     y: @int32 (* GLint *);
     width: @int32 (* GLsizei *);
     height: @int32 (* GLsizei *);
  enter (target, level, xoffset, yoffset, zoffset, x, y, width, height)
  do callStd;
  #);



(* EXT_color_table *)

glColorTableEXT: External
  (# target: @int32u (* GLenum *);
     internalformat: @int32u (* GLenum *);
     width: @int32 (* GLsizei *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     table: @int32 (* GLvoid* *);
  enter (target, internalformat, width, format, type, table)
  do callStd;
  #);

glColorSubTableEXT: External
  (# target: @int32u (* GLenum *);
     start: @int32 (* GLsizei *);
     count: @int32 (* GLsizei *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     data: @int32 (* GLvoid* *);
  enter (target, start, count, format, type, data)
  do callStd;
  #);

glGetColorTableEXT: External
  (# target: @int32u (* GLenum *);
     format: @int32u (* GLenum *);
     type: @int32u (* GLenum *);
     table: @int32 (* GLvoid* *);
  enter (target, format, type, table)
  do callStd;
  #);

glGetColorTableParameterfvEXT: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *);
  enter (target, pname, params)
  do callStd;
  #);

glGetColorTableParameterivEXT: External
  (# target: @int32u (* GLenum *);
     pname: @int32u (* GLenum *);
     params: @int32 (* GLint* *) 
  enter (target, pname, params)
  do callStd;
  #);



(* GL_EXT_point_parameters *)

glPointParameterfEXT: External (* wrapped *)
  (# pname: @int32u (* GLenum *);
     param: @real (* GLfloat *);
  enter (pname, param)
  do (* 'wrapglPointParameterfEXT'->CallC; *)
  #);

glPointParameterfvEXT: External
  (# pname: @int32u (* GLenum *);
     params: @int32 (* GLfloat* *);
  enter (pname, params)
  do callStd;
  #);




(* wrapper function *)
wrapset3double: External
  (# d1,d2,d3: @real;
  enter(d1,d2,d3)
  #)


23.6 OpenGLlib Interface
© 1994-2002 Mjølner Informatics
[Modified: Wednesday February 24th 1999 at 21:38]