'' tinygl.bi - FreeBASIC header for TinyGL
'' Converted from Bellard's gl.h

#Pragma Once
#inclib "TinyGL"

Extern "C"

'' -----------------------------------------------------------------------------
'' Constants & Enums
'' -----------------------------------------------------------------------------

Const GL_VERSION_1_1 = 1

#if 0
  '' Data types
  Const GL_BYTE           = &h1400
  Const GL_UNSIGNED_BYTE  = &h1401
  Const GL_SHORT          = &h1402
  Const GL_UNSIGNED_SHORT = &h1403
  Const GL_INT            = &h1404
  Const GL_UNSIGNED_INT   = &h1405
  Const GL_FLOAT          = &h1406
  Const GL_DOUBLE         = &h140A
  Const GL_2_BYTES        = &h1407
  Const GL_3_BYTES        = &h1408
  Const GL_4_BYTES        = &h1409
  
  '' Primitives
  Const GL_LINES          = &h0001
  Const GL_POINTS         = &h0000
  Const GL_LINE_STRIP     = &h0003
  Const GL_LINE_LOOP      = &h0002
  Const GL_TRIANGLES      = &h0004
  Const GL_TRIANGLE_STRIP = &h0005
  Const GL_TRIANGLE_FAN   = &h0006
  Const GL_QUADS          = &h0007
  Const GL_QUAD_STRIP     = &h0008
  Const GL_POLYGON        = &h0009
  Const GL_EDGE_FLAG      = &h0B43
  
  '' Matrix Mode
  Const GL_MATRIX_MODE = &h0BA0
  Const GL_MODELVIEW   = &h1700
  Const GL_PROJECTION  = &h1701
  Const GL_TEXTURE     = &h1702
  
  '' Depth buffer
  Const GL_NEVER    = &h0200
  Const GL_LESS     = &h0201
  Const GL_GEQUAL   = &h0206
  Const GL_LEQUAL   = &h0203
  Const GL_GREATER  = &h0204
  Const GL_NOTEQUAL = &h0205
  Const GL_EQUAL    = &h0202
  Const GL_ALWAYS   = &h0207
  Const GL_DEPTH_TEST = &h0B71
  Const GL_DEPTH_BUFFER_BIT = &h00000100
  Const GL_COLOR_BUFFER_BIT = &h00004000
  
  '' Lighting
  Const GL_LIGHTING = &h0B50
  Const GL_LIGHT0   = &h4000
  Const GL_LIGHT1   = &h4001
  Const GL_AMBIENT  = &h1200
  Const GL_DIFFUSE  = &h1201
  Const GL_SPECULAR = &h1202
  Const GL_POSITION = &h1203
  Const GL_SMOOTH   = &h1D01
  Const GL_FLAT     = &h1D00
  
  '' Polygon
  Const GL_CULL_FACE = &h0B44
  Const GL_FRONT     = &h0404
  Const GL_BACK      = &h0405
  Const GL_CCW       = &h0901
  Const GL_CW        = &h0900
  
  '' Texture
  Const GL_TEXTURE_2D = &h0DE1
  Const GL_RGB        = &h1907
  Const GL_RGBA       = &h1908
  Const GL_NEAREST    = &h2600
  Const GL_LINEAR     = &h2601
  Const GL_REPEAT     = &h2901
  Const GL_CLAMP      = &h2900
#endif

