-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgl.Version_2_0.cs
1564 lines (1349 loc) · 62.4 KB
/
gl.Version_2_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 <[email protected]>
//
// 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 blend equation separately for color and alpha.
/// </summary>
/// <param name="modeRGB">A <see cref="glBlendEquationMode"/> specifying the color blend equation.</param>
/// <param name="modeAlpha">A <see cref="glBlendEquationMode"/> specifying the alpha blend equation.</param>
public delegate void glBlendEquationSeparate(glBlendEquationMode modeRGB, glBlendEquationMode modeAlpha);
/// <summary>
/// Sets the buffers to be drawn into.
/// </summary>
/// <param name="count">Number of buffers.</param>
/// <param name="bufs">A array of <see cref="glBuffer"/>s specifying the buffers.</param>
public delegate void glDrawBuffers(int count, params glBuffer[] bufs);
/// <summary>
/// Sets the front and/or back face stencil operation.
/// </summary>
/// <param name="face">A <see cref="glFace"/> specifying the face(s).</param>
/// <param name="sfail">A <see cref="glStencilOpMode"/> specifying the action to take when the stencil test fails.</param>
/// <param name="dpfail">A <see cref="glStencilOpMode"/> specifying the action to take when the stencil test passed, but the depth test fails.</param>
/// <param name="dppass">A <see cref="glStencilOpMode"/> specifying the action to take when the stencil and depth test passes.</param>
public delegate void glStencilOpSeparate(glFace face, glStencilOpMode sfail, glStencilOpMode dpfail, glStencilOpMode dppass);
/// <summary>
/// Sets the front and/or back face stencil test function.
/// </summary>
/// <param name="face">A <see cref="glFace"/> specifying the face(s).</param>
/// <param name="func">A <see cref="glFunc"/> specifying the test function.</param>
/// <param name="ref">The reference value.</param>
/// <param name="mask">The bitmask for the operation.</param>
public delegate void glStencilFuncSeparate(glFace face, glFunc func, int @ref, uint mask);
/// <summary>
/// Sets the front and/or back face stencil mask for stencil write operations.
/// </summary>
/// <param name="face">A <see cref="glFace"/> specifying the face(s).</param>
/// <param name="mask">The bitmask.</param>
public delegate void glStencilMaskSeparate(glFace face, uint mask);
/// <summary>
/// Attaches a shader to a program.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="shader">The name of the shader.</param>
public delegate void glAttachShader(uint program, uint shader);
/// <summary>
/// Binds a vertex attribute index to a named attribute vertex shader variable.
/// </summary>
/// <param name="program"></param>
/// <param name="index">The attribute index to be bound.</param>
/// <param name="name">The name of the vertex shader variable.</param>
public delegate void glBindAttribLocation(uint program, uint index, string name);
/// <summary>
/// Compiles a shader.
/// </summary>
/// <param name="shader">The name of the shader.</param>
public delegate void glCompileShader(uint shader);
/// <summary>
/// Creates a program and returns the name of the program.
/// </summary>
/// <returns>The name of the program.</returns>
public delegate uint glCreateProgram();
/// <summary>
/// Creates a shader of a specific type and returns the name of the shader object.
/// </summary>
/// <param name="type">A <see cref="glShaderType"/> specifying the shader type.</param>
/// <returns>The name of the shader object.</returns>
public delegate uint glCreateShader(glShaderType type);
/// <summary>
/// Releases/Destroys a program.
/// </summary>
/// <param name="program">The name of the program.</param>
public delegate void glDeleteProgram(uint program);
/// <summary>
/// Releases/Destroys a shader.
/// </summary>
/// <param name="shader">The name of the shader.</param>
public delegate void glDeleteShader(uint shader);
/// <summary>
/// Detaches a shader from a program.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="shader">The name of the shader.</param>
public delegate void glDetachShader(uint program, uint shader);
/// <summary>
/// Disables a vertex attribute array.
/// </summary>
/// <param name="index">The index of the vertex attribute array.</param>
public delegate void glDisableVertexAttribArray(uint index);
/// <summary>
/// Enables a vertex attribute array.
/// </summary>
/// <param name="index">The index of the vertex attribute array.</param>
public delegate void glEnableVertexAttribArray(uint index);
internal delegate void glGetActiveAttrib(uint program, uint index, int bufSize, out int length, out int size, out glGLSLType type, StringBuilder name);
internal delegate void glGetActiveUniform(uint program, uint index, int bufSize, out int length, out int size, out glGLSLType type, StringBuilder name);
/// <summary>
/// Returns the attached shaders of a program.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="maxCount">The maximum number of shader names to be returned. (Size of the <paramref name="obj"/> array.)</param>
/// <param name="count">Returns the number of actual returned shader names.</param>
/// <param name="obj">Returns the shader names.</param>
public delegate void glGetAttachedShaders(uint program, int maxCount, out int count, uint[] obj);
/// <summary>
/// Returns the location of a vertex attribute that is bound to a named attribute variable.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="name">The name of the attribute variable.</param>
/// <returns>The index of the vertex attribute.</returns>
public delegate int glGetAttribLocation(uint program, string name);
/// <summary>
/// Returns the parameters of program object.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="pname">A <see cref="glProgramParameter"/> specifying the parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetProgrami(uint program, glProgramParameter pname, out int param);
/// <summary>
/// Returns the parameters of program object.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="pname">A <see cref="glProgramParameter"/> specifying the parameter.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetProgramiv(uint program, glProgramParameter pname, int[] @params);
internal delegate void glGetProgramInfoLog(uint program, int maxLength, out int length, StringBuilder infoLog);
/// <summary>
/// Returns the parameters of shader object.
/// </summary>
/// <param name="shader">The name of the shader.</param>
/// <param name="pname">A <see cref="glShaderParameter"/> specifying the parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetShaderi(uint shader, glShaderParameter pname, out int param);
/// <summary>
/// Returns the parameters of shader object.
/// </summary>
/// <param name="shader">The name of the shader.</param>
/// <param name="pname">A <see cref="glShaderParameter"/> specifying the parameter.</param>
/// <param name="params">Returns the requested value.</param>
public delegate void glGetShaderiv(uint shader, glShaderParameter pname, int[] @params);
internal delegate void glGetShaderInfoLog(uint shader, int bufSize, out int length, StringBuilder infoLog);
internal delegate void glGetShaderSource(uint shader, int bufSize, out int length, StringBuilder source);
/// <summary>
/// Returns the location of a uniform variable.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="name">The name of the uniform variable.</param>
/// <returns>The location of the uniform variable inside the program object.</returns>
public delegate int glGetUniformLocation(uint program, string name);
/// <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 glGetUniformf(uint program, int location, out float 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 glGetUniformfv(uint program, int location, float[] @params);
/// <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 glGetUniformi(uint program, int location, out int 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 glGetUniformiv(uint program, int location, 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 glGetVertexAttribd(uint index, glVertexAttribParameter pname, out double 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 glGetVertexAttribdv(uint index, glVertexAttribParameter pname, double[] @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 glGetVertexAttribf(uint index, glVertexAttribParameter pname, out float 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 glGetVertexAttribfv(uint index, glVertexAttribParameter pname, float[] @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 glGetVertexAttribi(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 glGetVertexAttribiv(uint index, glVertexAttribParameter pname, int[] @params);
internal delegate void glGetVertexAttribPointerv_32(uint index, glVertexAttribPointerParameter pname, out int pointer);
internal delegate void glGetVertexAttribPointerv_64(uint index, glVertexAttribPointerParameter pname, out long pointer);
/// <summary>
/// Determines if a name is a program name.
/// </summary>
/// <param name="program">>The maybe program name.</param>
/// <returns><b>true</b> if <paramref name="program"/> is a program name.</returns>
[return: MarshalAs(UnmanagedType.I1)]
public delegate bool glIsProgram(uint program);
/// <summary>
/// Determines if a name is a shader name.
/// </summary>
/// <param name="shader">>The maybe shader name.</param>
/// <returns><b>true</b> if <paramref name="shader"/> is a shader name.</returns>
[return: MarshalAs(UnmanagedType.I1)]
public delegate bool glIsShader(uint shader);
/// <summary>
/// Links a program object.
/// </summary>
/// <param name="program">The name of the program.</param>
public delegate void glLinkProgram(uint program);
internal delegate void glShaderSource(uint shader, int count, string[] strings, int[] lengths);
/// <summary>
/// Sets the active program.
/// </summary>
/// <param name="program">The name of the program.</param>
public delegate void glUseProgram(uint program);
/// <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 glUniform1f(int location, float 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 glUniform2f(int location, float v0, float 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">Thrid value of a tuple to set.</param>
public delegate void glUniform3f(int location, float v0, float v1, float 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 glUniform4f(int location, float v0, float v1, float v2, float v3);
/// <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 glUniform1i(int location, int 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 glUniform2i(int location, int v0, int 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">Thrid value of a tuple to set.</param>
public delegate void glUniform3i(int location, int v0, int v1, int 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 glUniform4i(int location, int v0, int v1, int v2, int 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 glUniform1fv(int location, int count, params float[] 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 glUniform2fv(int location, int count, params float[] 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 glUniform3fv(int location, int count, params float[] 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 glUniform4fv(int location, int count, params float[] 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 glUniform1iv(int location, int count, params int[] 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 glUniform2iv(int location, int count, params int[] 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 glUniform3iv(int location, int count, params int[] 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 glUniform4iv(int location, int count, params int[] value);
/// <summary>
/// Sets a uniform matrix value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="count">Number of matrices to be loaded. (>1 if uniform is array of matrices)</param>
/// <param name="transpose">Set <b>true</b> if the matrix is to be transposed.</param>
/// <param name="value">The values of the matrix.</param>
public delegate void glUniformMatrix2fv(int location, int count, [MarshalAs(UnmanagedType.I1)] bool transpose, params float[] value);
/// <summary>
/// Sets a uniform matrix value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="count">Number of matrices to be loaded. (>1 if uniform is array of matrices)</param>
/// <param name="transpose">Set <b>true</b> if the matrix is to be transposed.</param>
/// <param name="value">The values of the matrix.</param>
public delegate void glUniformMatrix3fv(int location, int count, [MarshalAs(UnmanagedType.I1)] bool transpose, params float[] value);
/// <summary>
/// Sets a uniform matrix value.
/// </summary>
/// <param name="location">The location of the uniform.</param>
/// <param name="count">Number of matrices to be loaded. (>1 if uniform is array of matrices)</param>
/// <param name="transpose">Set <b>true</b> if the matrix is to be transposed.</param>
/// <param name="value">The values of the matrix.</param>
public delegate void glUniformMatrix4fv(int location, int count, [MarshalAs(UnmanagedType.I1)] bool transpose, params float[] value);
/// <summary>
/// Validates a program. The status of the validation will be stored in <see cref="glProgramParameter.VALIDATE_STATUS"/>.
/// </summary>
/// <param name="program">The name of the program to be validated.</param>
public delegate void glValidateProgram(uint program);
/// <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 glVertexAttrib1d(uint index, double x);
/// <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 glVertexAttrib1dv(uint index, double[] v);
/// <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 glVertexAttrib1f(uint index, float x);
/// <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 glVertexAttrib1fv(uint index, float[] v);
/// <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 glVertexAttrib1s(uint index, short x);
/// <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 glVertexAttrib1sv(uint index, short[] v);
/// <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 glVertexAttrib2d(uint index, double x, double y);
/// <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 glVertexAttrib2dv(uint index, double[] v);
/// <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 glVertexAttrib2f(uint index, float x, float y);
/// <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 glVertexAttrib2fv(uint index, float[] v);
/// <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 glVertexAttrib2s(uint index, short x, short y);
/// <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 glVertexAttrib2sv(uint index, short[] v);
/// <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 glVertexAttrib3d(uint index, double x, double y, double z);
/// <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 glVertexAttrib3dv(uint index, double[] v);
/// <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 glVertexAttrib3f(uint index, float x, float y, float z);
/// <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 glVertexAttrib3fv(uint index, float[] v);
/// <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 glVertexAttrib3s(uint index, short x, short y, short z);
/// <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 glVertexAttrib3sv(uint index, 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 glVertexAttrib4Nbv(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 glVertexAttrib4Niv(uint index, params 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 glVertexAttrib4Nsv(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="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 glVertexAttrib4Nub(uint index, byte x, byte y, byte z, byte w);
/// <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 glVertexAttrib4Nubv(uint index, 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 glVertexAttrib4Nuiv(uint index, params 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 glVertexAttrib4Nusv(uint index, params ushort[] 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 glVertexAttrib4bv(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="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 glVertexAttrib4d(uint index, double x, double y, double z, double w);
/// <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 glVertexAttrib4dv(uint index, double[] v);
/// <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 glVertexAttrib4f(uint index, float x, float y, float z, float w);
/// <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 glVertexAttrib4fv(uint index, float[] 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 glVertexAttrib4iv(uint index, params int[] v);
/// <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 glVertexAttrib4s(uint index, short x, short y, short z, short w);
/// <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 glVertexAttrib4sv(uint index, 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 glVertexAttrib4ubv(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 glVertexAttrib4uiv(uint index, params 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 glVertexAttrib4usv(uint index, params ushort[] v);
internal delegate void glVertexAttribPointer_32(uint index, int size, glVertexAttribType type, [MarshalAs(UnmanagedType.I1)] bool normalized, int stride, int pointer);
internal delegate void glVertexAttribPointer_64(uint index, int size, glVertexAttribType type, [MarshalAs(UnmanagedType.I1)] bool normalized, int stride, long pointer);
}
public static partial class gl
{
/// <summary>
/// Indicates if OpenGL version 2.0 is available.
/// </summary>
public static bool VERSION_2_0;
#region Delegates
/// <summary>
/// Sets the blend equation separately for color and alpha.
/// </summary>
public static glBlendEquationSeparate BlendEquationSeparate;
/// <summary>
/// Sets the buffers to be drawn into.
/// </summary>
public static glDrawBuffers DrawBuffers;
/// <summary>
/// Sets the front and/or back face stencil operation.
/// </summary>
public static glStencilOpSeparate StencilOpSeparate;
/// <summary>
/// Sets the front and/or back face stencil test function.
/// </summary>
public static glStencilFuncSeparate StencilFuncSeparate;
/// <summary>
/// Sets the front and/or back face stencil mask for stencil write operations.
/// </summary>
public static glStencilMaskSeparate StencilMaskSeparate;
/// <summary>
/// Attaches a shader to a program.
/// </summary>
public static glAttachShader AttachShader;
/// <summary>
/// Binds a vertex attribute index to a named attribute vertex shader variable.
/// </summary>
public static glBindAttribLocation BindAttribLocation;
/// <summary>
/// Compiles a shader.
/// </summary>
public static glCompileShader CompileShader;
/// <summary>
/// Creates a program and returns the name of the program.
/// </summary>
public static glCreateProgram CreateProgram;
/// <summary>
/// Creates a shader of a specific type and returns the name of the shader object.
/// </summary>
public static glCreateShader CreateShader;
/// <summary>
/// Releases/Destroys a program.
/// </summary>
public static glDeleteProgram DeleteProgram;
/// <summary>
/// Releases/Destroys a shader.
/// </summary>
public static glDeleteShader DeleteShader;
/// <summary>
/// Detaches a shader from a program.
/// </summary>
public static glDetachShader DetachShader;
/// <summary>
/// Disables a vertex attribute array.
/// </summary>
public static glDisableVertexAttribArray DisableVertexAttribArray;
/// <summary>
/// Enables a vertex attribute array.
/// </summary>
public static glEnableVertexAttribArray EnableVertexAttribArray;
private static glGetActiveAttrib _GetActiveAttrib;
private static glGetActiveUniform _GetActiveUniform;
/// <summary>
/// Returns the attached shaders of a program.
/// </summary>
public static glGetAttachedShaders GetAttachedShaders;
/// <summary>
/// Returns the location of a vertex attribute that is bound to a named attribute variable.
/// </summary>
public static glGetAttribLocation GetAttribLocation;
/// <summary>
/// Returns the parameters of program object.
/// </summary>
public static glGetProgrami GetProgrami;
/// <summary>
/// Returns the parameters of program object.
/// </summary>
public static glGetProgramiv GetProgramiv;
private static glGetProgramInfoLog _GetProgramInfoLog;
/// <summary>
/// Returns the parameters of shader object.
/// </summary>
public static glGetShaderi GetShaderi;
/// <summary>
/// Returns the parameters of shader object.
/// </summary>
public static glGetShaderiv GetShaderiv;
private static glGetShaderInfoLog _GetShaderInfoLog;
private static glGetShaderSource _GetShaderSource;
/// <summary>
/// Returns the location of a uniform variable.
/// </summary>
public static glGetUniformLocation GetUniformLocation;
/// <summary>
/// Returns the value of a uniform variable.
/// </summary>
public static glGetUniformf GetUniformf;
/// <summary>
/// Returns the value(s) of a uniform variable.
/// </summary>
public static glGetUniformfv GetUniformfv;
/// <summary>
/// Returns the value of a uniform variable.
/// </summary>
public static glGetUniformi GetUniformi;
/// <summary>
/// Returns the value(s) of a uniform variable.
/// </summary>
public static glGetUniformiv GetUniformiv;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribd GetVertexAttribd;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribdv GetVertexAttribdv;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribf GetVertexAttribf;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribfv GetVertexAttribfv;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribi GetVertexAttribi;
/// <summary>
/// Returns parameters of vertex attributes.
/// </summary>
public static glGetVertexAttribiv GetVertexAttribiv;
private static glGetVertexAttribPointerv_32 GetVertexAttribPointerv_32;
private static glGetVertexAttribPointerv_64 GetVertexAttribPointerv_64;
/// <summary>
/// Determines if a name is a program name.
/// </summary>
public static glIsProgram IsProgram;
/// <summary>
/// Determines if a name is a shader name.
/// </summary>
public static glIsShader IsShader;
/// <summary>
/// Links a program object.
/// </summary>
public static glLinkProgram LinkProgram;
private static glShaderSource _ShaderSource;
/// <summary>
/// Sets the active program.
/// </summary>
public static glUseProgram UseProgram;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform1f Uniform1f;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform2f Uniform2f;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform3f Uniform3f;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform4f Uniform4f;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform1i Uniform1i;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform2i Uniform2i;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform3i Uniform3i;
/// <summary>
/// Sets a uniform value.
/// </summary>
public static glUniform4i Uniform4i;
/// <summary>