OSDN Git Service

[GLESv3] Fix protocol error + build on older imgs
[android-x86/device-generic-goldfish-opengl.git] / system / GLESv2_enc / gl2_entry.cpp
1 // Generated Code - DO NOT EDIT !!
2 // generated by 'emugen'
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include "gl2_client_context.h"
6
7 #ifndef GL_TRUE
8 extern "C" {
9         void glActiveTexture(GLenum texture);
10         void glAttachShader(GLuint program, GLuint shader);
11         void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name);
12         void glBindBuffer(GLenum target, GLuint buffer);
13         void glBindFramebuffer(GLenum target, GLuint framebuffer);
14         void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
15         void glBindTexture(GLenum target, GLuint texture);
16         void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
17         void glBlendEquation(GLenum mode);
18         void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
19         void glBlendFunc(GLenum sfactor, GLenum dfactor);
20         void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
21         void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
22         void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
23         GLenum glCheckFramebufferStatus(GLenum target);
24         void glClear(GLbitfield mask);
25         void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
26         void glClearDepthf(GLclampf depth);
27         void glClearStencil(GLint s);
28         void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
29         void glCompileShader(GLuint shader);
30         void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
31         void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
32         void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
33         void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
34         GLuint glCreateProgram();
35         GLuint glCreateShader(GLenum type);
36         void glCullFace(GLenum mode);
37         void glDeleteBuffers(GLsizei n, const GLuint* buffers);
38         void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers);
39         void glDeleteProgram(GLuint program);
40         void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers);
41         void glDeleteShader(GLuint shader);
42         void glDeleteTextures(GLsizei n, const GLuint* textures);
43         void glDepthFunc(GLenum func);
44         void glDepthMask(GLboolean flag);
45         void glDepthRangef(GLclampf zNear, GLclampf zFar);
46         void glDetachShader(GLuint program, GLuint shader);
47         void glDisable(GLenum cap);
48         void glDisableVertexAttribArray(GLuint index);
49         void glDrawArrays(GLenum mode, GLint first, GLsizei count);
50         void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
51         void glEnable(GLenum cap);
52         void glEnableVertexAttribArray(GLuint index);
53         void glFinish();
54         void glFlush();
55         void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
56         void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
57         void glFrontFace(GLenum mode);
58         void glGenBuffers(GLsizei n, GLuint* buffers);
59         void glGenerateMipmap(GLenum target);
60         void glGenFramebuffers(GLsizei n, GLuint* framebuffers);
61         void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers);
62         void glGenTextures(GLsizei n, GLuint* textures);
63         void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
64         void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
65         void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
66         int glGetAttribLocation(GLuint program, const GLchar* name);
67         void glGetBooleanv(GLenum pname, GLboolean* params);
68         void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params);
69         GLenum glGetError();
70         void glGetFloatv(GLenum pname, GLfloat* params);
71         void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params);
72         void glGetIntegerv(GLenum pname, GLint* params);
73         void glGetProgramiv(GLuint program, GLenum pname, GLint* params);
74         void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
75         void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params);
76         void glGetShaderiv(GLuint shader, GLenum pname, GLint* params);
77         void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
78         void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
79         void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
80         const GLubyte* glGetString(GLenum name);
81         void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params);
82         void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params);
83         void glGetUniformfv(GLuint program, GLint location, GLfloat* params);
84         void glGetUniformiv(GLuint program, GLint location, GLint* params);
85         int glGetUniformLocation(GLuint program, const GLchar* name);
86         void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params);
87         void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params);
88         void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer);
89         void glHint(GLenum target, GLenum mode);
90         GLboolean glIsBuffer(GLuint buffer);
91         GLboolean glIsEnabled(GLenum cap);
92         GLboolean glIsFramebuffer(GLuint framebuffer);
93         GLboolean glIsProgram(GLuint program);
94         GLboolean glIsRenderbuffer(GLuint renderbuffer);
95         GLboolean glIsShader(GLuint shader);
96         GLboolean glIsTexture(GLuint texture);
97         void glLineWidth(GLfloat width);
98         void glLinkProgram(GLuint program);
99         void glPixelStorei(GLenum pname, GLint param);
100         void glPolygonOffset(GLfloat factor, GLfloat units);
101         void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
102         void glReleaseShaderCompiler();
103         void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
104         void glSampleCoverage(GLclampf value, GLboolean invert);
105         void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
106         void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
107         void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
108         void glStencilFunc(GLenum func, GLint ref, GLuint mask);
109         void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
110         void glStencilMask(GLuint mask);
111         void glStencilMaskSeparate(GLenum face, GLuint mask);
112         void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass);
113         void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
114         void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
115         void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
116         void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params);
117         void glTexParameteri(GLenum target, GLenum pname, GLint param);
118         void glTexParameteriv(GLenum target, GLenum pname, const GLint* params);
119         void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
120         void glUniform1f(GLint location, GLfloat x);
121         void glUniform1fv(GLint location, GLsizei count, const GLfloat* v);
122         void glUniform1i(GLint location, GLint x);
123         void glUniform1iv(GLint location, GLsizei count, const GLint* v);
124         void glUniform2f(GLint location, GLfloat x, GLfloat y);
125         void glUniform2fv(GLint location, GLsizei count, const GLfloat* v);
126         void glUniform2i(GLint location, GLint x, GLint y);
127         void glUniform2iv(GLint location, GLsizei count, const GLint* v);
128         void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z);
129         void glUniform3fv(GLint location, GLsizei count, const GLfloat* v);
130         void glUniform3i(GLint location, GLint x, GLint y, GLint z);
131         void glUniform3iv(GLint location, GLsizei count, const GLint* v);
132         void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
133         void glUniform4fv(GLint location, GLsizei count, const GLfloat* v);
134         void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w);
135         void glUniform4iv(GLint location, GLsizei count, const GLint* v);
136         void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
137         void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
138         void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
139         void glUseProgram(GLuint program);
140         void glValidateProgram(GLuint program);
141         void glVertexAttrib1f(GLuint indx, GLfloat x);
142         void glVertexAttrib1fv(GLuint indx, const GLfloat* values);
143         void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
144         void glVertexAttrib2fv(GLuint indx, const GLfloat* values);
145         void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
146         void glVertexAttrib3fv(GLuint indx, const GLfloat* values);
147         void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
148         void glVertexAttrib4fv(GLuint indx, const GLfloat* values);
149         void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
150         void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
151         void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
152         void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
153         void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary);
154         void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length);
155         void* glMapBufferOES(GLenum target, GLenum access);
156         GLboolean glUnmapBufferOES(GLenum target);
157         void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
158         void glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
159         void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
160         void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
161         void glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
162         void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
163         void glBindVertexArrayOES(GLuint array);
164         void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays);
165         void glGenVertexArraysOES(GLsizei n, GLuint* arrays);
166         GLboolean glIsVertexArrayOES(GLuint array);
167         void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
168         void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount);
169         void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount);
170         void glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups);
171         void glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
172         void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString);
173         void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString);
174         void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid* data);
175         void glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors);
176         void glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors);
177         void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
178         void glBeginPerfMonitorAMD(GLuint monitor);
179         void glEndPerfMonitorAMD(GLuint monitor);
180         void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
181         void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
182         void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
183         void glDeleteFencesNV(GLsizei n, const GLuint* fences);
184         void glGenFencesNV(GLsizei n, GLuint* fences);
185         GLboolean glIsFenceNV(GLuint fence);
186         GLboolean glTestFenceNV(GLuint fence);
187         void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params);
188         void glFinishFenceNV(GLuint fence);
189         void glSetFenceNV(GLuint fence, GLenum condition);
190         void glCoverageMaskNV(GLboolean mask);
191         void glCoverageOperationNV(GLenum operation);
192         void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls);
193         void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString);
194         void glEnableDriverControlQCOM(GLuint driverControl);
195         void glDisableDriverControlQCOM(GLuint driverControl);
196         void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures);
197         void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
198         void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
199         void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
200         void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
201         void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
202         void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels);
203         void glExtGetBufferPointervQCOM(GLenum target, GLvoidptr* params);
204         void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders);
205         void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms);
206         GLboolean glExtIsProgramBinaryQCOM(GLuint program);
207         void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length);
208         void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
209         void glEndTilingQCOM(GLbitfield preserveMask);
210         void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen);
211         void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset);
212         void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset);
213         void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
214         void glGetCompressedTextureFormats(int count, GLint* formats);
215         void glShaderString(GLuint shader, const GLchar* string, GLsizei len);
216         int glFinishRoundTrip();
217         void glGenVertexArrays(GLsizei n, GLuint* arrays);
218         void glBindVertexArray(GLuint array);
219         void glDeleteVertexArrays(GLsizei n, const GLuint* arrays);
220         GLboolean glIsVertexArray(GLuint array);
221         void* glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
222         GLboolean glUnmapBuffer(GLenum target);
223         void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
224         void glMapBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped);
225         void glUnmapBufferAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res);
226         void glFlushMappedBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer);
227         void glReadPixelsOffsetAEMU(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset);
228         void glCompressedTexImage2DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset);
229         void glCompressedTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset);
230         void glTexImage2DOffsetAEMU(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset);
231         void glTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset);
232         void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
233         void glBindBufferBase(GLenum target, GLuint index, GLuint buffer);
234         void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
235         void glClearBufferiv(GLenum buffer, GLint drawBuffer, const GLint* value);
236         void glClearBufferuiv(GLenum buffer, GLint drawBuffer, const GLuint* value);
237         void glClearBufferfv(GLenum buffer, GLint drawBuffer, const GLfloat* value);
238         void glClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil);
239         void glGetBufferParameteri64v(GLenum target, GLenum value, GLint64* data);
240         void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params);
241         void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
242         GLuint glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName);
243         void glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices);
244         void glGetUniformIndicesAEMU(GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices);
245         void glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);
246         void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName);
247         void glUniform1ui(GLint location, GLuint v0);
248         void glUniform2ui(GLint location, GLuint v0, GLuint v1);
249         void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
250         void glUniform4ui(GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3);
251         void glUniform1uiv(GLint location, GLsizei count, const GLuint* value);
252         void glUniform2uiv(GLint location, GLsizei count, const GLuint* value);
253         void glUniform3uiv(GLint location, GLsizei count, const GLuint* value);
254         void glUniform4uiv(GLint location, GLsizei count, const GLuint* value);
255         void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
256         void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
257         void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
258         void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
259         void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
260         void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
261         void glGetUniformuiv(GLuint program, GLint location, GLuint* params);
262         void glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
263         void glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
264         void glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
265         void glVertexAttribI4iv(GLuint index, const GLint* v);
266         void glVertexAttribI4uiv(GLuint index, const GLuint* v);
267         void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
268         void glVertexAttribIPointerOffsetAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset);
269         void glVertexAttribIPointerDataAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
270         void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params);
271         void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params);
272         void glVertexAttribDivisor(GLuint index, GLuint divisor);
273         void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
274         void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
275         void glDrawElementsInstancedDataAEMU(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen);
276         void glDrawElementsInstancedOffsetAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount);
277         void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices);
278         void glDrawRangeElementsDataAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen);
279         void glDrawRangeElementsOffsetAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset);
280         GLsync glFenceSync(GLenum condition, GLbitfield flags);
281         GLenum glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
282         void glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
283         void glDeleteSync(GLsync to_delete);
284         GLboolean glIsSync(GLsync sync);
285         void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values);
286         uint64_t glFenceSyncAEMU(GLenum condition, GLbitfield flags);
287         GLenum glClientWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout);
288         void glWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout);
289         void glDeleteSyncAEMU(uint64_t to_delete);
290         GLboolean glIsSyncAEMU(uint64_t sync);
291         void glGetSyncivAEMU(uint64_t sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values);
292         void glDrawBuffers(GLsizei n, const GLenum* bufs);
293         void glReadBuffer(GLenum src);
294         void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
295         void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments);
296         void glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height);
297         void glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
298         void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
299         void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
300         void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params);
301         void glBeginTransformFeedback(GLenum primitiveMode);
302         void glEndTransformFeedback();
303         void glGenTransformFeedbacks(GLsizei n, GLuint* ids);
304         void glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids);
305         void glBindTransformFeedback(GLenum target, GLuint id);
306         void glPauseTransformFeedback();
307         void glResumeTransformFeedback();
308         GLboolean glIsTransformFeedback(GLuint id);
309         void glTransformFeedbackVaryings(GLuint program, GLsizei count, const char** varyings, GLenum bufferMode);
310         void glTransformFeedbackVaryingsAEMU(GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode);
311         void glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name);
312         void glGenSamplers(GLsizei n, GLuint* samplers);
313         void glDeleteSamplers(GLsizei n, const GLuint* samplers);
314         void glBindSampler(GLuint unit, GLuint sampler);
315         void glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
316         void glSamplerParameteri(GLuint sampler, GLenum pname, GLint param);
317         void glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* params);
318         void glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* params);
319         void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params);
320         void glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params);
321         GLboolean glIsSampler(GLuint sampler);
322         void glGenQueries(GLsizei n, GLuint* queries);
323         void glDeleteQueries(GLsizei n, const GLuint* queries);
324         void glBeginQuery(GLenum target, GLuint query);
325         void glEndQuery(GLenum target);
326         void glGetQueryiv(GLenum target, GLenum pname, GLint* params);
327         void glGetQueryObjectuiv(GLuint query, GLenum pname, GLuint* params);
328         GLboolean glIsQuery(GLuint query);
329         void glProgramParameteri(GLuint program, GLenum pname, GLint value);
330         void glProgramBinary(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length);
331         void glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary);
332         GLint glGetFragDataLocation(GLuint program, const char* name);
333         void glGetInteger64v(GLenum pname, GLint64* data);
334         void glGetIntegeri_v(GLenum target, GLuint index, GLint* data);
335         void glGetInteger64i_v(GLenum target, GLuint index, GLint64* data);
336         void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data);
337         void glTexImage3DOffsetAEMU(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset);
338         void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
339         void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data);
340         void glTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset);
341         void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
342         void glCompressedTexImage3DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint offset);
343         void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
344         void glCompressedTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data);
345         void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
346         const GLubyte* glGetStringi(GLenum name, GLuint index);
347         void glGetBooleani_v(GLenum target, GLuint index, GLboolean* data);
348         void glMemoryBarrier(GLbitfield barriers);
349         void glMemoryBarrierByRegion(GLbitfield barriers);
350         void glGenProgramPipelines(GLsizei n, GLuint* pipelines);
351         void glDeleteProgramPipelines(GLsizei n, const GLuint* pipelines);
352         void glBindProgramPipeline(GLuint pipeline);
353         void glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params);
354         void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
355         void glValidateProgramPipeline(GLuint pipeline);
356         GLboolean glIsProgramPipeline(GLuint pipeline);
357         void glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
358         GLuint glCreateShaderProgramv(GLenum type, GLsizei count, const char** strings);
359         GLuint glCreateShaderProgramvAEMU(GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen);
360         void glProgramUniform1f(GLuint program, GLint location, GLfloat v0);
361         void glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1);
362         void glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
363         void glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
364         void glProgramUniform1i(GLuint program, GLint location, GLint v0);
365         void glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1);
366         void glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
367         void glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
368         void glProgramUniform1ui(GLuint program, GLint location, GLuint v0);
369         void glProgramUniform2ui(GLuint program, GLint location, GLint v0, GLuint v1);
370         void glProgramUniform3ui(GLuint program, GLint location, GLint v0, GLint v1, GLuint v2);
371         void glProgramUniform4ui(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3);
372         void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
373         void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
374         void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
375         void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
376         void glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint* value);
377         void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint* value);
378         void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint* value);
379         void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint* value);
380         void glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
381         void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
382         void glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
383         void glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
384         void glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
385         void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
386         void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
387         void glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
388         void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
389         void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
390         void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
391         void glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
392         void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
393         void glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params);
394         void glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params);
395         GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char* name);
396         GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char* name);
397         void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name);
398         void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
399         void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
400         void glDispatchComputeIndirect(GLintptr indirect);
401         void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride);
402         void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
403         void glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
404         void glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
405         void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
406         void glDrawArraysIndirect(GLenum mode, const void* indirect);
407         void glDrawArraysIndirectDataAEMU(GLenum mode, const void* indirect, GLuint datalen);
408         void glDrawArraysIndirectOffsetAEMU(GLenum mode, GLuint offset);
409         void glDrawElementsIndirect(GLenum mode, GLenum type, const void* indirect);
410         void glDrawElementsIndirectDataAEMU(GLenum mode, GLenum type, const void* indirect, GLuint datalen);
411         void glDrawElementsIndirectOffsetAEMU(GLenum mode, GLenum type, GLuint offset);
412         void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
413         void glSampleMaski(GLuint maskNumber, GLbitfield mask);
414         void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val);
415         void glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
416         void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params);
417         void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params);
418         void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params);
419 };
420
421 #endif
422 #ifndef GET_CONTEXT
423 static gl2_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
424 void gl2_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
425 #define GET_CONTEXT gl2_client_context_t * ctx = getCurrentContext()
426 #endif
427
428 void glActiveTexture(GLenum texture)
429 {
430         GET_CONTEXT;
431         ctx->glActiveTexture(ctx, texture);
432 }
433
434 void glAttachShader(GLuint program, GLuint shader)
435 {
436         GET_CONTEXT;
437         ctx->glAttachShader(ctx, program, shader);
438 }
439
440 void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
441 {
442         GET_CONTEXT;
443         ctx->glBindAttribLocation(ctx, program, index, name);
444 }
445
446 void glBindBuffer(GLenum target, GLuint buffer)
447 {
448         GET_CONTEXT;
449         ctx->glBindBuffer(ctx, target, buffer);
450 }
451
452 void glBindFramebuffer(GLenum target, GLuint framebuffer)
453 {
454         GET_CONTEXT;
455         ctx->glBindFramebuffer(ctx, target, framebuffer);
456 }
457
458 void glBindRenderbuffer(GLenum target, GLuint renderbuffer)
459 {
460         GET_CONTEXT;
461         ctx->glBindRenderbuffer(ctx, target, renderbuffer);
462 }
463
464 void glBindTexture(GLenum target, GLuint texture)
465 {
466         GET_CONTEXT;
467         ctx->glBindTexture(ctx, target, texture);
468 }
469
470 void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
471 {
472         GET_CONTEXT;
473         ctx->glBlendColor(ctx, red, green, blue, alpha);
474 }
475
476 void glBlendEquation(GLenum mode)
477 {
478         GET_CONTEXT;
479         ctx->glBlendEquation(ctx, mode);
480 }
481
482 void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
483 {
484         GET_CONTEXT;
485         ctx->glBlendEquationSeparate(ctx, modeRGB, modeAlpha);
486 }
487
488 void glBlendFunc(GLenum sfactor, GLenum dfactor)
489 {
490         GET_CONTEXT;
491         ctx->glBlendFunc(ctx, sfactor, dfactor);
492 }
493
494 void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
495 {
496         GET_CONTEXT;
497         ctx->glBlendFuncSeparate(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha);
498 }
499
500 void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
501 {
502         GET_CONTEXT;
503         ctx->glBufferData(ctx, target, size, data, usage);
504 }
505
506 void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
507 {
508         GET_CONTEXT;
509         ctx->glBufferSubData(ctx, target, offset, size, data);
510 }
511
512 GLenum glCheckFramebufferStatus(GLenum target)
513 {
514         GET_CONTEXT;
515         return ctx->glCheckFramebufferStatus(ctx, target);
516 }
517
518 void glClear(GLbitfield mask)
519 {
520         GET_CONTEXT;
521         ctx->glClear(ctx, mask);
522 }
523
524 void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
525 {
526         GET_CONTEXT;
527         ctx->glClearColor(ctx, red, green, blue, alpha);
528 }
529
530 void glClearDepthf(GLclampf depth)
531 {
532         GET_CONTEXT;
533         ctx->glClearDepthf(ctx, depth);
534 }
535
536 void glClearStencil(GLint s)
537 {
538         GET_CONTEXT;
539         ctx->glClearStencil(ctx, s);
540 }
541
542 void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
543 {
544         GET_CONTEXT;
545         ctx->glColorMask(ctx, red, green, blue, alpha);
546 }
547
548 void glCompileShader(GLuint shader)
549 {
550         GET_CONTEXT;
551         ctx->glCompileShader(ctx, shader);
552 }
553
554 void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
555 {
556         GET_CONTEXT;
557          if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
558         ctx->glCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, imageSize, data);
559 }
560
561 void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
562 {
563         GET_CONTEXT;
564          if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
565         ctx->glCompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data);
566 }
567
568 void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
569 {
570         GET_CONTEXT;
571         ctx->glCopyTexImage2D(ctx, target, level, internalformat, x, y, width, height, border);
572 }
573
574 void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
575 {
576         GET_CONTEXT;
577         ctx->glCopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height);
578 }
579
580 GLuint glCreateProgram()
581 {
582         GET_CONTEXT;
583         return ctx->glCreateProgram(ctx);
584 }
585
586 GLuint glCreateShader(GLenum type)
587 {
588         GET_CONTEXT;
589         return ctx->glCreateShader(ctx, type);
590 }
591
592 void glCullFace(GLenum mode)
593 {
594         GET_CONTEXT;
595         ctx->glCullFace(ctx, mode);
596 }
597
598 void glDeleteBuffers(GLsizei n, const GLuint* buffers)
599 {
600         GET_CONTEXT;
601          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
602         ctx->glDeleteBuffers(ctx, n, buffers);
603 }
604
605 void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
606 {
607         GET_CONTEXT;
608          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
609         ctx->glDeleteFramebuffers(ctx, n, framebuffers);
610 }
611
612 void glDeleteProgram(GLuint program)
613 {
614         GET_CONTEXT;
615         ctx->glDeleteProgram(ctx, program);
616 }
617
618 void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
619 {
620         GET_CONTEXT;
621          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
622         ctx->glDeleteRenderbuffers(ctx, n, renderbuffers);
623 }
624
625 void glDeleteShader(GLuint shader)
626 {
627         GET_CONTEXT;
628         ctx->glDeleteShader(ctx, shader);
629 }
630
631 void glDeleteTextures(GLsizei n, const GLuint* textures)
632 {
633         GET_CONTEXT;
634          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
635         ctx->glDeleteTextures(ctx, n, textures);
636 }
637
638 void glDepthFunc(GLenum func)
639 {
640         GET_CONTEXT;
641         ctx->glDepthFunc(ctx, func);
642 }
643
644 void glDepthMask(GLboolean flag)
645 {
646         GET_CONTEXT;
647         ctx->glDepthMask(ctx, flag);
648 }
649
650 void glDepthRangef(GLclampf zNear, GLclampf zFar)
651 {
652         GET_CONTEXT;
653         ctx->glDepthRangef(ctx, zNear, zFar);
654 }
655
656 void glDetachShader(GLuint program, GLuint shader)
657 {
658         GET_CONTEXT;
659         ctx->glDetachShader(ctx, program, shader);
660 }
661
662 void glDisable(GLenum cap)
663 {
664         GET_CONTEXT;
665         ctx->glDisable(ctx, cap);
666 }
667
668 void glDisableVertexAttribArray(GLuint index)
669 {
670         GET_CONTEXT;
671         ctx->glDisableVertexAttribArray(ctx, index);
672 }
673
674 void glDrawArrays(GLenum mode, GLint first, GLsizei count)
675 {
676         GET_CONTEXT;
677         ctx->glDrawArrays(ctx, mode, first, count);
678 }
679
680 void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
681 {
682         GET_CONTEXT;
683         ctx->glDrawElements(ctx, mode, count, type, indices);
684 }
685
686 void glEnable(GLenum cap)
687 {
688         GET_CONTEXT;
689         ctx->glEnable(ctx, cap);
690 }
691
692 void glEnableVertexAttribArray(GLuint index)
693 {
694         GET_CONTEXT;
695         ctx->glEnableVertexAttribArray(ctx, index);
696 }
697
698 void glFinish()
699 {
700         GET_CONTEXT;
701         ctx->glFinish(ctx);
702 }
703
704 void glFlush()
705 {
706         GET_CONTEXT;
707         ctx->glFlush(ctx);
708 }
709
710 void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
711 {
712         GET_CONTEXT;
713         ctx->glFramebufferRenderbuffer(ctx, target, attachment, renderbuffertarget, renderbuffer);
714 }
715
716 void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
717 {
718         GET_CONTEXT;
719         ctx->glFramebufferTexture2D(ctx, target, attachment, textarget, texture, level);
720 }
721
722 void glFrontFace(GLenum mode)
723 {
724         GET_CONTEXT;
725         ctx->glFrontFace(ctx, mode);
726 }
727
728 void glGenBuffers(GLsizei n, GLuint* buffers)
729 {
730         GET_CONTEXT;
731          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
732         ctx->glGenBuffers(ctx, n, buffers);
733 }
734
735 void glGenerateMipmap(GLenum target)
736 {
737         GET_CONTEXT;
738         ctx->glGenerateMipmap(ctx, target);
739 }
740
741 void glGenFramebuffers(GLsizei n, GLuint* framebuffers)
742 {
743         GET_CONTEXT;
744          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
745         ctx->glGenFramebuffers(ctx, n, framebuffers);
746 }
747
748 void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
749 {
750         GET_CONTEXT;
751          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
752         ctx->glGenRenderbuffers(ctx, n, renderbuffers);
753 }
754
755 void glGenTextures(GLsizei n, GLuint* textures)
756 {
757         GET_CONTEXT;
758          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
759         ctx->glGenTextures(ctx, n, textures);
760 }
761
762 void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
763 {
764         GET_CONTEXT;
765          if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
766         ctx->glGetActiveAttrib(ctx, program, index, bufsize, length, size, type, name);
767 }
768
769 void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
770 {
771         GET_CONTEXT;
772          if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
773         ctx->glGetActiveUniform(ctx, program, index, bufsize, length, size, type, name);
774 }
775
776 void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
777 {
778         GET_CONTEXT;
779         ctx->glGetAttachedShaders(ctx, program, maxcount, count, shaders);
780 }
781
782 int glGetAttribLocation(GLuint program, const GLchar* name)
783 {
784         GET_CONTEXT;
785         return ctx->glGetAttribLocation(ctx, program, name);
786 }
787
788 void glGetBooleanv(GLenum pname, GLboolean* params)
789 {
790         GET_CONTEXT;
791         ctx->glGetBooleanv(ctx, pname, params);
792 }
793
794 void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
795 {
796         GET_CONTEXT;
797         ctx->glGetBufferParameteriv(ctx, target, pname, params);
798 }
799
800 GLenum glGetError()
801 {
802         GET_CONTEXT;
803         return ctx->glGetError(ctx);
804 }
805
806 void glGetFloatv(GLenum pname, GLfloat* params)
807 {
808         GET_CONTEXT;
809         ctx->glGetFloatv(ctx, pname, params);
810 }
811
812 void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
813 {
814         GET_CONTEXT;
815         ctx->glGetFramebufferAttachmentParameteriv(ctx, target, attachment, pname, params);
816 }
817
818 void glGetIntegerv(GLenum pname, GLint* params)
819 {
820         GET_CONTEXT;
821         ctx->glGetIntegerv(ctx, pname, params);
822 }
823
824 void glGetProgramiv(GLuint program, GLenum pname, GLint* params)
825 {
826         GET_CONTEXT;
827         ctx->glGetProgramiv(ctx, program, pname, params);
828 }
829
830 void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
831 {
832         GET_CONTEXT;
833          if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
834         ctx->glGetProgramInfoLog(ctx, program, bufsize, length, infolog);
835 }
836
837 void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
838 {
839         GET_CONTEXT;
840         ctx->glGetRenderbufferParameteriv(ctx, target, pname, params);
841 }
842
843 void glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
844 {
845         GET_CONTEXT;
846         ctx->glGetShaderiv(ctx, shader, pname, params);
847 }
848
849 void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
850 {
851         GET_CONTEXT;
852          if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
853         ctx->glGetShaderInfoLog(ctx, shader, bufsize, length, infolog);
854 }
855
856 void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
857 {
858         GET_CONTEXT;
859         ctx->glGetShaderPrecisionFormat(ctx, shadertype, precisiontype, range, precision);
860 }
861
862 void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
863 {
864         GET_CONTEXT;
865          if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
866         ctx->glGetShaderSource(ctx, shader, bufsize, length, source);
867 }
868
869 const GLubyte* glGetString(GLenum name)
870 {
871         GET_CONTEXT;
872         return ctx->glGetString(ctx, name);
873 }
874
875 void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
876 {
877         GET_CONTEXT;
878         ctx->glGetTexParameterfv(ctx, target, pname, params);
879 }
880
881 void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
882 {
883         GET_CONTEXT;
884         ctx->glGetTexParameteriv(ctx, target, pname, params);
885 }
886
887 void glGetUniformfv(GLuint program, GLint location, GLfloat* params)
888 {
889         GET_CONTEXT;
890         ctx->glGetUniformfv(ctx, program, location, params);
891 }
892
893 void glGetUniformiv(GLuint program, GLint location, GLint* params)
894 {
895         GET_CONTEXT;
896         ctx->glGetUniformiv(ctx, program, location, params);
897 }
898
899 int glGetUniformLocation(GLuint program, const GLchar* name)
900 {
901         GET_CONTEXT;
902         return ctx->glGetUniformLocation(ctx, program, name);
903 }
904
905 void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
906 {
907         GET_CONTEXT;
908         ctx->glGetVertexAttribfv(ctx, index, pname, params);
909 }
910
911 void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
912 {
913         GET_CONTEXT;
914         ctx->glGetVertexAttribiv(ctx, index, pname, params);
915 }
916
917 void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
918 {
919         GET_CONTEXT;
920         ctx->glGetVertexAttribPointerv(ctx, index, pname, pointer);
921 }
922
923 void glHint(GLenum target, GLenum mode)
924 {
925         GET_CONTEXT;
926         ctx->glHint(ctx, target, mode);
927 }
928
929 GLboolean glIsBuffer(GLuint buffer)
930 {
931         GET_CONTEXT;
932         return ctx->glIsBuffer(ctx, buffer);
933 }
934
935 GLboolean glIsEnabled(GLenum cap)
936 {
937         GET_CONTEXT;
938         return ctx->glIsEnabled(ctx, cap);
939 }
940
941 GLboolean glIsFramebuffer(GLuint framebuffer)
942 {
943         GET_CONTEXT;
944         return ctx->glIsFramebuffer(ctx, framebuffer);
945 }
946
947 GLboolean glIsProgram(GLuint program)
948 {
949         GET_CONTEXT;
950         return ctx->glIsProgram(ctx, program);
951 }
952
953 GLboolean glIsRenderbuffer(GLuint renderbuffer)
954 {
955         GET_CONTEXT;
956         return ctx->glIsRenderbuffer(ctx, renderbuffer);
957 }
958
959 GLboolean glIsShader(GLuint shader)
960 {
961         GET_CONTEXT;
962         return ctx->glIsShader(ctx, shader);
963 }
964
965 GLboolean glIsTexture(GLuint texture)
966 {
967         GET_CONTEXT;
968         return ctx->glIsTexture(ctx, texture);
969 }
970
971 void glLineWidth(GLfloat width)
972 {
973         GET_CONTEXT;
974         ctx->glLineWidth(ctx, width);
975 }
976
977 void glLinkProgram(GLuint program)
978 {
979         GET_CONTEXT;
980         ctx->glLinkProgram(ctx, program);
981 }
982
983 void glPixelStorei(GLenum pname, GLint param)
984 {
985         GET_CONTEXT;
986         ctx->glPixelStorei(ctx, pname, param);
987 }
988
989 void glPolygonOffset(GLfloat factor, GLfloat units)
990 {
991         GET_CONTEXT;
992         ctx->glPolygonOffset(ctx, factor, units);
993 }
994
995 void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
996 {
997         GET_CONTEXT;
998         ctx->glReadPixels(ctx, x, y, width, height, format, type, pixels);
999 }
1000
1001 void glReleaseShaderCompiler()
1002 {
1003         GET_CONTEXT;
1004         ctx->glReleaseShaderCompiler(ctx);
1005 }
1006
1007 void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
1008 {
1009         GET_CONTEXT;
1010         ctx->glRenderbufferStorage(ctx, target, internalformat, width, height);
1011 }
1012
1013 void glSampleCoverage(GLclampf value, GLboolean invert)
1014 {
1015         GET_CONTEXT;
1016         ctx->glSampleCoverage(ctx, value, invert);
1017 }
1018
1019 void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
1020 {
1021         GET_CONTEXT;
1022         ctx->glScissor(ctx, x, y, width, height);
1023 }
1024
1025 void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
1026 {
1027         GET_CONTEXT;
1028         ctx->glShaderBinary(ctx, n, shaders, binaryformat, binary, length);
1029 }
1030
1031 void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length)
1032 {
1033         GET_CONTEXT;
1034         ctx->glShaderSource(ctx, shader, count, string, length);
1035 }
1036
1037 void glStencilFunc(GLenum func, GLint ref, GLuint mask)
1038 {
1039         GET_CONTEXT;
1040         ctx->glStencilFunc(ctx, func, ref, mask);
1041 }
1042
1043 void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
1044 {
1045         GET_CONTEXT;
1046         ctx->glStencilFuncSeparate(ctx, face, func, ref, mask);
1047 }
1048
1049 void glStencilMask(GLuint mask)
1050 {
1051         GET_CONTEXT;
1052         ctx->glStencilMask(ctx, mask);
1053 }
1054
1055 void glStencilMaskSeparate(GLenum face, GLuint mask)
1056 {
1057         GET_CONTEXT;
1058         ctx->glStencilMaskSeparate(ctx, face, mask);
1059 }
1060
1061 void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
1062 {
1063         GET_CONTEXT;
1064         ctx->glStencilOp(ctx, fail, zfail, zpass);
1065 }
1066
1067 void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1068 {
1069         GET_CONTEXT;
1070         ctx->glStencilOpSeparate(ctx, face, fail, zfail, zpass);
1071 }
1072
1073 void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
1074 {
1075         GET_CONTEXT;
1076         ctx->glTexImage2D(ctx, target, level, internalformat, width, height, border, format, type, pixels);
1077 }
1078
1079 void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
1080 {
1081         GET_CONTEXT;
1082         ctx->glTexParameterf(ctx, target, pname, param);
1083 }
1084
1085 void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
1086 {
1087         GET_CONTEXT;
1088         ctx->glTexParameterfv(ctx, target, pname, params);
1089 }
1090
1091 void glTexParameteri(GLenum target, GLenum pname, GLint param)
1092 {
1093         GET_CONTEXT;
1094         ctx->glTexParameteri(ctx, target, pname, param);
1095 }
1096
1097 void glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
1098 {
1099         GET_CONTEXT;
1100         ctx->glTexParameteriv(ctx, target, pname, params);
1101 }
1102
1103 void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
1104 {
1105         GET_CONTEXT;
1106         ctx->glTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels);
1107 }
1108
1109 void glUniform1f(GLint location, GLfloat x)
1110 {
1111         GET_CONTEXT;
1112         ctx->glUniform1f(ctx, location, x);
1113 }
1114
1115 void glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
1116 {
1117         GET_CONTEXT;
1118         ctx->glUniform1fv(ctx, location, count, v);
1119 }
1120
1121 void glUniform1i(GLint location, GLint x)
1122 {
1123         GET_CONTEXT;
1124         ctx->glUniform1i(ctx, location, x);
1125 }
1126
1127 void glUniform1iv(GLint location, GLsizei count, const GLint* v)
1128 {
1129         GET_CONTEXT;
1130         ctx->glUniform1iv(ctx, location, count, v);
1131 }
1132
1133 void glUniform2f(GLint location, GLfloat x, GLfloat y)
1134 {
1135         GET_CONTEXT;
1136         ctx->glUniform2f(ctx, location, x, y);
1137 }
1138
1139 void glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
1140 {
1141         GET_CONTEXT;
1142         ctx->glUniform2fv(ctx, location, count, v);
1143 }
1144
1145 void glUniform2i(GLint location, GLint x, GLint y)
1146 {
1147         GET_CONTEXT;
1148         ctx->glUniform2i(ctx, location, x, y);
1149 }
1150
1151 void glUniform2iv(GLint location, GLsizei count, const GLint* v)
1152 {
1153         GET_CONTEXT;
1154         ctx->glUniform2iv(ctx, location, count, v);
1155 }
1156
1157 void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1158 {
1159         GET_CONTEXT;
1160         ctx->glUniform3f(ctx, location, x, y, z);
1161 }
1162
1163 void glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
1164 {
1165         GET_CONTEXT;
1166         ctx->glUniform3fv(ctx, location, count, v);
1167 }
1168
1169 void glUniform3i(GLint location, GLint x, GLint y, GLint z)
1170 {
1171         GET_CONTEXT;
1172         ctx->glUniform3i(ctx, location, x, y, z);
1173 }
1174
1175 void glUniform3iv(GLint location, GLsizei count, const GLint* v)
1176 {
1177         GET_CONTEXT;
1178         ctx->glUniform3iv(ctx, location, count, v);
1179 }
1180
1181 void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1182 {
1183         GET_CONTEXT;
1184         ctx->glUniform4f(ctx, location, x, y, z, w);
1185 }
1186
1187 void glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
1188 {
1189         GET_CONTEXT;
1190         ctx->glUniform4fv(ctx, location, count, v);
1191 }
1192
1193 void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1194 {
1195         GET_CONTEXT;
1196         ctx->glUniform4i(ctx, location, x, y, z, w);
1197 }
1198
1199 void glUniform4iv(GLint location, GLsizei count, const GLint* v)
1200 {
1201         GET_CONTEXT;
1202         ctx->glUniform4iv(ctx, location, count, v);
1203 }
1204
1205 void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1206 {
1207         GET_CONTEXT;
1208         ctx->glUniformMatrix2fv(ctx, location, count, transpose, value);
1209 }
1210
1211 void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1212 {
1213         GET_CONTEXT;
1214         ctx->glUniformMatrix3fv(ctx, location, count, transpose, value);
1215 }
1216
1217 void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1218 {
1219         GET_CONTEXT;
1220         ctx->glUniformMatrix4fv(ctx, location, count, transpose, value);
1221 }
1222
1223 void glUseProgram(GLuint program)
1224 {
1225         GET_CONTEXT;
1226         ctx->glUseProgram(ctx, program);
1227 }
1228
1229 void glValidateProgram(GLuint program)
1230 {
1231         GET_CONTEXT;
1232         ctx->glValidateProgram(ctx, program);
1233 }
1234
1235 void glVertexAttrib1f(GLuint indx, GLfloat x)
1236 {
1237         GET_CONTEXT;
1238         ctx->glVertexAttrib1f(ctx, indx, x);
1239 }
1240
1241 void glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1242 {
1243         GET_CONTEXT;
1244         ctx->glVertexAttrib1fv(ctx, indx, values);
1245 }
1246
1247 void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1248 {
1249         GET_CONTEXT;
1250         ctx->glVertexAttrib2f(ctx, indx, x, y);
1251 }
1252
1253 void glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1254 {
1255         GET_CONTEXT;
1256         ctx->glVertexAttrib2fv(ctx, indx, values);
1257 }
1258
1259 void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1260 {
1261         GET_CONTEXT;
1262         ctx->glVertexAttrib3f(ctx, indx, x, y, z);
1263 }
1264
1265 void glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1266 {
1267         GET_CONTEXT;
1268         ctx->glVertexAttrib3fv(ctx, indx, values);
1269 }
1270
1271 void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1272 {
1273         GET_CONTEXT;
1274         ctx->glVertexAttrib4f(ctx, indx, x, y, z, w);
1275 }
1276
1277 void glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1278 {
1279         GET_CONTEXT;
1280         ctx->glVertexAttrib4fv(ctx, indx, values);
1281 }
1282
1283 void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
1284 {
1285         GET_CONTEXT;
1286         ctx->glVertexAttribPointer(ctx, indx, size, type, normalized, stride, ptr);
1287 }
1288
1289 void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
1290 {
1291         GET_CONTEXT;
1292         ctx->glViewport(ctx, x, y, width, height);
1293 }
1294
1295 void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
1296 {
1297         GET_CONTEXT;
1298         ctx->glEGLImageTargetTexture2DOES(ctx, target, image);
1299 }
1300
1301 void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
1302 {
1303         GET_CONTEXT;
1304         ctx->glEGLImageTargetRenderbufferStorageOES(ctx, target, image);
1305 }
1306
1307 void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
1308 {
1309         GET_CONTEXT;
1310         ctx->glGetProgramBinaryOES(ctx, program, bufSize, length, binaryFormat, binary);
1311 }
1312
1313 void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length)
1314 {
1315         GET_CONTEXT;
1316         ctx->glProgramBinaryOES(ctx, program, binaryFormat, binary, length);
1317 }
1318
1319 void* glMapBufferOES(GLenum target, GLenum access)
1320 {
1321         GET_CONTEXT;
1322         return ctx->glMapBufferOES(ctx, target, access);
1323 }
1324
1325 GLboolean glUnmapBufferOES(GLenum target)
1326 {
1327         GET_CONTEXT;
1328         return ctx->glUnmapBufferOES(ctx, target);
1329 }
1330
1331 void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
1332 {
1333         GET_CONTEXT;
1334         ctx->glTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, format, type, pixels);
1335 }
1336
1337 void glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
1338 {
1339         GET_CONTEXT;
1340         ctx->glTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
1341 }
1342
1343 void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
1344 {
1345         GET_CONTEXT;
1346         ctx->glCopyTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
1347 }
1348
1349 void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
1350 {
1351         GET_CONTEXT;
1352          if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
1353         ctx->glCompressedTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
1354 }
1355
1356 void glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
1357 {
1358         GET_CONTEXT;
1359          if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
1360         ctx->glCompressedTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
1361 }
1362
1363 void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
1364 {
1365         GET_CONTEXT;
1366         ctx->glFramebufferTexture3DOES(ctx, target, attachment, textarget, texture, level, zoffset);
1367 }
1368
1369 void glBindVertexArrayOES(GLuint array)
1370 {
1371         GET_CONTEXT;
1372         ctx->glBindVertexArrayOES(ctx, array);
1373 }
1374
1375 void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays)
1376 {
1377         GET_CONTEXT;
1378          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
1379         ctx->glDeleteVertexArraysOES(ctx, n, arrays);
1380 }
1381
1382 void glGenVertexArraysOES(GLsizei n, GLuint* arrays)
1383 {
1384         GET_CONTEXT;
1385          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
1386         ctx->glGenVertexArraysOES(ctx, n, arrays);
1387 }
1388
1389 GLboolean glIsVertexArrayOES(GLuint array)
1390 {
1391         GET_CONTEXT;
1392         return ctx->glIsVertexArrayOES(ctx, array);
1393 }
1394
1395 void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
1396 {
1397         GET_CONTEXT;
1398         ctx->glDiscardFramebufferEXT(ctx, target, numAttachments, attachments);
1399 }
1400
1401 void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount)
1402 {
1403         GET_CONTEXT;
1404         ctx->glMultiDrawArraysEXT(ctx, mode, first, count, primcount);
1405 }
1406
1407 void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount)
1408 {
1409         GET_CONTEXT;
1410         ctx->glMultiDrawElementsEXT(ctx, mode, count, type, indices, primcount);
1411 }
1412
1413 void glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups)
1414 {
1415         GET_CONTEXT;
1416         ctx->glGetPerfMonitorGroupsAMD(ctx, numGroups, groupsSize, groups);
1417 }
1418
1419 void glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters)
1420 {
1421         GET_CONTEXT;
1422         ctx->glGetPerfMonitorCountersAMD(ctx, group, numCounters, maxActiveCounters, counterSize, counters);
1423 }
1424
1425 void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString)
1426 {
1427         GET_CONTEXT;
1428         ctx->glGetPerfMonitorGroupStringAMD(ctx, group, bufSize, length, groupString);
1429 }
1430
1431 void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString)
1432 {
1433         GET_CONTEXT;
1434         ctx->glGetPerfMonitorCounterStringAMD(ctx, group, counter, bufSize, length, counterString);
1435 }
1436
1437 void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid* data)
1438 {
1439         GET_CONTEXT;
1440         ctx->glGetPerfMonitorCounterInfoAMD(ctx, group, counter, pname, data);
1441 }
1442
1443 void glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors)
1444 {
1445         GET_CONTEXT;
1446         ctx->glGenPerfMonitorsAMD(ctx, n, monitors);
1447 }
1448
1449 void glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors)
1450 {
1451         GET_CONTEXT;
1452         ctx->glDeletePerfMonitorsAMD(ctx, n, monitors);
1453 }
1454
1455 void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList)
1456 {
1457         GET_CONTEXT;
1458         ctx->glSelectPerfMonitorCountersAMD(ctx, monitor, enable, group, numCounters, countersList);
1459 }
1460
1461 void glBeginPerfMonitorAMD(GLuint monitor)
1462 {
1463         GET_CONTEXT;
1464         ctx->glBeginPerfMonitorAMD(ctx, monitor);
1465 }
1466
1467 void glEndPerfMonitorAMD(GLuint monitor)
1468 {
1469         GET_CONTEXT;
1470         ctx->glEndPerfMonitorAMD(ctx, monitor);
1471 }
1472
1473 void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten)
1474 {
1475         GET_CONTEXT;
1476         ctx->glGetPerfMonitorCounterDataAMD(ctx, monitor, pname, dataSize, data, bytesWritten);
1477 }
1478
1479 void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
1480 {
1481         GET_CONTEXT;
1482         ctx->glRenderbufferStorageMultisampleIMG(ctx, target, samples, internalformat, width, height);
1483 }
1484
1485 void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
1486 {
1487         GET_CONTEXT;
1488         ctx->glFramebufferTexture2DMultisampleIMG(ctx, target, attachment, textarget, texture, level, samples);
1489 }
1490
1491 void glDeleteFencesNV(GLsizei n, const GLuint* fences)
1492 {
1493         GET_CONTEXT;
1494         ctx->glDeleteFencesNV(ctx, n, fences);
1495 }
1496
1497 void glGenFencesNV(GLsizei n, GLuint* fences)
1498 {
1499         GET_CONTEXT;
1500         ctx->glGenFencesNV(ctx, n, fences);
1501 }
1502
1503 GLboolean glIsFenceNV(GLuint fence)
1504 {
1505         GET_CONTEXT;
1506         return ctx->glIsFenceNV(ctx, fence);
1507 }
1508
1509 GLboolean glTestFenceNV(GLuint fence)
1510 {
1511         GET_CONTEXT;
1512         return ctx->glTestFenceNV(ctx, fence);
1513 }
1514
1515 void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params)
1516 {
1517         GET_CONTEXT;
1518         ctx->glGetFenceivNV(ctx, fence, pname, params);
1519 }
1520
1521 void glFinishFenceNV(GLuint fence)
1522 {
1523         GET_CONTEXT;
1524         ctx->glFinishFenceNV(ctx, fence);
1525 }
1526
1527 void glSetFenceNV(GLuint fence, GLenum condition)
1528 {
1529         GET_CONTEXT;
1530         ctx->glSetFenceNV(ctx, fence, condition);
1531 }
1532
1533 void glCoverageMaskNV(GLboolean mask)
1534 {
1535         GET_CONTEXT;
1536         ctx->glCoverageMaskNV(ctx, mask);
1537 }
1538
1539 void glCoverageOperationNV(GLenum operation)
1540 {
1541         GET_CONTEXT;
1542         ctx->glCoverageOperationNV(ctx, operation);
1543 }
1544
1545 void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls)
1546 {
1547         GET_CONTEXT;
1548         ctx->glGetDriverControlsQCOM(ctx, num, size, driverControls);
1549 }
1550
1551 void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
1552 {
1553         GET_CONTEXT;
1554         ctx->glGetDriverControlStringQCOM(ctx, driverControl, bufSize, length, driverControlString);
1555 }
1556
1557 void glEnableDriverControlQCOM(GLuint driverControl)
1558 {
1559         GET_CONTEXT;
1560         ctx->glEnableDriverControlQCOM(ctx, driverControl);
1561 }
1562
1563 void glDisableDriverControlQCOM(GLuint driverControl)
1564 {
1565         GET_CONTEXT;
1566         ctx->glDisableDriverControlQCOM(ctx, driverControl);
1567 }
1568
1569 void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures)
1570 {
1571         GET_CONTEXT;
1572         ctx->glExtGetTexturesQCOM(ctx, textures, maxTextures, numTextures);
1573 }
1574
1575 void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
1576 {
1577         GET_CONTEXT;
1578         ctx->glExtGetBuffersQCOM(ctx, buffers, maxBuffers, numBuffers);
1579 }
1580
1581 void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
1582 {
1583         GET_CONTEXT;
1584         ctx->glExtGetRenderbuffersQCOM(ctx, renderbuffers, maxRenderbuffers, numRenderbuffers);
1585 }
1586
1587 void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
1588 {
1589         GET_CONTEXT;
1590         ctx->glExtGetFramebuffersQCOM(ctx, framebuffers, maxFramebuffers, numFramebuffers);
1591 }
1592
1593 void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
1594 {
1595         GET_CONTEXT;
1596         ctx->glExtGetTexLevelParameterivQCOM(ctx, texture, face, level, pname, params);
1597 }
1598
1599 void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
1600 {
1601         GET_CONTEXT;
1602         ctx->glExtTexObjectStateOverrideiQCOM(ctx, target, pname, param);
1603 }
1604
1605 void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
1606 {
1607         GET_CONTEXT;
1608         ctx->glExtGetTexSubImageQCOM(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
1609 }
1610
1611 void glExtGetBufferPointervQCOM(GLenum target, GLvoidptr* params)
1612 {
1613         GET_CONTEXT;
1614         ctx->glExtGetBufferPointervQCOM(ctx, target, params);
1615 }
1616
1617 void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders)
1618 {
1619         GET_CONTEXT;
1620         ctx->glExtGetShadersQCOM(ctx, shaders, maxShaders, numShaders);
1621 }
1622
1623 void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms)
1624 {
1625         GET_CONTEXT;
1626         ctx->glExtGetProgramsQCOM(ctx, programs, maxPrograms, numPrograms);
1627 }
1628
1629 GLboolean glExtIsProgramBinaryQCOM(GLuint program)
1630 {
1631         GET_CONTEXT;
1632         return ctx->glExtIsProgramBinaryQCOM(ctx, program);
1633 }
1634
1635 void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length)
1636 {
1637         GET_CONTEXT;
1638         ctx->glExtGetProgramBinarySourceQCOM(ctx, program, shadertype, source, length);
1639 }
1640
1641 void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
1642 {
1643         GET_CONTEXT;
1644         ctx->glStartTilingQCOM(ctx, x, y, width, height, preserveMask);
1645 }
1646
1647 void glEndTilingQCOM(GLbitfield preserveMask)
1648 {
1649         GET_CONTEXT;
1650         ctx->glEndTilingQCOM(ctx, preserveMask);
1651 }
1652
1653 void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen)
1654 {
1655         GET_CONTEXT;
1656         ctx->glVertexAttribPointerData(ctx, indx, size, type, normalized, stride, data, datalen);
1657 }
1658
1659 void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset)
1660 {
1661         GET_CONTEXT;
1662         ctx->glVertexAttribPointerOffset(ctx, indx, size, type, normalized, stride, offset);
1663 }
1664
1665 void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset)
1666 {
1667         GET_CONTEXT;
1668         ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
1669 }
1670
1671 void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
1672 {
1673         GET_CONTEXT;
1674         ctx->glDrawElementsData(ctx, mode, count, type, data, datalen);
1675 }
1676
1677 void glGetCompressedTextureFormats(int count, GLint* formats)
1678 {
1679         GET_CONTEXT;
1680         ctx->glGetCompressedTextureFormats(ctx, count, formats);
1681 }
1682
1683 void glShaderString(GLuint shader, const GLchar* string, GLsizei len)
1684 {
1685         GET_CONTEXT;
1686         ctx->glShaderString(ctx, shader, string, len);
1687 }
1688
1689 int glFinishRoundTrip()
1690 {
1691         GET_CONTEXT;
1692         return ctx->glFinishRoundTrip(ctx);
1693 }
1694
1695 void glGenVertexArrays(GLsizei n, GLuint* arrays)
1696 {
1697         GET_CONTEXT;
1698          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
1699         ctx->glGenVertexArrays(ctx, n, arrays);
1700 }
1701
1702 void glBindVertexArray(GLuint array)
1703 {
1704         GET_CONTEXT;
1705         ctx->glBindVertexArray(ctx, array);
1706 }
1707
1708 void glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
1709 {
1710         GET_CONTEXT;
1711          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
1712         ctx->glDeleteVertexArrays(ctx, n, arrays);
1713 }
1714
1715 GLboolean glIsVertexArray(GLuint array)
1716 {
1717         GET_CONTEXT;
1718         return ctx->glIsVertexArray(ctx, array);
1719 }
1720
1721 void* glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
1722 {
1723         GET_CONTEXT;
1724         return ctx->glMapBufferRange(ctx, target, offset, length, access);
1725 }
1726
1727 GLboolean glUnmapBuffer(GLenum target)
1728 {
1729         GET_CONTEXT;
1730         return ctx->glUnmapBuffer(ctx, target);
1731 }
1732
1733 void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
1734 {
1735         GET_CONTEXT;
1736         ctx->glFlushMappedBufferRange(ctx, target, offset, length);
1737 }
1738
1739 void glMapBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped)
1740 {
1741         GET_CONTEXT;
1742         ctx->glMapBufferRangeAEMU(ctx, target, offset, length, access, mapped);
1743 }
1744
1745 void glUnmapBufferAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res)
1746 {
1747         GET_CONTEXT;
1748         ctx->glUnmapBufferAEMU(ctx, target, offset, length, access, guest_buffer, out_res);
1749 }
1750
1751 void glFlushMappedBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer)
1752 {
1753         GET_CONTEXT;
1754         ctx->glFlushMappedBufferRangeAEMU(ctx, target, offset, length, access, guest_buffer);
1755 }
1756
1757 void glReadPixelsOffsetAEMU(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
1758 {
1759         GET_CONTEXT;
1760         ctx->glReadPixelsOffsetAEMU(ctx, x, y, width, height, format, type, offset);
1761 }
1762
1763 void glCompressedTexImage2DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset)
1764 {
1765         GET_CONTEXT;
1766         ctx->glCompressedTexImage2DOffsetAEMU(ctx, target, level, internalformat, width, height, border, imageSize, offset);
1767 }
1768
1769 void glCompressedTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset)
1770 {
1771         GET_CONTEXT;
1772         ctx->glCompressedTexSubImage2DOffsetAEMU(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, offset);
1773 }
1774
1775 void glTexImage2DOffsetAEMU(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset)
1776 {
1777         GET_CONTEXT;
1778         ctx->glTexImage2DOffsetAEMU(ctx, target, level, internalformat, width, height, border, format, type, offset);
1779 }
1780
1781 void glTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
1782 {
1783         GET_CONTEXT;
1784         ctx->glTexSubImage2DOffsetAEMU(ctx, target, level, xoffset, yoffset, width, height, format, type, offset);
1785 }
1786
1787 void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
1788 {
1789         GET_CONTEXT;
1790         ctx->glBindBufferRange(ctx, target, index, buffer, offset, size);
1791 }
1792
1793 void glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
1794 {
1795         GET_CONTEXT;
1796         ctx->glBindBufferBase(ctx, target, index, buffer);
1797 }
1798
1799 void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
1800 {
1801         GET_CONTEXT;
1802         ctx->glCopyBufferSubData(ctx, readtarget, writetarget, readoffset, writeoffset, size);
1803 }
1804
1805 void glClearBufferiv(GLenum buffer, GLint drawBuffer, const GLint* value)
1806 {
1807         GET_CONTEXT;
1808         ctx->glClearBufferiv(ctx, buffer, drawBuffer, value);
1809 }
1810
1811 void glClearBufferuiv(GLenum buffer, GLint drawBuffer, const GLuint* value)
1812 {
1813         GET_CONTEXT;
1814         ctx->glClearBufferuiv(ctx, buffer, drawBuffer, value);
1815 }
1816
1817 void glClearBufferfv(GLenum buffer, GLint drawBuffer, const GLfloat* value)
1818 {
1819         GET_CONTEXT;
1820         ctx->glClearBufferfv(ctx, buffer, drawBuffer, value);
1821 }
1822
1823 void glClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil)
1824 {
1825         GET_CONTEXT;
1826         ctx->glClearBufferfi(ctx, buffer, drawBuffer, depth, stencil);
1827 }
1828
1829 void glGetBufferParameteri64v(GLenum target, GLenum value, GLint64* data)
1830 {
1831         GET_CONTEXT;
1832         ctx->glGetBufferParameteri64v(ctx, target, value, data);
1833 }
1834
1835 void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
1836 {
1837         GET_CONTEXT;
1838         ctx->glGetBufferPointerv(ctx, target, pname, params);
1839 }
1840
1841 void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
1842 {
1843         GET_CONTEXT;
1844         ctx->glUniformBlockBinding(ctx, program, uniformBlockIndex, uniformBlockBinding);
1845 }
1846
1847 GLuint glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
1848 {
1849         GET_CONTEXT;
1850         return ctx->glGetUniformBlockIndex(ctx, program, uniformBlockName);
1851 }
1852
1853 void glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices)
1854 {
1855         GET_CONTEXT;
1856         ctx->glGetUniformIndices(ctx, program, uniformCount, uniformNames, uniformIndices);
1857 }
1858
1859 void glGetUniformIndicesAEMU(GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices)
1860 {
1861         GET_CONTEXT;
1862         ctx->glGetUniformIndicesAEMU(ctx, program, uniformCount, packedUniformNames, packedLen, uniformIndices);
1863 }
1864
1865 void glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
1866 {
1867         GET_CONTEXT;
1868         ctx->glGetActiveUniformBlockiv(ctx, program, uniformBlockIndex, pname, params);
1869 }
1870
1871 void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
1872 {
1873         GET_CONTEXT;
1874          if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
1875         ctx->glGetActiveUniformBlockName(ctx, program, uniformBlockIndex, bufSize, length, uniformBlockName);
1876 }
1877
1878 void glUniform1ui(GLint location, GLuint v0)
1879 {
1880         GET_CONTEXT;
1881         ctx->glUniform1ui(ctx, location, v0);
1882 }
1883
1884 void glUniform2ui(GLint location, GLuint v0, GLuint v1)
1885 {
1886         GET_CONTEXT;
1887         ctx->glUniform2ui(ctx, location, v0, v1);
1888 }
1889
1890 void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
1891 {
1892         GET_CONTEXT;
1893         ctx->glUniform3ui(ctx, location, v0, v1, v2);
1894 }
1895
1896 void glUniform4ui(GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3)
1897 {
1898         GET_CONTEXT;
1899         ctx->glUniform4ui(ctx, location, v0, v1, v2, v3);
1900 }
1901
1902 void glUniform1uiv(GLint location, GLsizei count, const GLuint* value)
1903 {
1904         GET_CONTEXT;
1905         ctx->glUniform1uiv(ctx, location, count, value);
1906 }
1907
1908 void glUniform2uiv(GLint location, GLsizei count, const GLuint* value)
1909 {
1910         GET_CONTEXT;
1911         ctx->glUniform2uiv(ctx, location, count, value);
1912 }
1913
1914 void glUniform3uiv(GLint location, GLsizei count, const GLuint* value)
1915 {
1916         GET_CONTEXT;
1917         ctx->glUniform3uiv(ctx, location, count, value);
1918 }
1919
1920 void glUniform4uiv(GLint location, GLsizei count, const GLuint* value)
1921 {
1922         GET_CONTEXT;
1923         ctx->glUniform4uiv(ctx, location, count, value);
1924 }
1925
1926 void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1927 {
1928         GET_CONTEXT;
1929         ctx->glUniformMatrix2x3fv(ctx, location, count, transpose, value);
1930 }
1931
1932 void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1933 {
1934         GET_CONTEXT;
1935         ctx->glUniformMatrix3x2fv(ctx, location, count, transpose, value);
1936 }
1937
1938 void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1939 {
1940         GET_CONTEXT;
1941         ctx->glUniformMatrix2x4fv(ctx, location, count, transpose, value);
1942 }
1943
1944 void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1945 {
1946         GET_CONTEXT;
1947         ctx->glUniformMatrix4x2fv(ctx, location, count, transpose, value);
1948 }
1949
1950 void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1951 {
1952         GET_CONTEXT;
1953         ctx->glUniformMatrix3x4fv(ctx, location, count, transpose, value);
1954 }
1955
1956 void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1957 {
1958         GET_CONTEXT;
1959         ctx->glUniformMatrix4x3fv(ctx, location, count, transpose, value);
1960 }
1961
1962 void glGetUniformuiv(GLuint program, GLint location, GLuint* params)
1963 {
1964         GET_CONTEXT;
1965         ctx->glGetUniformuiv(ctx, program, location, params);
1966 }
1967
1968 void glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
1969 {
1970         GET_CONTEXT;
1971         ctx->glGetActiveUniformsiv(ctx, program, uniformCount, uniformIndices, pname, params);
1972 }
1973
1974 void glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3)
1975 {
1976         GET_CONTEXT;
1977         ctx->glVertexAttribI4i(ctx, index, v0, v1, v2, v3);
1978 }
1979
1980 void glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
1981 {
1982         GET_CONTEXT;
1983         ctx->glVertexAttribI4ui(ctx, index, v0, v1, v2, v3);
1984 }
1985
1986 void glVertexAttribI4iv(GLuint index, const GLint* v)
1987 {
1988         GET_CONTEXT;
1989         ctx->glVertexAttribI4iv(ctx, index, v);
1990 }
1991
1992 void glVertexAttribI4uiv(GLuint index, const GLuint* v)
1993 {
1994         GET_CONTEXT;
1995         ctx->glVertexAttribI4uiv(ctx, index, v);
1996 }
1997
1998 void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
1999 {
2000         GET_CONTEXT;
2001         ctx->glVertexAttribIPointer(ctx, index, size, type, stride, pointer);
2002 }
2003
2004 void glVertexAttribIPointerOffsetAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset)
2005 {
2006         GET_CONTEXT;
2007         ctx->glVertexAttribIPointerOffsetAEMU(ctx, index, size, type, stride, offset);
2008 }
2009
2010 void glVertexAttribIPointerDataAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
2011 {
2012         GET_CONTEXT;
2013         ctx->glVertexAttribIPointerDataAEMU(ctx, index, size, type, stride, data, datalen);
2014 }
2015
2016 void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
2017 {
2018         GET_CONTEXT;
2019         ctx->glGetVertexAttribIiv(ctx, index, pname, params);
2020 }
2021
2022 void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
2023 {
2024         GET_CONTEXT;
2025         ctx->glGetVertexAttribIuiv(ctx, index, pname, params);
2026 }
2027
2028 void glVertexAttribDivisor(GLuint index, GLuint divisor)
2029 {
2030         GET_CONTEXT;
2031         ctx->glVertexAttribDivisor(ctx, index, divisor);
2032 }
2033
2034 void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
2035 {
2036         GET_CONTEXT;
2037         ctx->glDrawArraysInstanced(ctx, mode, first, count, primcount);
2038 }
2039
2040 void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount)
2041 {
2042         GET_CONTEXT;
2043         ctx->glDrawElementsInstanced(ctx, mode, count, type, indices, primcount);
2044 }
2045
2046 void glDrawElementsInstancedDataAEMU(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen)
2047 {
2048         GET_CONTEXT;
2049         ctx->glDrawElementsInstancedDataAEMU(ctx, mode, count, type, indices, primcount, datalen);
2050 }
2051
2052 void glDrawElementsInstancedOffsetAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount)
2053 {
2054         GET_CONTEXT;
2055         ctx->glDrawElementsInstancedOffsetAEMU(ctx, mode, count, type, offset, primcount);
2056 }
2057
2058 void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
2059 {
2060         GET_CONTEXT;
2061         ctx->glDrawRangeElements(ctx, mode, start, end, count, type, indices);
2062 }
2063
2064 void glDrawRangeElementsDataAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen)
2065 {
2066         GET_CONTEXT;
2067         ctx->glDrawRangeElementsDataAEMU(ctx, mode, start, end, count, type, indices, datalen);
2068 }
2069
2070 void glDrawRangeElementsOffsetAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset)
2071 {
2072         GET_CONTEXT;
2073         ctx->glDrawRangeElementsOffsetAEMU(ctx, mode, start, end, count, type, offset);
2074 }
2075
2076 GLsync glFenceSync(GLenum condition, GLbitfield flags)
2077 {
2078         GET_CONTEXT;
2079         return ctx->glFenceSync(ctx, condition, flags);
2080 }
2081
2082 GLenum glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout)
2083 {
2084         GET_CONTEXT;
2085         return ctx->glClientWaitSync(ctx, wait_on, flags, timeout);
2086 }
2087
2088 void glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout)
2089 {
2090         GET_CONTEXT;
2091         ctx->glWaitSync(ctx, wait_on, flags, timeout);
2092 }
2093
2094 void glDeleteSync(GLsync to_delete)
2095 {
2096         GET_CONTEXT;
2097         ctx->glDeleteSync(ctx, to_delete);
2098 }
2099
2100 GLboolean glIsSync(GLsync sync)
2101 {
2102         GET_CONTEXT;
2103         return ctx->glIsSync(ctx, sync);
2104 }
2105
2106 void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
2107 {
2108         GET_CONTEXT;
2109         ctx->glGetSynciv(ctx, sync, pname, bufSize, length, values);
2110 }
2111
2112 uint64_t glFenceSyncAEMU(GLenum condition, GLbitfield flags)
2113 {
2114         GET_CONTEXT;
2115         return ctx->glFenceSyncAEMU(ctx, condition, flags);
2116 }
2117
2118 GLenum glClientWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout)
2119 {
2120         GET_CONTEXT;
2121         return ctx->glClientWaitSyncAEMU(ctx, wait_on, flags, timeout);
2122 }
2123
2124 void glWaitSyncAEMU(uint64_t wait_on, GLbitfield flags, GLuint64 timeout)
2125 {
2126         GET_CONTEXT;
2127         ctx->glWaitSyncAEMU(ctx, wait_on, flags, timeout);
2128 }
2129
2130 void glDeleteSyncAEMU(uint64_t to_delete)
2131 {
2132         GET_CONTEXT;
2133         ctx->glDeleteSyncAEMU(ctx, to_delete);
2134 }
2135
2136 GLboolean glIsSyncAEMU(uint64_t sync)
2137 {
2138         GET_CONTEXT;
2139         return ctx->glIsSyncAEMU(ctx, sync);
2140 }
2141
2142 void glGetSyncivAEMU(uint64_t sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
2143 {
2144         GET_CONTEXT;
2145          if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2146         ctx->glGetSyncivAEMU(ctx, sync, pname, bufSize, length, values);
2147 }
2148
2149 void glDrawBuffers(GLsizei n, const GLenum* bufs)
2150 {
2151         GET_CONTEXT;
2152         ctx->glDrawBuffers(ctx, n, bufs);
2153 }
2154
2155 void glReadBuffer(GLenum src)
2156 {
2157         GET_CONTEXT;
2158         ctx->glReadBuffer(ctx, src);
2159 }
2160
2161 void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
2162 {
2163         GET_CONTEXT;
2164         ctx->glBlitFramebuffer(ctx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
2165 }
2166
2167 void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
2168 {
2169         GET_CONTEXT;
2170         ctx->glInvalidateFramebuffer(ctx, target, numAttachments, attachments);
2171 }
2172
2173 void glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
2174 {
2175         GET_CONTEXT;
2176         ctx->glInvalidateSubFramebuffer(ctx, target, numAttachments, attachments, x, y, width, height);
2177 }
2178
2179 void glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
2180 {
2181         GET_CONTEXT;
2182         ctx->glFramebufferTextureLayer(ctx, target, attachment, texture, level, layer);
2183 }
2184
2185 void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
2186 {
2187         GET_CONTEXT;
2188         ctx->glRenderbufferStorageMultisample(ctx, target, samples, internalformat, width, height);
2189 }
2190
2191 void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
2192 {
2193         GET_CONTEXT;
2194         ctx->glTexStorage2D(ctx, target, levels, internalformat, width, height);
2195 }
2196
2197 void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
2198 {
2199         GET_CONTEXT;
2200         ctx->glGetInternalformativ(ctx, target, internalformat, pname, bufSize, params);
2201 }
2202
2203 void glBeginTransformFeedback(GLenum primitiveMode)
2204 {
2205         GET_CONTEXT;
2206         ctx->glBeginTransformFeedback(ctx, primitiveMode);
2207 }
2208
2209 void glEndTransformFeedback()
2210 {
2211         GET_CONTEXT;
2212         ctx->glEndTransformFeedback(ctx);
2213 }
2214
2215 void glGenTransformFeedbacks(GLsizei n, GLuint* ids)
2216 {
2217         GET_CONTEXT;
2218          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
2219         ctx->glGenTransformFeedbacks(ctx, n, ids);
2220 }
2221
2222 void glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
2223 {
2224         GET_CONTEXT;
2225          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
2226         ctx->glDeleteTransformFeedbacks(ctx, n, ids);
2227 }
2228
2229 void glBindTransformFeedback(GLenum target, GLuint id)
2230 {
2231         GET_CONTEXT;
2232         ctx->glBindTransformFeedback(ctx, target, id);
2233 }
2234
2235 void glPauseTransformFeedback()
2236 {
2237         GET_CONTEXT;
2238         ctx->glPauseTransformFeedback(ctx);
2239 }
2240
2241 void glResumeTransformFeedback()
2242 {
2243         GET_CONTEXT;
2244         ctx->glResumeTransformFeedback(ctx);
2245 }
2246
2247 GLboolean glIsTransformFeedback(GLuint id)
2248 {
2249         GET_CONTEXT;
2250         return ctx->glIsTransformFeedback(ctx, id);
2251 }
2252
2253 void glTransformFeedbackVaryings(GLuint program, GLsizei count, const char** varyings, GLenum bufferMode)
2254 {
2255         GET_CONTEXT;
2256         ctx->glTransformFeedbackVaryings(ctx, program, count, varyings, bufferMode);
2257 }
2258
2259 void glTransformFeedbackVaryingsAEMU(GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode)
2260 {
2261         GET_CONTEXT;
2262         ctx->glTransformFeedbackVaryingsAEMU(ctx, program, count, packedVaryings, packedVaryingsLen, bufferMode);
2263 }
2264
2265 void glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name)
2266 {
2267         GET_CONTEXT;
2268          if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2269         ctx->glGetTransformFeedbackVarying(ctx, program, index, bufSize, length, size, type, name);
2270 }
2271
2272 void glGenSamplers(GLsizei n, GLuint* samplers)
2273 {
2274         GET_CONTEXT;
2275          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
2276         ctx->glGenSamplers(ctx, n, samplers);
2277 }
2278
2279 void glDeleteSamplers(GLsizei n, const GLuint* samplers)
2280 {
2281         GET_CONTEXT;
2282          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
2283         ctx->glDeleteSamplers(ctx, n, samplers);
2284 }
2285
2286 void glBindSampler(GLuint unit, GLuint sampler)
2287 {
2288         GET_CONTEXT;
2289         ctx->glBindSampler(ctx, unit, sampler);
2290 }
2291
2292 void glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
2293 {
2294         GET_CONTEXT;
2295         ctx->glSamplerParameterf(ctx, sampler, pname, param);
2296 }
2297
2298 void glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
2299 {
2300         GET_CONTEXT;
2301         ctx->glSamplerParameteri(ctx, sampler, pname, param);
2302 }
2303
2304 void glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* params)
2305 {
2306         GET_CONTEXT;
2307         ctx->glSamplerParameterfv(ctx, sampler, pname, params);
2308 }
2309
2310 void glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* params)
2311 {
2312         GET_CONTEXT;
2313         ctx->glSamplerParameteriv(ctx, sampler, pname, params);
2314 }
2315
2316 void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
2317 {
2318         GET_CONTEXT;
2319         ctx->glGetSamplerParameterfv(ctx, sampler, pname, params);
2320 }
2321
2322 void glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
2323 {
2324         GET_CONTEXT;
2325         ctx->glGetSamplerParameteriv(ctx, sampler, pname, params);
2326 }
2327
2328 GLboolean glIsSampler(GLuint sampler)
2329 {
2330         GET_CONTEXT;
2331         return ctx->glIsSampler(ctx, sampler);
2332 }
2333
2334 void glGenQueries(GLsizei n, GLuint* queries)
2335 {
2336         GET_CONTEXT;
2337          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
2338         ctx->glGenQueries(ctx, n, queries);
2339 }
2340
2341 void glDeleteQueries(GLsizei n, const GLuint* queries)
2342 {
2343         GET_CONTEXT;
2344          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
2345         ctx->glDeleteQueries(ctx, n, queries);
2346 }
2347
2348 void glBeginQuery(GLenum target, GLuint query)
2349 {
2350         GET_CONTEXT;
2351         ctx->glBeginQuery(ctx, target, query);
2352 }
2353
2354 void glEndQuery(GLenum target)
2355 {
2356         GET_CONTEXT;
2357         ctx->glEndQuery(ctx, target);
2358 }
2359
2360 void glGetQueryiv(GLenum target, GLenum pname, GLint* params)
2361 {
2362         GET_CONTEXT;
2363         ctx->glGetQueryiv(ctx, target, pname, params);
2364 }
2365
2366 void glGetQueryObjectuiv(GLuint query, GLenum pname, GLuint* params)
2367 {
2368         GET_CONTEXT;
2369         ctx->glGetQueryObjectuiv(ctx, query, pname, params);
2370 }
2371
2372 GLboolean glIsQuery(GLuint query)
2373 {
2374         GET_CONTEXT;
2375         return ctx->glIsQuery(ctx, query);
2376 }
2377
2378 void glProgramParameteri(GLuint program, GLenum pname, GLint value)
2379 {
2380         GET_CONTEXT;
2381         ctx->glProgramParameteri(ctx, program, pname, value);
2382 }
2383
2384 void glProgramBinary(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length)
2385 {
2386         GET_CONTEXT;
2387         ctx->glProgramBinary(ctx, program, binaryFormat, binary, length);
2388 }
2389
2390 void glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary)
2391 {
2392         GET_CONTEXT;
2393          if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2394         ctx->glGetProgramBinary(ctx, program, bufSize, length, binaryFormat, binary);
2395 }
2396
2397 GLint glGetFragDataLocation(GLuint program, const char* name)
2398 {
2399         GET_CONTEXT;
2400         return ctx->glGetFragDataLocation(ctx, program, name);
2401 }
2402
2403 void glGetInteger64v(GLenum pname, GLint64* data)
2404 {
2405         GET_CONTEXT;
2406         ctx->glGetInteger64v(ctx, pname, data);
2407 }
2408
2409 void glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
2410 {
2411         GET_CONTEXT;
2412         ctx->glGetIntegeri_v(ctx, target, index, data);
2413 }
2414
2415 void glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
2416 {
2417         GET_CONTEXT;
2418         ctx->glGetInteger64i_v(ctx, target, index, data);
2419 }
2420
2421 void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data)
2422 {
2423         GET_CONTEXT;
2424         ctx->glTexImage3D(ctx, target, level, internalFormat, width, height, depth, border, format, type, data);
2425 }
2426
2427 void glTexImage3DOffsetAEMU(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset)
2428 {
2429         GET_CONTEXT;
2430         ctx->glTexImage3DOffsetAEMU(ctx, target, level, internalFormat, width, height, depth, border, format, type, offset);
2431 }
2432
2433 void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
2434 {
2435         GET_CONTEXT;
2436         ctx->glTexStorage3D(ctx, target, levels, internalformat, width, height, depth);
2437 }
2438
2439 void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data)
2440 {
2441         GET_CONTEXT;
2442         ctx->glTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
2443 }
2444
2445 void glTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset)
2446 {
2447         GET_CONTEXT;
2448         ctx->glTexSubImage3DOffsetAEMU(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, offset);
2449 }
2450
2451 void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
2452 {
2453         GET_CONTEXT;
2454          if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2455         ctx->glCompressedTexImage3D(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
2456 }
2457
2458 void glCompressedTexImage3DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint offset)
2459 {
2460         GET_CONTEXT;
2461         ctx->glCompressedTexImage3DOffsetAEMU(ctx, target, level, internalformat, width, height, depth, border, imageSize, offset);
2462 }
2463
2464 void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
2465 {
2466         GET_CONTEXT;
2467          if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2468         ctx->glCompressedTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
2469 }
2470
2471 void glCompressedTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data)
2472 {
2473         GET_CONTEXT;
2474         ctx->glCompressedTexSubImage3DOffsetAEMU(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
2475 }
2476
2477 void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
2478 {
2479         GET_CONTEXT;
2480         ctx->glCopyTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
2481 }
2482
2483 const GLubyte* glGetStringi(GLenum name, GLuint index)
2484 {
2485         GET_CONTEXT;
2486         return ctx->glGetStringi(ctx, name, index);
2487 }
2488
2489 void glGetBooleani_v(GLenum target, GLuint index, GLboolean* data)
2490 {
2491         GET_CONTEXT;
2492         ctx->glGetBooleani_v(ctx, target, index, data);
2493 }
2494
2495 void glMemoryBarrier(GLbitfield barriers)
2496 {
2497         GET_CONTEXT;
2498         ctx->glMemoryBarrier(ctx, barriers);
2499 }
2500
2501 void glMemoryBarrierByRegion(GLbitfield barriers)
2502 {
2503         GET_CONTEXT;
2504         ctx->glMemoryBarrierByRegion(ctx, barriers);
2505 }
2506
2507 void glGenProgramPipelines(GLsizei n, GLuint* pipelines)
2508 {
2509         GET_CONTEXT;
2510         ctx->glGenProgramPipelines(ctx, n, pipelines);
2511 }
2512
2513 void glDeleteProgramPipelines(GLsizei n, const GLuint* pipelines)
2514 {
2515         GET_CONTEXT;
2516          if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
2517         ctx->glDeleteProgramPipelines(ctx, n, pipelines);
2518 }
2519
2520 void glBindProgramPipeline(GLuint pipeline)
2521 {
2522         GET_CONTEXT;
2523         ctx->glBindProgramPipeline(ctx, pipeline);
2524 }
2525
2526 void glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params)
2527 {
2528         GET_CONTEXT;
2529         ctx->glGetProgramPipelineiv(ctx, pipeline, pname, params);
2530 }
2531
2532 void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
2533 {
2534         GET_CONTEXT;
2535          if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2536         ctx->glGetProgramPipelineInfoLog(ctx, pipeline, bufSize, length, infoLog);
2537 }
2538
2539 void glValidateProgramPipeline(GLuint pipeline)
2540 {
2541         GET_CONTEXT;
2542         ctx->glValidateProgramPipeline(ctx, pipeline);
2543 }
2544
2545 GLboolean glIsProgramPipeline(GLuint pipeline)
2546 {
2547         GET_CONTEXT;
2548         return ctx->glIsProgramPipeline(ctx, pipeline);
2549 }
2550
2551 void glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
2552 {
2553         GET_CONTEXT;
2554         ctx->glUseProgramStages(ctx, pipeline, stages, program);
2555 }
2556
2557 GLuint glCreateShaderProgramv(GLenum type, GLsizei count, const char** strings)
2558 {
2559         GET_CONTEXT;
2560         return ctx->glCreateShaderProgramv(ctx, type, count, strings);
2561 }
2562
2563 GLuint glCreateShaderProgramvAEMU(GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen)
2564 {
2565         GET_CONTEXT;
2566         return ctx->glCreateShaderProgramvAEMU(ctx, type, count, packedStrings, packedLen);
2567 }
2568
2569 void glProgramUniform1f(GLuint program, GLint location, GLfloat v0)
2570 {
2571         GET_CONTEXT;
2572         ctx->glProgramUniform1f(ctx, program, location, v0);
2573 }
2574
2575 void glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
2576 {
2577         GET_CONTEXT;
2578         ctx->glProgramUniform2f(ctx, program, location, v0, v1);
2579 }
2580
2581 void glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
2582 {
2583         GET_CONTEXT;
2584         ctx->glProgramUniform3f(ctx, program, location, v0, v1, v2);
2585 }
2586
2587 void glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
2588 {
2589         GET_CONTEXT;
2590         ctx->glProgramUniform4f(ctx, program, location, v0, v1, v2, v3);
2591 }
2592
2593 void glProgramUniform1i(GLuint program, GLint location, GLint v0)
2594 {
2595         GET_CONTEXT;
2596         ctx->glProgramUniform1i(ctx, program, location, v0);
2597 }
2598
2599 void glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
2600 {
2601         GET_CONTEXT;
2602         ctx->glProgramUniform2i(ctx, program, location, v0, v1);
2603 }
2604
2605 void glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
2606 {
2607         GET_CONTEXT;
2608         ctx->glProgramUniform3i(ctx, program, location, v0, v1, v2);
2609 }
2610
2611 void glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
2612 {
2613         GET_CONTEXT;
2614         ctx->glProgramUniform4i(ctx, program, location, v0, v1, v2, v3);
2615 }
2616
2617 void glProgramUniform1ui(GLuint program, GLint location, GLuint v0)
2618 {
2619         GET_CONTEXT;
2620         ctx->glProgramUniform1ui(ctx, program, location, v0);
2621 }
2622
2623 void glProgramUniform2ui(GLuint program, GLint location, GLint v0, GLuint v1)
2624 {
2625         GET_CONTEXT;
2626         ctx->glProgramUniform2ui(ctx, program, location, v0, v1);
2627 }
2628
2629 void glProgramUniform3ui(GLuint program, GLint location, GLint v0, GLint v1, GLuint v2)
2630 {
2631         GET_CONTEXT;
2632         ctx->glProgramUniform3ui(ctx, program, location, v0, v1, v2);
2633 }
2634
2635 void glProgramUniform4ui(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3)
2636 {
2637         GET_CONTEXT;
2638         ctx->glProgramUniform4ui(ctx, program, location, v0, v1, v2, v3);
2639 }
2640
2641 void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
2642 {
2643         GET_CONTEXT;
2644         ctx->glProgramUniform1fv(ctx, program, location, count, value);
2645 }
2646
2647 void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
2648 {
2649         GET_CONTEXT;
2650         ctx->glProgramUniform2fv(ctx, program, location, count, value);
2651 }
2652
2653 void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
2654 {
2655         GET_CONTEXT;
2656         ctx->glProgramUniform3fv(ctx, program, location, count, value);
2657 }
2658
2659 void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
2660 {
2661         GET_CONTEXT;
2662         ctx->glProgramUniform4fv(ctx, program, location, count, value);
2663 }
2664
2665 void glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint* value)
2666 {
2667         GET_CONTEXT;
2668         ctx->glProgramUniform1iv(ctx, program, location, count, value);
2669 }
2670
2671 void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint* value)
2672 {
2673         GET_CONTEXT;
2674         ctx->glProgramUniform2iv(ctx, program, location, count, value);
2675 }
2676
2677 void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint* value)
2678 {
2679         GET_CONTEXT;
2680         ctx->glProgramUniform3iv(ctx, program, location, count, value);
2681 }
2682
2683 void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint* value)
2684 {
2685         GET_CONTEXT;
2686         ctx->glProgramUniform4iv(ctx, program, location, count, value);
2687 }
2688
2689 void glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
2690 {
2691         GET_CONTEXT;
2692         ctx->glProgramUniform1uiv(ctx, program, location, count, value);
2693 }
2694
2695 void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
2696 {
2697         GET_CONTEXT;
2698         ctx->glProgramUniform2uiv(ctx, program, location, count, value);
2699 }
2700
2701 void glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
2702 {
2703         GET_CONTEXT;
2704         ctx->glProgramUniform3uiv(ctx, program, location, count, value);
2705 }
2706
2707 void glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
2708 {
2709         GET_CONTEXT;
2710         ctx->glProgramUniform4uiv(ctx, program, location, count, value);
2711 }
2712
2713 void glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2714 {
2715         GET_CONTEXT;
2716         ctx->glProgramUniformMatrix2fv(ctx, program, location, count, transpose, value);
2717 }
2718
2719 void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2720 {
2721         GET_CONTEXT;
2722         ctx->glProgramUniformMatrix3fv(ctx, program, location, count, transpose, value);
2723 }
2724
2725 void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2726 {
2727         GET_CONTEXT;
2728         ctx->glProgramUniformMatrix4fv(ctx, program, location, count, transpose, value);
2729 }
2730
2731 void glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2732 {
2733         GET_CONTEXT;
2734         ctx->glProgramUniformMatrix2x3fv(ctx, program, location, count, transpose, value);
2735 }
2736
2737 void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2738 {
2739         GET_CONTEXT;
2740         ctx->glProgramUniformMatrix3x2fv(ctx, program, location, count, transpose, value);
2741 }
2742
2743 void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2744 {
2745         GET_CONTEXT;
2746         ctx->glProgramUniformMatrix2x4fv(ctx, program, location, count, transpose, value);
2747 }
2748
2749 void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2750 {
2751         GET_CONTEXT;
2752         ctx->glProgramUniformMatrix4x2fv(ctx, program, location, count, transpose, value);
2753 }
2754
2755 void glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2756 {
2757         GET_CONTEXT;
2758         ctx->glProgramUniformMatrix3x4fv(ctx, program, location, count, transpose, value);
2759 }
2760
2761 void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2762 {
2763         GET_CONTEXT;
2764         ctx->glProgramUniformMatrix4x3fv(ctx, program, location, count, transpose, value);
2765 }
2766
2767 void glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params)
2768 {
2769         GET_CONTEXT;
2770         ctx->glGetProgramInterfaceiv(ctx, program, programInterface, pname, params);
2771 }
2772
2773 void glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params)
2774 {
2775         GET_CONTEXT;
2776          if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2777         ctx->glGetProgramResourceiv(ctx, program, programInterface, index, propCount, props, bufSize, length, params);
2778 }
2779
2780 GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char* name)
2781 {
2782         GET_CONTEXT;
2783         return ctx->glGetProgramResourceIndex(ctx, program, programInterface, name);
2784 }
2785
2786 GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char* name)
2787 {
2788         GET_CONTEXT;
2789         return ctx->glGetProgramResourceLocation(ctx, program, programInterface, name);
2790 }
2791
2792 void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name)
2793 {
2794         GET_CONTEXT;
2795          if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
2796         ctx->glGetProgramResourceName(ctx, program, programInterface, index, bufSize, length, name);
2797 }
2798
2799 void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
2800 {
2801         GET_CONTEXT;
2802         ctx->glBindImageTexture(ctx, unit, texture, level, layered, layer, access, format);
2803 }
2804
2805 void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
2806 {
2807         GET_CONTEXT;
2808         ctx->glDispatchCompute(ctx, num_groups_x, num_groups_y, num_groups_z);
2809 }
2810
2811 void glDispatchComputeIndirect(GLintptr indirect)
2812 {
2813         GET_CONTEXT;
2814         ctx->glDispatchComputeIndirect(ctx, indirect);
2815 }
2816
2817 void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride)
2818 {
2819         GET_CONTEXT;
2820         ctx->glBindVertexBuffer(ctx, bindingindex, buffer, offset, stride);
2821 }
2822
2823 void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex)
2824 {
2825         GET_CONTEXT;
2826         ctx->glVertexAttribBinding(ctx, attribindex, bindingindex);
2827 }
2828
2829 void glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
2830 {
2831         GET_CONTEXT;
2832         ctx->glVertexAttribFormat(ctx, attribindex, size, type, normalized, relativeoffset);
2833 }
2834
2835 void glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
2836 {
2837         GET_CONTEXT;
2838         ctx->glVertexAttribIFormat(ctx, attribindex, size, type, relativeoffset);
2839 }
2840
2841 void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor)
2842 {
2843         GET_CONTEXT;
2844         ctx->glVertexBindingDivisor(ctx, bindingindex, divisor);
2845 }
2846
2847 void glDrawArraysIndirect(GLenum mode, const void* indirect)
2848 {
2849         GET_CONTEXT;
2850         ctx->glDrawArraysIndirect(ctx, mode, indirect);
2851 }
2852
2853 void glDrawArraysIndirectDataAEMU(GLenum mode, const void* indirect, GLuint datalen)
2854 {
2855         GET_CONTEXT;
2856         ctx->glDrawArraysIndirectDataAEMU(ctx, mode, indirect, datalen);
2857 }
2858
2859 void glDrawArraysIndirectOffsetAEMU(GLenum mode, GLuint offset)
2860 {
2861         GET_CONTEXT;
2862         ctx->glDrawArraysIndirectOffsetAEMU(ctx, mode, offset);
2863 }
2864
2865 void glDrawElementsIndirect(GLenum mode, GLenum type, const void* indirect)
2866 {
2867         GET_CONTEXT;
2868         ctx->glDrawElementsIndirect(ctx, mode, type, indirect);
2869 }
2870
2871 void glDrawElementsIndirectDataAEMU(GLenum mode, GLenum type, const void* indirect, GLuint datalen)
2872 {
2873         GET_CONTEXT;
2874         ctx->glDrawElementsIndirectDataAEMU(ctx, mode, type, indirect, datalen);
2875 }
2876
2877 void glDrawElementsIndirectOffsetAEMU(GLenum mode, GLenum type, GLuint offset)
2878 {
2879         GET_CONTEXT;
2880         ctx->glDrawElementsIndirectOffsetAEMU(ctx, mode, type, offset);
2881 }
2882
2883 void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
2884 {
2885         GET_CONTEXT;
2886         ctx->glTexStorage2DMultisample(ctx, target, samples, internalformat, width, height, fixedsamplelocations);
2887 }
2888
2889 void glSampleMaski(GLuint maskNumber, GLbitfield mask)
2890 {
2891         GET_CONTEXT;
2892         ctx->glSampleMaski(ctx, maskNumber, mask);
2893 }
2894
2895 void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val)
2896 {
2897         GET_CONTEXT;
2898         ctx->glGetMultisamplefv(ctx, pname, index, val);
2899 }
2900
2901 void glFramebufferParameteri(GLenum target, GLenum pname, GLint param)
2902 {
2903         GET_CONTEXT;
2904         ctx->glFramebufferParameteri(ctx, target, pname, param);
2905 }
2906
2907 void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params)
2908 {
2909         GET_CONTEXT;
2910         ctx->glGetFramebufferParameteriv(ctx, target, pname, params);
2911 }
2912
2913 void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params)
2914 {
2915         GET_CONTEXT;
2916         ctx->glGetTexLevelParameterfv(ctx, target, level, pname, params);
2917 }
2918
2919 void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
2920 {
2921         GET_CONTEXT;
2922         ctx->glGetTexLevelParameteriv(ctx, target, level, pname, params);
2923 }
2924