enum
	'/* Boolean values */
	GL_FALSE			= 0
	GL_TRUE				= 1

	'/* Data types */
	GL_BYTE				= &h1400
	GL_UNSIGNED_BYTE		= &h1401
	GL_SHORT			= &h1402
	GL_UNSIGNED_SHORT		= &h1403
	GL_INT				= &h1404
	GL_UNSIGNED_INT			= &h1405
	GL_FLOAT			= &h1406
	GL_DOUBLE			= &h140A
	GL_2_BYTES			= &h1407
	GL_3_BYTES			= &h1408
	GL_4_BYTES			= &h1409

	'/* Primitives */
	GL_LINES			= &h0001
	GL_POINTS			= &h0000
	GL_LINE_STRIP			= &h0003
	GL_LINE_LOOP			= &h0002
	GL_TRIANGLES			= &h0004
	GL_TRIANGLE_STRIP		= &h0005
	GL_TRIANGLE_FAN			= &h0006
	GL_QUADS			= &h0007
	GL_QUAD_STRIP			= &h0008
	GL_POLYGON			= &h0009
	GL_EDGE_FLAG			= &h0B43

	'/* Vertex Arrays */
	GL_VERTEX_ARRAY			= &h8074
	GL_NORMAL_ARRAY			= &h8075
	GL_COLOR_ARRAY			= &h8076
	GL_INDEX_ARRAY			= &h8077
	GL_TEXTURE_COORD_ARRAY		= &h8078
	GL_EDGE_FLAG_ARRAY		= &h8079
	GL_VERTEX_ARRAY_SIZE		= &h807A
	GL_VERTEX_ARRAY_TYPE		= &h807B
	GL_VERTEX_ARRAY_STRIDE		= &h807C
	GL_VERTEX_ARRAY_COUNT		= &h807D
	GL_NORMAL_ARRAY_TYPE		= &h807E
	GL_NORMAL_ARRAY_STRIDE		= &h807F
	GL_NORMAL_ARRAY_COUNT		= &h8080
	GL_COLOR_ARRAY_SIZE		= &h8081
	GL_COLOR_ARRAY_TYPE		= &h8082
	GL_COLOR_ARRAY_STRIDE		= &h8083
	GL_COLOR_ARRAY_COUNT		= &h8084
	GL_INDEX_ARRAY_TYPE		= &h8085
	GL_INDEX_ARRAY_STRIDE		= &h8086
	GL_INDEX_ARRAY_COUNT		= &h8087
	GL_TEXTURE_COORD_ARRAY_SIZE	= &h8088
	GL_TEXTURE_COORD_ARRAY_TYPE	= &h8089
	GL_TEXTURE_COORD_ARRAY_STRIDE	= &h808A
	GL_TEXTURE_COORD_ARRAY_COUNT	= &h808B
	GL_EDGE_FLAG_ARRAY_STRIDE	= &h808C
	GL_EDGE_FLAG_ARRAY_COUNT	= &h808D
	GL_VERTEX_ARRAY_POINTER		= &h808E
	GL_NORMAL_ARRAY_POINTER		= &h808F
	GL_COLOR_ARRAY_POINTER		= &h8090
	GL_INDEX_ARRAY_POINTER		= &h8091
	GL_TEXTURE_COORD_ARRAY_POINTER	= &h8092
	GL_EDGE_FLAG_ARRAY_POINTER	= &h8093
        GL_V2F				= &h2A20
	GL_V3F				= &h2A21
	GL_C4UB_V2F			= &h2A22
	GL_C4UB_V3F			= &h2A23
	GL_C3F_V3F			= &h2A24
	GL_N3F_V3F			= &h2A25
	GL_C4F_N3F_V3F			= &h2A26
	GL_T2F_V3F			= &h2A27
	GL_T4F_V4F			= &h2A28
	GL_T2F_C4UB_V3F			= &h2A29
	GL_T2F_C3F_V3F			= &h2A2A
	GL_T2F_N3F_V3F			= &h2A2B
	GL_T2F_C4F_N3F_V3F		= &h2A2C
	GL_T4F_C4F_N3F_V4F		= &h2A2D

	'/* Matrix Mode */
	GL_MATRIX_MODE			= &h0BA0
	GL_MODELVIEW			= &h1700
	GL_PROJECTION			= &h1701
	GL_TEXTURE			= &h1702

	'/* Points */
	GL_POINT_SMOOTH			= &h0B10
	GL_POINT_SIZE			= &h0B11
	GL_POINT_SIZE_GRANULARITY 	= &h0B13
	GL_POINT_SIZE_RANGE		= &h0B12

	'/* Lines */
	GL_LINE_SMOOTH			= &h0B20
	GL_LINE_STIPPLE			= &h0B24
	GL_LINE_STIPPLE_PATTERN		= &h0B25
	GL_LINE_STIPPLE_REPEAT		= &h0B26
	GL_LINE_WIDTH			= &h0B21
	GL_LINE_WIDTH_GRANULARITY	= &h0B23
	GL_LINE_WIDTH_RANGE		= &h0B22

	'/* Polygons */
	GL_POINT			= &h1B00
	GL_LINE				= &h1B01
	GL_FILL				= &h1B02
	GL_CCW				= &h0901
	GL_CW				= &h0900
	GL_FRONT			= &h0404
	GL_BACK				= &h0405
	GL_CULL_FACE			= &h0B44
	GL_CULL_FACE_MODE		= &h0B45
	GL_POLYGON_SMOOTH		= &h0B41
	GL_POLYGON_STIPPLE		= &h0B42
	GL_FRONT_FACE			= &h0B46
	GL_POLYGON_MODE			= &h0B40
	GL_POLYGON_OFFSET_FACTOR	= &h3038
	GL_POLYGON_OFFSET_UNITS		= &h2A00
	GL_POLYGON_OFFSET_POINT		= &h2A01
	GL_POLYGON_OFFSET_LINE		= &h2A02
	GL_POLYGON_OFFSET_FILL		= &h8037

	'/* Display Lists */
	GL_COMPILE			= &h1300
	GL_COMPILE_AND_EXECUTE		= &h1301
	GL_LIST_BASE			= &h0B32
	GL_LIST_INDEX			= &h0B33
	GL_LIST_MODE			= &h0B30

	'/* Depth buffer */
	GL_NEVER			= &h0200
	GL_LESS				= &h0201
	GL_GEQUAL			= &h0206
	GL_LEQUAL			= &h0203
	GL_GREATER			= &h0204
	GL_NOTEQUAL			= &h0205
	GL_EQUAL			= &h0202
	GL_ALWAYS			= &h0207
	GL_DEPTH_TEST			= &h0B71
	GL_DEPTH_BITS			= &h0D56
	GL_DEPTH_CLEAR_VALUE		= &h0B73
	GL_DEPTH_FUNC			= &h0B74
	GL_DEPTH_RANGE			= &h0B70
	GL_DEPTH_WRITEMASK		= &h0B72
	GL_DEPTH_COMPONENT		= &h1902

	'/* Lighting */
	GL_LIGHTING			= &h0B50
	GL_LIGHT0			= &h4000
	GL_LIGHT1			= &h4001
	GL_LIGHT2			= &h4002
	GL_LIGHT3			= &h4003
	GL_LIGHT4			= &h4004
	GL_LIGHT5			= &h4005
	GL_LIGHT6			= &h4006
	GL_LIGHT7			= &h4007
	GL_SPOT_EXPONENT		= &h1205
	GL_SPOT_CUTOFF			= &h1206
	GL_CONSTANT_ATTENUATION		= &h1207
	GL_LINEAR_ATTENUATION		= &h1208
	GL_QUADRATIC_ATTENUATION	= &h1209
	GL_AMBIENT			= &h1200
	GL_DIFFUSE			= &h1201
	GL_SPECULAR			= &h1202
	GL_SHININESS			= &h1601
	GL_EMISSION			= &h1600
	GL_POSITION			= &h1203
	GL_SPOT_DIRECTION		= &h1204
	GL_AMBIENT_AND_DIFFUSE		= &h1602
	GL_COLOR_INDEXES		= &h1603
	GL_LIGHT_MODEL_TWO_SIDE		= &h0B52
	GL_LIGHT_MODEL_LOCAL_VIEWER	= &h0B51
	GL_LIGHT_MODEL_AMBIENT		= &h0B53
	GL_FRONT_AND_BACK		= &h0408
	GL_SHADE_MODEL			= &h0B54
	GL_FLAT				= &h1D00
	GL_SMOOTH			= &h1D01
	GL_COLOR_MATERIAL		= &h0B57
	GL_COLOR_MATERIAL_FACE		= &h0B55
	GL_COLOR_MATERIAL_PARAMETER	= &h0B56
	GL_NORMALIZE			= &h0BA1

	'/* User clipping planes */
	GL_CLIP_PLANE0			= &h3000
	GL_CLIP_PLANE1			= &h3001
	GL_CLIP_PLANE2			= &h3002
	GL_CLIP_PLANE3			= &h3003
	GL_CLIP_PLANE4			= &h3004
	GL_CLIP_PLANE5			= &h3005

	'/* Accumulation buffer */
	GL_ACCUM_RED_BITS		= &h0D58
	GL_ACCUM_GREEN_BITS		= &h0D59
	GL_ACCUM_BLUE_BITS		= &h0D5A
	GL_ACCUM_ALPHA_BITS		= &h0D5B
	GL_ACCUM_CLEAR_VALUE		= &h0B80
	GL_ACCUM			= &h0100
	GL_ADD				= &h0104
	GL_LOAD				= &h0101
	GL_MULT				= &h0103
	GL_RETURN			= &h0102

	'/* Alpha testing */
	GL_ALPHA_TEST			= &h0BC0
	GL_ALPHA_TEST_REF		= &h0BC2
	GL_ALPHA_TEST_FUNC		= &h0BC1

	'/* Blending */
	GL_BLEND			= &h0BE2
	GL_BLEND_SRC			= &h0BE1
	GL_BLEND_DST			= &h0BE0
	GL_ZERO				= 0
	GL_ONE				= 1
	GL_SRC_COLOR			= &h0300
	GL_ONE_MINUS_SRC_COLOR		= &h0301
	GL_DST_COLOR			= &h0306
	GL_ONE_MINUS_DST_COLOR		= &h0307
	GL_SRC_ALPHA			= &h0302
	GL_ONE_MINUS_SRC_ALPHA		= &h0303
	GL_DST_ALPHA			= &h0304
	GL_ONE_MINUS_DST_ALPHA		= &h0305
	GL_SRC_ALPHA_SATURATE		= &h0308
	GL_CONSTANT_COLOR		= &h8001
	GL_ONE_MINUS_CONSTANT_COLOR	= &h8002
	GL_CONSTANT_ALPHA		= &h8003
	GL_ONE_MINUS_CONSTANT_ALPHA	= &h8004

	'/* Render Mode */
	GL_FEEDBACK			= &h1C01
	GL_RENDER			= &h1C00
	GL_SELECT			= &h1C02

	'/* Feedback */
	GL_2D				= &h0600
	GL_3D				= &h0601
	GL_3D_COLOR			= &h0602
	GL_3D_COLOR_TEXTURE		= &h0603
	GL_4D_COLOR_TEXTURE		= &h0604
	GL_POINT_TOKEN			= &h0701
	GL_LINE_TOKEN			= &h0702
	GL_LINE_RESET_TOKEN		= &h0707
	GL_POLYGON_TOKEN		= &h0703
	GL_BITMAP_TOKEN			= &h0704
	GL_DRAW_PIXEL_TOKEN		= &h0705
	GL_COPY_PIXEL_TOKEN		= &h0706
	GL_PASS_THROUGH_TOKEN		= &h0700

	'/* Fog */
	GL_FOG				= &h0B60
	GL_FOG_MODE			= &h0B65
	GL_FOG_DENSITY			= &h0B62
	GL_FOG_COLOR			= &h0B66
	GL_FOG_INDEX			= &h0B61
	GL_FOG_START			= &h0B63
	GL_FOG_END			= &h0B64
	GL_LINEAR			= &h2601
	GL_EXP				= &h0800
	GL_EXP2				= &h0801

	'/* Logic Ops */
	GL_LOGIC_OP			= &h0BF1
	GL_LOGIC_OP_MODE		= &h0BF0
	GL_CLEAR			= &h1500
	GL_SET				= &h150F
	GL_COPY				= &h1503
	GL_COPY_INVERTED		= &h150C
	GL_NOOP				= &h1505
	GL_INVERT			= &h150A
	GL_AND				= &h1501
	GL_NAND				= &h150E
	GL_OR				= &h1507
	GL_NOR				= &h1508
	GL_XOR				= &h1506
	GL_EQUIV			= &h1509
	GL_AND_REVERSE			= &h1502
	GL_AND_INVERTED			= &h1504
	GL_OR_REVERSE			= &h150B
	GL_OR_INVERTED			= &h150D

	'/* Stencil */
	GL_STENCIL_TEST			= &h0B90
	GL_STENCIL_WRITEMASK		= &h0B98
	GL_STENCIL_BITS			= &h0D57
	GL_STENCIL_FUNC			= &h0B92
	GL_STENCIL_VALUE_MASK		= &h0B93
	GL_STENCIL_REF			= &h0B97
	GL_STENCIL_FAIL			= &h0B94
	GL_STENCIL_PASS_DEPTH_PASS	= &h0B96
	GL_STENCIL_PASS_DEPTH_FAIL	= &h0B95
	GL_STENCIL_CLEAR_VALUE		= &h0B91
	GL_STENCIL_INDEX		= &h1901
	GL_KEEP				= &h1E00
	GL_REPLACE			= &h1E01
	GL_INCR				= &h1E02
	GL_DECR				= &h1E03

	'/* Buffers Pixel Drawing/Reading */
	GL_NONE				= 0
	GL_LEFT				= &h0406
	GL_RIGHT			= &h0407
	'/*GL_FRONT			= &h0404 */
	'/*GL_BACK			= &h0405 */
	'/*GL_FRONT_AND_BACK		= &h0408 */
	GL_FRONT_LEFT			= &h0400
	GL_FRONT_RIGHT			= &h0401
	GL_BACK_LEFT			= &h0402
	GL_BACK_RIGHT			= &h0403
	GL_AUX0				= &h0409
	GL_AUX1				= &h040A
	GL_AUX2				= &h040B
	GL_AUX3				= &h040C
	GL_COLOR_INDEX			= &h1900
	GL_RED				= &h1903
	GL_GREEN			= &h1904
	GL_BLUE				= &h1905
	GL_ALPHA			= &h1906
	GL_LUMINANCE			= &h1909
	GL_LUMINANCE_ALPHA		= &h190A
	GL_ALPHA_BITS			= &h0D55
	GL_RED_BITS			= &h0D52
	GL_GREEN_BITS			= &h0D53
	GL_BLUE_BITS			= &h0D54
	GL_INDEX_BITS			= &h0D51
	GL_SUBPIXEL_BITS		= &h0D50
	GL_AUX_BUFFERS			= &h0C00
	GL_READ_BUFFER			= &h0C02
	GL_DRAW_BUFFER			= &h0C01
	GL_DOUBLEBUFFER			= &h0C32
	GL_STEREO			= &h0C33
	GL_BITMAP			= &h1A00
	GL_COLOR			= &h1800
	GL_DEPTH			= &h1801
	GL_STENCIL			= &h1802
	GL_DITHER			= &h0BD0
	GL_RGB				= &h1907
	GL_RGBA				= &h1908

	'/* Implementation limits */
	GL_MAX_LIST_NESTING		= &h0B31
	GL_MAX_ATTRIB_STACK_DEPTH	= &h0D35
	GL_MAX_MODELVIEW_STACK_DEPTH	= &h0D36
	GL_MAX_NAME_STACK_DEPTH		= &h0D37
	GL_MAX_PROJECTION_STACK_DEPTH	= &h0D38
	GL_MAX_TEXTURE_STACK_DEPTH	= &h0D39
	GL_MAX_EVAL_ORDER		= &h0D30
	GL_MAX_LIGHTS			= &h0D31
	GL_MAX_CLIP_PLANES		= &h0D32
	GL_MAX_TEXTURE_SIZE		= &h0D33
	GL_MAX_PIXEL_MAP_TABLE		= &h0D34
	GL_MAX_VIEWPORT_DIMS		= &h0D3A
	GL_MAX_CLIENT_ATTRIB_STACK_DEPTH= &h0D3B

	'/* Gets */
	GL_ATTRIB_STACK_DEPTH		= &h0BB0
	GL_COLOR_CLEAR_VALUE		= &h0C22
	GL_COLOR_WRITEMASK		= &h0C23
	GL_CURRENT_INDEX		= &h0B01
	GL_CURRENT_COLOR		= &h0B00
	GL_CURRENT_NORMAL		= &h0B02
	GL_CURRENT_RASTER_COLOR		= &h0B04
	GL_CURRENT_RASTER_DISTANCE	= &h0B09
	GL_CURRENT_RASTER_INDEX		= &h0B05
	GL_CURRENT_RASTER_POSITION	= &h0B07
	GL_CURRENT_RASTER_TEXTURE_COORDS = &h0B06
	GL_CURRENT_RASTER_POSITION_VALID = &h0B08
	GL_CURRENT_TEXTURE_COORDS	= &h0B03
	GL_INDEX_CLEAR_VALUE		= &h0C20
	GL_INDEX_MODE			= &h0C30
	GL_INDEX_WRITEMASK		= &h0C21
	GL_MODELVIEW_MATRIX		= &h0BA6
	GL_MODELVIEW_STACK_DEPTH	= &h0BA3
	GL_NAME_STACK_DEPTH		= &h0D70
	GL_PROJECTION_MATRIX		= &h0BA7
	GL_PROJECTION_STACK_DEPTH	= &h0BA4
	GL_RENDER_MODE			= &h0C40
	GL_RGBA_MODE			= &h0C31
	GL_TEXTURE_MATRIX		= &h0BA8
	GL_TEXTURE_STACK_DEPTH		= &h0BA5
	GL_VIEWPORT			= &h0BA2


	'/* Evaluators */
	GL_AUTO_NORMAL			= &h0D80
	GL_MAP1_COLOR_4			= &h0D90
	GL_MAP1_GRID_DOMAIN		= &h0DD0
	GL_MAP1_GRID_SEGMENTS		= &h0DD1
	GL_MAP1_INDEX			= &h0D91
	GL_MAP1_NORMAL			= &h0D92
	GL_MAP1_TEXTURE_COORD_1		= &h0D93
	GL_MAP1_TEXTURE_COORD_2		= &h0D94
	GL_MAP1_TEXTURE_COORD_3		= &h0D95
	GL_MAP1_TEXTURE_COORD_4		= &h0D96
	GL_MAP1_VERTEX_3		= &h0D97
	GL_MAP1_VERTEX_4		= &h0D98
	GL_MAP2_COLOR_4			= &h0DB0
	GL_MAP2_GRID_DOMAIN		= &h0DD2
	GL_MAP2_GRID_SEGMENTS		= &h0DD3
	GL_MAP2_INDEX			= &h0DB1
	GL_MAP2_NORMAL			= &h0DB2
	GL_MAP2_TEXTURE_COORD_1		= &h0DB3
	GL_MAP2_TEXTURE_COORD_2		= &h0DB4
	GL_MAP2_TEXTURE_COORD_3		= &h0DB5
	GL_MAP2_TEXTURE_COORD_4		= &h0DB6
	GL_MAP2_VERTEX_3		= &h0DB7
	GL_MAP2_VERTEX_4		= &h0DB8
	GL_COEFF			= &h0A00
	GL_DOMAIN			= &h0A02
	GL_ORDER			= &h0A01

	'/* Hints */
	GL_FOG_HINT			= &h0C54
	GL_LINE_SMOOTH_HINT		= &h0C52
	GL_PERSPECTIVE_CORRECTION_HINT	= &h0C50
	GL_POINT_SMOOTH_HINT		= &h0C51
	GL_POLYGON_SMOOTH_HINT		= &h0C53
	GL_DONT_CARE			= &h1100
	GL_FASTEST			= &h1101
	GL_NICEST			= &h1102

	'/* Scissor box */
	GL_SCISSOR_TEST			= &h0C11
	GL_SCISSOR_BOX			= &h0C10

	'/* Pixel Mode / Transfer */
	GL_MAP_COLOR			= &h0D10
	GL_MAP_STENCIL			= &h0D11
	GL_INDEX_SHIFT			= &h0D12
	GL_INDEX_OFFSET			= &h0D13
	GL_RED_SCALE			= &h0D14
	GL_RED_BIAS			= &h0D15
	GL_GREEN_SCALE			= &h0D18
	GL_GREEN_BIAS			= &h0D19
	GL_BLUE_SCALE			= &h0D1A
	GL_BLUE_BIAS			= &h0D1B
	GL_ALPHA_SCALE			= &h0D1C
	GL_ALPHA_BIAS			= &h0D1D
	GL_DEPTH_SCALE			= &h0D1E
	GL_DEPTH_BIAS			= &h0D1F
	GL_PIXEL_MAP_S_TO_S_SIZE	= &h0CB1
	GL_PIXEL_MAP_I_TO_I_SIZE	= &h0CB0
	GL_PIXEL_MAP_I_TO_R_SIZE	= &h0CB2
	GL_PIXEL_MAP_I_TO_G_SIZE	= &h0CB3
	GL_PIXEL_MAP_I_TO_B_SIZE	= &h0CB4
	GL_PIXEL_MAP_I_TO_A_SIZE	= &h0CB5
	GL_PIXEL_MAP_R_TO_R_SIZE	= &h0CB6
	GL_PIXEL_MAP_G_TO_G_SIZE	= &h0CB7
	GL_PIXEL_MAP_B_TO_B_SIZE	= &h0CB8
	GL_PIXEL_MAP_A_TO_A_SIZE	= &h0CB9
	GL_PIXEL_MAP_S_TO_S		= &h0C71
	GL_PIXEL_MAP_I_TO_I		= &h0C70
	GL_PIXEL_MAP_I_TO_R		= &h0C72
	GL_PIXEL_MAP_I_TO_G		= &h0C73
	GL_PIXEL_MAP_I_TO_B		= &h0C74
	GL_PIXEL_MAP_I_TO_A		= &h0C75
	GL_PIXEL_MAP_R_TO_R		= &h0C76
	GL_PIXEL_MAP_G_TO_G		= &h0C77
	GL_PIXEL_MAP_B_TO_B		= &h0C78
	GL_PIXEL_MAP_A_TO_A		= &h0C79
	GL_PACK_ALIGNMENT		= &h0D05
	GL_PACK_LSB_FIRST		= &h0D01
	GL_PACK_ROW_LENGTH		= &h0D02
	GL_PACK_SKIP_PIXELS		= &h0D04
	GL_PACK_SKIP_ROWS		= &h0D03
	GL_PACK_SWAP_BYTES		= &h0D00
	GL_UNPACK_ALIGNMENT		= &h0CF5
	GL_UNPACK_LSB_FIRST		= &h0CF1
	GL_UNPACK_ROW_LENGTH		= &h0CF2
	GL_UNPACK_SKIP_PIXELS		= &h0CF4
	GL_UNPACK_SKIP_ROWS		= &h0CF3
	GL_UNPACK_SWAP_BYTES		= &h0CF0
	GL_ZOOM_X			= &h0D16
	GL_ZOOM_Y			= &h0D17

	'/* Texture mapping */
	GL_TEXTURE_ENV			= &h2300
	GL_TEXTURE_ENV_MODE		= &h2200
	GL_TEXTURE_1D			= &h0DE0
	GL_TEXTURE_2D			= &h0DE1
	GL_TEXTURE_WRAP_S		= &h2802
	GL_TEXTURE_WRAP_T		= &h2803
	GL_TEXTURE_MAG_FILTER		= &h2800
	GL_TEXTURE_MIN_FILTER		= &h2801
	GL_TEXTURE_ENV_COLOR		= &h2201
	GL_TEXTURE_GEN_S		= &h0C60
	GL_TEXTURE_GEN_T		= &h0C61
	GL_TEXTURE_GEN_MODE		= &h2500
	GL_TEXTURE_BORDER_COLOR		= &h1004
	GL_TEXTURE_WIDTH		= &h1000
	GL_TEXTURE_HEIGHT		= &h1001
	GL_TEXTURE_BORDER		= &h1005
	GL_TEXTURE_COMPONENTS		= &h1003
	GL_NEAREST_MIPMAP_NEAREST	= &h2700
	GL_NEAREST_MIPMAP_LINEAR	= &h2702
	GL_LINEAR_MIPMAP_NEAREST	= &h2701
	GL_LINEAR_MIPMAP_LINEAR		= &h2703
	GL_OBJECT_LINEAR		= &h2401
	GL_OBJECT_PLANE			= &h2501
	GL_EYE_LINEAR			= &h2400
	GL_EYE_PLANE			= &h2502
	GL_SPHERE_MAP			= &h2402
	GL_DECAL			= &h2101
	GL_MODULATE			= &h2100
	GL_NEAREST			= &h2600
	GL_REPEAT			= &h2901
	GL_CLAMP			= &h2900
	GL_S				= &h2000
	GL_T				= &h2001
	GL_R				= &h2002
	GL_Q				= &h2003
	GL_TEXTURE_GEN_R		= &h0C62
	GL_TEXTURE_GEN_Q		= &h0C63

	GL_PROXY_TEXTURE_1D		= &h8063
	GL_PROXY_TEXTURE_2D		= &h8064
	GL_TEXTURE_PRIORITY		= &h8066
	GL_TEXTURE_RESIDENT		= &h8067
	GL_TEXTURE_1D_BINDING		= &h8068
	GL_TEXTURE_2D_BINDING		= &h8069

	'/* Internal texture formats */
	GL_ALPHA4			= &h803B
	GL_ALPHA8			= &h803C
	GL_ALPHA12			= &h803D
	GL_ALPHA16			= &h803E
	GL_LUMINANCE4			= &h803F
	GL_LUMINANCE8			= &h8040
	GL_LUMINANCE12			= &h8041
	GL_LUMINANCE16			= &h8042
	GL_LUMINANCE4_ALPHA4		= &h8043
	GL_LUMINANCE6_ALPHA2		= &h8044
	GL_LUMINANCE8_ALPHA8		= &h8045
	GL_LUMINANCE12_ALPHA4		= &h8046
	GL_LUMINANCE12_ALPHA12		= &h8047
	GL_LUMINANCE16_ALPHA16		= &h8048
	GL_INTENSITY			= &h8049
	GL_INTENSITY4			= &h804A
	GL_INTENSITY8			= &h804B
	GL_INTENSITY12			= &h804C
	GL_INTENSITY16			= &h804D
	GL_R3_G3_B2			= &h2A10
	GL_RGB4				= &h804F
	GL_RGB5				= &h8050
	GL_RGB8				= &h8051
	GL_RGB10			= &h8052
	GL_RGB12			= &h8053
	GL_RGB16			= &h8054
	GL_RGBA2			= &h8055
	GL_RGBA4			= &h8056
	GL_RGB5_A1			= &h8057
	GL_RGBA8			= &h8058
	GL_RGB10_A2			= &h8059
	GL_RGBA12			= &h805A
	GL_RGBA16			= &h805B

	'/* Utility */
	GL_VENDOR			= &h1F00
	GL_RENDERER			= &h1F01
	GL_VERSION			= &h1F02
	GL_EXTENSIONS			= &h1F03

	'/* Errors */
	GL_INVALID_VALUE		= &h0501
	GL_INVALID_ENUM			= &h0500
	GL_INVALID_OPERATION		= &h0502
	GL_STACK_OVERFLOW		= &h0503
	GL_STACK_UNDERFLOW		= &h0504
	GL_OUT_OF_MEMORY		= &h0505

	'/*
	' * 1.0 Extensions
	' */
  '/* GL_EXT_blend_minmax and GL_EXT_blend_color */
	GL_CONSTANT_COLOR_EXT		= &h8001
	GL_ONE_MINUS_CONSTANT_COLOR_EXT	= &h8002
	GL_CONSTANT_ALPHA_EXT		= &h8003
	GL_ONE_MINUS_CONSTANT_ALPHA_EXT	= &h8004
	GL_BLEND_EQUATION_EXT		= &h8009
	GL_MIN_EXT			= &h8007
	GL_MAX_EXT			= &h8008
	GL_FUNC_ADD_EXT			= &h8006
	GL_FUNC_SUBTRACT_EXT		= &h800A
	GL_FUNC_REVERSE_SUBTRACT_EXT	= &h800B
	GL_BLEND_COLOR_EXT		= &h8005

	'/* GL_EXT_polygon_offset */
        GL_POLYGON_OFFSET_EXT           = &h8037
        GL_POLYGON_OFFSET_FACTOR_EXT    = &h8038
        GL_POLYGON_OFFSET_BIAS_EXT      = &h8039

	'/* GL_EXT_vertex_array */
	GL_VERTEX_ARRAY_EXT		= &h8074
	GL_NORMAL_ARRAY_EXT		= &h8075
	GL_COLOR_ARRAY_EXT		= &h8076
	GL_INDEX_ARRAY_EXT		= &h8077
	GL_TEXTURE_COORD_ARRAY_EXT	= &h8078
	GL_EDGE_FLAG_ARRAY_EXT		= &h8079
	GL_VERTEX_ARRAY_SIZE_EXT	= &h807A
	GL_VERTEX_ARRAY_TYPE_EXT	= &h807B
	GL_VERTEX_ARRAY_STRIDE_EXT	= &h807C
	GL_VERTEX_ARRAY_COUNT_EXT	= &h807D
	GL_NORMAL_ARRAY_TYPE_EXT	= &h807E
	GL_NORMAL_ARRAY_STRIDE_EXT	= &h807F
	GL_NORMAL_ARRAY_COUNT_EXT	= &h8080
	GL_COLOR_ARRAY_SIZE_EXT		= &h8081
	GL_COLOR_ARRAY_TYPE_EXT		= &h8082
	GL_COLOR_ARRAY_STRIDE_EXT	= &h8083
	GL_COLOR_ARRAY_COUNT_EXT	= &h8084
	GL_INDEX_ARRAY_TYPE_EXT		= &h8085
	GL_INDEX_ARRAY_STRIDE_EXT	= &h8086
	GL_INDEX_ARRAY_COUNT_EXT	= &h8087
	GL_TEXTURE_COORD_ARRAY_SIZE_EXT	= &h8088
	GL_TEXTURE_COORD_ARRAY_TYPE_EXT	= &h8089
	GL_TEXTURE_COORD_ARRAY_STRIDE_EXT= &h808A
	GL_TEXTURE_COORD_ARRAY_COUNT_EXT= &h808B
	GL_EDGE_FLAG_ARRAY_STRIDE_EXT	= &h808C
	GL_EDGE_FLAG_ARRAY_COUNT_EXT	= &h808D
	GL_VERTEX_ARRAY_POINTER_EXT	= &h808E
	GL_NORMAL_ARRAY_POINTER_EXT	= &h808F
	GL_COLOR_ARRAY_POINTER_EXT	= &h8090
	GL_INDEX_ARRAY_POINTER_EXT	= &h8091
	GL_TEXTURE_COORD_ARRAY_POINTER_EXT= &h8092
	GL_EDGE_FLAG_ARRAY_POINTER_EXT	= &h8093

