-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenGL12.pas
8968 lines (8376 loc) · 467 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
// 23/02/02 - EG - Added GL_NV_fence
{******************************************************************************}
{ }
{ 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 context }
{ and extension management functions. }
{ }
{ The original Pascal code is: OpenGL12.pas }
{ The initial developer of the Pascal code is Mike Lischke }
{ }
{ }
{ 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 }
{ }
{ 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.
//
// NOTE: In order to fully support multi thread rendering it is necessary to hold all
// extension address in threadvars. For single threaded applications this would be an
// unnecessary time penalty, however. Hence there is a compiler switch to
// allow single threaded OpenGL application to use vars while multi threaded applications
// will use threadvars. By default the switch MULTITHREADOPENGL is not active and
// must explicitly enabled to take effect.
//
//----------------------------------------------------------------------------------------------------------------------
//
// 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 than the default ones. This function closes previously
// loaded DLLs before it tries to open the new libraries.
// 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 if <> 0)
// 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])
// - initial context activation balancing by Eric Grange ([email protected])
// - additional nVidia extensions by Olivier Chatelain ([email protected])
//
// Contact: [email protected], www.lischke-online.de
//
// Version: 1.2.10
//----------------------------------------------------------------------------------------------------------------------
// 18-AUG-2001 ml:
// - multi thread support for function addresses (extensions)
// 28-JUL-2001 ml:
// - included original type names (+ $EXTERNALSYM directives)
// 10-JUL-2001 ml:
// - TGLubyte changed to UCHAR
// 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
// Deactived by Eric Grange - GLScene is not thread-safe, so get best performance
{.$define MULTITHREADOPENGL}
{.$i ..\GLScene.inc}
uses
VectorTypes, // Added by Eric Grange for GLScene Compatibility
{$ifdef Win32}
Windows
{$endif Win32}
{$ifdef LINUX}
LibC, XLib, Types
{$endif LINUX}
;
type
TRCOptions = set of (
opDoubleBuffered,
opGDI,
opStereo
);
{$EXTERNALSYM GLenum}
GLenum = UINT;
TGLenum = UINT;
PGLenum = ^TGLenum;
{$EXTERNALSYM GLboolean}
GLboolean = BYTEBOOL;
TGLboolean = BYTEBOOL;
PGLboolean = ^TGLboolean;
{$EXTERNALSYM GLbitfield}
GLbitfield = UINT;
TGLbitfield = UINT;
PGLbitfield = ^TGLbitfield;
{$EXTERNALSYM GLbyte}
GLbyte = ShortInt;
TGLbyte = ShortInt;
PGLbyte = ^TGLbyte;
{$EXTERNALSYM GLshort}
GLshort = SmallInt;
TGLshort = SmallInt;
PGLshort = ^TGLshort;
{$EXTERNALSYM GLint}
GLint = Integer;
TGLint = Integer;
PGLint = ^TGLint;
{$EXTERNALSYM GLsizei}
GLsizei = Integer;
TGLsizei = Integer;
PGLsizei = ^TGLsizei;
{$EXTERNALSYM GLubyte}
GLubyte = UCHAR;
TGLubyte = UCHAR;
PGLubyte = ^TGLubyte;
{$EXTERNALSYM GLushort}
GLushort = Word;
TGLushort = Word;
PGLushort = ^TGLushort;
{$EXTERNALSYM GLuint}
GLuint = UINT;
TGLuint = UINT;
PGLuint = ^TGLuint;
{$EXTERNALSYM GLfloat}
GLfloat = Single;
TGLfloat = Single;
PGLfloat = ^TGLfloat;
{$EXTERNALSYM GLclampf}
GLclampf = Single;
TGLclampf = Single;
PGLclampf = ^TGLclampf;
{$EXTERNALSYM GLdouble}
GLdouble = Double;
TGLdouble = Double;
PGLdouble = ^TGLdouble;
{$EXTERNALSYM GLclampd}
GLclampd = Double;
TGLclampd = Double;
PGLclampd = ^TGLclampd;
// Commented out by Eric Grange for GLScene Compatibility
{
TVector3d = array[0..2] of GLdouble;
TVector4i = array[0..3] of GLint;
TVector4f = array[0..3] of GLfloat;
TMatrix4f = array[0..3, 0..3] of GLfloat;
TMatrix4d = array[0..3, 0..3] of GLdouble;
}
TVector4p = array[0..3] of Pointer;
PPointer = ^Pointer;
{$ifdef MULTITHREADOPENGL}
threadvar
{$else}
var
{$endif}
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_NV_multisample_filter_hint,
GL_NV_fence,
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,
// -EGG- ----------------------------
WGL_EXT_swap_control,
WGL_ARB_multisample,
WGL_ARB_extensions_string,
WGL_ARB_pixel_format,
WGL_ARB_pbuffer,
WGL_ARB_buffer_region,
// Extensions (glu)
GLU_EXT_Texture,
GLU_EXT_object_space_tess,
GLU_EXT_nurbs_tessellator: Boolean;
const
// ********** GL generic constants **********
// errors
GL_NO_ERROR = 0;
{$EXTERNALSYM GL_NO_ERROR}
GL_INVALID_ENUM = $0500;
{$EXTERNALSYM GL_INVALID_ENUM}
GL_INVALID_VALUE = $0501;
{$EXTERNALSYM GL_INVALID_VALUE}
GL_INVALID_OPERATION = $0502;
{$EXTERNALSYM GL_INVALID_OPERATION}
GL_STACK_OVERFLOW = $0503;
{$EXTERNALSYM GL_STACK_OVERFLOW}
GL_STACK_UNDERFLOW = $0504;
{$EXTERNALSYM GL_STACK_UNDERFLOW}
GL_OUT_OF_MEMORY = $0505;
{$EXTERNALSYM GL_STACK_UNDERFLOW}
// attribute bits
GL_CURRENT_BIT = $00000001;
{$EXTERNALSYM GL_CURRENT_BIT}
GL_POINT_BIT = $00000002;
{$EXTERNALSYM GL_POINT_BIT}
GL_LINE_BIT = $00000004;
{$EXTERNALSYM GL_LINE_BIT}
GL_POLYGON_BIT = $00000008;
{$EXTERNALSYM GL_POLYGON_BIT}
GL_POLYGON_STIPPLE_BIT = $00000010;
{$EXTERNALSYM GL_POLYGON_STIPPLE_BIT}
GL_PIXEL_MODE_BIT = $00000020;
{$EXTERNALSYM GL_PIXEL_MODE_BIT}
GL_LIGHTING_BIT = $00000040;
{$EXTERNALSYM GL_LIGHTING_BIT}
GL_FOG_BIT = $00000080;
{$EXTERNALSYM GL_FOG_BIT}
GL_DEPTH_BUFFER_BIT = $00000100;
{$EXTERNALSYM GL_DEPTH_BUFFER_BIT}
GL_ACCUM_BUFFER_BIT = $00000200;
{$EXTERNALSYM GL_ACCUM_BUFFER_BIT}
GL_STENCIL_BUFFER_BIT = $00000400;
{$EXTERNALSYM GL_STENCIL_BUFFER_BIT}
GL_VIEWPORT_BIT = $00000800;
{$EXTERNALSYM GL_VIEWPORT_BIT}
GL_TRANSFORM_BIT = $00001000;
{$EXTERNALSYM GL_TRANSFORM_BIT}
GL_ENABLE_BIT = $00002000;
{$EXTERNALSYM GL_ENABLE_BIT}
GL_COLOR_BUFFER_BIT = $00004000;
{$EXTERNALSYM GL_COLOR_BUFFER_BIT}
GL_HINT_BIT = $00008000;
{$EXTERNALSYM GL_HINT_BIT}
GL_EVAL_BIT = $00010000;
{$EXTERNALSYM GL_EVAL_BIT}
GL_LIST_BIT = $00020000;
{$EXTERNALSYM GL_LIST_BIT}
GL_TEXTURE_BIT = $00040000;
{$EXTERNALSYM GL_TEXTURE_BIT}
GL_SCISSOR_BIT = $00080000;
{$EXTERNALSYM GL_SCISSOR_BIT}
GL_ALL_ATTRIB_BITS = $000FFFFF;
{$EXTERNALSYM GL_ALL_ATTRIB_BITS}
// client attribute bits
GL_CLIENT_PIXEL_STORE_BIT = $00000001;
{$EXTERNALSYM GL_CLIENT_PIXEL_STORE_BIT}
GL_CLIENT_VERTEX_ARRAY_BIT = $00000002;
{$EXTERNALSYM GL_CLIENT_VERTEX_ARRAY_BIT}
GL_CLIENT_ALL_ATTRIB_BITS = $FFFFFFFF;
{$EXTERNALSYM GL_CLIENT_ALL_ATTRIB_BITS}
// boolean values
GL_FALSE = 0;
{$EXTERNALSYM GL_FALSE}
GL_TRUE = 1;
{$EXTERNALSYM GL_TRUE}
// primitives
GL_POINTS = $0000;
{$EXTERNALSYM GL_POINTS}
GL_LINES = $0001;
{$EXTERNALSYM GL_LINES}
GL_LINE_LOOP = $0002;
{$EXTERNALSYM GL_LINE_LOOP}
GL_LINE_STRIP = $0003;
{$EXTERNALSYM GL_LINE_STRIP}
GL_TRIANGLES = $0004;
{$EXTERNALSYM GL_TRIANGLES}
GL_TRIANGLE_STRIP = $0005;
{$EXTERNALSYM GL_TRIANGLE_STRIP}
GL_TRIANGLE_FAN = $0006;
{$EXTERNALSYM GL_TRIANGLE_FAN}
GL_QUADS = $0007;
{$EXTERNALSYM GL_QUADS}
GL_QUAD_STRIP = $0008;
{$EXTERNALSYM GL_QUAD_STRIP}
GL_POLYGON = $0009;
{$EXTERNALSYM GL_POLYGON}
// blending
GL_ZERO = 0;
{$EXTERNALSYM GL_ZERO}
GL_ONE = 1;
{$EXTERNALSYM GL_ONE}
GL_SRC_COLOR = $0300;
{$EXTERNALSYM GL_SRC_COLOR}
GL_ONE_MINUS_SRC_COLOR = $0301;
{$EXTERNALSYM GL_ONE_MINUS_SRC_COLOR}
GL_SRC_ALPHA = $0302;
{$EXTERNALSYM GL_SRC_ALPHA}
GL_ONE_MINUS_SRC_ALPHA = $0303;
{$EXTERNALSYM GL_ONE_MINUS_SRC_ALPHA}
GL_DST_ALPHA = $0304;
{$EXTERNALSYM GL_DST_ALPHA}
GL_ONE_MINUS_DST_ALPHA = $0305;
{$EXTERNALSYM GL_ONE_MINUS_DST_ALPHA}
GL_DST_COLOR = $0306;
{$EXTERNALSYM GL_DST_COLOR}
GL_ONE_MINUS_DST_COLOR = $0307;
{$EXTERNALSYM GL_ONE_MINUS_DST_COLOR}
GL_SRC_ALPHA_SATURATE = $0308;
{$EXTERNALSYM GL_SRC_ALPHA_SATURATE}
GL_BLEND_DST = $0BE0;
{$EXTERNALSYM GL_BLEND_DST}
GL_BLEND_SRC = $0BE1;
{$EXTERNALSYM GL_BLEND_SRC}
GL_BLEND = $0BE2;
{$EXTERNALSYM GL_BLEND}
// blending (GL 1.2 ARB imaging)
GL_BLEND_COLOR = $8005;
{$EXTERNALSYM GL_BLEND_COLOR}
GL_CONSTANT_COLOR = $8001;
{$EXTERNALSYM GL_CONSTANT_COLOR}
GL_ONE_MINUS_CONSTANT_COLOR = $8002;
{$EXTERNALSYM GL_ONE_MINUS_CONSTANT_COLOR}
GL_CONSTANT_ALPHA = $8003;
{$EXTERNALSYM GL_CONSTANT_ALPHA}
GL_ONE_MINUS_CONSTANT_ALPHA = $8004;
{$EXTERNALSYM GL_ONE_MINUS_CONSTANT_ALPHA}
GL_FUNC_ADD = $8006;
{$EXTERNALSYM GL_FUNC_ADD}
GL_MIN = $8007;
{$EXTERNALSYM GL_MIN}
GL_MAX = $8008;
{$EXTERNALSYM GL_MAX}
GL_FUNC_SUBTRACT = $800A;
{$EXTERNALSYM GL_FUNC_SUBTRACT}
GL_FUNC_REVERSE_SUBTRACT = $800B;
{$EXTERNALSYM GL_FUNC_REVERSE_SUBTRACT}
// color table GL 1.2 ARB imaging
GL_COLOR_TABLE = $80D0;
{$EXTERNALSYM GL_COLOR_TABLE}
GL_POST_CONVOLUTION_COLOR_TABLE = $80D1;
{$EXTERNALSYM GL_POST_CONVOLUTION_COLOR_TABLE}
GL_POST_COLOR_MATRIX_COLOR_TABLE = $80D2;
{$EXTERNALSYM GL_POST_COLOR_MATRIX_COLOR_TABLE}
GL_PROXY_COLOR_TABLE = $80D3;
{$EXTERNALSYM GL_PROXY_COLOR_TABLE}
GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = $80D4;
{$EXTERNALSYM GL_PROXY_POST_CONVOLUTION_COLOR_TABLE}
GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = $80D5;
{$EXTERNALSYM GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
GL_COLOR_TABLE_SCALE = $80D6;
{$EXTERNALSYM GL_COLOR_TABLE_SCALE}
GL_COLOR_TABLE_BIAS = $80D7;
{$EXTERNALSYM GL_COLOR_TABLE_BIAS}
GL_COLOR_TABLE_FORMAT = $80D8;
{$EXTERNALSYM GL_COLOR_TABLE_FORMAT}
GL_COLOR_TABLE_WIDTH = $80D9;
{$EXTERNALSYM GL_COLOR_TABLE_WIDTH}
GL_COLOR_TABLE_RED_SIZE = $80DA;
{$EXTERNALSYM GL_COLOR_TABLE_RED_SIZE}
GL_COLOR_TABLE_GREEN_SIZE = $80DB;
{$EXTERNALSYM GL_COLOR_TABLE_GREEN_SIZE}
GL_COLOR_TABLE_BLUE_SIZE = $80DC;
{$EXTERNALSYM GL_COLOR_TABLE_BLUE_SIZE}
GL_COLOR_TABLE_ALPHA_SIZE = $80DD;
{$EXTERNALSYM GL_COLOR_TABLE_ALPHA_SIZE}
GL_COLOR_TABLE_LUMINANCE_SIZE = $80DE;
{$EXTERNALSYM GL_COLOR_TABLE_LUMINANCE_SIZE}
GL_COLOR_TABLE_INTENSITY_SIZE = $80DF;
{$EXTERNALSYM GL_COLOR_TABLE_INTENSITY_SIZE}
// convolutions GL 1.2 ARB imaging
GL_CONVOLUTION_1D = $8010;
{$EXTERNALSYM GL_CONVOLUTION_1D}
GL_CONVOLUTION_2D = $8011;
{$EXTERNALSYM GL_CONVOLUTION_2D}
GL_SEPARABLE_2D = $8012;
{$EXTERNALSYM GL_SEPARABLE_2D}
GL_CONVOLUTION_BORDER_MODE = $8013;
{$EXTERNALSYM GL_CONVOLUTION_BORDER_MODE}
GL_CONVOLUTION_FILTER_SCALE = $8014;
{$EXTERNALSYM GL_CONVOLUTION_FILTER_SCALE}
GL_CONVOLUTION_FILTER_BIAS = $8015;
{$EXTERNALSYM GL_CONVOLUTION_FILTER_BIAS}
GL_REDUCE = $8016;
{$EXTERNALSYM GL_REDUCE}
GL_CONVOLUTION_FORMAT = $8017;
{$EXTERNALSYM GL_CONVOLUTION_FORMAT}
GL_CONVOLUTION_WIDTH = $8018;
{$EXTERNALSYM GL_CONVOLUTION_WIDTH}
GL_CONVOLUTION_HEIGHT = $8019;
{$EXTERNALSYM GL_CONVOLUTION_HEIGHT}
GL_MAX_CONVOLUTION_WIDTH = $801A;
{$EXTERNALSYM GL_MAX_CONVOLUTION_WIDTH}
GL_MAX_CONVOLUTION_HEIGHT = $801B;
{$EXTERNALSYM GL_MAX_CONVOLUTION_HEIGHT}
GL_POST_CONVOLUTION_RED_SCALE = $801C;
{$EXTERNALSYM GL_POST_CONVOLUTION_RED_SCALE}
GL_POST_CONVOLUTION_GREEN_SCALE = $801D;
{$EXTERNALSYM GL_POST_CONVOLUTION_GREEN_SCALE}
GL_POST_CONVOLUTION_BLUE_SCALE = $801E;
{$EXTERNALSYM GL_POST_CONVOLUTION_BLUE_SCALE}
GL_POST_CONVOLUTION_ALPHA_SCALE = $801F;
{$EXTERNALSYM GL_POST_CONVOLUTION_ALPHA_SCALE}
GL_POST_CONVOLUTION_RED_BIAS = $8020;
{$EXTERNALSYM GL_POST_CONVOLUTION_RED_BIAS}
GL_POST_CONVOLUTION_GREEN_BIAS = $8021;
{$EXTERNALSYM GL_POST_CONVOLUTION_GREEN_BIAS}
GL_POST_CONVOLUTION_BLUE_BIAS = $8022;
{$EXTERNALSYM GL_POST_CONVOLUTION_BLUE_BIAS}
GL_POST_CONVOLUTION_ALPHA_BIAS = $8023;
{$EXTERNALSYM GL_POST_CONVOLUTION_ALPHA_BIAS}
// histogram GL 1.2 ARB imaging
GL_HISTOGRAM = $8024;
{$EXTERNALSYM GL_HISTOGRAM}
GL_PROXY_HISTOGRAM = $8025;
{$EXTERNALSYM GL_PROXY_HISTOGRAM}
GL_HISTOGRAM_WIDTH = $8026;
{$EXTERNALSYM GL_HISTOGRAM_WIDTH}
GL_HISTOGRAM_FORMAT = $8027;
{$EXTERNALSYM GL_HISTOGRAM_FORMAT}
GL_HISTOGRAM_RED_SIZE = $8028;
{$EXTERNALSYM GL_HISTOGRAM_RED_SIZE}
GL_HISTOGRAM_GREEN_SIZE = $8029;
{$EXTERNALSYM GL_HISTOGRAM_GREEN_SIZE}
GL_HISTOGRAM_BLUE_SIZE = $802A;
{$EXTERNALSYM GL_HISTOGRAM_BLUE_SIZE}
GL_HISTOGRAM_ALPHA_SIZE = $802B;
{$EXTERNALSYM GL_HISTOGRAM_ALPHA_SIZE}
GL_HISTOGRAM_LUMINANCE_SIZE = $802C;
{$EXTERNALSYM GL_HISTOGRAM_LUMINANCE_SIZE}
GL_HISTOGRAM_SINK = $802D;
{$EXTERNALSYM GL_HISTOGRAM_SINK}
GL_MINMAX = $802E;
{$EXTERNALSYM GL_MINMAX}
GL_MINMAX_FORMAT = $802F;
{$EXTERNALSYM GL_MINMAX_FORMAT}
GL_MINMAX_SINK = $8030;
{$EXTERNALSYM GL_MINMAX_SINK}
// buffers
GL_NONE = 0;
{$EXTERNALSYM GL_NONE}
GL_FRONT_LEFT = $0400;
{$EXTERNALSYM GL_FRONT_LEFT}
GL_FRONT_RIGHT = $0401;
{$EXTERNALSYM GL_FRONT_RIGHT}
GL_BACK_LEFT = $0402;
{$EXTERNALSYM GL_BACK_LEFT}
GL_BACK_RIGHT = $0403;
{$EXTERNALSYM GL_BACK_RIGHT}
GL_FRONT = $0404;
{$EXTERNALSYM GL_FRONT}
GL_BACK = $0405;
{$EXTERNALSYM GL_BACK}
GL_LEFT = $0406;
{$EXTERNALSYM GL_LEFT}
GL_RIGHT = $0407;
{$EXTERNALSYM GL_RIGHT}
GL_FRONT_AND_BACK = $0408;
{$EXTERNALSYM GL_FRONT_AND_BACK}
GL_AUX0 = $0409;
{$EXTERNALSYM GL_AUX0}
GL_AUX1 = $040A;
{$EXTERNALSYM GL_AUX1}
GL_AUX2 = $040B;
{$EXTERNALSYM GL_AUX2}
GL_AUX3 = $040C;
{$EXTERNALSYM GL_AUX3}
GL_AUX_BUFFERS = $0C00;
{$EXTERNALSYM GL_AUX_BUFFERS}
GL_DRAW_BUFFER = $0C01;
{$EXTERNALSYM GL_DRAW_BUFFER}
GL_READ_BUFFER = $0C02;
{$EXTERNALSYM GL_READ_BUFFER}
GL_DOUBLEBUFFER = $0C32;
{$EXTERNALSYM GL_DOUBLEBUFFER}
GL_STEREO = $0C33;
{$EXTERNALSYM GL_STEREO}
// depth buffer
GL_DEPTH_RANGE = $0B70;
{$EXTERNALSYM GL_DEPTH_RANGE}
GL_DEPTH_TEST = $0B71;
{$EXTERNALSYM GL_DEPTH_TEST}
GL_DEPTH_WRITEMASK = $0B72;
{$EXTERNALSYM GL_DEPTH_WRITEMASK}
GL_DEPTH_CLEAR_VALUE = $0B73;
{$EXTERNALSYM GL_DEPTH_CLEAR_VALUE}
GL_DEPTH_FUNC = $0B74;
{$EXTERNALSYM GL_DEPTH_FUNC}
GL_NEVER = $0200;
{$EXTERNALSYM GL_NEVER}
GL_LESS = $0201;
{$EXTERNALSYM GL_LESS}
GL_EQUAL = $0202;
{$EXTERNALSYM GL_EQUAL}
GL_LEQUAL = $0203;
{$EXTERNALSYM GL_LEQUAL}
GL_GREATER = $0204;
{$EXTERNALSYM GL_GREATER}
GL_NOTEQUAL = $0205;
{$EXTERNALSYM GL_NOTEQUAL}
GL_GEQUAL = $0206;
{$EXTERNALSYM GL_GEQUAL}
GL_ALWAYS = $0207;
{$EXTERNALSYM GL_ALWAYS}
// accumulation buffer
GL_ACCUM = $0100;
{$EXTERNALSYM GL_ACCUM}
GL_LOAD = $0101;
{$EXTERNALSYM GL_LOAD}
GL_RETURN = $0102;
{$EXTERNALSYM GL_RETURN}
GL_MULT = $0103;
{$EXTERNALSYM GL_MULT}
GL_ADD = $0104;
{$EXTERNALSYM GL_ADD}
GL_ACCUM_CLEAR_VALUE = $0B80;
{$EXTERNALSYM GL_ACCUM_CLEAR_VALUE}
// feedback buffer
GL_FEEDBACK_BUFFER_POINTER = $0DF0;
{$EXTERNALSYM GL_FEEDBACK_BUFFER_POINTER}
GL_FEEDBACK_BUFFER_SIZE = $0DF1;
{$EXTERNALSYM GL_FEEDBACK_BUFFER_SIZE}
GL_FEEDBACK_BUFFER_TYPE = $0DF2;
{$EXTERNALSYM GL_FEEDBACK_BUFFER_TYPE}
// feedback types
GL_2D = $0600;
{$EXTERNALSYM GL_2D}
GL_3D = $0601;
{$EXTERNALSYM GL_3D}
GL_3D_COLOR = $0602;
{$EXTERNALSYM GL_3D_COLOR}
GL_3D_COLOR_TEXTURE = $0603;
{$EXTERNALSYM GL_3D_COLOR_TEXTURE}
GL_4D_COLOR_TEXTURE = $0604;
{$EXTERNALSYM GL_4D_COLOR_TEXTURE}
// feedback tokens
GL_PASS_THROUGH_TOKEN = $0700;
{$EXTERNALSYM GL_PASS_THROUGH_TOKEN}
GL_POINT_TOKEN = $0701;
{$EXTERNALSYM GL_POINT_TOKEN}
GL_LINE_TOKEN = $0702;
{$EXTERNALSYM GL_LINE_TOKEN}
GL_POLYGON_TOKEN = $0703;
{$EXTERNALSYM GL_POLYGON_TOKEN}
GL_BITMAP_TOKEN = $0704;
{$EXTERNALSYM GL_BITMAP_TOKEN}
GL_DRAW_PIXEL_TOKEN = $0705;
{$EXTERNALSYM GL_DRAW_PIXEL_TOKEN}
GL_COPY_PIXEL_TOKEN = $0706;
{$EXTERNALSYM GL_COPY_PIXEL_TOKEN}
GL_LINE_RESET_TOKEN = $0707;
{$EXTERNALSYM GL_LINE_RESET_TOKEN}
// fog
GL_EXP = $0800;
{$EXTERNALSYM GL_EXP}
GL_EXP2 = $0801;
{$EXTERNALSYM GL_EXP2}
GL_FOG = $0B60;
{$EXTERNALSYM GL_FOG}
GL_FOG_INDEX = $0B61;
{$EXTERNALSYM GL_FOG_INDEX}
GL_FOG_DENSITY = $0B62;
{$EXTERNALSYM GL_FOG_DENSITY}
GL_FOG_START = $0B63;
{$EXTERNALSYM GL_FOG_START}
GL_FOG_END = $0B64;
{$EXTERNALSYM GL_FOG_END}
GL_FOG_MODE = $0B65;
{$EXTERNALSYM GL_FOG_MODE}
GL_FOG_COLOR = $0B66;
{$EXTERNALSYM GL_FOG_COLOR}
// pixel mode, transfer
GL_PIXEL_MAP_I_TO_I = $0C70;
{$EXTERNALSYM GL_PIXEL_MAP_I_TO_I}
GL_PIXEL_MAP_S_TO_S = $0C71;
{$EXTERNALSYM GL_PIXEL_MAP_S_TO_S}
GL_PIXEL_MAP_I_TO_R = $0C72;
{$EXTERNALSYM GL_PIXEL_MAP_I_TO_R}
GL_PIXEL_MAP_I_TO_G = $0C73;
{$EXTERNALSYM GL_PIXEL_MAP_I_TO_G}
GL_PIXEL_MAP_I_TO_B = $0C74;
{$EXTERNALSYM GL_PIXEL_MAP_I_TO_B}
GL_PIXEL_MAP_I_TO_A = $0C75;
{$EXTERNALSYM GL_PIXEL_MAP_I_TO_A}
GL_PIXEL_MAP_R_TO_R = $0C76;
{$EXTERNALSYM GL_PIXEL_MAP_R_TO_R}
GL_PIXEL_MAP_G_TO_G = $0C77;
{$EXTERNALSYM GL_PIXEL_MAP_G_TO_G}
GL_PIXEL_MAP_B_TO_B = $0C78;
{$EXTERNALSYM GL_PIXEL_MAP_B_TO_B}
GL_PIXEL_MAP_A_TO_A = $0C79;
{$EXTERNALSYM GL_PIXEL_MAP_A_TO_A}
// vertex arrays
GL_VERTEX_ARRAY_POINTER = $808E;
{$EXTERNALSYM GL_VERTEX_ARRAY_POINTER}
GL_NORMAL_ARRAY_POINTER = $808F;
{$EXTERNALSYM GL_NORMAL_ARRAY_POINTER}
GL_COLOR_ARRAY_POINTER = $8090;
{$EXTERNALSYM GL_COLOR_ARRAY_POINTER}
GL_INDEX_ARRAY_POINTER = $8091;
{$EXTERNALSYM GL_INDEX_ARRAY_POINTER}
GL_TEXTURE_COORD_ARRAY_POINTER = $8092;
{$EXTERNALSYM GL_TEXTURE_COORD_ARRAY_POINTER}
GL_EDGE_FLAG_ARRAY_POINTER = $8093;
{$EXTERNALSYM GL_EDGE_FLAG_ARRAY_POINTER}
// stenciling
GL_STENCIL_TEST = $0B90;
{$EXTERNALSYM GL_STENCIL_TEST}
GL_STENCIL_CLEAR_VALUE = $0B91;
{$EXTERNALSYM GL_STENCIL_CLEAR_VALUE}
GL_STENCIL_FUNC = $0B92;
{$EXTERNALSYM GL_STENCIL_FUNC}
GL_STENCIL_VALUE_MASK = $0B93;
{$EXTERNALSYM GL_STENCIL_VALUE_MASK}
GL_STENCIL_FAIL = $0B94;
{$EXTERNALSYM GL_STENCIL_FAIL}
GL_STENCIL_PASS_DEPTH_FAIL = $0B95;
{$EXTERNALSYM GL_STENCIL_PASS_DEPTH_FAIL}
GL_STENCIL_PASS_DEPTH_PASS = $0B96;
{$EXTERNALSYM GL_STENCIL_PASS_DEPTH_PASS}
GL_STENCIL_REF = $0B97;
{$EXTERNALSYM GL_STENCIL_REF}
GL_STENCIL_WRITEMASK = $0B98;
{$EXTERNALSYM GL_STENCIL_WRITEMASK}
GL_KEEP = $1E00;
{$EXTERNALSYM GL_KEEP}
GL_REPLACE = $1E01;
{$EXTERNALSYM GL_REPLACE}
GL_INCR = $1E02;
{$EXTERNALSYM GL_INCR}
GL_DECR = $1E03;
{$EXTERNALSYM GL_DECR}
// color material
GL_COLOR_MATERIAL_FACE = $0B55;
{$EXTERNALSYM GL_COLOR_MATERIAL_FACE}
GL_COLOR_MATERIAL_PARAMETER = $0B56;
{$EXTERNALSYM GL_COLOR_MATERIAL_PARAMETER}
GL_COLOR_MATERIAL = $0B57;
{$EXTERNALSYM GL_COLOR_MATERIAL}
// points
GL_POINT_SMOOTH = $0B10;
{$EXTERNALSYM GL_POINT_SMOOTH}
GL_POINT_SIZE = $0B11;
{$EXTERNALSYM GL_POINT_SIZE}
GL_POINT_SIZE_RANGE = $0B12;
{$EXTERNALSYM GL_POINT_SIZE_RANGE}
GL_POINT_SIZE_GRANULARITY = $0B13;
{$EXTERNALSYM GL_POINT_SIZE_GRANULARITY}
// lines
GL_LINE_SMOOTH = $0B20;
{$EXTERNALSYM GL_LINE_SMOOTH}
GL_LINE_WIDTH = $0B21;
{$EXTERNALSYM GL_LINE_WIDTH}
GL_LINE_WIDTH_RANGE = $0B22;
{$EXTERNALSYM GL_LINE_WIDTH_RANGE}
GL_LINE_WIDTH_GRANULARITY = $0B23;
{$EXTERNALSYM GL_LINE_WIDTH_GRANULARITY}
GL_LINE_STIPPLE = $0B24;
{$EXTERNALSYM GL_LINE_STIPPLE}
GL_LINE_STIPPLE_PATTERN = $0B25;