-
Notifications
You must be signed in to change notification settings - Fork 0
/
qglfunctions.h
1688 lines (1576 loc) · 49.3 KB
/
qglfunctions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtOpenGL module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QGLFUNCTIONS_H
#define QGLFUNCTIONS_H
#include <QtOpenGL/qgl.h>
#include <QtGui/qopenglcontext.h>
#include <QtGui/qopenglfunctions.h>
QT_BEGIN_NAMESPACE
struct QGLFunctionsPrivate;
class Q_OPENGL_EXPORT QGLFunctions
{
public:
QGLFunctions();
explicit QGLFunctions(const QGLContext *context);
~QGLFunctions() {}
enum OpenGLFeature
{
Multitexture = 0x0001,
Shaders = 0x0002,
Buffers = 0x0004,
Framebuffers = 0x0008,
BlendColor = 0x0010,
BlendEquation = 0x0020,
BlendEquationSeparate = 0x0040,
BlendFuncSeparate = 0x0080,
BlendSubtract = 0x0100,
CompressedTextures = 0x0200,
Multisample = 0x0400,
StencilSeparate = 0x0800,
NPOTTextures = 0x1000
};
Q_DECLARE_FLAGS(OpenGLFeatures, OpenGLFeature)
QGLFunctions::OpenGLFeatures openGLFeatures() const;
bool hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const;
void initializeGLFunctions(const QGLContext *context = nullptr);
void glActiveTexture(GLenum texture);
void glAttachShader(GLuint program, GLuint shader);
void glBindAttribLocation(GLuint program, GLuint index, const char* name);
void glBindBuffer(GLenum target, GLuint buffer);
void glBindFramebuffer(GLenum target, GLuint framebuffer);
void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void glBlendEquation(GLenum mode);
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
void glBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage);
void glBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data);
GLenum glCheckFramebufferStatus(GLenum target);
void glClearDepthf(GLclampf depth);
void glCompileShader(GLuint shader);
void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
GLuint glCreateProgram();
GLuint glCreateShader(GLenum type);
void glDeleteBuffers(GLsizei n, const GLuint* buffers);
void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
void glDeleteProgram(GLuint program);
void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
void glDeleteShader(GLuint shader);
void glDepthRangef(GLclampf zNear, GLclampf zFar);
void glDetachShader(GLuint program, GLuint shader);
void glDisableVertexAttribArray(GLuint index);
void glEnableVertexAttribArray(GLuint index);
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
void glGenBuffers(GLsizei n, GLuint* buffers);
void glGenerateMipmap(GLenum target);
void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
int glGetAttribLocation(GLuint program, const char* name);
void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
void glGetUniformiv(GLuint program, GLint location, GLint* params);
int glGetUniformLocation(GLuint program, const char* name);
void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
void glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer);
GLboolean glIsBuffer(GLuint buffer);
GLboolean glIsFramebuffer(GLuint framebuffer);
GLboolean glIsProgram(GLuint program);
GLboolean glIsRenderbuffer(GLuint renderbuffer);
GLboolean glIsShader(GLuint shader);
void glLinkProgram(GLuint program);
void glReleaseShaderCompiler();
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
void glSampleCoverage(GLclampf value, GLboolean invert);
void glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
void glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length);
void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
void glStencilMaskSeparate(GLenum face, GLuint mask);
void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
void glUniform1f(GLint location, GLfloat x);
void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform1i(GLint location, GLint x);
void glUniform1iv(GLint location, GLsizei count, const GLint* v);
void glUniform2f(GLint location, GLfloat x, GLfloat y);
void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform2i(GLint location, GLint x, GLint y);
void glUniform2iv(GLint location, GLsizei count, const GLint* v);
void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform3i(GLint location, GLint x, GLint y, GLint z);
void glUniform3iv(GLint location, GLsizei count, const GLint* v);
void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
void glUniform4iv(GLint location, GLsizei count, const GLint* v);
void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
void glUseProgram(GLuint program);
void glValidateProgram(GLuint program);
void glVertexAttrib1f(GLuint indx, GLfloat x);
void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
private:
QGLFunctionsPrivate *d_ptr;
static bool isInitialized(const QGLFunctionsPrivate *d) { return d != nullptr; }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFunctions::OpenGLFeatures)
struct QGLFunctionsPrivate
{
QGLFunctionsPrivate(const QGLContext *context = nullptr);
QOpenGLFunctions *funcs;
};
inline void QGLFunctions::glActiveTexture(GLenum texture)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glActiveTexture(texture);
}
inline void QGLFunctions::glAttachShader(GLuint program, GLuint shader)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glAttachShader(program, shader);
}
inline void QGLFunctions::glBindAttribLocation(GLuint program, GLuint index, const char* name)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBindAttribLocation(program, index, name);
}
inline void QGLFunctions::glBindBuffer(GLenum target, GLuint buffer)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBindBuffer(target, buffer);
}
inline void QGLFunctions::glBindFramebuffer(GLenum target, GLuint framebuffer)
{
if (framebuffer == 0)
framebuffer = QOpenGLContext::currentContext()->defaultFramebufferObject();
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBindFramebuffer(target, framebuffer);
}
inline void QGLFunctions::glBindRenderbuffer(GLenum target, GLuint renderbuffer)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBindRenderbuffer(target, renderbuffer);
}
inline void QGLFunctions::glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBlendColor(red, green, blue, alpha);
}
inline void QGLFunctions::glBlendEquation(GLenum mode)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBlendEquation(mode);
}
inline void QGLFunctions::glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBlendEquationSeparate(modeRGB, modeAlpha);
}
inline void QGLFunctions::glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}
inline void QGLFunctions::glBufferData(GLenum target, qopengl_GLsizeiptr size, const void* data, GLenum usage)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBufferData(target, size, data, usage);
}
inline void QGLFunctions::glBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, const void* data)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glBufferSubData(target, offset, size, data);
}
inline GLenum QGLFunctions::glCheckFramebufferStatus(GLenum target)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glCheckFramebufferStatus(target);
}
inline void QGLFunctions::glClearDepthf(GLclampf depth)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glClearDepthf(depth);
}
inline void QGLFunctions::glCompileShader(GLuint shader)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glCompileShader(shader);
}
inline void QGLFunctions::glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
}
inline void QGLFunctions::glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
inline GLuint QGLFunctions::glCreateProgram()
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glCreateProgram();
}
inline GLuint QGLFunctions::glCreateShader(GLenum type)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glCreateShader(type);
}
inline void QGLFunctions::glDeleteBuffers(GLsizei n, const GLuint* buffers)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glDeleteBuffers(n, buffers);
}
inline void QGLFunctions::glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glDeleteFramebuffers(n, framebuffers);
}
inline void QGLFunctions::glDeleteProgram(GLuint program)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glDeleteProgram(program);
}
inline void QGLFunctions::glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glDeleteRenderbuffers(n, renderbuffers);
}
inline void QGLFunctions::glDeleteShader(GLuint shader)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glDeleteShader(shader);
}
inline void QGLFunctions::glDepthRangef(GLclampf zNear, GLclampf zFar)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glDepthRangef(zNear, zFar);
}
inline void QGLFunctions::glDetachShader(GLuint program, GLuint shader)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glDetachShader(program, shader);
}
inline void QGLFunctions::glDisableVertexAttribArray(GLuint index)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glDisableVertexAttribArray(index);
}
inline void QGLFunctions::glEnableVertexAttribArray(GLuint index)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glEnableVertexAttribArray(index);
}
inline void QGLFunctions::glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
}
inline void QGLFunctions::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glFramebufferTexture2D(target, attachment, textarget, texture, level);
}
inline void QGLFunctions::glGenBuffers(GLsizei n, GLuint* buffers)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGenBuffers(n, buffers);
}
inline void QGLFunctions::glGenerateMipmap(GLenum target)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGenerateMipmap(target);
}
inline void QGLFunctions::glGenFramebuffers(GLsizei n, GLuint* framebuffers)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGenFramebuffers(n, framebuffers);
}
inline void QGLFunctions::glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGenRenderbuffers(n, renderbuffers);
}
inline void QGLFunctions::glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetActiveAttrib(program, index, bufsize, length, size, type, name);
}
inline void QGLFunctions::glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetActiveUniform(program, index, bufsize, length, size, type, name);
}
inline void QGLFunctions::glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetAttachedShaders(program, maxcount, count, shaders);
}
inline int QGLFunctions::glGetAttribLocation(GLuint program, const char* name)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glGetAttribLocation(program, name);
}
inline void QGLFunctions::glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetBufferParameteriv(target, pname, params);
}
inline void QGLFunctions::glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
}
inline void QGLFunctions::glGetProgramiv(GLuint program, GLenum pname, GLint* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetProgramiv(program, pname, params);
}
inline void QGLFunctions::glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetProgramInfoLog(program, bufsize, length, infolog);
}
inline void QGLFunctions::glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetRenderbufferParameteriv(target, pname, params);
}
inline void QGLFunctions::glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetShaderiv(shader, pname, params);
}
inline void QGLFunctions::glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetShaderInfoLog(shader, bufsize, length, infolog);
}
inline void QGLFunctions::glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
}
inline void QGLFunctions::glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetShaderSource(shader, bufsize, length, source);
}
inline void QGLFunctions::glGetUniformfv(GLuint program, GLint location, GLfloat* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetUniformfv(program, location, params);
}
inline void QGLFunctions::glGetUniformiv(GLuint program, GLint location, GLint* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetUniformiv(program, location, params);
}
inline int QGLFunctions::glGetUniformLocation(GLuint program, const char* name)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glGetUniformLocation(program, name);
}
inline void QGLFunctions::glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetVertexAttribfv(index, pname, params);
}
inline void QGLFunctions::glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetVertexAttribiv(index, pname, params);
}
inline void QGLFunctions::glGetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glGetVertexAttribPointerv(index, pname, pointer);
}
inline GLboolean QGLFunctions::glIsBuffer(GLuint buffer)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glIsBuffer(buffer);
}
inline GLboolean QGLFunctions::glIsFramebuffer(GLuint framebuffer)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glIsFramebuffer(framebuffer);
}
inline GLboolean QGLFunctions::glIsProgram(GLuint program)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glIsProgram(program);
}
inline GLboolean QGLFunctions::glIsRenderbuffer(GLuint renderbuffer)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glIsRenderbuffer(renderbuffer);
}
inline GLboolean QGLFunctions::glIsShader(GLuint shader)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
return d_ptr->funcs->glIsShader(shader);
}
inline void QGLFunctions::glLinkProgram(GLuint program)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glLinkProgram(program);
}
inline void QGLFunctions::glReleaseShaderCompiler()
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glReleaseShaderCompiler();
}
inline void QGLFunctions::glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glRenderbufferStorage(target, internalformat, width, height);
}
inline void QGLFunctions::glSampleCoverage(GLclampf value, GLboolean invert)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glSampleCoverage(value, invert);
}
inline void QGLFunctions::glShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glShaderBinary(n, shaders, binaryformat, binary, length);
}
inline void QGLFunctions::glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glShaderSource(shader, count, string, length);
}
inline void QGLFunctions::glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glStencilFuncSeparate(face, func, ref, mask);
}
inline void QGLFunctions::glStencilMaskSeparate(GLenum face, GLuint mask)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glStencilMaskSeparate(face, mask);
}
inline void QGLFunctions::glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glStencilOpSeparate(face, fail, zfail, zpass);
}
inline void QGLFunctions::glUniform1f(GLint location, GLfloat x)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform1f(location, x);
}
inline void QGLFunctions::glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform1fv(location, count, v);
}
inline void QGLFunctions::glUniform1i(GLint location, GLint x)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform1i(location, x);
}
inline void QGLFunctions::glUniform1iv(GLint location, GLsizei count, const GLint* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform1iv(location, count, v);
}
inline void QGLFunctions::glUniform2f(GLint location, GLfloat x, GLfloat y)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform2f(location, x, y);
}
inline void QGLFunctions::glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform2fv(location, count, v);
}
inline void QGLFunctions::glUniform2i(GLint location, GLint x, GLint y)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform2i(location, x, y);
}
inline void QGLFunctions::glUniform2iv(GLint location, GLsizei count, const GLint* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform2iv(location, count, v);
}
inline void QGLFunctions::glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform3f(location, x, y, z);
}
inline void QGLFunctions::glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform3fv(location, count, v);
}
inline void QGLFunctions::glUniform3i(GLint location, GLint x, GLint y, GLint z)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform3i(location, x, y, z);
}
inline void QGLFunctions::glUniform3iv(GLint location, GLsizei count, const GLint* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform3iv(location, count, v);
}
inline void QGLFunctions::glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform4f(location, x, y, z, w);
}
inline void QGLFunctions::glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform4fv(location, count, v);
}
inline void QGLFunctions::glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform4i(location, x, y, z, w);
}
inline void QGLFunctions::glUniform4iv(GLint location, GLsizei count, const GLint* v)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniform4iv(location, count, v);
}
inline void QGLFunctions::glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniformMatrix2fv(location, count, transpose, value);
}
inline void QGLFunctions::glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniformMatrix3fv(location, count, transpose, value);
}
inline void QGLFunctions::glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUniformMatrix4fv(location, count, transpose, value);
}
inline void QGLFunctions::glUseProgram(GLuint program)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glUseProgram(program);
}
inline void QGLFunctions::glValidateProgram(GLuint program)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glValidateProgram(program);
}
inline void QGLFunctions::glVertexAttrib1f(GLuint indx, GLfloat x)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib1f(indx, x);
}
inline void QGLFunctions::glVertexAttrib1fv(GLuint indx, const GLfloat* values)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib1fv(indx, values);
}
inline void QGLFunctions::glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib2f(indx, x, y);
}
inline void QGLFunctions::glVertexAttrib2fv(GLuint indx, const GLfloat* values)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib2fv(indx, values);
}
inline void QGLFunctions::glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib3f(indx, x, y, z);
}
inline void QGLFunctions::glVertexAttrib3fv(GLuint indx, const GLfloat* values)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib3fv(indx, values);
}
inline void QGLFunctions::glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib4f(indx, x, y, z, w);
}
inline void QGLFunctions::glVertexAttrib4fv(GLuint indx, const GLfloat* values)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttrib4fv(indx, values);
}
inline void QGLFunctions::glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
{
Q_ASSERT(QGLFunctions::isInitialized(d_ptr));
d_ptr->funcs->glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
}
#ifndef GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#endif
#ifndef GL_ACTIVE_ATTRIBUTES
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#endif
#ifndef GL_ACTIVE_TEXTURE
#define GL_ACTIVE_TEXTURE 0x84E0
#endif
#ifndef GL_ACTIVE_UNIFORM_MAX_LENGTH
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#endif
#ifndef GL_ACTIVE_UNIFORMS
#define GL_ACTIVE_UNIFORMS 0x8B86
#endif
#ifndef GL_ALIASED_LINE_WIDTH_RANGE
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#endif
#ifndef GL_ALIASED_POINT_SIZE_RANGE
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#endif
#ifndef GL_ALPHA
#define GL_ALPHA 0x1906
#endif
#ifndef GL_ALPHA_BITS
#define GL_ALPHA_BITS 0x0D55
#endif
#ifndef GL_ALWAYS
#define GL_ALWAYS 0x0207
#endif
#ifndef GL_ARRAY_BUFFER
#define GL_ARRAY_BUFFER 0x8892
#endif
#ifndef GL_ARRAY_BUFFER_BINDING
#define GL_ARRAY_BUFFER_BINDING 0x8894
#endif
#ifndef GL_ATTACHED_SHADERS
#define GL_ATTACHED_SHADERS 0x8B85
#endif
#ifndef GL_BACK
#define GL_BACK 0x0405
#endif
#ifndef GL_BLEND
#define GL_BLEND 0x0BE2
#endif
#ifndef GL_BLEND_COLOR
#define GL_BLEND_COLOR 0x8005
#endif
#ifndef GL_BLEND_DST_ALPHA
#define GL_BLEND_DST_ALPHA 0x80CA
#endif
#ifndef GL_BLEND_DST_RGB
#define GL_BLEND_DST_RGB 0x80C8
#endif
#ifndef GL_BLEND_EQUATION
#define GL_BLEND_EQUATION 0x8009
#endif
#ifndef GL_BLEND_EQUATION_ALPHA
#define GL_BLEND_EQUATION_ALPHA 0x883D
#endif
#ifndef GL_BLEND_EQUATION_RGB
#define GL_BLEND_EQUATION_RGB 0x8009
#endif
#ifndef GL_BLEND_SRC_ALPHA
#define GL_BLEND_SRC_ALPHA 0x80CB
#endif
#ifndef GL_BLEND_SRC_RGB
#define GL_BLEND_SRC_RGB 0x80C9
#endif
#ifndef GL_BLUE_BITS
#define GL_BLUE_BITS 0x0D54
#endif
#ifndef GL_BOOL
#define GL_BOOL 0x8B56
#endif
#ifndef GL_BOOL_VEC2
#define GL_BOOL_VEC2 0x8B57
#endif
#ifndef GL_BOOL_VEC3
#define GL_BOOL_VEC3 0x8B58
#endif
#ifndef GL_BOOL_VEC4
#define GL_BOOL_VEC4 0x8B59
#endif
#ifndef GL_BUFFER_SIZE
#define GL_BUFFER_SIZE 0x8764
#endif
#ifndef GL_BUFFER_USAGE
#define GL_BUFFER_USAGE 0x8765
#endif
#ifndef GL_BYTE
#define GL_BYTE 0x1400
#endif
#ifndef GL_CCW
#define GL_CCW 0x0901
#endif
#ifndef GL_CLAMP_TO_EDGE
#define GL_CLAMP_TO_EDGE 0x812F
#endif
#ifndef GL_COLOR_ATTACHMENT0
#define GL_COLOR_ATTACHMENT0 0x8CE0
#endif
#ifndef GL_COLOR_BUFFER_BIT
#define GL_COLOR_BUFFER_BIT 0x00004000
#endif
#ifndef GL_COLOR_CLEAR_VALUE
#define GL_COLOR_CLEAR_VALUE 0x0C22
#endif
#ifndef GL_COLOR_WRITEMASK
#define GL_COLOR_WRITEMASK 0x0C23
#endif
#ifndef GL_COMPILE_STATUS
#define GL_COMPILE_STATUS 0x8B81
#endif
#ifndef GL_COMPRESSED_TEXTURE_FORMATS
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
#endif
#ifndef GL_CONSTANT_ALPHA
#define GL_CONSTANT_ALPHA 0x8003
#endif
#ifndef GL_CONSTANT_COLOR
#define GL_CONSTANT_COLOR 0x8001
#endif
#ifndef GL_CULL_FACE
#define GL_CULL_FACE 0x0B44
#endif
#ifndef GL_CULL_FACE_MODE
#define GL_CULL_FACE_MODE 0x0B45
#endif
#ifndef GL_CURRENT_PROGRAM
#define GL_CURRENT_PROGRAM 0x8B8D
#endif
#ifndef GL_CURRENT_VERTEX_ATTRIB
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
#endif
#ifndef GL_CW
#define GL_CW 0x0900
#endif
#ifndef GL_DECR
#define GL_DECR 0x1E03
#endif
#ifndef GL_DECR_WRAP
#define GL_DECR_WRAP 0x8508
#endif
#ifndef GL_DELETE_STATUS
#define GL_DELETE_STATUS 0x8B80
#endif
#ifndef GL_DEPTH_ATTACHMENT
#define GL_DEPTH_ATTACHMENT 0x8D00
#endif
#ifndef GL_DEPTH_BITS
#define GL_DEPTH_BITS 0x0D56
#endif
#ifndef GL_DEPTH_BUFFER_BIT
#define GL_DEPTH_BUFFER_BIT 0x00000100
#endif
#ifndef GL_DEPTH_CLEAR_VALUE
#define GL_DEPTH_CLEAR_VALUE 0x0B73
#endif
#ifndef GL_DEPTH_COMPONENT
#define GL_DEPTH_COMPONENT 0x1902
#endif
#ifndef GL_DEPTH_COMPONENT16
#define GL_DEPTH_COMPONENT16 0x81A5
#endif
#ifndef GL_DEPTH_FUNC
#define GL_DEPTH_FUNC 0x0B74
#endif
#ifndef GL_DEPTH_RANGE
#define GL_DEPTH_RANGE 0x0B70
#endif
#ifndef GL_DEPTH_TEST
#define GL_DEPTH_TEST 0x0B71
#endif
#ifndef GL_DEPTH_WRITEMASK
#define GL_DEPTH_WRITEMASK 0x0B72
#endif
#ifndef GL_DITHER
#define GL_DITHER 0x0BD0
#endif
#ifndef GL_DONT_CARE
#define GL_DONT_CARE 0x1100
#endif
#ifndef GL_DST_ALPHA
#define GL_DST_ALPHA 0x0304
#endif
#ifndef GL_DST_COLOR
#define GL_DST_COLOR 0x0306
#endif
#ifndef GL_DYNAMIC_DRAW
#define GL_DYNAMIC_DRAW 0x88E8
#endif
#ifndef GL_ELEMENT_ARRAY_BUFFER
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#endif
#ifndef GL_ELEMENT_ARRAY_BUFFER_BINDING
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#endif
#ifndef GL_EQUAL
#define GL_EQUAL 0x0202
#endif
#ifndef GL_EXTENSIONS
#define GL_EXTENSIONS 0x1F03
#endif
#ifndef GL_FALSE
#define GL_FALSE 0
#endif
#ifndef GL_FASTEST
#define GL_FASTEST 0x1101
#endif
#ifndef GL_FIXED
#define GL_FIXED 0x140C
#endif
#ifndef GL_FLOAT
#define GL_FLOAT 0x1406
#endif
#ifndef GL_FLOAT_MAT2
#define GL_FLOAT_MAT2 0x8B5A
#endif
#ifndef GL_FLOAT_MAT3
#define GL_FLOAT_MAT3 0x8B5B
#endif
#ifndef GL_FLOAT_MAT4
#define GL_FLOAT_MAT4 0x8B5C
#endif