end enum
enum
	GL_CURRENT_BIT		= &h00000001
	GL_POINT_BIT		= &h00000002
	GL_LINE_BIT		= &h00000004
	GL_POLYGON_BIT		= &h00000008
	GL_POLYGON_STIPPLE_BIT	= &h00000010
	GL_PIXEL_MODE_BIT	= &h00000020
	GL_LIGHTING_BIT		= &h00000040
	GL_FOG_BIT		= &h00000080
	GL_DEPTH_BUFFER_BIT	= &h00000100
	GL_ACCUM_BUFFER_BIT	= &h00000200
	GL_STENCIL_BUFFER_BIT	= &h00000400
	GL_VIEWPORT_BIT		= &h00000800
	GL_TRANSFORM_BIT	= &h00001000
	GL_ENABLE_BIT		= &h00002000
	GL_COLOR_BUFFER_BIT	= &h00004000
	GL_HINT_BIT		= &h00008000
	GL_EVAL_BIT		= &h00010000
	GL_LIST_BIT		= &h00020000
	GL_TEXTURE_BIT		= &h00040000
	GL_SCISSOR_BIT		= &h00080000
	GL_ALL_ATTRIB_BITS	= &h000fffff
end enum

'' -----------------------------------------------------------------------------
'' Types
'' -----------------------------------------------------------------------------

