forked from bkaradzic/bgfx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
renderer_gl.h
1522 lines (1212 loc) · 36.3 KB
/
renderer_gl.h
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
/*
* Copyright 2011-2017 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#ifndef BGFX_RENDERER_GL_H_HEADER_GUARD
#define BGFX_RENDERER_GL_H_HEADER_GUARD
#define BGFX_USE_EGL (BGFX_CONFIG_RENDERER_OPENGLES && (0 \
|| BX_PLATFORM_ANDROID \
|| BX_PLATFORM_BSD \
|| BX_PLATFORM_EMSCRIPTEN \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_NX \
|| BX_PLATFORM_QNX \
|| BX_PLATFORM_RPI \
|| BX_PLATFORM_STEAMLINK \
|| BX_PLATFORM_WINDOWS \
) )
#define BGFX_USE_WGL (BGFX_CONFIG_RENDERER_OPENGL && BX_PLATFORM_WINDOWS)
#define BGFX_USE_GLX (BGFX_CONFIG_RENDERER_OPENGL && (0 \
|| BX_PLATFORM_BSD \
|| BX_PLATFORM_LINUX \
) )
#define BGFX_USE_GL_DYNAMIC_LIB (0 \
|| BX_PLATFORM_BSD \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_WINDOWS \
)
#if BGFX_CONFIG_RENDERER_OPENGL
# if BGFX_CONFIG_RENDERER_OPENGL >= 31
# include <gl/glcorearb.h>
# if BX_PLATFORM_OSX
# define GL_ARB_shader_objects // OSX collsion with GLhandleARB in gltypes.h
# endif // BX_PLATFORM_OSX
# else
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
# define GL_PROTOTYPES
# define GL_GLEXT_LEGACY
# include <GL/gl.h>
# undef GL_PROTOTYPES
# elif BX_PLATFORM_OSX
# define GL_GLEXT_LEGACY
# define long ptrdiff_t
# include <OpenGL/gl.h>
# undef long
# undef GL_VERSION_1_2
# undef GL_VERSION_1_3
# undef GL_VERSION_1_4
# undef GL_VERSION_1_5
# undef GL_VERSION_2_0
# else
# include <GL/gl.h>
# endif // BX_PLATFORM_
# include <gl/glext.h>
# endif // BGFX_CONFIG_RENDERER_OPENGL >= 31
#elif BGFX_CONFIG_RENDERER_OPENGLES
typedef double GLdouble;
# if BGFX_CONFIG_RENDERER_OPENGLES < 30
# if BX_PLATFORM_IOS
# include <OpenGLES/ES2/gl.h>
# include <OpenGLES/ES2/glext.h>
//#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
#define GL_TEXTURE_3D_OES 0x806F
#define GL_SAMPLER_3D_OES 0x8B5F
#define GL_TEXTURE_WRAP_R_OES 0x8072
#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
# else
# include <GLES2/gl2platform.h>
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
# endif // BX_PLATFORM_
typedef int64_t GLint64;
typedef uint64_t GLuint64;
# define GL_PROGRAM_BINARY_LENGTH GL_PROGRAM_BINARY_LENGTH_OES
# define GL_HALF_FLOAT GL_HALF_FLOAT_OES
# define GL_RGBA8 GL_RGBA8_OES
# define GL_UNSIGNED_INT_2_10_10_10_REV GL_UNSIGNED_INT_2_10_10_10_REV_EXT
# ifndef GL_TEXTURE_3D
# define GL_TEXTURE_3D GL_TEXTURE_3D_OES
# endif // GL_TEXTURE_3D
# define GL_SAMPLER_3D GL_SAMPLER_3D_OES
# define GL_TEXTURE_WRAP_R GL_TEXTURE_WRAP_R_OES
# ifndef GL_MIN
# define GL_MIN GL_MIN_EXT
# endif // GL_MIN
# ifndef GL_MAX
# define GL_MAX GL_MAX_EXT
# endif // GL_MAX
# define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES
# define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
# define GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32_OES
# define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
# elif BGFX_CONFIG_RENDERER_OPENGLES >= 30
# include <GLES3/gl3platform.h>
# include <GLES3/gl3.h>
# include <GLES3/gl3ext.h>
# endif // BGFX_CONFIG_RENDERER_
# if BGFX_USE_EGL
# include "glcontext_egl.h"
# endif // BGFX_USE_EGL
# if BX_PLATFORM_EMSCRIPTEN
# include <emscripten/emscripten.h>
# endif // BX_PLATFORM_EMSCRIPTEN
#endif // BGFX_CONFIG_RENDERER_OPENGL
#include "renderer.h"
#include "hmd.h"
#include "hmd_openvr.h"
#include "debug_renderdoc.h"
#ifndef GL_LUMINANCE
# define GL_LUMINANCE 0x1909
#endif // GL_LUMINANCE
#ifndef GL_BGRA
# define GL_BGRA 0x80E1
#endif // GL_BGRA
#ifndef GL_R8
# define GL_R8 0x8229
#endif // GL_R8
#ifndef GL_R8I
# define GL_R8I 0x8231
#endif // GL_R8I
#ifndef GL_R8UI
# define GL_R8UI 0x8232
#endif // GL_R8UI
#ifndef GL_R8_SNORM
# define GL_R8_SNORM 0x8F94
#endif // GL_R8_SNORM
#ifndef GL_R16
# define GL_R16 0x822A
#endif // GL_R16
#ifndef GL_R16I
# define GL_R16I 0x8233
#endif // GL_R16I
#ifndef GL_R16UI
# define GL_R16UI 0x8234
#endif // GL_R16UI
#ifndef GL_R16F
# define GL_R16F 0x822D
#endif // GL_R16F
#ifndef GL_R16_SNORM
# define GL_R16_SNORM 0x8F98
#endif // GL_R16_SNORM
#ifndef GL_R32UI
# define GL_R32UI 0x8236
#endif // GL_R32UI
#ifndef GL_R32F
# define GL_R32F 0x822E
#endif // GL_R32F
#ifndef GL_RG8
# define GL_RG8 0x822B
#endif // GL_RG8
#ifndef GL_RG8I
# define GL_RG8I 0x8237
#endif // GL_RG8I
#ifndef GL_RG8UI
# define GL_RG8UI 0x8238
#endif // GL_RG8UI
#ifndef GL_RG8_SNORM
# define GL_RG8_SNORM 0x8F95
#endif // GL_RG8_SNORM
#ifndef GL_RG16
# define GL_RG16 0x822C
#endif // GL_RG16
#ifndef GL_RG16UI
# define GL_RG16UI 0x823A
#endif // GL_RG16UI
#ifndef GL_RG16F
# define GL_RG16F 0x822F
#endif // GL_RG16F
#ifndef GL_RG16I
# define GL_RG16I 0x8239
#endif // GL_RG16I
#ifndef GL_RG16UI
# define GL_RG16UI 0x823A
#endif // GL_RG16UI
#ifndef GL_RG16_SNORM
# define GL_RG16_SNORM 0x8F99
#endif // GL_RG16_SNORM
#ifndef GL_R32I
# define GL_R32I 0x8235
#endif // GL_R32I
#ifndef GL_R32UI
# define GL_R32UI 0x8236
#endif // GL_R32UI
#ifndef GL_RG32I
# define GL_RG32I 0x823B
#endif // GL_RG32I
#ifndef GL_RG32UI
# define GL_RG32UI 0x823C
#endif // GL_RG32UI
#ifndef GL_RG32F
# define GL_RG32F 0x8230
#endif // GL_RG32F
#ifndef GL_RGB8
# define GL_RGB8 0x8051
#endif // GL_RGB8
#ifndef GL_SRGB
# define GL_SRGB 0x8C40
#endif // GL_SRGB
#ifndef GL_SRGB8
# define GL_SRGB8 0x8C41
#endif // GL_SRGB8
#ifndef GL_RGB8I
# define GL_RGB8I 0x8D8F
#endif // GL_RGB8I
#ifndef GL_RGB8UI
# define GL_RGB8UI 0x8D7D
#endif // GL_RGB8UI
#ifndef GL_RGB8_SNORM
# define GL_RGB8_SNORM 0x8F96
#endif // GL_RGB8_SNORM
#ifndef GL_RGBA8I
# define GL_RGBA8I 0x8D8E
#endif // GL_RGBA8I
#ifndef GL_RGBA8UI
# define GL_RGBA8UI 0x8D7C
#endif // GL_RGBA8UI
#ifndef GL_RGBA8_SNORM
# define GL_RGBA8_SNORM 0x8F97
#endif // GL_RGBA8_SNORM
#ifndef GL_RGBA16I
# define GL_RGBA16I 0x8D88
#endif // GL_RGBA16I
#ifndef GL_RGBA16UI
# define GL_RGBA16UI 0x8D76
#endif // GL_RGBA16UI
#ifndef GL_RGBA16_SNORM
# define GL_RGBA16_SNORM 0x8F9B
#endif // GL_RGBA16_SNORM
#ifndef GL_RGBA32UI
# define GL_RGBA32UI 0x8D70
#endif // GL_RGBA32UI
#ifndef GL_RGBA32F
# define GL_RGBA32F 0x8814
#endif // GL_RGBA32F
#ifndef GL_RGBA32I
# define GL_RGBA32I 0x8D82
#endif // GL_RGBA32I
#ifndef GL_STENCIL_INDEX
# define GL_STENCIL_INDEX 0x1901
#endif // GL_STENCIL_INDEX
#ifndef GL_RED
# define GL_RED 0x1903
#endif // GL_RED
#ifndef GL_RED_INTEGER
# define GL_RED_INTEGER 0x8D94
#endif // GL_RED_INTEGER
#ifndef GL_RG
# define GL_RG 0x8227
#endif // GL_RG
#ifndef GL_RG_INTEGER
# define GL_RG_INTEGER 0x8228
#endif // GL_RG_INTEGER
#ifndef GL_GREEN
# define GL_GREEN 0x1904
#endif // GL_GREEN
#ifndef GL_BLUE
# define GL_BLUE 0x1905
#endif // GL_BLUE
#ifndef GL_RGBA_INTEGER
# define GL_RGBA_INTEGER 0x8D99
#endif // GL_RGBA_INTEGER
#ifndef GL_RGB10_A2
# define GL_RGB10_A2 0x8059
#endif // GL_RGB10_A2
#ifndef GL_RGBA16
# define GL_RGBA16 0x805B
#endif // GL_RGBA16
#ifndef GL_RGBA16F
# define GL_RGBA16F 0x881A
#endif // GL_RGBA16F
#ifndef GL_R16UI
# define GL_R16UI 0x8234
#endif // GL_R16UI
#ifndef GL_RGBA16UI
# define GL_RGBA16UI 0x8D76
#endif // GL_RGBA16UI
#ifndef GL_RGB9_E5
# define GL_RGB9_E5 0x8C3D
#endif // GL_RGB9_E5
#ifndef GL_UNSIGNED_INT_5_9_9_9_REV
# define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
#endif // GL_UNSIGNED_INT_5_9_9_9_REV
#ifndef GL_R11F_G11F_B10F
# define GL_R11F_G11F_B10F 0x8C3A
#endif // GL_R11F_G11F_B10F
#ifndef GL_UNSIGNED_SHORT_5_6_5_REV
# define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
#endif // GL_UNSIGNED_SHORT_5_6_5_REV
#ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV
# define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
#endif // GL_UNSIGNED_SHORT_1_5_5_5_REV
#ifndef GL_UNSIGNED_SHORT_4_4_4_4_REV
# define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
#endif // GL_UNSIGNED_SHORT_4_4_4_4_REV
#ifndef GL_UNSIGNED_INT_10F_11F_11F_REV
# define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
#endif // GL_UNSIGNED_INT_10F_11F_11F_REV
#ifndef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
# define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#endif // GL_COMPRESSED_RGB_S3TC_DXT1_EXT
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
# define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
# define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
#endif // GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
#ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
# define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#endif // GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
#ifndef GL_COMPRESSED_LUMINANCE_LATC1_EXT
# define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
#endif // GL_COMPRESSED_LUMINANCE_LATC1_EXT
#ifndef GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT
# define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
#endif // GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT
#ifndef GL_COMPRESSED_RED_RGTC1
# define GL_COMPRESSED_RED_RGTC1 0x8DBB
#endif // GL_COMPRESSED_RED_RGTC1
#ifndef GL_COMPRESSED_RG_RGTC2
# define GL_COMPRESSED_RG_RGTC2 0x8DBD
#endif // GL_COMPRESSED_RG_RGTC2
#ifndef GL_ETC1_RGB8_OES
# define GL_ETC1_RGB8_OES 0x8D64
#endif // GL_ETC1_RGB8_OES
#ifndef GL_COMPRESSED_RGB8_ETC2
# define GL_COMPRESSED_RGB8_ETC2 0x9274
#endif // GL_COMPRESSED_RGB8_ETC2
#ifndef GL_COMPRESSED_RGBA8_ETC2_EAC
# define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
#endif // GL_COMPRESSED_RGBA8_ETC2_EAC
#ifndef GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
# define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
#endif // GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
#ifndef GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG
# define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
#endif // GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG
#ifndef GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
# define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif // GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
#ifndef GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG
# define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
#endif // GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG
#ifndef GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
# define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
#endif // GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
#ifndef GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG
# define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137
#endif // GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG
#ifndef GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG
# define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138
#endif // GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG
#ifndef GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT
# define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54
#endif // GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT
#ifndef GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT
# define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55
#endif // GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT
#ifndef GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT
# define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56
#endif // GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT
#ifndef GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT
# define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57
#endif // GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT
#ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB
# define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
#endif // GL_COMPRESSED_RGBA_BPTC_UNORM_ARB
#ifndef GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
# define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
#endif // GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
#ifndef GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB
# define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
#endif // GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB
#ifndef GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
# define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
#endif // GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
#ifndef GL_SRGB8_ALPHA8
# define GL_SRGB8_ALPHA8 0x8C43
#endif // GL_SRGB8_ALPHA8
#ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
# define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
#endif // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
#ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
# define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#endif // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
#ifndef GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
# define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
#endif // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
#ifndef GL_COMPRESSED_SRGB8_ETC2
# define GL_COMPRESSED_SRGB8_ETC2 0x9275
#endif // GL_COMPRESSED_SRGB8_ETC2
#ifndef GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
# define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
#endif // GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
#ifndef GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE
# define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
#endif // GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE
#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
# define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#endif // GL_TEXTURE_MAX_ANISOTROPY_EXT
#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
# define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
#endif // GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
#ifndef GL_TEXTURE_SWIZZLE_RGBA
# define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
#endif // GL_TEXTURE_SWIZZLE_RGBA
#ifndef GL_MAX_SAMPLES
# define GL_MAX_SAMPLES 0x8D57
#endif // GL_MAX_SAMPLES
#ifndef GL_MAX_COLOR_ATTACHMENTS
# define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
#endif // GL_MAX_COLOR_ATTACHMENTS
#ifndef GL_MAX_DRAW_BUFFERS
# define GL_MAX_DRAW_BUFFERS 0x8824
#endif // GL_MAX_DRAW_BUFFERS
#ifndef GL_QUERY_RESULT
# define GL_QUERY_RESULT 0x8866
#endif // GL_QUERY_RESULT
#ifndef GL_QUERY_RESULT_AVAILABLE
# define GL_QUERY_RESULT_AVAILABLE 0x8867
#endif // GL_QUERY_RESULT_AVAILABLE
#ifndef GL_SAMPLES_PASSED
# define GL_SAMPLES_PASSED 0x8914
#endif // GL_SAMPLES_PASSED
#ifndef GL_ANY_SAMPLES_PASSED
# define GL_ANY_SAMPLES_PASSED 0x8C2F
#endif // GL_ANY_SAMPLES_PASSED
#ifndef GL_READ_FRAMEBUFFER
# define GL_READ_FRAMEBUFFER 0x8CA8
#endif /// GL_READ_FRAMEBUFFER
#ifndef GL_DRAW_FRAMEBUFFER
# define GL_DRAW_FRAMEBUFFER 0x8CA9
#endif // GL_DRAW_FRAMEBUFFER
#ifndef GL_TIME_ELAPSED
# define GL_TIME_ELAPSED 0x88BF
#endif // GL_TIME_ELAPSED
#ifndef GL_TIMESTAMP
# define GL_TIMESTAMP 0x8E28
#endif // GL_TIMESTAMP
#ifndef GL_VBO_FREE_MEMORY_ATI
# define GL_VBO_FREE_MEMORY_ATI 0x87FB
#endif // GL_VBO_FREE_MEMORY_ATI
#ifndef GL_TEXTURE_FREE_MEMORY_ATI
# define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
#endif // GL_TEXTURE_FREE_MEMORY_ATI
#ifndef GL_RENDERBUFFER_FREE_MEMORY_ATI
# define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
#endif // GL_RENDERBUFFER_FREE_MEMORY_ATI
// http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt
#ifndef GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
# define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
#endif // GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
#ifndef GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX
# define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
#endif // GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX
#ifndef GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
# define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
#endif // GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
#ifndef GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX
# define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
#endif // GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX
#ifndef GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX
# define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
#endif // GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX
#ifndef GL_UNPACK_ROW_LENGTH
# define GL_UNPACK_ROW_LENGTH 0x0CF2
#endif // GL_UNPACK_ROW_LENGTH
#ifndef GL_DEPTH_STENCIL
# define GL_DEPTH_STENCIL 0x84F9
#endif // GL_DEPTH_STENCIL
#ifndef GL_DEPTH_COMPONENT32
# define GL_DEPTH_COMPONENT32 0x81A7
#endif // GL_DEPTH_COMPONENT32
#ifndef GL_DEPTH_COMPONENT32F
# define GL_DEPTH_COMPONENT32F 0x8CAC
#endif // GL_DEPTH_COMPONENT32F
#ifndef GL_DEPTH_STENCIL_ATTACHMENT
# define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
#endif // GL_DEPTH_STENCIL_ATTACHMENT
#ifndef GL_TEXTURE_COMPARE_MODE
# define GL_TEXTURE_COMPARE_MODE 0x884C
#endif // GL_TEXTURE_COMPARE_MODE
#ifndef GL_TEXTURE_COMPARE_FUNC
# define GL_TEXTURE_COMPARE_FUNC 0x884D
#endif // GL_TEXTURE_COMPARE_FUNC
#ifndef GL_COMPARE_REF_TO_TEXTURE
# define GL_COMPARE_REF_TO_TEXTURE 0x884E
#endif // GL_COMPARE_REF_TO_TEXTURE
#ifndef GL_INT_SAMPLER_2D
# define GL_INT_SAMPLER_2D 0x8DCA
#endif // GL_INT_SAMPLER_2D
#ifndef GL_UNSIGNED_INT_SAMPLER_2D
# define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
#endif // GL_UNSIGNED_INT_SAMPLER_2D
#ifndef GL_INT_SAMPLER_2D_ARRAY
# define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
#endif // GL_INT_SAMPLER_2D_ARRAY
#ifndef GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
# define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
#endif // GL_UNSIGNED_INT_SAMPLER_2D_ARRAY
#ifndef GL_INT_SAMPLER_3D
# define GL_INT_SAMPLER_3D 0x8DCB
#endif // GL_INT_SAMPLER_3D
#ifndef GL_UNSIGNED_INT_SAMPLER_3D
# define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
#endif // GL_UNSIGNED_INT_SAMPLER_3D
#ifndef GL_INT_SAMPLER_CUBE
# define GL_INT_SAMPLER_CUBE 0x8DCC
#endif // GL_INT_SAMPLER_CUBEER_3D
#ifndef GL_UNSIGNED_INT_SAMPLER_CUBE
# define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
#endif // GL_UNSIGNED_INT_SAMPLER_CUBE
#ifndef GL_SAMPLER_2D_MULTISAMPLE
# define GL_SAMPLER_2D_MULTISAMPLE 0x9108
#endif // GL_SAMPLER_2D_MULTISAMPLE
#ifndef GL_INT_SAMPLER_2D_MULTISAMPLE
# define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
#endif // GL_INT_SAMPLER_2D_MULTISAMPLE
#ifndef GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE
# define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
#endif // GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE
#ifndef GL_SAMPLER_2D_SHADOW
# define GL_SAMPLER_2D_SHADOW 0x8B62
#endif // GL_SAMPLER_2D_SHADOW
#ifndef GL_SAMPLER_2D_ARRAY
# define GL_SAMPLER_2D_ARRAY 0x8DC1
#endif // GL_SAMPLER_2D_ARRAY
#ifndef GL_SAMPLER_2D_ARRAY_SHADOW
# define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
#endif // GL_SAMPLER_2D_ARRAY_SHADOW
#ifndef GL_TEXTURE_RECTANGLE
# define GL_TEXTURE_RECTANGLE 0x84F5
#endif // GL_TEXTURE_RECTANGLE
#ifndef GL_TEXTURE_MAX_LEVEL
# define GL_TEXTURE_MAX_LEVEL 0x813D
#endif // GL_TEXTURE_MAX_LEVEL
#ifndef GL_COMPUTE_SHADER
# define GL_COMPUTE_SHADER 0x91B9
#endif // GL_COMPUTE_SHADER
#ifndef GL_READ_ONLY
# define GL_READ_ONLY 0x88B8
#endif // GL_READ_ONLY
#ifndef GL_WRITE_ONLY
# define GL_WRITE_ONLY 0x88B9
#endif // GL_WRITE_ONLY
#ifndef GL_READ_WRITE
# define GL_READ_WRITE 0x88BA
#endif // GL_READ_WRITE
#ifndef GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT
# define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
#endif // GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT
#ifndef GL_ELEMENT_ARRAY_BARRIER_BIT
# define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
#endif // GL_ELEMENT_ARRAY_BARRIER_BIT
#ifndef GL_SHADER_IMAGE_ACCESS_BARRIER_BIT
# define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
#endif // GL_SHADER_IMAGE_ACCESS_BARRIER_BIT
#ifndef GL_SHADER_STORAGE_BARRIER_BIT
# define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
#endif // GL_SHADER_STORAGE_BARRIER_BIT
#ifndef GL_SHADER_STORAGE_BUFFER
# define GL_SHADER_STORAGE_BUFFER 0x90D2
#endif // GL_SHADER_STORAGE_BUFFER
#ifndef GL_IMAGE_1D
# define GL_IMAGE_1D 0x904C
#endif // GL_IMAGE_1D
#ifndef GL_IMAGE_2D
# define GL_IMAGE_2D 0x904D
#endif // GL_IMAGE_2D
#ifndef GL_IMAGE_2D_ARRAY
# define GL_IMAGE_2D_ARRAY 0x9053
#endif // GL_IMAGE_2D_ARRAY
#ifndef GL_IMAGE_3D
# define GL_IMAGE_3D 0x904E
#endif // GL_IMAGE_3D
#ifndef GL_IMAGE_CUBE
# define GL_IMAGE_CUBE 0x9050
#endif // GL_IMAGE_CUBE
#ifndef GL_INT_IMAGE_1D
# define GL_INT_IMAGE_1D 0x9057
#endif // GL_INT_IMAGE_1D
#ifndef GL_INT_IMAGE_2D
# define GL_INT_IMAGE_2D 0x9058
#endif // GL_INT_IMAGE_2D
#ifndef GL_INT_IMAGE_3D
# define GL_INT_IMAGE_3D 0x9059
#endif // GL_INT_IMAGE_3D
#ifndef GL_INT_IMAGE_CUBE
# define GL_INT_IMAGE_CUBE 0x905B
#endif // GL_INT_IMAGE_CUBE
#ifndef GL_UNSIGNED_INT_IMAGE_1D
# define GL_UNSIGNED_INT_IMAGE_1D 0x9062
#endif // GL_UNSIGNED_INT_IMAGE_1D
#ifndef GL_UNSIGNED_INT_IMAGE_2D
# define GL_UNSIGNED_INT_IMAGE_2D 0x9063
#endif // GL_UNSIGNED_INT_IMAGE_2D
#ifndef GL_UNSIGNED_INT_IMAGE_3D
# define GL_UNSIGNED_INT_IMAGE_3D 0x9064
#endif // GL_UNSIGNED_INT_IMAGE_3D
#ifndef GL_UNSIGNED_INT_IMAGE_CUBE
# define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
#endif // GL_UNSIGNED_INT_IMAGE_CUBE
#ifndef GL_PROGRAM_INPUT
# define GL_PROGRAM_INPUT 0x92E3
#endif // GL_PROGRAM_INPUT
#ifndef GL_ACTIVE_RESOURCES
# define GL_ACTIVE_RESOURCES 0x92F5
#endif // GL_ACTIVE_RESOURCES
#ifndef GL_UNIFORM
# define GL_UNIFORM 0x92E1
#endif // GL_UNIFORM
#ifndef GL_BUFFER_VARIABLE
# define GL_BUFFER_VARIABLE 0x92E5
#endif // GL_BUFFER_VARIABLE
#ifndef GL_UNSIGNED_INT_VEC2
# define GL_UNSIGNED_INT_VEC2 0x8DC6
#endif // GL_UNSIGNED_INT_VEC2
#ifndef GL_UNSIGNED_INT_VEC3
# define GL_UNSIGNED_INT_VEC3 0x8DC7
#endif // GL_UNSIGNED_INT_VEC3
#ifndef GL_UNSIGNED_INT_VEC4
# define GL_UNSIGNED_INT_VEC4 0x8DC8
#endif // GL_UNSIGNED_INT_VEC4
#ifndef GL_TYPE
# define GL_TYPE 0x92FA
#endif // GL_TYPE
#ifndef GL_ARRAY_SIZE
# define GL_ARRAY_SIZE 0x92FB
#endif // GL_ARRAY_SIZE
#ifndef GL_LOCATION
# define GL_LOCATION 0x930E
#endif // GL_LOCATION
#ifndef GL_UNSIGNED_INT_10_10_10_2
# define GL_UNSIGNED_INT_10_10_10_2 0x8DF6
#endif // GL_UNSIGNED_INT_10_10_10_2
#ifndef GL_FRAMEBUFFER_SRGB
# define GL_FRAMEBUFFER_SRGB 0x8DB9
#endif // GL_FRAMEBUFFER_SRGB
#ifndef GL_NUM_EXTENSIONS
# define GL_NUM_EXTENSIONS 0x821D
#endif // GL_NUM_EXTENSIONS
#ifndef GL_SAMPLE_ALPHA_TO_COVERAGE
# define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#endif // GL_SAMPLE_ALPHA_TO_COVERAGE
#ifndef GL_CONSERVATIVE_RASTERIZATION_NV
# define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346
#endif // GL_CONSERVATIVE_RASTERIZATION_NV
#ifndef GL_NEGATIVE_ONE_TO_ONE
# define GL_NEGATIVE_ONE_TO_ONE 0x935E
#endif // GL_NEGATIVE_ONE_TO_ONE
#ifndef GL_ZERO_TO_ONE
# define GL_ZERO_TO_ONE 0x935F
#endif // GL_ZERO_TO_ONE
#ifndef GL_LOWER_LEFT
# define GL_LOWER_LEFT 0x8CA1
#endif // GL_LOWER_LEFT
#ifndef GL_UPPER_LEFT
# define GL_UPPER_LEFT 0x8CA2
#endif // GL_UPPER_LEFT
#ifndef GL_SHADER
# define GL_SHADER 0x82E1
#endif // GL_SHADER
#ifndef GL_TEXTURE
# define GL_TEXTURE 0x1702
#endif // GL_TEXTURE
// _KHR or _ARB...
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
#define GL_DEBUG_SOURCE_API 0x8246
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
#define GL_DEBUG_SOURCE_APPLICATION 0x824A
#define GL_DEBUG_SOURCE_OTHER 0x824B
#define GL_DEBUG_TYPE_ERROR 0x824C
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
#define GL_DEBUG_TYPE_PORTABILITY 0x824F
#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
#define GL_DEBUG_TYPE_OTHER 0x8251
#define GL_DEBUG_TYPE_MARKER 0x8268
#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
#define GL_DEBUG_TYPE_POP_GROUP 0x826A
#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
#define GL_MAX_LABEL_LENGTH 0x82E8
#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
#define GL_DEBUG_LOGGED_MESSAGES 0x9145
#define GL_DEBUG_SEVERITY_HIGH 0x9146
#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
#define GL_DEBUG_SEVERITY_LOW 0x9148
#ifndef GL_DEPTH_CLAMP
# define GL_DEPTH_CLAMP 0x864F
#endif // GL_DEPTH_CLAMP
#ifndef GL_TEXTURE_BORDER_COLOR
# define GL_TEXTURE_BORDER_COLOR 0x1004
#endif // GL_TEXTURE_BORDER_COLOR
#ifndef GL_CLAMP_TO_BORDER
# define GL_CLAMP_TO_BORDER 0x812D
#endif // GL_CLAMP_TO_BORDER
#ifndef GL_TEXTURE_2D_ARRAY
# define GL_TEXTURE_2D_ARRAY 0x8C1A
#endif // GL_TEXTURE_2D_ARRAY
#ifndef GL_TEXTURE_2D_MULTISAMPLE_ARRAY
# define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
#endif // GL_TEXTURE_2D_MULTISAMPLE_ARRAY
#ifndef GL_TEXTURE_CUBE_MAP_ARRAY
# define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
#endif // GL_TEXTURE_CUBE_MAP_ARRAY
#ifndef GL_TEXTURE_CUBE_MAP_SEAMLESS
# define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
#endif // GL_TEXTURE_CUBE_MAP_SEAMLESS
#ifndef GL_TEXTURE_2D_MULTISAMPLE
# define GL_TEXTURE_2D_MULTISAMPLE 0x9100
#endif // GL_TEXTURE_2D_MULTISAMPLE
#ifndef GL_DRAW_INDIRECT_BUFFER
# define GL_DRAW_INDIRECT_BUFFER 0x8F3F
#endif // GL_DRAW_INDIRECT_BUFFER
#ifndef GL_DISPATCH_INDIRECT_BUFFER
# define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
#endif // GL_DISPATCH_INDIRECT_BUFFER
#ifndef GL_MAX_NAME_LENGTH
# define GL_MAX_NAME_LENGTH 0x92F6
#endif // GL_MAX_NAME_LENGTH
#ifndef GL_DEBUG_SEVERITY_NOTIFICATION
# define GL_DEBUG_SEVERITY_NOTIFICATION 0x826b
#endif // GL_DEBUG_SEVERITY_NOTIFICATION
#ifndef GL_LINE
# define GL_LINE 0x1B01
#endif // GL_LINE
#ifndef GL_FILL
# define GL_FILL 0x1B02
#endif // GL_FILL
#ifndef GL_MULTISAMPLE
# define GL_MULTISAMPLE 0x809D
#endif // GL_MULTISAMPLE
#ifndef GL_LINE_SMOOTH
# define GL_LINE_SMOOTH 0x0B20
#endif // GL_LINE_SMOOTH
#ifndef GL_TEXTURE_LOD_BIAS
# define GL_TEXTURE_LOD_BIAS 0x8501
#endif // GL_TEXTURE_LOD_BIAS
#if BX_PLATFORM_WINDOWS
# include <windows.h>
#elif BX_PLATFORM_LINUX || BX_PLATFORM_BSD
# include "glcontext_glx.h"
#elif BX_PLATFORM_OSX
# include "glcontext_nsgl.h"
#elif BX_PLATFORM_IOS
# include "glcontext_eagl.h"
#endif // BX_PLATFORM_
#if BGFX_USE_WGL
# include "glcontext_wgl.h"
#endif // BGFX_USE_WGL
#ifndef GL_APIENTRY
# define GL_APIENTRY APIENTRY
#endif // GL_APIENTRY
#ifndef GL_APIENTRYP
# define GL_APIENTRYP GL_APIENTRY*
#endif // GL_APIENTRYP
#if !BGFX_CONFIG_RENDERER_OPENGL
# define glClearDepth glClearDepthf
#endif // !BGFX_CONFIG_RENDERER_OPENGL
namespace bgfx
{
class UniformBuffer;
} // namespace bgfx
namespace bgfx { namespace gl
{
void dumpExtensions(const char* _extensions);
const char* glEnumName(GLenum _enum);
#define _GL_CHECK(_check, _call) \
BX_MACRO_BLOCK_BEGIN \
/*BX_TRACE(#_call);*/ \