-
Notifications
You must be signed in to change notification settings - Fork 4
/
OpenGL12.pas
6802 lines (6172 loc) · 375 KB
/
OpenGL12.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{******************************************************************************}
{ }
{ Borland Delphi Runtime Library }
{ OpenGL interface unit }
{ }
{ }
{ This is an interface unit for the use of OpenGL from within Delphi and Kylix.}
{ It contains the translations of gl.h, glu.h, glx.h as well as some support }
{ functions. }
{ }
{ }
{ Portions created by Microsoft are }
{ Copyright (C) 1995-2001 Microsoft Corporation. }
{ All Rights Reserved. }
{ }
{ Portions created by Silicon Graphics Incorporated are }
{ Copyright (C) 1995-2001 Silicon Graphics Incorporated }
{ All Rights Reserved. }
{ }
{ Portions created by NVidia are }
{ Copyright (C) 1995-2001 NVidia }
{ All Rights Reserved. }
{ }
{ Portions created by Brian Paul }
{ Copyright (C) 1995-2001 Brian Paul }
{ All Rights Reserved. }
{ }
{ }
{ The original file is: gl.h }
{ The original file is: glut.h }
{ The original file is: glx.h }
{ The original file is: glx.h }
{ }
{ The original Pascal code is: OpenGL12.pas }
{ The initial developer of the Pascal code is Mike Lischke }
{ }
{ Portions created by Mike Lischke are }
{ Copyright (C) 2001 Mike Lischke. }
{ }
{ Portions created by John O'Harrow are }
{ Copyright (C) 2001 John O'Harrow. }
{ }
{ Portions created by Eric Grange are }
{ Copyright (C) 2001 Eric Grange. }
{ }
{ Portions created by Olivier Chatelain }
{ Copyright (C) 2001 Olivier Chatelain. }
{ }
{ Portions created by Tom Nuydens }
{ Copyright (C) 2001 Tom Nuydens. }
{ }
{ Portions created by Matthias Thoma are }
{ Copyright (C) 2001 Matthias Thoma. }
{ }
{ Portions created by Sven Bobrowski are }
{ Copyright (C) 2001 Sven Bobrowski }
{ }
{ }
{ Obtained through: }
{ }
{ Joint Endeavour of Delphi Innovators (Project JEDI) }
{ }
{ You may retrieve the latest version of this file at the Project }
{ JEDI home page, located at http://delphi-jedi.org }
{ }
{ The contents of this file are used with permission, subject to }
{ the Mozilla Public License Version 1.1 (the "License"); you may }
{ not use this file except in compliance with the License. You may }
{ obtain a copy of the License at }
{ http://www.mozilla.org/MPL/MPL-1.1.html }
{ }
{ Software distributed under the License is distributed on an }
{ "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or }
{ implied. See the License for the specific language governing }
{ rights and limitations under the License. }
{ }
{******************************************************************************}
unit OpenGL12;
//----------------------------------------------------------------------------------------------------------------------
//
// This is an interface unit for the use of OpenGL from within Delphi and contains
// the translations of gl.h, glu.h as well as some support functions.
// OpenGL12.pas contains bug fixes and enhancements of Delphi's and other translations
// as well as support for extensions.
//
//----------------------------------------------------------------------------------------------------------------------
//
// function InitOpenGL: Boolean;
// Needed to load the OpenGL DLLs and all addresses of the standard functions.
// In case OpenGL is already initialized this function does nothing. No error
// is raised, if something goes wrong, but you need to inspect the Result in order
// to know if all went okay.
// Result: True if successful or already loaded, False otherwise.
//
// function InitOpenGLFromLibrary(GL_Name, GLU_Name: String): Boolean;
// Same as InitOpenGL, but you can specify specific DLLs. Useful if you want to
// use different DLLs then those of Windows. This function closes eventually
// loaded DLLs before it tries to open the newly given.
// Result: True if successful, False otherwise.
//
// procedure CloseOpenGL;
// Unloads the OpenGL DLLs and sets all function addresses to nil, including
// extensions. You can load and unload the DLLs as often as you like.
//
// procedure ClearExtensions;
// Sets all extension routines to nil. This is needed when you change the Pixelformat
// of your OpenGL window, since the availability of these routines changes from
// PixelFormat to Pixelformat (and also between various vendors).
//
// function CreateRenderingContext(DC: HDC; Options: TRCOptions; ColorBits, StencilBits, AccumBits, AuxBuffers: Integer;
// Layer: Integer; var Palette: HPALETTE): HGLRC;
// Sets up a pixel format and creates a new rendering context depending of the
// given parameters:
// DC - the device context for which the rc is to be created
// Options - options for the context, which the application would like to have
// (it is not guaranteed they will be available)
// ColorBits - the color depth of the device context (Note: Because of the internal DC handling of the VCL you
// should avoid using GetDeviceCaps for memory DCs which are members of a TBitmap class.
// Translate the Pixelformat member instead!)
// StencilBits - requested size of the stencil buffer
// AccumBits - requested size of the accumulation buffer
// AuxBuffers - requested number of auxiliary buffers
// Layer - ID for the layer for which the RC will be created (-1..-15 for underlay planes, 0 for main plane,
// 1..15 for overlay planes)
// Note: The layer handling is not yet complete as there is very few information
// available and (until now) no OpenGL implementation with layer support on the low budget market.
// Hence use 0 (for the main plane) as layer ID.
// Palette - Palette Handle created within function (need to use DeleteObject(Palette) to free this)
// Result: the newly created context or 0 if setup failed
//
// procedure ActivateRenderingContext(DC: HDC; RC: HGLRC);
// Makes RC in DC 'current' (wglMakeCurrent(..)) and loads all extension addresses
// and flags if necessary.
//
// procedure DeactivateRenderingContext;
// Counterpart to ActivateRenderingContext.
//
// procedure DestroyRenderingContext(RC: HGLRC);
// RC will be destroyed and must be recreated if you want to use it again.
//
// procedure ReadExtensions;
// Determines which extensions for the current rendering context are available and
// loads their addresses. This procedure is called from ActivateRenderingContext
// if a new pixel format is used, but you can safely call it from where you want
// to actualize those values (under the condition that a rendering context MUST be
// active).
//
// procedure ReadImplementationProperties;
// Determines other properties of the OpenGL DLL (version, availability of extensions).
// Again, a valid rendering context must be active.
//
// function HasActiveContext: Boolean;
// Determines whether the calling thread has currently an active rendering context.
//----------------------------------------------------------------------------------------------------------------------
//
// This translation is based on different sources:
//
// - first translation from Artemis Alliance Inc.
// - previous versions from Mike Lischke
// - Alexander Staubo
// - Borland OpenGL.pas (from Delphi 3)
// - Microsoft and SGI OpenGL header files
// - www.opengl.org, www.sgi.com/OpenGL
// - nVidia extension reference as of December 1999
// - nVidia extension reference as of January 2001
// - vertex_array_range sample by Tom Nuydens at Delphi3D
// - minor bug fixes and greatly extended by John O'Harrow ([email protected])
// - context activation balancing by Eric Grange ([email protected])
// - additional nVidia extensions by Olivier Chatelain ([email protected])
//
// Contact: [email protected]
//
// Version: 1.2.7
//----------------------------------------------------------------------------------------------------------------------
//
// 05-JUL-2001 ml:
// - own exception type for OpenGL
// - TGLboolean is now of type BYTEBOOL
// 05-MAY-2001 ml:
// - correct tracking of RC creation and release as well as multithreaded RC activation
// - compatibility routines for users of other OpenGL unit variants
// - improved rendering context creation
// - bug fixes
// 01-MAY-2001 ml:
// - added more nVidia extensions
//----------------------------------------------------------------------------------------------------------------------
interface
uses
{$IFDEF Win32}
Windows
{$ENDIF}
{$IFDEF LINUX}
LibC, XLib, Types
{$ENDIF}
;
type
TRCOptions = set of (
opDoubleBuffered,
opGDI,
opStereo);
TGLenum = UINT;
PGLenum = ^TGLenum;
TGLboolean = BYTEBOOL;
PGLboolean = ^TGLboolean;
TGLbitfield = UINT;
PGLbitfield = ^TGLbitfield;
TGLbyte = ShortInt;
PGLbyte = ^TGLbyte;
TGLshort = SmallInt;
PGLshort = ^TGLshort;
TGLint = Integer;
PGLint = ^TGLint;
TGLsizei = Integer;
PGLsizei = ^TGLsizei;
TGLubyte = CHAR;
PGLubyte = ^TGLubyte;
TGLushort = Word;
PGLushort = ^TGLushort;
TGLuint = UINT;
PGLuint = ^TGLuint;
Tglfloat = Single;
PGLfloat = ^TGLfloat;
TGLclampf = Single;
PGLclampf = ^TGLclampf;
TGLdouble = Double;
PGLdouble = ^TGLdouble;
TGLclampd = Double;
PGLclampd = ^TGLclampd;
TVector3d = array[0..2] of Double;
TVector4i = array[0..3] of Integer;
TVector4f = array[0..3] of Single;
TVector4p = array[0..3] of Pointer;
TMatrix4f = array[0..3, 0..3] of Single;
TMatrix4d = array[0..3, 0..3] of Double;
PPointer = ^Pointer;
var
GL_VERSION_1_0,
GL_VERSION_1_1,
GL_VERSION_1_2,
GLU_VERSION_1_1,
GLU_VERSION_1_2,
GLU_VERSION_1_3: Boolean;
// Extensions (gl)
GL_3DFX_multisample,
GL_3DFX_tbuffer,
GL_3DFX_texture_compression_FXT1,
GL_APPLE_specular_vector,
GL_APPLE_transform_hint,
GL_ARB_imaging,
GL_ARB_multisample,
GL_ARB_multitexture,
GL_ARB_texture_compression,
GL_ARB_texture_cube_map,
GL_ARB_transpose_matrix,
GL_ARB_vertex_blend,
GL_EXT_422_pixels,
GL_EXT_abgr,
GL_EXT_bgra,
GL_EXT_blend_color,
GL_EXT_blend_func_separate,
GL_EXT_blend_logic_op,
GL_EXT_blend_minmax,
GL_EXT_blend_subtract,
GL_EXT_clip_volume_hint,
GL_EXT_cmyka,
GL_EXT_color_subtable,
GL_EXT_compiled_vertex_array,
GL_EXT_convolution,
GL_EXT_coordinate_frame,
GL_EXT_copy_texture,
GL_EXT_cull_vertex,
GL_EXT_draw_range_elements,
GL_EXT_fog_coord,
GL_EXT_histogram,
GL_EXT_index_array_formats,
GL_EXT_index_func,
GL_EXT_index_material,
GL_EXT_index_texture,
GL_EXT_light_max_exponent,
GL_EXT_light_texture,
GL_EXT_misc_attribute,
GL_EXT_multi_draw_arrays,
GL_EXT_multisample,
GL_EXT_packed_pixels,
GL_EXT_paletted_texture,
GL_EXT_pixel_transform,
GL_EXT_point_parameters,
GL_EXT_polygon_offset,
GL_EXT_rescale_normal,
GL_EXT_scene_marker,
GL_EXT_secondary_color,
GL_EXT_separate_specular_color,
GL_EXT_shared_texture_palette,
GL_EXT_stencil_wrap,
GL_EXT_subtexture,
GL_EXT_texture_color_table,
GL_EXT_texture_compression_s3tc,
GL_EXT_texture_cube_map,
GL_EXT_texture_edge_clamp,
GL_EXT_texture_env_add,
GL_EXT_texture_env_combine,
GL_EXT_texture_filter_anisotropic,
GL_EXT_texture_lod_bias,
GL_EXT_texture_object,
GL_EXT_texture_perturb_normal,
GL_EXT_texture3D,
GL_EXT_vertex_array,
GL_EXT_vertex_weighting,
GL_FfdMaskSGIX,
GL_HP_convolution_border_modes,
GL_HP_image_transform,
GL_HP_occlusion_test,
GL_HP_texture_lighting,
GL_IBM_cull_vertex,
GL_IBM_multimode_draw_arrays,
GL_IBM_rasterpos_clip,
GL_IBM_vertex_array_lists,
GL_INGR_color_clamp,
GL_INGR_interlace_read,
GL_INTEL_parallel_arrays,
GL_KTX_buffer_region,
GL_MESA_resize_buffers,
GL_MESA_window_pos,
GL_NV_blend_square,
GL_NV_fog_distance,
GL_NV_light_max_exponent,
GL_NV_register_combiners,
GL_NV_texgen_emboss,
GL_NV_texgen_reflection,
GL_NV_texture_env_combine4,
GL_NV_vertex_array_range,
GL_NV_vertex_program,
GL_PGI_misc_hints,
GL_PGI_vertex_hints,
GL_REND_screen_coordinates,
GL_SGI_color_matrix,
GL_SGI_color_table,
GL_SGI_depth_pass_instrument,
GL_SGIS_detail_texture,
GL_SGIS_fog_function,
GL_SGIS_generate_mipmap,
GL_SGIS_multisample,
GL_SGIS_multitexture,
GL_SGIS_pixel_texture,
GL_SGIS_point_line_texgen,
GL_SGIS_point_parameters,
GL_SGIS_sharpen_texture,
GL_SGIS_texture_border_clamp,
GL_SGIS_texture_color_mask,
GL_SGIS_texture_edge_clamp,
GL_SGIS_texture_filter4,
GL_SGIS_texture_lod,
GL_SGIS_texture_select,
GL_SGIS_texture4D,
GL_SGIX_async,
GL_SGIX_async_histogram,
GL_SGIX_async_pixel,
GL_SGIX_blend_alpha_minmax,
GL_SGIX_calligraphic_fragment,
GL_SGIX_clipmap,
GL_SGIX_convolution_accuracy,
GL_SGIX_depth_texture,
GL_SGIX_flush_raster,
GL_SGIX_fog_offset,
GL_SGIX_fog_scale,
GL_SGIX_fragment_lighting,
GL_SGIX_framezoom,
GL_SGIX_igloo_interface,
GL_SGIX_instruments,
GL_SGIX_interlace,
GL_SGIX_ir_instrument1,
GL_SGIX_list_priority,
GL_SGIX_pixel_texture,
GL_SGIX_pixel_tiles,
GL_SGIX_polynomial_ffd,
GL_SGIX_reference_plane,
GL_SGIX_resample,
GL_SGIX_shadow,
GL_SGIX_shadow_ambient,
GL_SGIX_sprite,
GL_SGIX_subsample,
GL_SGIX_tag_sample_buffer,
GL_SGIX_texture_add_env,
GL_SGIX_texture_lod_bias,
GL_SGIX_texture_multi_buffer,
GL_SGIX_texture_scale_bias,
GL_SGIX_vertex_preclip,
GL_SGIX_ycrcb,
GL_SGIX_ycrcba,
GL_SUN_convolution_border_modes,
GL_SUN_global_alpha,
GL_SUN_triangle_list,
GL_SUN_vertex,
GL_SUNX_constant_data,
GL_WIN_phong_shading,
GL_WIN_specular_fog,
GL_WIN_swap_hint,
WGL_EXT_swap_control,
// Extensions (glu)
GLU_EXT_Texture,
GLU_EXT_object_space_tess,
GLU_EXT_nurbs_tessellator: Boolean;
const
// ********** GL generic constants **********
// errors
GL_NO_ERROR = 0;
GL_INVALID_ENUM = $0500;
GL_INVALID_VALUE = $0501;
GL_INVALID_OPERATION = $0502;
GL_STACK_OVERFLOW = $0503;
GL_STACK_UNDERFLOW = $0504;
GL_OUT_OF_MEMORY = $0505;
// attribute bits
GL_CURRENT_BIT = $00000001;
GL_POINT_BIT = $00000002;
GL_LINE_BIT = $00000004;
GL_POLYGON_BIT = $00000008;
GL_POLYGON_STIPPLE_BIT = $00000010;
GL_PIXEL_MODE_BIT = $00000020;
GL_LIGHTING_BIT = $00000040;
GL_FOG_BIT = $00000080;
GL_DEPTH_BUFFER_BIT = $00000100;
GL_ACCUM_BUFFER_BIT = $00000200;
GL_STENCIL_BUFFER_BIT = $00000400;
GL_VIEWPORT_BIT = $00000800;
GL_TRANSFORM_BIT = $00001000;
GL_ENABLE_BIT = $00002000;
GL_COLOR_BUFFER_BIT = $00004000;
GL_HINT_BIT = $00008000;
GL_EVAL_BIT = $00010000;
GL_LIST_BIT = $00020000;
GL_TEXTURE_BIT = $00040000;
GL_SCISSOR_BIT = $00080000;
GL_ALL_ATTRIB_BITS = $000FFFFF;
// client attribute bits
GL_CLIENT_PIXEL_STORE_BIT = $00000001;
GL_CLIENT_VERTEX_ARRAY_BIT = $00000002;
GL_CLIENT_ALL_ATTRIB_BITS = $FFFFFFFF;
// boolean values
GL_FALSE = 0;
GL_TRUE = 1;
// primitives
GL_POINTS = $0000;
GL_LINES = $0001;
GL_LINE_LOOP = $0002;
GL_LINE_STRIP = $0003;
GL_TRIANGLES = $0004;
GL_TRIANGLE_STRIP = $0005;
GL_TRIANGLE_FAN = $0006;
GL_QUADS = $0007;
GL_QUAD_STRIP = $0008;
GL_POLYGON = $0009;
// blending
GL_ZERO = 0;
GL_ONE = 1;
GL_SRC_COLOR = $0300;
GL_ONE_MINUS_SRC_COLOR = $0301;
GL_SRC_ALPHA = $0302;
GL_ONE_MINUS_SRC_ALPHA = $0303;
GL_DST_ALPHA = $0304;
GL_ONE_MINUS_DST_ALPHA = $0305;
GL_DST_COLOR = $0306;
GL_ONE_MINUS_DST_COLOR = $0307;
GL_SRC_ALPHA_SATURATE = $0308;
GL_BLEND_DST = $0BE0;
GL_BLEND_SRC = $0BE1;
GL_BLEND = $0BE2;
// blending (GL 1.2 ARB imaging)
GL_BLEND_COLOR = $8005;
GL_CONSTANT_COLOR = $8001;
GL_ONE_MINUS_CONSTANT_COLOR = $8002;
GL_CONSTANT_ALPHA = $8003;
GL_ONE_MINUS_CONSTANT_ALPHA = $8004;
GL_FUNC_ADD = $8006;
GL_MIN = $8007;
GL_MAX = $8008;
GL_FUNC_SUBTRACT = $800A;
GL_FUNC_REVERSE_SUBTRACT = $800B;
// color table GL 1.2 ARB imaging
GL_COLOR_TABLE = $80D0;
GL_POST_CONVOLUTION_COLOR_TABLE = $80D1;
GL_POST_COLOR_MATRIX_COLOR_TABLE = $80D2;
GL_PROXY_COLOR_TABLE = $80D3;
GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = $80D4;
GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = $80D5;
GL_COLOR_TABLE_SCALE = $80D6;
GL_COLOR_TABLE_BIAS = $80D7;
GL_COLOR_TABLE_FORMAT = $80D8;
GL_COLOR_TABLE_WIDTH = $80D9;
GL_COLOR_TABLE_RED_SIZE = $80DA;
GL_COLOR_TABLE_GREEN_SIZE = $80DB;
GL_COLOR_TABLE_BLUE_SIZE = $80DC;
GL_COLOR_TABLE_ALPHA_SIZE = $80DD;
GL_COLOR_TABLE_LUMINANCE_SIZE = $80DE;
GL_COLOR_TABLE_INTENSITY_SIZE = $80DF;
// convolutions GL 1.2 ARB imaging
GL_CONVOLUTION_1D = $8010;
GL_CONVOLUTION_2D = $8011;
GL_SEPARABLE_2D = $8012;
GL_CONVOLUTION_BORDER_MODE = $8013;
GL_CONVOLUTION_FILTER_SCALE = $8014;
GL_CONVOLUTION_FILTER_BIAS = $8015;
GL_REDUCE = $8016;
GL_CONVOLUTION_FORMAT = $8017;
GL_CONVOLUTION_WIDTH = $8018;
GL_CONVOLUTION_HEIGHT = $8019;
GL_MAX_CONVOLUTION_WIDTH = $801A;
GL_MAX_CONVOLUTION_HEIGHT = $801B;
GL_POST_CONVOLUTION_RED_SCALE = $801C;
GL_POST_CONVOLUTION_GREEN_SCALE = $801D;
GL_POST_CONVOLUTION_BLUE_SCALE = $801E;
GL_POST_CONVOLUTION_ALPHA_SCALE = $801F;
GL_POST_CONVOLUTION_RED_BIAS = $8020;
GL_POST_CONVOLUTION_GREEN_BIAS = $8021;
GL_POST_CONVOLUTION_BLUE_BIAS = $8022;
GL_POST_CONVOLUTION_ALPHA_BIAS = $8023;
// histogram GL 1.2 ARB imaging
GL_HISTOGRAM = $8024;
GL_PROXY_HISTOGRAM = $8025;
GL_HISTOGRAM_WIDTH = $8026;
GL_HISTOGRAM_FORMAT = $8027;
GL_HISTOGRAM_RED_SIZE = $8028;
GL_HISTOGRAM_GREEN_SIZE = $8029;
GL_HISTOGRAM_BLUE_SIZE = $802A;
GL_HISTOGRAM_ALPHA_SIZE = $802B;
GL_HISTOGRAM_LUMINANCE_SIZE = $802C;
GL_HISTOGRAM_SINK = $802D;
GL_MINMAX = $802E;
GL_MINMAX_FORMAT = $802F;
GL_MINMAX_SINK = $8030;
// buffers
GL_NONE = 0;
GL_FRONT_LEFT = $0400;
GL_FRONT_RIGHT = $0401;
GL_BACK_LEFT = $0402;
GL_BACK_RIGHT = $0403;
GL_FRONT = $0404;
GL_BACK = $0405;
GL_LEFT = $0406;
GL_RIGHT = $0407;
GL_FRONT_AND_BACK = $0408;
GL_AUX0 = $0409;
GL_AUX1 = $040A;
GL_AUX2 = $040B;
GL_AUX3 = $040C;
GL_AUX_BUFFERS = $0C00;
GL_DRAW_BUFFER = $0C01;
GL_READ_BUFFER = $0C02;
GL_DOUBLEBUFFER = $0C32;
GL_STEREO = $0C33;
// depth buffer
GL_DEPTH_RANGE = $0B70;
GL_DEPTH_TEST = $0B71;
GL_DEPTH_WRITEMASK = $0B72;
GL_DEPTH_CLEAR_VALUE = $0B73;
GL_DEPTH_FUNC = $0B74;
GL_NEVER = $0200;
GL_LESS = $0201;
GL_EQUAL = $0202;
GL_LEQUAL = $0203;
GL_GREATER = $0204;
GL_NOTEQUAL = $0205;
GL_GEQUAL = $0206;
GL_ALWAYS = $0207;
// accumulation buffer
GL_ACCUM = $0100;
GL_LOAD = $0101;
GL_RETURN = $0102;
GL_MULT = $0103;
GL_ADD = $0104;
GL_ACCUM_CLEAR_VALUE = $0B80;
// feedback buffer
GL_FEEDBACK_BUFFER_POINTER = $0DF0;
GL_FEEDBACK_BUFFER_SIZE = $0DF1;
GL_FEEDBACK_BUFFER_TYPE = $0DF2;
// feedback types
GL_2D = $0600;
GL_3D = $0601;
GL_3D_COLOR = $0602;
GL_3D_COLOR_TEXTURE = $0603;
GL_4D_COLOR_TEXTURE = $0604;
// feedback tokens
GL_PASS_THROUGH_TOKEN = $0700;
GL_POINT_TOKEN = $0701;
GL_LINE_TOKEN = $0702;
GL_POLYGON_TOKEN = $0703;
GL_BITMAP_TOKEN = $0704;
GL_DRAW_PIXEL_TOKEN = $0705;
GL_COPY_PIXEL_TOKEN = $0706;
GL_LINE_RESET_TOKEN = $0707;
// fog
GL_EXP = $0800;
GL_EXP2 = $0801;
GL_FOG = $0B60;
GL_FOG_INDEX = $0B61;
GL_FOG_DENSITY = $0B62;
GL_FOG_START = $0B63;
GL_FOG_END = $0B64;
GL_FOG_MODE = $0B65;
GL_FOG_COLOR = $0B66;
// pixel mode, transfer
GL_PIXEL_MAP_I_TO_I = $0C70;
GL_PIXEL_MAP_S_TO_S = $0C71;
GL_PIXEL_MAP_I_TO_R = $0C72;
GL_PIXEL_MAP_I_TO_G = $0C73;
GL_PIXEL_MAP_I_TO_B = $0C74;
GL_PIXEL_MAP_I_TO_A = $0C75;
GL_PIXEL_MAP_R_TO_R = $0C76;
GL_PIXEL_MAP_G_TO_G = $0C77;
GL_PIXEL_MAP_B_TO_B = $0C78;
GL_PIXEL_MAP_A_TO_A = $0C79;
// vertex arrays
GL_VERTEX_ARRAY_POINTER = $808E;
GL_NORMAL_ARRAY_POINTER = $808F;
GL_COLOR_ARRAY_POINTER = $8090;
GL_INDEX_ARRAY_POINTER = $8091;
GL_TEXTURE_COORD_ARRAY_POINTER = $8092;
GL_EDGE_FLAG_ARRAY_POINTER = $8093;
// stenciling
GL_STENCIL_TEST = $0B90;
GL_STENCIL_CLEAR_VALUE = $0B91;
GL_STENCIL_FUNC = $0B92;
GL_STENCIL_VALUE_MASK = $0B93;
GL_STENCIL_FAIL = $0B94;
GL_STENCIL_PASS_DEPTH_FAIL = $0B95;
GL_STENCIL_PASS_DEPTH_PASS = $0B96;
GL_STENCIL_REF = $0B97;
GL_STENCIL_WRITEMASK = $0B98;
GL_KEEP = $1E00;
GL_REPLACE = $1E01;
GL_INCR = $1E02;
GL_DECR = $1E03;
// color material
GL_COLOR_MATERIAL_FACE = $0B55;
GL_COLOR_MATERIAL_PARAMETER = $0B56;
GL_COLOR_MATERIAL = $0B57;
// points
GL_POINT_SMOOTH = $0B10;
GL_POINT_SIZE = $0B11;
GL_POINT_SIZE_RANGE = $0B12;
GL_POINT_SIZE_GRANULARITY = $0B13;
// lines
GL_LINE_SMOOTH = $0B20;
GL_LINE_WIDTH = $0B21;
GL_LINE_WIDTH_RANGE = $0B22;
GL_LINE_WIDTH_GRANULARITY = $0B23;
GL_LINE_STIPPLE = $0B24;
GL_LINE_STIPPLE_PATTERN = $0B25;
GL_LINE_STIPPLE_REPEAT = $0B26;
// polygons
GL_POLYGON_MODE = $0B40;
GL_POLYGON_SMOOTH = $0B41;
GL_POLYGON_STIPPLE = $0B42;
GL_EDGE_FLAG = $0B43;
GL_CULL_FACE = $0B44;
GL_CULL_FACE_MODE = $0B45;
GL_FRONT_FACE = $0B46;
GL_CW = $0900;
GL_CCW = $0901;
GL_POINT = $1B00;
GL_LINE = $1B01;
GL_FILL = $1B02;
// display lists
GL_LIST_MODE = $0B30;
GL_LIST_BASE = $0B32;
GL_LIST_INDEX = $0B33;
GL_COMPILE = $1300;
GL_COMPILE_AND_EXECUTE = $1301;
// lighting
GL_LIGHTING = $0B50;
GL_LIGHT_MODEL_LOCAL_VIEWER = $0B51;
GL_LIGHT_MODEL_TWO_SIDE = $0B52;
GL_LIGHT_MODEL_AMBIENT = $0B53;
GL_LIGHT_MODEL_COLOR_CONTROL = $81F8; // GL 1.2
GL_SHADE_MODEL = $0B54;
GL_NORMALIZE = $0BA1;
GL_AMBIENT = $1200;
GL_DIFFUSE = $1201;
GL_SPECULAR = $1202;
GL_POSITION = $1203;
GL_SPOT_DIRECTION = $1204;
GL_SPOT_EXPONENT = $1205;
GL_SPOT_CUTOFF = $1206;
GL_CONSTANT_ATTENUATION = $1207;
GL_LINEAR_ATTENUATION = $1208;
GL_QUADRATIC_ATTENUATION = $1209;
GL_EMISSION = $1600;
GL_SHININESS = $1601;
GL_AMBIENT_AND_DIFFUSE = $1602;
GL_COLOR_INDEXES = $1603;
GL_FLAT = $1D00;
GL_SMOOTH = $1D01;
GL_LIGHT0 = $4000;
GL_LIGHT1 = $4001;
GL_LIGHT2 = $4002;
GL_LIGHT3 = $4003;
GL_LIGHT4 = $4004;
GL_LIGHT5 = $4005;
GL_LIGHT6 = $4006;
GL_LIGHT7 = $4007;
// matrix modes
GL_MATRIX_MODE = $0BA0;
GL_MODELVIEW = $1700;
GL_PROJECTION = $1701;
GL_TEXTURE = $1702;
// gets
GL_CURRENT_COLOR = $0B00;
GL_CURRENT_INDEX = $0B01;
GL_CURRENT_NORMAL = $0B02;
GL_CURRENT_TEXTURE_COORDS = $0B03;
GL_CURRENT_RASTER_COLOR = $0B04;
GL_CURRENT_RASTER_INDEX = $0B05;
GL_CURRENT_RASTER_TEXTURE_COORDS = $0B06;
GL_CURRENT_RASTER_POSITION = $0B07;
GL_CURRENT_RASTER_POSITION_VALID = $0B08;
GL_CURRENT_RASTER_DISTANCE = $0B09;
GL_MAX_LIST_NESTING = $0B31;
GL_VIEWPORT = $0BA2;
GL_MODELVIEW_STACK_DEPTH = $0BA3;
GL_PROJECTION_STACK_DEPTH = $0BA4;
GL_TEXTURE_STACK_DEPTH = $0BA5;
GL_MODELVIEW_MATRIX = $0BA6;
GL_PROJECTION_MATRIX = $0BA7;
GL_TEXTURE_MATRIX = $0BA8;
GL_ATTRIB_STACK_DEPTH = $0BB0;
GL_CLIENT_ATTRIB_STACK_DEPTH = $0BB1;
GL_SINGLE_COLOR = $81F9; // GL 1.2
GL_SEPARATE_SPECULAR_COLOR = $81FA; // GL 1.2
// alpha testing
GL_ALPHA_TEST = $0BC0;
GL_ALPHA_TEST_FUNC = $0BC1;
GL_ALPHA_TEST_REF = $0BC2;
GL_LOGIC_OP_MODE = $0BF0;
GL_INDEX_LOGIC_OP = $0BF1;
GL_LOGIC_OP = $0BF1;
GL_COLOR_LOGIC_OP = $0BF2;
GL_SCISSOR_BOX = $0C10;
GL_SCISSOR_TEST = $0C11;
GL_INDEX_CLEAR_VALUE = $0C20;
GL_INDEX_WRITEMASK = $0C21;
GL_COLOR_CLEAR_VALUE = $0C22;
GL_COLOR_WRITEMASK = $0C23;
GL_INDEX_MODE = $0C30;
GL_RGBA_MODE = $0C31;
GL_RENDER_MODE = $0C40;
GL_PERSPECTIVE_CORRECTION_HINT = $0C50;
GL_POINT_SMOOTH_HINT = $0C51;
GL_LINE_SMOOTH_HINT = $0C52;
GL_POLYGON_SMOOTH_HINT = $0C53;
GL_FOG_HINT = $0C54;
GL_TEXTURE_GEN_S = $0C60;
GL_TEXTURE_GEN_T = $0C61;
GL_TEXTURE_GEN_R = $0C62;
GL_TEXTURE_GEN_Q = $0C63;
GL_PIXEL_MAP_I_TO_I_SIZE = $0CB0;
GL_PIXEL_MAP_S_TO_S_SIZE = $0CB1;
GL_PIXEL_MAP_I_TO_R_SIZE = $0CB2;
GL_PIXEL_MAP_I_TO_G_SIZE = $0CB3;
GL_PIXEL_MAP_I_TO_B_SIZE = $0CB4;
GL_PIXEL_MAP_I_TO_A_SIZE = $0CB5;
GL_PIXEL_MAP_R_TO_R_SIZE = $0CB6;
GL_PIXEL_MAP_G_TO_G_SIZE = $0CB7;
GL_PIXEL_MAP_B_TO_B_SIZE = $0CB8;
GL_PIXEL_MAP_A_TO_A_SIZE = $0CB9;
GL_UNPACK_SWAP_BYTES = $0CF0;
GL_UNPACK_LSB_FIRST = $0CF1;
GL_UNPACK_ROW_LENGTH = $0CF2;
GL_UNPACK_SKIP_ROWS = $0CF3;
GL_UNPACK_SKIP_PIXELS = $0CF4;
GL_UNPACK_ALIGNMENT = $0CF5;
GL_PACK_SWAP_BYTES = $0D00;
GL_PACK_LSB_FIRST = $0D01;
GL_PACK_ROW_LENGTH = $0D02;
GL_PACK_SKIP_ROWS = $0D03;
GL_PACK_SKIP_PIXELS = $0D04;
GL_PACK_ALIGNMENT = $0D05;
GL_PACK_SKIP_IMAGES = $806B; // GL 1.2
GL_PACK_IMAGE_HEIGHT = $806C; // GL 1.2
GL_UNPACK_SKIP_IMAGES = $806D; // GL 1.2
GL_UNPACK_IMAGE_HEIGHT = $806E; // GL 1.2
GL_MAP_COLOR = $0D10;
GL_MAP_STENCIL = $0D11;
GL_INDEX_SHIFT = $0D12;
GL_INDEX_OFFSET = $0D13;
GL_RED_SCALE = $0D14;
GL_RED_BIAS = $0D15;
GL_ZOOM_X = $0D16;
GL_ZOOM_Y = $0D17;
GL_GREEN_SCALE = $0D18;
GL_GREEN_BIAS = $0D19;
GL_BLUE_SCALE = $0D1A;
GL_BLUE_BIAS = $0D1B;
GL_ALPHA_SCALE = $0D1C;
GL_ALPHA_BIAS = $0D1D;
GL_DEPTH_SCALE = $0D1E;
GL_DEPTH_BIAS = $0D1F;
GL_MAX_EVAL_ORDER = $0D30;
GL_MAX_LIGHTS = $0D31;
GL_MAX_CLIP_PLANES = $0D32;
GL_MAX_TEXTURE_SIZE = $0D33;
GL_MAX_3D_TEXTURE_SIZE = $8073; // GL 1.2
GL_MAX_PIXEL_MAP_TABLE = $0D34;
GL_MAX_ATTRIB_STACK_DEPTH = $0D35;
GL_MAX_MODELVIEW_STACK_DEPTH = $0D36;
GL_MAX_NAME_STACK_DEPTH = $0D37;
GL_MAX_PROJECTION_STACK_DEPTH = $0D38;
GL_MAX_TEXTURE_STACK_DEPTH = $0D39;
GL_MAX_VIEWPORT_DIMS = $0D3A;
GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = $0D3B;
GL_MAX_ELEMENTS_VERTICES = $80E8; // GL 1.2
GL_MAX_ELEMENTS_INDICES = $80E9; // GL 1.2
GL_RESCALE_NORMAL = $803A; // GL 1.2
GL_SUBPIXEL_BITS = $0D50;
GL_INDEX_BITS = $0D51;
GL_RED_BITS = $0D52;
GL_GREEN_BITS = $0D53;
GL_BLUE_BITS = $0D54;
GL_ALPHA_BITS = $0D55;
GL_DEPTH_BITS = $0D56;
GL_STENCIL_BITS = $0D57;
GL_ACCUM_RED_BITS = $0D58;
GL_ACCUM_GREEN_BITS = $0D59;
GL_ACCUM_BLUE_BITS = $0D5A;
GL_ACCUM_ALPHA_BITS = $0D5B;
GL_NAME_STACK_DEPTH = $0D70;
GL_AUTO_NORMAL = $0D80;
GL_MAP1_COLOR_4 = $0D90;
GL_MAP1_INDEX = $0D91;
GL_MAP1_NORMAL = $0D92;
GL_MAP1_TEXTURE_COORD_1 = $0D93;
GL_MAP1_TEXTURE_COORD_2 = $0D94;
GL_MAP1_TEXTURE_COORD_3 = $0D95;
GL_MAP1_TEXTURE_COORD_4 = $0D96;
GL_MAP1_VERTEX_3 = $0D97;
GL_MAP1_VERTEX_4 = $0D98;
GL_MAP2_COLOR_4 = $0DB0;
GL_MAP2_INDEX = $0DB1;
GL_MAP2_NORMAL = $0DB2;
GL_MAP2_TEXTURE_COORD_1 = $0DB3;
GL_MAP2_TEXTURE_COORD_2 = $0DB4;
GL_MAP2_TEXTURE_COORD_3 = $0DB5;
GL_MAP2_TEXTURE_COORD_4 = $0DB6;
GL_MAP2_VERTEX_3 = $0DB7;
GL_MAP2_VERTEX_4 = $0DB8;
GL_MAP1_GRID_DOMAIN = $0DD0;
GL_MAP1_GRID_SEGMENTS = $0DD1;
GL_MAP2_GRID_DOMAIN = $0DD2;
GL_MAP2_GRID_SEGMENTS = $0DD3;
GL_TEXTURE_1D = $0DE0;
GL_TEXTURE_2D = $0DE1;
GL_TEXTURE_3D = $806F; // GL 1.2
GL_SELECTION_BUFFER_POINTER = $0DF3;
GL_SELECTION_BUFFER_SIZE = $0DF4;
GL_POLYGON_OFFSET_UNITS = $2A00;
GL_POLYGON_OFFSET_POINT = $2A01;
GL_POLYGON_OFFSET_LINE = $2A02;
GL_POLYGON_OFFSET_FILL = $8037;
GL_POLYGON_OFFSET_FACTOR = $8038;
GL_TEXTURE_BINDING_1D = $8068;
GL_TEXTURE_BINDING_2D = $8069;
GL_VERTEX_ARRAY = $8074;
GL_NORMAL_ARRAY = $8075;
GL_COLOR_ARRAY = $8076;
GL_INDEX_ARRAY = $8077;
GL_TEXTURE_COORD_ARRAY = $8078;
GL_EDGE_FLAG_ARRAY = $8079;
GL_VERTEX_ARRAY_SIZE = $807A;
GL_VERTEX_ARRAY_TYPE = $807B;
GL_VERTEX_ARRAY_STRIDE = $807C;
GL_NORMAL_ARRAY_TYPE = $807E;
GL_NORMAL_ARRAY_STRIDE = $807F;
GL_COLOR_ARRAY_SIZE = $8081;
GL_COLOR_ARRAY_TYPE = $8082;
GL_COLOR_ARRAY_STRIDE = $8083;
GL_INDEX_ARRAY_TYPE = $8085;
GL_INDEX_ARRAY_STRIDE = $8086;
GL_TEXTURE_COORD_ARRAY_SIZE = $8088;
GL_TEXTURE_COORD_ARRAY_TYPE = $8089;
GL_TEXTURE_COORD_ARRAY_STRIDE = $808A;
GL_EDGE_FLAG_ARRAY_STRIDE = $808C;
GL_COLOR_MATRIX = $80B1; // GL 1.2 ARB imaging
GL_COLOR_MATRIX_STACK_DEPTH = $80B2; // GL 1.2 ARB imaging
GL_MAX_COLOR_MATRIX_STACK_DEPTH = $80B3; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_RED_SCALE = $80B4; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_GREEN_SCALE = $80B5; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_BLUE_SCALE = $80B6; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_ALPHA_SCALE = $80B7; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_RED_BIAS = $80B8; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_GREEN_BIAS = $80B9; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_BLUE_BIAS = $80BA; // GL 1.2 ARB imaging
GL_POST_COLOR_MATRIX_ALPHA_BIAS = $80BB; // GL 1.2 ARB imaging
// evaluators
GL_COEFF = $0A00;
GL_ORDER = $0A01;
GL_DOMAIN = $0A02;
// texture mapping
GL_TEXTURE_WIDTH = $1000;
GL_TEXTURE_HEIGHT = $1001;
GL_TEXTURE_INTERNAL_FORMAT = $1003;
GL_TEXTURE_COMPONENTS = $1003;
GL_TEXTURE_BORDER_COLOR = $1004;
GL_TEXTURE_BORDER = $1005;
GL_TEXTURE_RED_SIZE = $805C;
GL_TEXTURE_GREEN_SIZE = $805D;
GL_TEXTURE_BLUE_SIZE = $805E;
GL_TEXTURE_ALPHA_SIZE = $805F;
GL_TEXTURE_LUMINANCE_SIZE = $8060;
GL_TEXTURE_INTENSITY_SIZE = $8061;
GL_TEXTURE_PRIORITY = $8066;
GL_TEXTURE_RESIDENT = $8067;
GL_BGR = $80E0; // v 1.2
GL_BGRA = $80E1; // v 1.2
GL_S = $2000;
GL_T = $2001;
GL_R = $2002;
GL_Q = $2003;
GL_MODULATE = $2100;
GL_DECAL = $2101;
GL_TEXTURE_ENV_MODE = $2200;
GL_TEXTURE_ENV_COLOR = $2201;