Type GLenum as UInteger
Type GLvoid as Any
Type GLboolean as UByte
Type GLbyte as Byte
Type GLshort as Short
Type GLint as Integer
Type GLubyte as UByte
Type GLushort as UShort
Type GLuint as UInteger
Type GLfloat as Single
Type GLdouble as Double
Type GLsizei as Integer

'' -----------------------------------------------------------------------------
'' Functions
'' -----------------------------------------------------------------------------

Declare Sub glEnable(ByVal code_ As Integer)
Declare Sub glDisable(ByVal code_ As Integer)

Declare Sub glShadeModel(ByVal mode As Integer)
Declare Sub glCullFace(ByVal mode As Integer)
Declare Sub glPolygonMode(ByVal face As Integer, ByVal mode As Integer)

Declare Sub glBegin(ByVal type_ As Integer)
Declare Sub glEnd()

'' Vertex Declarations
Declare Sub glVertex2f(ByVal x As Single, ByVal y As Single)
Declare Sub glVertex2d(ByVal x As Double, ByVal y As Double)
Declare Sub glVertex2fv(ByVal v As Single Ptr)
Declare Sub glVertex2dv(ByVal v As Double Ptr)

Declare Sub glVertex3f(ByVal x As Single, ByVal y As Single, ByVal z As Single)
Declare Sub glVertex3d(ByVal x As Double, ByVal y As Double, ByVal z As Double)
Declare Sub glVertex3fv(ByVal v As Single Ptr)
Declare Sub glVertex3dv(ByVal v As Double Ptr)

