-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgl.Version_4_3.cs
1666 lines (1518 loc) · 85.4 KB
/
gl.Version_4_3.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
{
internal delegate void glClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, IntPtr data);
internal delegate void glClearBufferSubData_32(glBufferTarget target, glInternalFormat internalformat, int offset, int size, glPixelFormat format, glPixelDataType type, IntPtr data);
internal delegate void glClearBufferSubData_64(glBufferTarget target, glInternalFormat internalformat, long offset, long size, glPixelFormat format, glPixelDataType type, IntPtr data);
/// <summary>
/// Launches one or more compute work groups.
/// </summary>
/// <param name="num_groups_x">The number of work groups to be launched in the X dimension.</param>
/// <param name="num_groups_y">The number of work groups to be launched in the Y dimension.</param>
/// <param name="num_groups_z">The number of work groups to be launched in the Z dimension.</param>
public delegate void glDispatchCompute(uint num_groups_x, uint num_groups_y, uint num_groups_z);
internal delegate void glDispatchComputeIndirect_32(int indirect);
internal delegate void glDispatchComputeIndirect_64(long indirect);
/// <summary>
/// Performs a raw data copy between two images.
/// </summary>
/// <param name="srcName">The name of a texture or renderbuffer object from which to copy.</param>
/// <param name="srcTarget">A <see cref="glTextureTarget"/> specifying the namespaces of <paramref name="srcName"/>.</param>
/// <param name="srcLevel">The level-of-detail to read form the source.</param>
/// <param name="srcX">The X coordinate of the left edge of the souce region to copy.</param>
/// <param name="srcY">The Y coordinate of the left edge of the souce region to copy.</param>
/// <param name="srcZ">The Z coordinate of the left edge of the souce region to copy.</param>
/// <param name="dstName">The name of a texture or renderbuffer object to which to copy.</param>
/// <param name="dstTarget">A <see cref="glTextureTarget"/> specifying the namespaces of <paramref name="dstName"/>.</param>
/// <param name="dstLevel">The level-of-detail of the target to write to.</param>
/// <param name="dstX">The X coordinate of the left edge of the destination region.</param>
/// <param name="dstY">The Y coordinate of the left edge of the destination region.</param>
/// <param name="dstZ">The Z coordinate of the left edge of the destination region.</param>
/// <param name="srcWidth">The width of the region.</param>
/// <param name="srcHeight">The height of the region.</param>
/// <param name="srcDepth">The depth of the region.</param>
public delegate void glCopyImageSubData(uint srcName, glTextureTarget srcTarget, int srcLevel, int srcX, int srcY, int srcZ, uint dstName, glTextureTarget dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth);
/// <summary>
/// Sets parameters of framebuffers.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="pname">A <see cref="glFramebufferParameter"/> specifying the parameter to set.</param>
/// <param name="param">The value to set.</param>
public delegate void glFramebufferParameteri(glFramebufferTarget target, glFramebufferParameter pname, int param);
/// <summary>
/// Returns the parameter of framebuffers.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="pname">A <see cref="glFramebufferParameter"/> specifying the parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetFramebufferParameteri(glFramebufferTarget target, glFramebufferParameter pname, out int param);
/// <summary>
/// Returns the parameter of framebuffers.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="pname">A <see cref="glFramebufferParameter"/> specifying the parameter.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetFramebufferParameteriv(glFramebufferTarget target, glFramebufferParameter pname, int[] @params);
/// <summary>
/// Returns parameters of internal formats.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target the <paramref name="internalformat"/> is used for.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="pname">A <see cref="glInternalformatParameter"/> specifying the parameter.</param>
/// <param name="bufSize">Must be one.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetInternalformati64(glTextureTarget target, glInternalFormat internalformat, glInternalformatParameter pname, int bufSize, out long param);
/// <summary>
/// Returns parameters of internal formats.
/// </summary>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target the <paramref name="internalformat"/> is used for.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="pname">A <see cref="glInternalformatParameter"/> specifying the parameter.</param>
/// <param name="bufSize">Must be one.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetInternalformati64v(glTextureTarget target, glInternalFormat internalformat, glInternalformatParameter pname, int bufSize, long[] @params);
/// <summary>
/// Invalidates parts of texture images.
/// </summary>
/// <param name="texture">The name of the texture.</param>
/// <param name="level">The level-of-detail.</param>
/// <param name="xoffset">The X offset of the region to be invalidated.</param>
/// <param name="yoffset">The Y offset of the region to be invalidated.</param>
/// <param name="zoffset">The Z offset of the region to be invalidated.</param>
/// <param name="width">The width of the region.</param>
/// <param name="height">The height of the region.</param>
/// <param name="depth">The depth of the region.</param>
public delegate void glInvalidateTexSubImage(uint texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth);
/// <summary>
/// Invalidates an entire texture image.
/// </summary>
/// <param name="texture">The name of the texture.</param>
/// <param name="level">The level-of-detail.</param>
public delegate void glInvalidateTexImage(uint texture, int level);
internal delegate void glInvalidateBufferSubData_32(uint buffer, int offset, int length);
internal delegate void glInvalidateBufferSubData_64(uint buffer, long offset, long length);
/// <summary>
/// Invalidates an entire buffer object's data storage.
/// </summary>
/// <param name="buffer">The name of the buffer object.</param>
public delegate void glInvalidateBufferData(uint buffer);
/// <summary>
/// Invalidates the content of some or all of a framebuffer's attachments.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="numAttachments">The number of attachments in <paramref name="attachments"/>.</param>
/// <param name="attachments">An array of <see cref="glBuffer"/>s specifying the attachments.</param>
public delegate void glInvalidateFramebuffer(glFramebufferTarget target, int numAttachments, params glBuffer[] attachments);
/// <summary>
/// Invalidates the content of a region of some or all of a framebuffer's attachments.
/// </summary>
/// <param name="target">A <see cref="glFramebufferTarget"/> specifying the framebuffer target.</param>
/// <param name="numAttachments">The number of attachments in <paramref name="attachments"/>.</param>
/// <param name="attachments">An array of <see cref="glBuffer"/>s specifying the attachments.</param>
/// <param name="x">The X offset of the region to be invalidated.</param>
/// <param name="y">The Y offset of the region to be invalidated.</param>
/// <param name="width">The width of the region to be invalidated.</param>
/// <param name="height">The height of the region to be invalidated.</param>
public delegate void glInvalidateSubFramebuffer(glFramebufferTarget target, int numAttachments, glBuffer[] attachments, int x, int y, int width, int height);
/// <summary>
/// Renders multiple instances of primitives from array, taking parameters from memory.
/// </summary>
/// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to be rendered.</param>
/// <param name="indirect">An array of structures containing the draw parameters.</param>
/// <param name="drawcount">The number of elements in the array of draw parameter structures.</param>
/// <param name="stride">The distance in bytes between elements of the draw parameter array. (Should be zero, here in .Net)</param>
public delegate void glMultiDrawArraysIndirect(glDrawMode mode, glDrawArraysIndirectCommand[] indirect, int drawcount, int stride);
/// <summary>
/// Renders multiple instances of primitives from array via indices, taking parameters from memory.
/// </summary>
/// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to render.</param>
/// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param>
/// <param name="indirect">The structure containing the draw parameters.</param>
/// <param name="drawcount">The number of elements in the array of draw parameter structures.</param>
/// <param name="stride">The distance in bytes between elements of the draw parameter array. (Should be zero, here in .Net)</param>
public delegate void glMultiDrawElementsIndirect(glDrawMode mode, glDrawElementsType type, glDrawElementsIndirectCommand[] indirect, int drawcount, int stride);
/// <summary>
/// Returns parameters of program interfaces.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="programInterface">A <see cref="glProgramInterface"/> specifying the program interface.</param>
/// <param name="pname">A <see cref="glProgramInterfaceParameter"/> specifying the parameter.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetProgramInterfacei(uint program, glProgramInterface programInterface, glProgramInterfaceParameter pname, out int param);
/// <summary>
/// Returns parameters of program interfaces.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="programInterface">A <see cref="glProgramInterface"/> specifying the program interface.</param>
/// <param name="pname">A <see cref="glProgramInterfaceParameter"/> specifying the parameter.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetProgramInterfaceiv(uint program, glProgramInterface programInterface, glProgramInterfaceParameter pname, int[] @params);
/// <summary>
/// Returns the index program resources.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="programInterface">A <see cref="glProgramInterface"/> specifying the program interface.</param>
/// <param name="name">The name of the program resources.</param>
/// <returns>Tthe index program resource.</returns>
public delegate uint glGetProgramResourceIndex(uint program, glProgramInterface programInterface, string name);
internal delegate void glGetProgramResourceName(uint program, glProgramInterface programInterface, uint index, int bufSize, out int length, StringBuilder name);
/// <summary>
/// Returns the values of properties of active program resources.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="programInterface">A <see cref="glProgramInterface"/> specifying the program interface.</param>
/// <param name="index">The index of the resource.</param>
/// <param name="propCount">Must be one.</param>
/// <param name="prop">A <see cref="glProgramResourceProperty"/> specifying the requested property.</param>
/// <param name="bufSize">Must be one.</param>
/// <param name="length">Will be one.</param>
/// <param name="param">Returns the requested value.</param>
public delegate void glGetProgramResourcei(uint program, glProgramInterface programInterface, uint index, int propCount, ref glProgramResourceProperty prop, int bufSize, out int length, out int param);
/// <summary>
/// Returns the values of properties of active program resources.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="programInterface">A <see cref="glProgramInterface"/> specifying the program interface.</param>
/// <param name="index">The index of the resource.</param>
/// <param name="propCount">The number of properties requested.</param>
/// <param name="props">An array of <see cref="glProgramResourceProperty"/> specifying the requested properties.</param>
/// <param name="bufSize">The size of the buffer <paramref name="params"/>.</param>
/// <param name="length">Returns the actual length of the result in <paramref name="params"/>.</param>
/// <param name="params">Returns the requested value(s).</param>
public delegate void glGetProgramResourceiv(uint program, glProgramInterface programInterface, uint index, int propCount, glProgramResourceProperty[] props, int bufSize, out int length, int[] @params);
/// <summary>
/// Returns the location of a named resource within a program.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="programInterface">A <see cref="glProgramInterface"/> specifying the program interface.</param>
/// <param name="name">The name of the resource.</param>
/// <returns>The location of the named resource within the program.</returns>
public delegate int glGetProgramResourceLocation(uint program, glProgramInterface programInterface, string name);
/// <summary>
/// Returns the fragment color index of a named variable within a program.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="programInterface">A <see cref="glProgramInterface"/> specifying the program interface.</param>
/// <param name="name">The name of the variable.</param>
/// <returns>The fragment color index of the named variable within the program.</returns>
public delegate int glGetProgramResourceLocationIndex(uint program, glProgramInterface programInterface, string name);
/// <summary>
/// Sets the binding of an active shader storage block.
/// </summary>
/// <param name="program">The name of the program.</param>
/// <param name="storageBlockIndex">The index storage block within the program.</param>
/// <param name="storageBlockBinding">The index storage block binding to associate with the specified storage block.</param>
public delegate void glShaderStorageBlockBinding(uint program, uint storageBlockIndex, uint storageBlockBinding);
internal delegate void glTexBufferRange_32(glBufferTarget target, glInternalFormat internalformat, uint buffer, int offset, int size);
internal delegate void glTexBufferRange_64(glBufferTarget target, glInternalFormat internalformat, uint buffer, long offset, long size);
/// <summary>
/// Creates a storage for of a 2D multisample texture.
/// </summary>
/// <param name="target">A <see cref="glTexture2DProxyTarget"/> specifying the texture target.</param>
/// <param name="samples">The number of samples in the texture.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="width">The width of the texture.</param>
/// <param name="height">The height of the texture.</param>
/// <param name="fixedsamplelocations">Specifies whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not depend on the internal format or size of the image.</param>
public delegate void glTexStorage2DMultisample(glTexture2DProxyTarget target, int samples, glInternalFormat internalformat, int width, int height, [MarshalAs(UnmanagedType.I1)] bool fixedsamplelocations);
/// <summary>
/// Creates a storage for of a 3D multisample texture.
/// </summary>
/// <param name="target">A <see cref="glTexture3DProxyTarget"/> specifying the texture target.</param>
/// <param name="samples">The number of samples in the texture.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="width">The width of the texture.</param>
/// <param name="height">The height of the texture.</param>
/// <param name="depth">The depth of the texture.</param>
/// <param name="fixedsamplelocations">Specifies whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not depend on the internal format or size of the image.</param>
public delegate void glTexStorage3DMultisample(glTexture3DProxyTarget target, int samples, glInternalFormat internalformat, int width, int height, int depth, [MarshalAs(UnmanagedType.I1)] bool fixedsamplelocations);
/// <summary>
/// Sets up a view to another texture's data store.
/// </summary>
/// <param name="texture">The name of the texture object to be initialized as a view.</param>
/// <param name="target">A <see cref="glTextureTarget"/> specifying the texture target to set up.</param>
/// <param name="origtexture">The name of the texture object of which to make a view.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying </param>
/// <param name="minlevel">The minimum level of the texture view.</param>
/// <param name="numlevels">The number of levels of the texture view.</param>
/// <param name="minlayer">The minimum layer number of the texture view.</param>
/// <param name="numlayers">The number of layers of the texture view.</param>
public delegate void glTextureView(uint texture, glTextureTarget target, uint origtexture, glInternalFormat internalformat, uint minlevel, uint numlevels, uint minlayer, uint numlayers);
internal delegate void glBindVertexBuffer_32(uint bindingindex, uint buffer, int offset, int stride);
internal delegate void glBindVertexBuffer_64(uint bindingindex, uint buffer, long offset, int stride);
/// <summary>
/// Sets the organization of vertex arrays.
/// </summary>
/// <param name="attribindex">The index of the vertex attribute.</param>
/// <param name="size">The number of values per vertex that are stored in the array.</param>
/// <param name="type">A <see cref="glVertexAttribType"/> specifying the type of the data stored in the array.</param>
/// <param name="normalized">Set <b>true</b> if data is normalized.</param>
/// <param name="relativeoffset">The distance between elements within the buffer.</param>
public delegate void glVertexAttribFormat(uint attribindex, int size, glVertexAttribType type, [MarshalAs(UnmanagedType.I1)] bool normalized, uint relativeoffset);
/// <summary>
/// Sets the organization of vertex arrays.
/// </summary>
/// <param name="attribindex">The index of the vertex attribute.</param>
/// <param name="size">The number of values per vertex that are stored in the array.</param>
/// <param name="type">A <see cref="glVertexAttribType"/> specifying the type of the data stored in the array.</param>
/// <param name="relativeoffset">The distance between elements within the buffer.</param>
public delegate void glVertexAttribIFormat(uint attribindex, int size, glVertexAttribType type, uint relativeoffset);
/// <summary>
/// Sets the organization of vertex arrays.
/// </summary>
/// <param name="attribindex">The index of the vertex attribute.</param>
/// <param name="size">The number of values per vertex that are stored in the array.</param>
/// <param name="type">A <see cref="glVertexAttribType"/> specifying the type of the data stored in the array.</param>
/// <param name="relativeoffset">The distance between elements within the buffer.</param>
public delegate void glVertexAttribLFormat(uint attribindex, int size, glVertexAttribType type, uint relativeoffset);
/// <summary>
/// Associate a vertex attribute and a vertex buffer binding for a vertex array object.
/// </summary>
/// <param name="attribindex">The index of the attribute to associate with a vertex buffer binding.</param>
/// <param name="bindingindex">The index of the vertex buffer binding with which to associate the generic vertex attribute.</param>
public delegate void glVertexAttribBinding(uint attribindex, uint bindingindex);
/// <summary>
/// Sets the rate at which vertex attributes advance.
/// </summary>
/// <param name="bindingindex">The index of the binding.</param>
/// <param name="divisor">The value for the instance step rate.</param>
public delegate void glVertexBindingDivisor(uint bindingindex, uint divisor);
/// <summary>
/// Controls the reporting of debug messages in a debug context.
/// </summary>
/// <param name="source">A <see cref="glDebugSource"/> specifying the message source.</param>
/// <param name="type">A <see cref="glDebugType"/> specifying the message type.</param>
/// <param name="severity">A <see cref="glDebugSeverity"/> specifying the severity of the message.</param>
/// <param name="count">The number of ids in <paramref name="ids"/>.</param>
/// <param name="ids">The ids of the messages.</param>
/// <param name="enabled">The state the messages in <paramref name="ids"/> will be set to.</param>
public delegate void glDebugMessageControl(glDebugSource source, glDebugType type, glDebugSeverity severity, int count, uint[] ids, [MarshalAs(UnmanagedType.I1)] bool enabled);
/// <summary>
/// Inserts a message into the debug message queue.
/// </summary>
/// <param name="source">A <see cref="glDebugSource"/> specifying the message source.</param>
/// <param name="type">A <see cref="glDebugType"/> specifying the message type.</param>
/// <param name="id">The id of the message.</param>
/// <param name="severity">A <see cref="glDebugSeverity"/> specifying the severity of the message.</param>
/// <param name="length">The length of the text in <paramref name="message"/>.</param>
/// <param name="message">The message text.</param>
public delegate void glDebugMessageInsert(glDebugSource source, glDebugType type, uint id, glDebugSeverity severity, int length, string message);
/// <summary>
/// Callback defintion for functions passed to <see cref="gl.DebugMessageCallback"/>.
/// </summary>
/// <param name="source">Gives a <see cref="glDebugSource"/> specifying the message source.</param>
/// <param name="type">Gives a <see cref="glDebugType"/> specifying the message type.</param>
/// <param name="id">Gives id of the message.</param>
/// <param name="severity">Gives a <see cref="glDebugSeverity"/> specifying the severity of the message.</param>
/// <param name="length">The length of the message.</param>
/// <param name="message">The pointer to the array countaining the message.</param>
/// <param name="userParam">The address of a user-supplied object passed to <see cref="gl.DebugMessageCallback"/>.</param>
/// <remarks>Use <c>Marshal.PtrToStringAnsi(message, length)</c> to get a <b>string</b> of the message.</remarks>
public delegate void glDebugProc(glDebugSource source, glDebugType type, uint id, glDebugSeverity severity, int length, IntPtr message, IntPtr userParam);
/// <summary>
/// Sets the callback to receive debugging messages.
/// </summary>
/// <param name="callback">A delegate of type <see cref="glDebugProc"/> to the function to call on messages.</param>
/// <param name="userParam">The address of a user-supplied object that will be passed the the callback each time it is called.</param>
public delegate void glDebugMessageCallback(glDebugProc callback, IntPtr userParam);
internal delegate uint glGetDebugMessageLog(uint count, int bufSize, glDebugSource[] sources, glDebugType[] types, uint[] ids, glDebugSeverity[] severities, int[] lengths, StringBuilder messageLog);
/// <summary>
/// Pushes a named debug group into the command stream.
/// </summary>
/// <param name="source">A <see cref="glDebugSource"/> specifying the message source.</param>
/// <param name="id">The id of the message.</param>
/// <param name="length">The length of the text in <paramref name="message"/>.</param>
/// <param name="message">The message text.</param>
public delegate void glPushDebugGroup(glDebugSource source, uint id, int length, string message);
/// <summary>
/// Pops the active debug group.
/// </summary>
public delegate void glPopDebugGroup();
/// <summary>
/// Labels named objects identified within a namespace.
/// </summary>
/// <param name="identifier">A <see cref="glObjectNamespaceIdentifier"/> specifying the namesapce.</param>
/// <param name="name">The name of the object.</param>
/// <param name="length">The length of the <paramref name="label"/>.</param>
/// <param name="label">The label.</param>
public delegate void glObjectLabel(glObjectNamespaceIdentifier identifier, uint name, int length, string label);
internal delegate void glGetObjectLabel(glObjectNamespaceIdentifier identifier, uint name, int bufSize, out int length, StringBuilder label);
/// <summary>
/// Labels objects identified by a handle (like sync objects).
/// </summary>
/// <param name="ptr">Handle to the object.</param>
/// <param name="length">The length of the <paramref name="label"/>.</param>
/// <param name="label">The label.</param>
public delegate void glObjectPtrLabel(IntPtr ptr, int length, string label);
internal delegate void glGetObjectPtrLabel(IntPtr ptr, int bufSize, out int length, StringBuilder label);
}
public static partial class gl
{
/// <summary>
/// Indicates if OpenGL version 4.3 is available.
/// </summary>
public static bool VERSION_4_3;
#region Delegates
private static glClearBufferData _ClearBufferData;
private static glClearBufferSubData_32 ClearBufferSubData_32;
private static glClearBufferSubData_64 ClearBufferSubData_64;
/// <summary>
/// Launches one or more compute work groups.
/// </summary>
public static glDispatchCompute DispatchCompute;
private static glDispatchComputeIndirect_32 DispatchComputeIndirect_32;
private static glDispatchComputeIndirect_64 DispatchComputeIndirect_64;
/// <summary>
/// Performs a raw data copy between two images.
/// </summary>
public static glCopyImageSubData CopyImageSubData;
/// <summary>
/// Sets parameters of framebuffers.
/// </summary>
public static glFramebufferParameteri FramebufferParameteri;
/// <summary>
/// Returns the parameter of framebuffers.
/// </summary>
public static glGetFramebufferParameteri GetFramebufferParameteri;
/// <summary>
/// Returns the parameter of framebuffers.
/// </summary>
public static glGetFramebufferParameteriv GetFramebufferParameteriv;
/// <summary>
/// Returns parameters of internal formats.
/// </summary>
public static glGetInternalformati64 GetInternalformati64;
/// <summary>
/// Returns parameters of internal formats.
/// </summary>
public static glGetInternalformati64v GetInternalformati64v;
/// <summary>
/// Invalidates parts of texture images.
/// </summary>
public static glInvalidateTexSubImage InvalidateTexSubImage;
/// <summary>
/// Invalidates an entire texture image.
/// </summary>
public static glInvalidateTexImage InvalidateTexImage;
private static glInvalidateBufferSubData_32 InvalidateBufferSubData_32;
private static glInvalidateBufferSubData_64 InvalidateBufferSubData_64;
/// <summary>
/// Invalidates an entire buffer object's data storage.
/// </summary>
public static glInvalidateBufferData InvalidateBufferData;
/// <summary>
/// Invalidates the content of some or all of a framebuffer's attachments.
/// </summary>
public static glInvalidateFramebuffer InvalidateFramebuffer;
/// <summary>
/// Invalidates the content of a region of some or all of a framebuffer's attachments.
/// </summary>
public static glInvalidateSubFramebuffer InvalidateSubFramebuffer;
/// <summary>
/// Renders multiple instances of primitives from array, taking parameters from memory.
/// </summary>
public static glMultiDrawArraysIndirect MultiDrawArraysIndirect;
/// <summary>
/// Renders multiple instances of primitives from array via indices, taking parameters from memory.
/// </summary>
public static glMultiDrawElementsIndirect MultiDrawElementsIndirect;
/// <summary>
/// Returns parameters of program interfaces.
/// </summary>
public static glGetProgramInterfacei GetProgramInterfacei;
/// <summary>
/// Returns parameters of program interfaces.
/// </summary>
public static glGetProgramInterfaceiv GetProgramInterfaceiv;
/// <summary>
/// Returns the index program resources.
/// </summary>
public static glGetProgramResourceIndex GetProgramResourceIndex;
private static glGetProgramResourceName _GetProgramResourceName;
/// <summary>
/// Returns the values of properties of active program resources.
/// </summary>
public static glGetProgramResourcei GetProgramResourcei;
/// <summary>
/// Returns the values of properties of active program resources.
/// </summary>
public static glGetProgramResourceiv GetProgramResourceiv;
/// <summary>
/// Returns the location of a named resource within a program.
/// </summary>
public static glGetProgramResourceLocation GetProgramResourceLocation;
/// <summary>
/// Returns the fragment color index of a named variable within a program.
/// </summary>
public static glGetProgramResourceLocationIndex GetProgramResourceLocationIndex;
/// <summary>
/// Sets the binding of an active shader storage block.
/// </summary>
public static glShaderStorageBlockBinding ShaderStorageBlockBinding;
private static glTexBufferRange_32 TexBufferRange_32;
private static glTexBufferRange_64 TexBufferRange_64;
/// <summary>
/// Creates a storage for of a 2D multisample texture.
/// </summary>
public static glTexStorage2DMultisample TexStorage2DMultisample;
/// <summary>
/// Creates a storage for of a 3D multisample texture.
/// </summary>
public static glTexStorage3DMultisample TexStorage3DMultisample;
/// <summary>
/// Sets up a view to another texture's data store.
/// </summary>
public static glTextureView TextureView;
private static glBindVertexBuffer_32 BindVertexBuffer_32;
private static glBindVertexBuffer_64 BindVertexBuffer_64;
/// <summary>
/// Sets the organization of vertex arrays.
/// </summary>
public static glVertexAttribFormat VertexAttribFormat;
/// <summary>
/// Sets the organization of vertex arrays.
/// </summary>
public static glVertexAttribIFormat VertexAttribIFormat;
/// <summary>
/// Sets the organization of vertex arrays.
/// </summary>
public static glVertexAttribLFormat VertexAttribLFormat;
/// <summary>
/// Associate a vertex attribute and a vertex buffer binding for a vertex array object.
/// </summary>
public static glVertexAttribBinding VertexAttribBinding;
/// <summary>
/// Sets the rate at which vertex attributes advance.
/// </summary>
public static glVertexBindingDivisor VertexBindingDivisor;
/// <summary>
/// Controls the reporting of debug messages in a debug context.
/// </summary>
public static glDebugMessageControl DebugMessageControl;
/// <summary>
/// Inserts a message into the debug message queue.
/// </summary>
public static glDebugMessageInsert DebugMessageInsert;
/// <summary>
/// Sets the callback to receive debugging messages.
/// </summary>
public static glDebugMessageCallback DebugMessageCallback;
private static glGetDebugMessageLog _GetDebugMessageLog;
/// <summary>
/// Pushes a named debug group into the command stream.
/// </summary>
public static glPushDebugGroup PushDebugGroup;
/// <summary>
/// Pops the active debug group.
/// </summary>
public static glPopDebugGroup PopDebugGroup;
/// <summary>
/// Labels named objects identified within a namespace.
/// </summary>
public static glObjectLabel ObjectLabel;
private static glGetObjectLabel _GetObjectLabel;
/// <summary>
/// Labels objects identified by a handle (like sync objects).
/// </summary>
public static glObjectPtrLabel ObjectPtrLabel;
private static glGetObjectPtrLabel _GetObjectPtrLabel;
#endregion
#region Overloads
#region ClearBufferData
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, IntPtr data)
{
_ClearBufferData(target, internalformat, format, type, data);
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, byte[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, sbyte[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, short[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, ushort[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, int[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, uint[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, long[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, ulong[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, float[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferData(glBufferTarget target, glInternalFormat internalformat, glPixelFormat format, glPixelDataType type, double[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
_ClearBufferData(target, internalformat, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
#endregion
#region ClearBufferSubData
/// <summary>
/// Fills all or parts a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="offset">The offset into the data store.</param>
/// <param name="size">The size of the region.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferSubData(glBufferTarget target, glInternalFormat internalformat, int offset, int size, glPixelFormat format, glPixelDataType type, IntPtr data)
{
if (IntPtr.Size == 4) ClearBufferSubData_32(target, internalformat, offset, size, format, type, data);
else ClearBufferSubData_64(target, internalformat, offset, size, format, type, data);
}
/// <summary>
/// Fills all or parts a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="offset">The offset into the data store.</param>
/// <param name="size">The size of the region.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferSubData(glBufferTarget target, glInternalFormat internalformat, long offset, long size, glPixelFormat format, glPixelDataType type, IntPtr data)
{
if (IntPtr.Size == 4)
{
if (((long)offset >> 32) != 0) throw new ArgumentOutOfRangeException("offset", PlatformErrorString);
if (((long)size >> 32) != 0) throw new ArgumentOutOfRangeException("size", PlatformErrorString);
ClearBufferSubData_32(target, internalformat, (int)offset, (int)size, format, type, data);
}
else ClearBufferSubData_64(target, internalformat, offset, size, format, type, data);
}
/// <summary>
/// Fills all or parts a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="offset">The offset into the data store.</param>
/// <param name="size">The size of the region.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferSubData(glBufferTarget target, glInternalFormat internalformat, int offset, int size, glPixelFormat format, glPixelDataType type, byte[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
ClearBufferSubData(target, internalformat, offset, size, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills all or parts a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="offset">The offset into the data store.</param>
/// <param name="size">The size of the region.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferSubData(glBufferTarget target, glInternalFormat internalformat, long offset, long size, glPixelFormat format, glPixelDataType type, byte[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
ClearBufferSubData(target, internalformat, offset, size, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills all or parts a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="offset">The offset into the data store.</param>
/// <param name="size">The size of the region.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferSubData(glBufferTarget target, glInternalFormat internalformat, int offset, int size, glPixelFormat format, glPixelDataType type, sbyte[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
ClearBufferSubData(target, internalformat, offset, size, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}
/// <summary>
/// Fills all or parts a buffer object's data store with a fixed value.
/// </summary>
/// <param name="target">A <see cref="glBufferTarget"/> specifying the buffer target.</param>
/// <param name="internalformat">A <see cref="glInternalFormat"/> specifying the internal format.</param>
/// <param name="offset">The offset into the data store.</param>
/// <param name="size">The size of the region.</param>
/// <param name="format">A <see cref="glPixelFormat"/> specifying the pixel format used in <paramref name="data"/>.</param>
/// <param name="type">A <see cref="glPixelDataType"/> specifying the pixel data type used in <paramref name="data"/>.</param>
/// <param name="data">The 'fixed' value.</param>
public static void ClearBufferSubData(glBufferTarget target, glInternalFormat internalformat, long offset, long size, glPixelFormat format, glPixelDataType type, sbyte[] data)
{
GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
try
{
ClearBufferSubData(target, internalformat, offset, size, format, type, hData.AddrOfPinnedObject());
}
finally
{
hData.Free();
}
}