-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgl.Version_3_0.cs
1634 lines (1420 loc) · 71.6 KB
/
gl.Version_3_0.cs
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
#region Copyright and License
// Copyright (c) 2013-2014 The Khronos Group Inc.
// Copyright (c) of C# port 2014 by Shinta <shintadono@googlemail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Materials, and to
// permit persons to whom the Materials are furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Materials.
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
#endregion
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace OpenGL.Core
{
using Delegates;
namespace Delegates
{
/// <summary>
/// Sets the color mask for color write operations for a specific draw buffer.
/// </summary>
/// <param name="index">The index of the draw buffer.</param>
/// <param name="red">Wether or not the write the red components.</param>
/// <param name="green">Wether or not the write the green components.</param>
/// <param name="blue">Wether or not the write the blue components.</param>
/// <param name="alpha">Wether or not the write the alpha components.</param>
public delegate void glColorMaski(uint index, [MarshalAs(UnmanagedType.I1)] bool red, [MarshalAs(UnmanagedType.I1)] bool green, [MarshalAs(UnmanagedType.I1)] bool blue, [MarshalAs(UnmanagedType.I1)] bool alpha);
/// <summary>
/// Returns the value of a index parameter.
/// </summary>
/// <param name="target">A <see cref="glGetBooleanParameter"/> specifying the parameter.</param>
/// <param name="index">The index of the element.</param>
/// <param name="data">Returns the requested value.</param>
public delegate void glGetBooleani_(glGetBooleanIndexedParameter target, uint index, [MarshalAs(UnmanagedType.I1)] out bool data);
internal delegate void glGetBooleani_v(glGetBooleanIndexedParameter target, uint index, IntPtr data); // bool[]
/// <summary>
/// Returns the value of a index parameter.
/// </summary>
/// <param name="target">A <see cref="glGetBooleanParameter"/> specifying the parameter.</param>
/// <param name="index">The index of the element.</param>
/// <param name="data">Returns the requested value.</param>
public delegate void glGetIntegeri_(glGetIntegerIndexedParameter target, uint index, out int data);
/// <summary>
/// Returns the value of a index parameter.
/// </summary>
/// <param name="target">A <see cref="glGetBooleanParameter"/> specifying the parameter.</param>
/// <param name="index">The index of the element.</param>
/// <param name="data">Returns the requested value.</param>
public delegate void glGetIntegeri_v(glGetIntegerIndexedParameter target, uint index, int[] data);
/// <summary>
/// Enables indexed OpenGL capabilities.
/// </summary>
/// <param name="target">The capability to be enabled.</param>
/// <param name="index">The index of the indexed capability.</param>
public delegate void glEnablei(glIndexedCapability target, uint index);
/// <summary>
/// Disables indexed OpenGL capabilities.
/// </summary>
/// <param name="target">The capability to be enabled.</param>
/// <param name="index">The index of the indexed capability.</param>
public delegate void glDisablei(glIndexedCapability target, uint index);
/// <summary>
/// Checks wether or not a indexed OpenGL capability is enabled.
/// </summary>
/// <param name="target">The capability to be enabled.</param>
/// <param name="index">The index of the indexed capability.</param>
/// <returns><b>true</b> if the indexed capability is enabled.</returns>
[return: MarshalAs(UnmanagedType.I1)]
public delegate bool glIsEnabledi(glIndexedCapability target, uint index);
/// <summary>
/// Starts transform feedback operation.
/// </summary>
/// <param name="primitiveMode">A <see cref="glDrawMode"/> specifying the output type of the primitives.</param>
public delegate void glBeginTransformFeedback(glDrawMode primitiveMode);
/// <summary>
/// Stops transform feedback operation.
/// </summary>
public delegate void glEndTransformFeedback();
internal delegate void glBindBufferRange_32(glBufferTarget target, uint index, uint buffer, int offset, int size);
internal delegate void glBindBufferRange_64(glBufferTarget target, uint index, uint buffer, long offset, long size);
/// <summary>
/// Binds buffer objects to indexed buffer target.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer.</param>
/// <param name="index">The index of the indexed buffer target.</param>
/// <param name="buffer">The name of the buffer object.</param>
public delegate void glBindBufferBase(glBufferTarget target, uint index, uint buffer);
/// <summary>
/// Sets values to record in transform feedback buffers.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="count">The number of varying variables.</param>
/// <param name="varyings">The name(s) of the varying variable(s).</param>
/// <param name="bufferMode">A <see cref="glTransformFeedbackBufferMode"/> specifying the transform feedback buffer mode.</param>
public delegate void glTransformFeedbackVaryings(uint program, int count, string[] varyings, glTransformFeedbackBufferMode bufferMode);
internal delegate void glGetTransformFeedbackVarying(uint program, uint index, int bufSize, out int length, out int size, out glGLSLType type, StringBuilder name);
/// <summary>
/// Sets read color clamping states.
/// </summary>
/// <param name="target">Must be <see cref="glClampColorTarget.CLAMP_READ_COLOR"/>.</param>
/// <param name="clamp">One of <see cref="glClampColorMode"/>.</param>
public delegate void glClampColor(glClampColorTarget target, glClampColorMode clamp);
/// <summary>
/// Starts conditional rendering.
/// </summary>
/// <param name="id">Specifies the name of an occlusion query object whose results are used to determine if the rendering commands are discarded.</param>
/// <param name="mode">A <see cref="glConditionalRenderMode"/> specifying how <b>gl.BeginConditionalRender</b> interprets the results of the occlusion query.</param>
public delegate void glBeginConditionalRender(uint id, glConditionalRenderMode mode);
/// <summary>
/// Stops conditional rendering.
/// </summary>
public delegate void glEndConditionalRender();
internal delegate void glVertexAttribIPointer_32(uint index, int size, glVertexAttribType type, int stride, int pointer);
internal delegate void glVertexAttribIPointer_64(uint index, int size, glVertexAttribType type, int stride, long pointer);
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="pname">A <see cref="glVertexAttribParameter"/> specifying the parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetVertexAttribIi(uint index, glVertexAttribParameter pname, out int param);
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="pname">A <see cref="glVertexAttribParameter"/> specifying the parameter.</param>
/// <param name="params">The requested value(s).</param>
public delegate void glGetVertexAttribIiv(uint index, glVertexAttribParameter pname, int[] @params);
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="pname">A <see cref="glVertexAttribParameter"/> specifying the parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetVertexAttribIui(uint index, glVertexAttribParameter pname, out uint param);
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="pname">A <see cref="glVertexAttribParameter"/> specifying the parameter.</param>
/// <param name="params">The requested value(s).</param>
public delegate void glGetVertexAttribIuiv(uint index, glVertexAttribParameter pname, uint[] @params);
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">The value to set.</param>
public delegate void glVertexAttribI1i(uint index, int x);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">First value to set.</param>
/// <param name="y">Second value to set.</param>
public delegate void glVertexAttribI2i(uint index, int x, int y);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">First value to set.</param>
/// <param name="y">Second value to set.</param>
/// <param name="z">Third value to set.</param>
public delegate void glVertexAttribI3i(uint index, int x, int y, int z);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">First value to set.</param>
/// <param name="y">Second value to set.</param>
/// <param name="z">Third value to set.</param>
/// <param name="w">Fourth value to set.</param>
public delegate void glVertexAttribI4i(uint index, int x, int y, int z, int w);
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">The value to set.</param>
public delegate void glVertexAttribI1ui(uint index, uint x);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">First value to set.</param>
/// <param name="y">Second value to set.</param>
public delegate void glVertexAttribI2ui(uint index, uint x, uint y);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">First value to set.</param>
/// <param name="y">Second value to set.</param>
/// <param name="z">Third value to set.</param>
public delegate void glVertexAttribI3ui(uint index, uint x, uint y, uint z);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="x">First value to set.</param>
/// <param name="y">Second value to set.</param>
/// <param name="z">Third value to set.</param>
/// <param name="w">Fourth value to set.</param>
public delegate void glVertexAttribI4ui(uint index, uint x, uint y, uint z, uint w);
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The value to set.</param>
public delegate void glVertexAttribI1iv(uint index, int[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI2iv(uint index, int[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI3iv(uint index, int[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI4iv(uint index, int[] v);
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The value to set.</param>
public delegate void glVertexAttribI1uiv(uint index, uint[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI2uiv(uint index, uint[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI3uiv(uint index, uint[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI4uiv(uint index, uint[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI4bv(uint index, params sbyte[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI4sv(uint index, params short[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI4ubv(uint index, params byte[] v);
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
/// <param name="index">The index of the vertex attribute.</param>
/// <param name="v">The values to set.</param>
public delegate void glVertexAttribI4usv(uint index, params ushort[] v);
/// <summary>
/// Returns the value of a uniform variable.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="location">The location of the uniform variable inside the program object.</param>
/// <param name="param">The value of the uniform variable.</param>
public delegate void glGetUniformui(uint program, int location, out uint param);
/// <summary>
/// Returns the value(s) of a uniform variable.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="location">The location of the uniform variable inside the program object.</param>
/// <param name="params">The value(s) of the uniform variable.</param>
public delegate void glGetUniformuiv(uint program, int location, uint[] @params);
/// <summary>
/// Binds a varing output variable to fragment shader color.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="color">The index of the color output.</param>
/// <param name="name">The name of the varing output variable.</param>
public delegate void glBindFragDataLocation(uint program, uint color, string name);
/// <summary>
/// Returns the fragment shader color index of a bound varing output variable.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="name">The name of the varing output variable.</param>
/// <returns>The color index of the bound varing output variable.</returns>
public delegate int glGetFragDataLocation(uint program, string name);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="v0">The value to set.</param>
public delegate void glUniform1ui(int location, uint v0);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="v0">First value of a tuple to set.</param>
/// <param name="v1">Second value of a tuple to set.</param>
public delegate void glUniform2ui(int location, uint v0, uint v1);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="v0">First value of a tuple to set.</param>
/// <param name="v1">Second value of a tuple to set.</param>
/// <param name="v2">Third value of a tuple to set.</param>
public delegate void glUniform3ui(int location, uint v0, uint v1, uint v2);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="v0">First value of a tuple to set.</param>
/// <param name="v1">Second value of a tuple to set.</param>
/// <param name="v2">Third value of a tuple to set.</param>
/// <param name="v3">Fourth value of a tuple to set.</param>
public delegate void glUniform4ui(int location, uint v0, uint v1, uint v2, uint v3);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="count">The number of values to be set. (>1 if uniform is an array)</param>
/// <param name="value">The value(s) to set.</param>
public delegate void glUniform1uiv(int location, int count, uint[] value);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="count">The number of values to be set. (>1 if uniform is an array)</param>
/// <param name="value">The value(s) to set.</param>
public delegate void glUniform2uiv(int location, int count, uint[] value);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="count">The number of values to be set. (>1 if uniform is an array)</param>
/// <param name="value">The value(s) to set.</param>
public delegate void glUniform3uiv(int location, int count, uint[] value);
/// <summary>
/// Sets a uniform value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="count">The number of values to be set. (>1 if uniform is an array)</param>
/// <param name="value">The value(s) to set.</param>
public delegate void glUniform4uiv(int location, int count, uint[] value);
/// <summary>
/// Sets texture parameter for the currently bound texture.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target.</param>
/// <param name="pname">A <see cref="glTextureParameter"/> selecting the parameter to be set.</param>
/// <param name="params">The value the parameter is set to.</param>
public delegate void glTexParameterIiv(glTextureTarget target, glTextureParameter pname, params int[] @params);
/// <summary>
/// Sets texture parameter for the currently bound texture.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target.</param>
/// <param name="pname">A <see cref="glTextureParameter"/> selecting the parameter to be set.</param>
/// <param name="params">The value the parameter is set to.</param>
public delegate void glTexParameterIuiv(glTextureTarget target, glTextureParameter pname, params uint[] @params);
/// <summary>
/// Returns the value of a texture parameter.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target.</param>
/// <param name="pname">A <see cref="glTextureParameter"/> specifying the texture parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetTexParameterIi(glTextureTarget target, glTextureParameter pname, out int param);
/// <summary>
/// Returns the value(s) of a texture parameter.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target.</param>
/// <param name="pname">A <see cref="glTextureParameter"/> specifying the texture parameter.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetTexParameterIiv(glTextureTarget target, glTextureParameter pname, int[] @params);
/// <summary>
/// Returns the value of a texture parameter.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target.</param>
/// <param name="pname">A <see cref="glTextureParameter"/> specifying the texture parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetTexParameterIui(glTextureTarget target, glTextureParameter pname, out uint param);
/// <summary>
/// Returns the value(s) of a texture parameter.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target.</param>
/// <param name="pname">A <see cref="glTextureParameter"/> specifying the texture parameter.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetTexParameterIuiv(glTextureTarget target, glTextureParameter pname, uint[] @params);
/// <summary>
/// Clears/Resets the values of a buffer to a specific value.
/// </summary>
/// <param name="buffer">A <see cref="glBuffer"/> specifying the buffer to be cleared.</param>
/// <param name="drawbuffer">The index of the color buffer if <paramref name="buffer"/> is <see cref="glBuffer.COLOR"/></param>
/// <param name="value">The value to be set.</param>
public delegate void glClearBufferiv(glBuffer buffer, int drawbuffer, params int[] value);
/// <summary>
/// Clears/Resets the values of a buffer to a specific value.
/// </summary>
/// <param name="buffer">A <see cref="glBuffer"/> specifying the buffer to be cleared.</param>
/// <param name="drawbuffer">The index of the color buffer if <paramref name="buffer"/> is <see cref="glBuffer.COLOR"/></param>
/// <param name="value">The value to be set.</param>
public delegate void glClearBufferuiv(glBuffer buffer, int drawbuffer, params uint[] value);
/// <summary>
/// Clears/Resets the values of a buffer to a specific value.
/// </summary>
/// <param name="buffer">A <see cref="glBuffer"/> specifying the buffer to be cleared.</param>
/// <param name="drawbuffer">The index of the color buffer if <paramref name="buffer"/> is <see cref="glBuffer.COLOR"/></param>
/// <param name="value">The value to be set.</param>
public delegate void glClearBufferfv(glBuffer buffer, int drawbuffer, params float[] value);
/// <summary>
/// Clears/Resets the values of the depth-stencil-buffer to a specific value.
/// </summary>
/// <param name="buffer">Must be <see cref="glBuffer.DEPTH_STENCIL"/>.</param>
/// <param name="drawbuffer">Must be zero.</param>
/// <param name="depth">The depth value to set.</param>
/// <param name="stencil">The stencil value to set.</param>
public delegate void glClearBufferfi(glBuffer buffer, int drawbuffer, float depth, int stencil);
internal delegate IntPtr glGetStringi(glGetStringIndexedParameter name, uint index);
/// <summary>
/// Determines if a name is a renderbuffer name.
/// </summary>
/// <param name="renderbuffer">The maybe renderbuffer name.</param>
/// <returns><b>true</b> if <paramref name="renderbuffer"/> is a renderbuffer name.</returns>
[return: MarshalAs(UnmanagedType.I1)]
public delegate bool glIsRenderbuffer(uint renderbuffer);
/// <summary>
/// Binds a renderbuffer.
/// </summary>
/// <param name="target">Must be <see cref="glRenderbufferTarget.RENDERBUFFER"/>.</param>
/// <param name="renderbuffer">The name of the renderbuffer to be bound.</param>
public delegate void glBindRenderbuffer(glRenderbufferTarget target, uint renderbuffer);
/// <summary>
/// Releases <paramref name="count"/> many renderbuffer names.
/// </summary>
/// <param name="count">Number of renderbuffer names to be released.</param>
/// <param name="renderbuffers">Array of renderbuffer names to be released.</param>
public delegate void glDeleteRenderbuffers(int count, params uint[] renderbuffers);
internal delegate void glGenRenderbuffer(int one, out uint renderbuffer);
internal delegate void glGenRenderbuffers(int count, uint[] renderbuffers);
/// <summary>
/// Creates a renderbuffer storage for the currently bound renderbuffer object.
/// </summary>
/// <param name="target">Must be <see cref="glRenderbufferTarget.RENDERBUFFER"/>.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format of the storage.</param>
/// <param name="width">The width of the storage in pixels.</param>
/// <param name="height">The height of the storage in pixels.</param>
public delegate void glRenderbufferStorage(glRenderbufferTarget target, glInternalFormat internalformat, int width, int height);
/// <summary>
/// Returns the value of a renderbuffer parameter.
/// </summary>
/// <param name="target">Must be <see cref="glRenderbufferTarget.RENDERBUFFER"/>.</param>
/// <param name="pname">A <see cref="glRenderbufferParameter"/> specifying the parameter.</param>
/// <param name="param">Returns requested the value.</param>
public delegate void glGetRenderbufferParameteri(glRenderbufferTarget target, glRenderbufferParameter pname, out int param);
/// <summary>
/// Returns the value(s) of a renderbuffer parameter.
/// </summary>
/// <param name="target">Must be <see cref="glRenderbufferTarget.RENDERBUFFER"/>.</param>
/// <param name="pname">A <see cref="glRenderbufferParameter"/> specifying the parameter.</param>
/// <param name="params">Returns requested the value(s).</param>
public delegate void glGetRenderbufferParameteriv(glRenderbufferTarget target, glRenderbufferParameter pname, int[] @params);
/// <summary>
/// Determines if a name is a framebuffer name.
/// </summary>
/// <param name="framebuffer">The maybe framebuffer name.</param>
/// <returns><b>true</b> if <paramref name="framebuffer"/> is a framebuffer name.</returns>
[return: MarshalAs(UnmanagedType.I1)]
public delegate bool glIsFramebuffer(uint framebuffer);
/// <summary>
/// Binds a framebuffer to a framebuffer target.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="framebuffer">The name of the framebuffer to be bound.</param>
public delegate void glBindFramebuffer(glFramebufferTarget target, uint framebuffer);
/// <summary>
/// Releases <paramref name="count"/> many framebuffer names.
/// </summary>
/// <param name="count">Number of framebuffer names to be released.</param>
/// <param name="framebuffers">Array of framebuffer names to be released.</param>
public delegate void glDeleteFramebuffers(int count, params uint[] framebuffers);
internal delegate void glGenFramebuffer(int one, out uint framebuffer);
internal delegate void glGenFramebuffers(int count, uint[] framebuffers);
/// <summary>
/// Checks and returns the state of a framebuffer target.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <returns>A <see cref="glFramebufferStatus"/> specifying the state of the framebuffer target</returns>
public delegate glFramebufferStatus glCheckFramebufferStatus(glFramebufferTarget target);
/// <summary>
/// Attachs a level of a texture as a buffer to a attachment of the currently bound framebuffer bound to a specific framebuffer target.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="attachment">The framebuffer attachment.</param>
/// <param name="textarget">A <see cref="glTexture1DTarget"/> specifying the texture target.</param>
/// <param name="texture">The name of the texture.</param>
/// <param name="level">The level of the texture.</param>
public delegate void glFramebufferTexture1D(glFramebufferTarget target, glBuffer attachment, glTexture1DTarget textarget, uint texture, int level);
/// <summary>
/// Attachs a level of a texture as a buffer to a attachment of the currently bound framebuffer bound to a specific framebuffer target.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="attachment">The framebuffer attachment.</param>
/// <param name="textarget">A <see cref="glTexture2DTarget"/> specifying the texture target.</param>
/// <param name="texture">The name of the texture.</param>
/// <param name="level">The level of the texture.</param>
public delegate void glFramebufferTexture2D(glFramebufferTarget target, glBuffer attachment, glTexture2DTarget textarget, uint texture, int level);
/// <summary>
/// Attachs a layer of a level of a texture as a buffer to a attachment of the currently bound framebuffer bound to a specific framebuffer target.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="attachment">The framebuffer attachment.</param>
/// <param name="textarget">A <see cref="glTexture3DTarget"/> specifying the texture target.</param>
/// <param name="texture">The name of the texture.</param>
/// <param name="level">The level of the texture.</param>
/// <param name="layer">The 2D layer image within a 3D texture.</param>
public delegate void glFramebufferTexture3D(glFramebufferTarget target, glBuffer attachment, glTexture3DTarget textarget, uint texture, int level, int layer);
/// <summary>
/// Attachs a renderbuffer as a buffer to a attachment of the currently bound framebuffer bound to a specific framebuffer target.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="attachment">The framebuffer attachment.</param>
/// <param name="renderbuffertarget">Must be <see cref="glRenderbufferTarget.RENDERBUFFER"/>.</param>
/// <param name="renderbuffer">The name of the renderbuffer.</param>
public delegate void glFramebufferRenderbuffer(glFramebufferTarget target, glBuffer attachment, glRenderbufferTarget renderbuffertarget, uint renderbuffer);
/// <summary>
/// Returns the value of a framebuffer attachment parameter.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="attachment">The framebuffer attachment.</param>
/// <param name="pname">A <see cref="glFramebufferAttachmentParameter"/> specifying the parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetFramebufferAttachmentParameteri(glFramebufferTarget target, glBuffer attachment, glFramebufferAttachmentParameter pname, out int param);
/// <summary>
/// Returns the value(s) of a framebuffer attachment parameter.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="attachment">The framebuffer attachment.</param>
/// <param name="pname">A <see cref="glFramebufferAttachmentParameter"/> specifying the parameter.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetFramebufferAttachmentParameteriv(glFramebufferTarget target, glBuffer attachment, glFramebufferAttachmentParameter pname, int[] @params);
/// <summary>
/// Generates the mipmap for the texture currently bound to a specific texture target.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target.</param>
public delegate void glGenerateMipmap(glTextureTarget target);
/// <summary>
/// Copies a block of pixels from the framebuffer bound to <see cref="glFramebufferTarget.READ_FRAMEBUFFER"/> to the framebuffer bound to <see cref="glFramebufferTarget.DRAW_FRAMEBUFFER"/>.
/// </summary>
/// <param name="srcX0">The left bound of the region to copy.</param>
/// <param name="srcY0">The bottom bound of the region to copy.</param>
/// <param name="srcX1">The right bound of the region to copy.</param>
/// <param name="srcY1">The top bound of the region to copy.</param>
/// <param name="dstX0">The left bound of the region to be copied in.</param>
/// <param name="dstY0">The bottom bound of the region to be copied in.</param>
/// <param name="dstX1">The right bound of the region to be copied in.</param>
/// <param name="dstY1">The top bound of the region to be copied in.</param>
/// <param name="mask">A <see cref="glBufferMask"/> specifying the values to copy.</param>
/// <param name="filter">A <see cref="glFilter"/> specifying the interpolation methode to use when resizing.</param>
public delegate void glBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, glBufferMask mask, glFilter filter);
/// <summary>
/// Creates a multisample renderbuffer storage for the currently bound renderbuffer object.
/// </summary>
/// <param name="target">Must be <see cref="glRenderbufferTarget.RENDERBUFFER"/>.</param>
/// <param name="samples">The number of samples.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format of the storage.</param>
/// <param name="width">The width of the storage in pixels.</param>
/// <param name="height">The height of the storage in pixels.</param>
public delegate void glRenderbufferStorageMultisample(glRenderbufferTarget target, int samples, glInternalFormat internalformat, int width, int height);
/// <summary>
/// Attachs a layer of a level of a texture as a buffer to a attachment of the currently bound framebuffer bound to a specific framebuffer target.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="attachment">The framebuffer attachment.</param>
/// <param name="texture">The name of the texture.</param>
/// <param name="level">The level of the texture.</param>
/// <param name="layer">The 2D layer image within a 3D texture or the face of a cubemap (array).</param>
public delegate void glFramebufferTextureLayer(glFramebufferTarget target, glBuffer attachment, uint texture, int level, int layer);
internal delegate IntPtr glMapBufferRange_32(glBufferTarget target, int offset, int length, glMapBufferRangeAccess access);
internal delegate IntPtr glMapBufferRange_64(glBufferTarget target, long offset, long length, glMapBufferRangeAccess access);
internal delegate void glFlushMappedBufferRange_32(glBufferTarget target, int offset, int length);
internal delegate void glFlushMappedBufferRange_64(glBufferTarget target, long offset, long length);
/// <summary>
/// Binds a vertex array object.
/// </summary>
/// <param name="array">The name of the vertex array.</param>
public delegate void glBindVertexArray(uint array);
/// <summary>
/// Releases <paramref name="count"/> many vertex array names.
/// </summary>
/// <param name="count">Number of vertex array names to be released.</param>
/// <param name="arrays">Array of vertex array names to be released.</param>
public delegate void glDeleteVertexArrays(int count, params uint[] arrays);
internal delegate void glGenVertexArray(int one, out uint array);
internal delegate void glGenVertexArrays(int count, uint[] arrays);
/// <summary>
/// Determines if a name is a vertex array name.
/// </summary>
/// <param name="array">The maybe vertex array name.</param>
/// <returns><b>true</b> if <paramref name="array"/> is a vertex array name.</returns>
[return: MarshalAs(UnmanagedType.I1)]
public delegate bool glIsVertexArray(uint array);
}
public static partial class gl
{
/// <summary>
/// Indicates if OpenGL version 3.0 is available.
/// </summary>
public static bool VERSION_3_0;
#region Delegates
/// <summary>
/// Sets the color mask for color write operations for a specific draw buffer.
/// </summary>
public static glColorMaski ColorMaski;
/// <summary>
/// Returns the value of a index parameter.
/// </summary>
public static glGetBooleani_ GetBooleani_;
private static glGetBooleani_v _GetBooleani_v;
/// <summary>
/// Returns the value of a index parameter.
/// </summary>
public static glGetIntegeri_ GetIntegeri_;
/// <summary>
/// Returns the value of a index parameter.
/// </summary>
public static glGetIntegeri_v GetIntegeri_v;
/// <summary>
/// Enables indexed OpenGL capabilities.
/// </summary>
public static glEnablei Enablei;
/// <summary>
/// Disables indexed OpenGL capabilities.
/// </summary>
public static glDisablei Disablei;
/// <summary>
/// Checks wether or not a indexed OpenGL capability is enabled.
/// </summary>
public static glIsEnabledi IsEnabledi;
/// <summary>
/// Starts transform feedback operation.
/// </summary>
public static glBeginTransformFeedback BeginTransformFeedback;
/// <summary>
/// Stops transform feedback operation.
/// </summary>
public static glEndTransformFeedback EndTransformFeedback;
private static glBindBufferRange_32 BindBufferRange_32;
private static glBindBufferRange_64 BindBufferRange_64;
/// <summary>
/// Binds buffer objects to indexed buffer target.
/// </summary>
public static glBindBufferBase BindBufferBase;
/// <summary>
/// Sets values to record in transform feedback buffers.
/// </summary>
public static glTransformFeedbackVaryings TransformFeedbackVaryings;
private static glGetTransformFeedbackVarying _GetTransformFeedbackVarying;
/// <summary>
/// Sets read color clamping states.
/// </summary>
public static glClampColor ClampColor;
/// <summary>
/// Starts conditional rendering.
/// </summary>
public static glBeginConditionalRender BeginConditionalRender;
/// <summary>
/// Stops conditional rendering.
/// </summary>
public static glEndConditionalRender EndConditionalRender;
private static glVertexAttribIPointer_32 VertexAttribIPointer_32;
private static glVertexAttribIPointer_64 VertexAttribIPointer_64;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribIi GetVertexAttribIi;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribIiv GetVertexAttribIiv;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribIui GetVertexAttribIui;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribIuiv GetVertexAttribIuiv;
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
public static glVertexAttribI1i VertexAttribI1i;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI2i VertexAttribI2i;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI3i VertexAttribI3i;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4i VertexAttribI4i;
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
public static glVertexAttribI1ui VertexAttribI1ui;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI2ui VertexAttribI2ui;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI3ui VertexAttribI3ui;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4ui VertexAttribI4ui;
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
public static glVertexAttribI1iv VertexAttribI1iv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI2iv VertexAttribI2iv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI3iv VertexAttribI3iv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4iv VertexAttribI4iv;
/// <summary>
/// Sets the value of a vertex attribute.
/// </summary>
public static glVertexAttribI1uiv VertexAttribI1uiv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI2uiv VertexAttribI2uiv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI3uiv VertexAttribI3uiv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4uiv VertexAttribI4uiv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4bv VertexAttribI4bv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4sv VertexAttribI4sv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4ubv VertexAttribI4ubv;
/// <summary>
/// Sets the values of a vertex attribute.
/// </summary>
public static glVertexAttribI4usv VertexAttribI4usv;
/// <summary>
/// Returns the value of a uniform variable.
/// </summary>
public static glGetUniformui GetUniformui;
/// <summary>
/// Returns the value(s) of a uniform variable.
/// </summary>
public static glGetUniformuiv GetUniformuiv;
/// <summary>
/// Binds a varing output variable to fragment shader color.
/// </summary>
public static glBindFragDataLocation BindFragDataLocation;
/// <summary>
/// Returns the fragment shader color index of a bound varing output variable.
/// </summary>
public static glGetFragDataLocation GetFragDataLocation;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform1ui Uniform1ui;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform2ui Uniform2ui;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform3ui Uniform3ui;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform4ui Uniform4ui;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform1uiv Uniform1uiv;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform2uiv Uniform2uiv;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform3uiv Uniform3uiv;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform4uiv Uniform4uiv;
/// <summary>
/// Sets texture parameter for the currently bound texture.
/// </summary>
public static glTexParameterIiv TexParameterIiv;
/// <summary>
/// Sets texture parameter for the currently bound texture.
/// </summary>