Declare Sub glVertex4f(ByVal x As Single, ByVal y As Single, ByVal z As Single, ByVal w As Single)
Declare Sub glVertex4d(ByVal x As Double, ByVal y As Double, ByVal z As Double, ByVal w As Double)
Declare Sub glVertex4fv(ByVal v As Single Ptr)
Declare Sub glVertex4dv(ByVal v As Double Ptr)

'' Color Declarations
Declare Sub glColor3f(ByVal r As Single, ByVal g As Single, ByVal b As Single)
Declare Sub glColor3d(ByVal r As Double, ByVal g As Double, ByVal b As Double)
Declare Sub glColor3fv(ByVal v As Single Ptr)
Declare Sub glColor3dv(ByVal v As Double Ptr)

Declare Sub glColor4f(ByVal r As Single, ByVal g As Single, ByVal b As Single, ByVal a As Single)
Declare Sub glColor4d(ByVal r As Double, ByVal g As Double, ByVal b As Double, ByVal a As Double)
Declare Sub glColor4fv(ByVal v As Single Ptr)
Declare Sub glColor4dv(ByVal v As Double Ptr)

'' Normal Declarations
Declare Sub glNormal3f(ByVal x As Single, ByVal y As Single, ByVal z As Single)
Declare Sub glNormal3d(ByVal x As Double, ByVal y As Double, ByVal z As Double)
Declare Sub glNormal3fv(ByVal v As Single Ptr)
Declare Sub glNormal3dv(ByVal v As Double Ptr)

