OSDN Git Service

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