'' TexCoord Declarations
Declare Sub glTexCoord2f(ByVal s As Single, ByVal t As Single)
Declare Sub glTexCoord2fv(ByVal v As Single Ptr)

'' Matrix Operations
Declare Sub glMatrixMode(ByVal mode As Integer)
Declare Sub glLoadMatrixf(ByVal m As Const Single Ptr)
Declare Sub glLoadIdentity()
Declare Sub glMultMatrixf(ByVal m As Const Single Ptr)
Declare Sub glPushMatrix()
Declare Sub glPopMatrix()
Declare Sub glRotatef(ByVal angle As Single, ByVal x As Single, ByVal y As Single, ByVal z As Single)
Declare Sub glTranslatef(ByVal x As Single, ByVal y As Single, ByVal z As Single)
Declare Sub glScalef(ByVal x As Single, ByVal y As Single, ByVal z As Single)

Declare Sub glViewport(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer)
Declare Sub glFrustum(ByVal left_ As Double, ByVal right_ As Double, ByVal bottom As Double, ByVal top As Double, ByVal near As Double, ByVal far As Double)

'' Lists
Declare Function glGenLists(ByVal range_ As Integer) As UInteger
Declare Function glIsList(ByVal list As UInteger) As Integer
Declare Sub glNewList(ByVal list As UInteger, ByVal mode As Integer)
Declare Sub glEndList()
Declare Sub glCallList(ByVal list As UInteger)

'' Clear
Declare Sub glClear(ByVal mask As Integer)
Declare Sub glClearColor(ByVal r As Single, ByVal g As Single, ByVal b As Single, ByVal a As Single)
Declare Sub glClearDepth(ByVal depth As Double)

'' Lighting & Materials
Declare Sub glMaterialfv(ByVal mode As Integer, ByVal type_ As Integer, ByVal v As Single Ptr)
Declare Sub glMaterialf(ByVal mode As Integer, ByVal type_ As Integer, ByVal v As Single)
Declare Sub glColorMaterial(ByVal mode As Integer, ByVal type_ As Integer)

Declare Sub glLightfv(ByVal light As Integer, ByVal type_ As Integer, ByVal v As Single Ptr)
Declare Sub glLightf(ByVal light As Integer, ByVal type_ As Integer, ByVal v As Single)
Declare Sub glLightModeli(ByVal pname As Integer, ByVal param As Integer)
Declare Sub glLightModelfv(ByVal pname As Integer, ByVal param As Single Ptr)

'' Textures
Declare Sub glGenTextures(ByVal n As Integer, ByVal textures As UInteger Ptr)
Declare Sub glBindTexture(ByVal target As Integer, ByVal texture As Integer)
Declare Sub glTexImage2D(ByVal target As Integer, ByVal level As Integer, ByVal components As Integer, _
                         ByVal width As Integer, ByVal height As Integer, ByVal border As Integer, _
                         ByVal format As Integer, ByVal type_ As Integer, ByVal pixels As Any Ptr)
Declare Sub glTexParameteri(ByVal target As Integer, ByVal pname As Integer, ByVal param As Integer)

'' Misc
Declare Sub glFlush()
Declare Sub glHint(ByVal target As Integer, ByVal mode As Integer)
Declare Sub glGetIntegerv(ByVal pname As Integer, ByVal params As Integer Ptr)

'' -----------------------------------------------------------------------------
'' TinyGL Specific / ZBuffer (Normally in zbuffer.h)
'' -----------------------------------------------------------------------------

'' We need an opaque pointer for ZBuffer
Type ZBuffer As Any

'' ZBuffer constants
const ZB_MODE_5R6G5B =  1
const ZB_MODE_INDEX  =  2
const ZB_MODE_RGBA   =  3
const ZB_MODE_RGB24  =  4
const ZB_NB_COLORS   =  225

'' Initialize the GL context with a ZBuffer
Declare Sub glInit(ByVal zbuffer As ZBuffer Ptr)
Declare Sub glClose()

'' Open a ZBuffer (width, height, mode, nb_colors, color_indexes, color_table, frame_buffer)
'' If frame_buffer is NULL, TinyGL allocates its own.
'' If frame_buffer is provided, TinyGL writes directly to it.
Declare Function ZB_open(ByVal xsize As long, ByVal ysize As long, ByVal mode As long, _
                         ByVal nb_colors As long, ByVal color_indexes As ubyte Ptr, _
                         ByVal color_table As long Ptr, ByVal frame_buffer As Any Ptr) As ZBuffer Ptr

Declare Sub ZB_close(ByVal zb As ZBuffer Ptr)
Declare Sub ZB_resize(ByVal zb As ZBuffer Ptr, ByVal frame_buffer As Any Ptr, ByVal w As long, ByVal h As long)
declare Sub ZB_initDither(zb as ZBuffer ptr,nb_colors as long,color_indexes As ubyte Ptr,color_table As long Ptr)
declare sub ZB_closeDither(zb as ZBuffer ptr)
declare sub ZB_ditherFrameBuffer(zb as ZBuffer ptr,dest as ubyte ptr,linesize as long)

End Extern
