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
8extern "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** 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, GLint* first, GLsizei* count, GLsizei primcount);
169	void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** 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};
218
219#endif
220#ifndef GET_CONTEXT
221static gl2_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
222void gl2_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
223#define GET_CONTEXT gl2_client_context_t * ctx = getCurrentContext()
224#endif
225
226void glActiveTexture(GLenum texture)
227{
228	GET_CONTEXT;
229	 ctx->glActiveTexture(ctx, texture);
230}
231
232void glAttachShader(GLuint program, GLuint shader)
233{
234	GET_CONTEXT;
235	 ctx->glAttachShader(ctx, program, shader);
236}
237
238void glBindAttribLocation(GLuint program, GLuint index, const GLchar* name)
239{
240	GET_CONTEXT;
241	 ctx->glBindAttribLocation(ctx, program, index, name);
242}
243
244void glBindBuffer(GLenum target, GLuint buffer)
245{
246	GET_CONTEXT;
247	 ctx->glBindBuffer(ctx, target, buffer);
248}
249
250void glBindFramebuffer(GLenum target, GLuint framebuffer)
251{
252	GET_CONTEXT;
253	 ctx->glBindFramebuffer(ctx, target, framebuffer);
254}
255
256void glBindRenderbuffer(GLenum target, GLuint renderbuffer)
257{
258	GET_CONTEXT;
259	 ctx->glBindRenderbuffer(ctx, target, renderbuffer);
260}
261
262void glBindTexture(GLenum target, GLuint texture)
263{
264	GET_CONTEXT;
265	 ctx->glBindTexture(ctx, target, texture);
266}
267
268void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
269{
270	GET_CONTEXT;
271	 ctx->glBlendColor(ctx, red, green, blue, alpha);
272}
273
274void glBlendEquation(GLenum mode)
275{
276	GET_CONTEXT;
277	 ctx->glBlendEquation(ctx, mode);
278}
279
280void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
281{
282	GET_CONTEXT;
283	 ctx->glBlendEquationSeparate(ctx, modeRGB, modeAlpha);
284}
285
286void glBlendFunc(GLenum sfactor, GLenum dfactor)
287{
288	GET_CONTEXT;
289	 ctx->glBlendFunc(ctx, sfactor, dfactor);
290}
291
292void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
293{
294	GET_CONTEXT;
295	 ctx->glBlendFuncSeparate(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha);
296}
297
298void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
299{
300	GET_CONTEXT;
301	 ctx->glBufferData(ctx, target, size, data, usage);
302}
303
304void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
305{
306	GET_CONTEXT;
307	 ctx->glBufferSubData(ctx, target, offset, size, data);
308}
309
310GLenum glCheckFramebufferStatus(GLenum target)
311{
312	GET_CONTEXT;
313	 return ctx->glCheckFramebufferStatus(ctx, target);
314}
315
316void glClear(GLbitfield mask)
317{
318	GET_CONTEXT;
319	 ctx->glClear(ctx, mask);
320}
321
322void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
323{
324	GET_CONTEXT;
325	 ctx->glClearColor(ctx, red, green, blue, alpha);
326}
327
328void glClearDepthf(GLclampf depth)
329{
330	GET_CONTEXT;
331	 ctx->glClearDepthf(ctx, depth);
332}
333
334void glClearStencil(GLint s)
335{
336	GET_CONTEXT;
337	 ctx->glClearStencil(ctx, s);
338}
339
340void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
341{
342	GET_CONTEXT;
343	 ctx->glColorMask(ctx, red, green, blue, alpha);
344}
345
346void glCompileShader(GLuint shader)
347{
348	GET_CONTEXT;
349	 ctx->glCompileShader(ctx, shader);
350}
351
352void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
353{
354	GET_CONTEXT;
355	 ctx->glCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, imageSize, data);
356}
357
358void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
359{
360	GET_CONTEXT;
361	 ctx->glCompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data);
362}
363
364void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
365{
366	GET_CONTEXT;
367	 ctx->glCopyTexImage2D(ctx, target, level, internalformat, x, y, width, height, border);
368}
369
370void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
371{
372	GET_CONTEXT;
373	 ctx->glCopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height);
374}
375
376GLuint glCreateProgram()
377{
378	GET_CONTEXT;
379	 return ctx->glCreateProgram(ctx);
380}
381
382GLuint glCreateShader(GLenum type)
383{
384	GET_CONTEXT;
385	 return ctx->glCreateShader(ctx, type);
386}
387
388void glCullFace(GLenum mode)
389{
390	GET_CONTEXT;
391	 ctx->glCullFace(ctx, mode);
392}
393
394void glDeleteBuffers(GLsizei n, const GLuint* buffers)
395{
396	GET_CONTEXT;
397	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
398	 ctx->glDeleteBuffers(ctx, n, buffers);
399}
400
401void glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
402{
403	GET_CONTEXT;
404	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
405	 ctx->glDeleteFramebuffers(ctx, n, framebuffers);
406}
407
408void glDeleteProgram(GLuint program)
409{
410	GET_CONTEXT;
411	 ctx->glDeleteProgram(ctx, program);
412}
413
414void glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
415{
416	GET_CONTEXT;
417	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
418	 ctx->glDeleteRenderbuffers(ctx, n, renderbuffers);
419}
420
421void glDeleteShader(GLuint shader)
422{
423	GET_CONTEXT;
424	 ctx->glDeleteShader(ctx, shader);
425}
426
427void glDeleteTextures(GLsizei n, const GLuint* textures)
428{
429	GET_CONTEXT;
430	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
431	 ctx->glDeleteTextures(ctx, n, textures);
432}
433
434void glDepthFunc(GLenum func)
435{
436	GET_CONTEXT;
437	 ctx->glDepthFunc(ctx, func);
438}
439
440void glDepthMask(GLboolean flag)
441{
442	GET_CONTEXT;
443	 ctx->glDepthMask(ctx, flag);
444}
445
446void glDepthRangef(GLclampf zNear, GLclampf zFar)
447{
448	GET_CONTEXT;
449	 ctx->glDepthRangef(ctx, zNear, zFar);
450}
451
452void glDetachShader(GLuint program, GLuint shader)
453{
454	GET_CONTEXT;
455	 ctx->glDetachShader(ctx, program, shader);
456}
457
458void glDisable(GLenum cap)
459{
460	GET_CONTEXT;
461	 ctx->glDisable(ctx, cap);
462}
463
464void glDisableVertexAttribArray(GLuint index)
465{
466	GET_CONTEXT;
467	 ctx->glDisableVertexAttribArray(ctx, index);
468}
469
470void glDrawArrays(GLenum mode, GLint first, GLsizei count)
471{
472	GET_CONTEXT;
473	 ctx->glDrawArrays(ctx, mode, first, count);
474}
475
476void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices)
477{
478	GET_CONTEXT;
479	 ctx->glDrawElements(ctx, mode, count, type, indices);
480}
481
482void glEnable(GLenum cap)
483{
484	GET_CONTEXT;
485	 ctx->glEnable(ctx, cap);
486}
487
488void glEnableVertexAttribArray(GLuint index)
489{
490	GET_CONTEXT;
491	 ctx->glEnableVertexAttribArray(ctx, index);
492}
493
494void glFinish()
495{
496	GET_CONTEXT;
497	 ctx->glFinish(ctx);
498}
499
500void glFlush()
501{
502	GET_CONTEXT;
503	 ctx->glFlush(ctx);
504}
505
506void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
507{
508	GET_CONTEXT;
509	 ctx->glFramebufferRenderbuffer(ctx, target, attachment, renderbuffertarget, renderbuffer);
510}
511
512void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
513{
514	GET_CONTEXT;
515	 ctx->glFramebufferTexture2D(ctx, target, attachment, textarget, texture, level);
516}
517
518void glFrontFace(GLenum mode)
519{
520	GET_CONTEXT;
521	 ctx->glFrontFace(ctx, mode);
522}
523
524void glGenBuffers(GLsizei n, GLuint* buffers)
525{
526	GET_CONTEXT;
527	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
528	 ctx->glGenBuffers(ctx, n, buffers);
529}
530
531void glGenerateMipmap(GLenum target)
532{
533	GET_CONTEXT;
534	 ctx->glGenerateMipmap(ctx, target);
535}
536
537void glGenFramebuffers(GLsizei n, GLuint* framebuffers)
538{
539	GET_CONTEXT;
540	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
541	 ctx->glGenFramebuffers(ctx, n, framebuffers);
542}
543
544void glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
545{
546	GET_CONTEXT;
547	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
548	 ctx->glGenRenderbuffers(ctx, n, renderbuffers);
549}
550
551void glGenTextures(GLsizei n, GLuint* textures)
552{
553	GET_CONTEXT;
554	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
555	 ctx->glGenTextures(ctx, n, textures);
556}
557
558void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
559{
560	GET_CONTEXT;
561	 ctx->glGetActiveAttrib(ctx, program, index, bufsize, length, size, type, name);
562}
563
564void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
565{
566	GET_CONTEXT;
567	 ctx->glGetActiveUniform(ctx, program, index, bufsize, length, size, type, name);
568}
569
570void glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
571{
572	GET_CONTEXT;
573	 ctx->glGetAttachedShaders(ctx, program, maxcount, count, shaders);
574}
575
576int glGetAttribLocation(GLuint program, const GLchar* name)
577{
578	GET_CONTEXT;
579	 return ctx->glGetAttribLocation(ctx, program, name);
580}
581
582void glGetBooleanv(GLenum pname, GLboolean* params)
583{
584	GET_CONTEXT;
585	 ctx->glGetBooleanv(ctx, pname, params);
586}
587
588void glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
589{
590	GET_CONTEXT;
591	 ctx->glGetBufferParameteriv(ctx, target, pname, params);
592}
593
594GLenum glGetError()
595{
596	GET_CONTEXT;
597	 return ctx->glGetError(ctx);
598}
599
600void glGetFloatv(GLenum pname, GLfloat* params)
601{
602	GET_CONTEXT;
603	 ctx->glGetFloatv(ctx, pname, params);
604}
605
606void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
607{
608	GET_CONTEXT;
609	 ctx->glGetFramebufferAttachmentParameteriv(ctx, target, attachment, pname, params);
610}
611
612void glGetIntegerv(GLenum pname, GLint* params)
613{
614	GET_CONTEXT;
615	 ctx->glGetIntegerv(ctx, pname, params);
616}
617
618void glGetProgramiv(GLuint program, GLenum pname, GLint* params)
619{
620	GET_CONTEXT;
621	 ctx->glGetProgramiv(ctx, program, pname, params);
622}
623
624void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
625{
626	GET_CONTEXT;
627	 ctx->glGetProgramInfoLog(ctx, program, bufsize, length, infolog);
628}
629
630void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
631{
632	GET_CONTEXT;
633	 ctx->glGetRenderbufferParameteriv(ctx, target, pname, params);
634}
635
636void glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
637{
638	GET_CONTEXT;
639	 ctx->glGetShaderiv(ctx, shader, pname, params);
640}
641
642void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
643{
644	GET_CONTEXT;
645	 ctx->glGetShaderInfoLog(ctx, shader, bufsize, length, infolog);
646}
647
648void glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
649{
650	GET_CONTEXT;
651	 ctx->glGetShaderPrecisionFormat(ctx, shadertype, precisiontype, range, precision);
652}
653
654void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
655{
656	GET_CONTEXT;
657	 ctx->glGetShaderSource(ctx, shader, bufsize, length, source);
658}
659
660const GLubyte* glGetString(GLenum name)
661{
662	GET_CONTEXT;
663	 return ctx->glGetString(ctx, name);
664}
665
666void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
667{
668	GET_CONTEXT;
669	 ctx->glGetTexParameterfv(ctx, target, pname, params);
670}
671
672void glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
673{
674	GET_CONTEXT;
675	 ctx->glGetTexParameteriv(ctx, target, pname, params);
676}
677
678void glGetUniformfv(GLuint program, GLint location, GLfloat* params)
679{
680	GET_CONTEXT;
681	 ctx->glGetUniformfv(ctx, program, location, params);
682}
683
684void glGetUniformiv(GLuint program, GLint location, GLint* params)
685{
686	GET_CONTEXT;
687	 ctx->glGetUniformiv(ctx, program, location, params);
688}
689
690int glGetUniformLocation(GLuint program, const GLchar* name)
691{
692	GET_CONTEXT;
693	 return ctx->glGetUniformLocation(ctx, program, name);
694}
695
696void glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
697{
698	GET_CONTEXT;
699	 ctx->glGetVertexAttribfv(ctx, index, pname, params);
700}
701
702void glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
703{
704	GET_CONTEXT;
705	 ctx->glGetVertexAttribiv(ctx, index, pname, params);
706}
707
708void glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** pointer)
709{
710	GET_CONTEXT;
711	 ctx->glGetVertexAttribPointerv(ctx, index, pname, pointer);
712}
713
714void glHint(GLenum target, GLenum mode)
715{
716	GET_CONTEXT;
717	 ctx->glHint(ctx, target, mode);
718}
719
720GLboolean glIsBuffer(GLuint buffer)
721{
722	GET_CONTEXT;
723	 return ctx->glIsBuffer(ctx, buffer);
724}
725
726GLboolean glIsEnabled(GLenum cap)
727{
728	GET_CONTEXT;
729	 return ctx->glIsEnabled(ctx, cap);
730}
731
732GLboolean glIsFramebuffer(GLuint framebuffer)
733{
734	GET_CONTEXT;
735	 return ctx->glIsFramebuffer(ctx, framebuffer);
736}
737
738GLboolean glIsProgram(GLuint program)
739{
740	GET_CONTEXT;
741	 return ctx->glIsProgram(ctx, program);
742}
743
744GLboolean glIsRenderbuffer(GLuint renderbuffer)
745{
746	GET_CONTEXT;
747	 return ctx->glIsRenderbuffer(ctx, renderbuffer);
748}
749
750GLboolean glIsShader(GLuint shader)
751{
752	GET_CONTEXT;
753	 return ctx->glIsShader(ctx, shader);
754}
755
756GLboolean glIsTexture(GLuint texture)
757{
758	GET_CONTEXT;
759	 return ctx->glIsTexture(ctx, texture);
760}
761
762void glLineWidth(GLfloat width)
763{
764	GET_CONTEXT;
765	 ctx->glLineWidth(ctx, width);
766}
767
768void glLinkProgram(GLuint program)
769{
770	GET_CONTEXT;
771	 ctx->glLinkProgram(ctx, program);
772}
773
774void glPixelStorei(GLenum pname, GLint param)
775{
776	GET_CONTEXT;
777	 ctx->glPixelStorei(ctx, pname, param);
778}
779
780void glPolygonOffset(GLfloat factor, GLfloat units)
781{
782	GET_CONTEXT;
783	 ctx->glPolygonOffset(ctx, factor, units);
784}
785
786void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
787{
788	GET_CONTEXT;
789	 ctx->glReadPixels(ctx, x, y, width, height, format, type, pixels);
790}
791
792void glReleaseShaderCompiler()
793{
794	GET_CONTEXT;
795	 ctx->glReleaseShaderCompiler(ctx);
796}
797
798void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
799{
800	GET_CONTEXT;
801	 ctx->glRenderbufferStorage(ctx, target, internalformat, width, height);
802}
803
804void glSampleCoverage(GLclampf value, GLboolean invert)
805{
806	GET_CONTEXT;
807	 ctx->glSampleCoverage(ctx, value, invert);
808}
809
810void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
811{
812	GET_CONTEXT;
813	 ctx->glScissor(ctx, x, y, width, height);
814}
815
816void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length)
817{
818	GET_CONTEXT;
819	 ctx->glShaderBinary(ctx, n, shaders, binaryformat, binary, length);
820}
821
822void glShaderSource(GLuint shader, GLsizei count, const GLchar** string, const GLint* length)
823{
824	GET_CONTEXT;
825	 ctx->glShaderSource(ctx, shader, count, string, length);
826}
827
828void glStencilFunc(GLenum func, GLint ref, GLuint mask)
829{
830	GET_CONTEXT;
831	 ctx->glStencilFunc(ctx, func, ref, mask);
832}
833
834void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
835{
836	GET_CONTEXT;
837	 ctx->glStencilFuncSeparate(ctx, face, func, ref, mask);
838}
839
840void glStencilMask(GLuint mask)
841{
842	GET_CONTEXT;
843	 ctx->glStencilMask(ctx, mask);
844}
845
846void glStencilMaskSeparate(GLenum face, GLuint mask)
847{
848	GET_CONTEXT;
849	 ctx->glStencilMaskSeparate(ctx, face, mask);
850}
851
852void glStencilOp(GLenum fail, GLenum zfail, GLenum zpass)
853{
854	GET_CONTEXT;
855	 ctx->glStencilOp(ctx, fail, zfail, zpass);
856}
857
858void glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
859{
860	GET_CONTEXT;
861	 ctx->glStencilOpSeparate(ctx, face, fail, zfail, zpass);
862}
863
864void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
865{
866	GET_CONTEXT;
867	 ctx->glTexImage2D(ctx, target, level, internalformat, width, height, border, format, type, pixels);
868}
869
870void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
871{
872	GET_CONTEXT;
873	 ctx->glTexParameterf(ctx, target, pname, param);
874}
875
876void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
877{
878	GET_CONTEXT;
879	 ctx->glTexParameterfv(ctx, target, pname, params);
880}
881
882void glTexParameteri(GLenum target, GLenum pname, GLint param)
883{
884	GET_CONTEXT;
885	 ctx->glTexParameteri(ctx, target, pname, param);
886}
887
888void glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
889{
890	GET_CONTEXT;
891	 ctx->glTexParameteriv(ctx, target, pname, params);
892}
893
894void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
895{
896	GET_CONTEXT;
897	 ctx->glTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, type, pixels);
898}
899
900void glUniform1f(GLint location, GLfloat x)
901{
902	GET_CONTEXT;
903	 ctx->glUniform1f(ctx, location, x);
904}
905
906void glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
907{
908	GET_CONTEXT;
909	 ctx->glUniform1fv(ctx, location, count, v);
910}
911
912void glUniform1i(GLint location, GLint x)
913{
914	GET_CONTEXT;
915	 ctx->glUniform1i(ctx, location, x);
916}
917
918void glUniform1iv(GLint location, GLsizei count, const GLint* v)
919{
920	GET_CONTEXT;
921	 ctx->glUniform1iv(ctx, location, count, v);
922}
923
924void glUniform2f(GLint location, GLfloat x, GLfloat y)
925{
926	GET_CONTEXT;
927	 ctx->glUniform2f(ctx, location, x, y);
928}
929
930void glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
931{
932	GET_CONTEXT;
933	 ctx->glUniform2fv(ctx, location, count, v);
934}
935
936void glUniform2i(GLint location, GLint x, GLint y)
937{
938	GET_CONTEXT;
939	 ctx->glUniform2i(ctx, location, x, y);
940}
941
942void glUniform2iv(GLint location, GLsizei count, const GLint* v)
943{
944	GET_CONTEXT;
945	 ctx->glUniform2iv(ctx, location, count, v);
946}
947
948void glUniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
949{
950	GET_CONTEXT;
951	 ctx->glUniform3f(ctx, location, x, y, z);
952}
953
954void glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
955{
956	GET_CONTEXT;
957	 ctx->glUniform3fv(ctx, location, count, v);
958}
959
960void glUniform3i(GLint location, GLint x, GLint y, GLint z)
961{
962	GET_CONTEXT;
963	 ctx->glUniform3i(ctx, location, x, y, z);
964}
965
966void glUniform3iv(GLint location, GLsizei count, const GLint* v)
967{
968	GET_CONTEXT;
969	 ctx->glUniform3iv(ctx, location, count, v);
970}
971
972void glUniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
973{
974	GET_CONTEXT;
975	 ctx->glUniform4f(ctx, location, x, y, z, w);
976}
977
978void glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
979{
980	GET_CONTEXT;
981	 ctx->glUniform4fv(ctx, location, count, v);
982}
983
984void glUniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
985{
986	GET_CONTEXT;
987	 ctx->glUniform4i(ctx, location, x, y, z, w);
988}
989
990void glUniform4iv(GLint location, GLsizei count, const GLint* v)
991{
992	GET_CONTEXT;
993	 ctx->glUniform4iv(ctx, location, count, v);
994}
995
996void glUniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
997{
998	GET_CONTEXT;
999	 ctx->glUniformMatrix2fv(ctx, location, count, transpose, value);
1000}
1001
1002void glUniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1003{
1004	GET_CONTEXT;
1005	 ctx->glUniformMatrix3fv(ctx, location, count, transpose, value);
1006}
1007
1008void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1009{
1010	GET_CONTEXT;
1011	 ctx->glUniformMatrix4fv(ctx, location, count, transpose, value);
1012}
1013
1014void glUseProgram(GLuint program)
1015{
1016	GET_CONTEXT;
1017	 ctx->glUseProgram(ctx, program);
1018}
1019
1020void glValidateProgram(GLuint program)
1021{
1022	GET_CONTEXT;
1023	 ctx->glValidateProgram(ctx, program);
1024}
1025
1026void glVertexAttrib1f(GLuint indx, GLfloat x)
1027{
1028	GET_CONTEXT;
1029	 ctx->glVertexAttrib1f(ctx, indx, x);
1030}
1031
1032void glVertexAttrib1fv(GLuint indx, const GLfloat* values)
1033{
1034	GET_CONTEXT;
1035	 ctx->glVertexAttrib1fv(ctx, indx, values);
1036}
1037
1038void glVertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1039{
1040	GET_CONTEXT;
1041	 ctx->glVertexAttrib2f(ctx, indx, x, y);
1042}
1043
1044void glVertexAttrib2fv(GLuint indx, const GLfloat* values)
1045{
1046	GET_CONTEXT;
1047	 ctx->glVertexAttrib2fv(ctx, indx, values);
1048}
1049
1050void glVertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1051{
1052	GET_CONTEXT;
1053	 ctx->glVertexAttrib3f(ctx, indx, x, y, z);
1054}
1055
1056void glVertexAttrib3fv(GLuint indx, const GLfloat* values)
1057{
1058	GET_CONTEXT;
1059	 ctx->glVertexAttrib3fv(ctx, indx, values);
1060}
1061
1062void glVertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1063{
1064	GET_CONTEXT;
1065	 ctx->glVertexAttrib4f(ctx, indx, x, y, z, w);
1066}
1067
1068void glVertexAttrib4fv(GLuint indx, const GLfloat* values)
1069{
1070	GET_CONTEXT;
1071	 ctx->glVertexAttrib4fv(ctx, indx, values);
1072}
1073
1074void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr)
1075{
1076	GET_CONTEXT;
1077	 ctx->glVertexAttribPointer(ctx, indx, size, type, normalized, stride, ptr);
1078}
1079
1080void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
1081{
1082	GET_CONTEXT;
1083	 ctx->glViewport(ctx, x, y, width, height);
1084}
1085
1086void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
1087{
1088	GET_CONTEXT;
1089	 ctx->glEGLImageTargetTexture2DOES(ctx, target, image);
1090}
1091
1092void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
1093{
1094	GET_CONTEXT;
1095	 ctx->glEGLImageTargetRenderbufferStorageOES(ctx, target, image);
1096}
1097
1098void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
1099{
1100	GET_CONTEXT;
1101	 ctx->glGetProgramBinaryOES(ctx, program, bufSize, length, binaryFormat, binary);
1102}
1103
1104void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length)
1105{
1106	GET_CONTEXT;
1107	 ctx->glProgramBinaryOES(ctx, program, binaryFormat, binary, length);
1108}
1109
1110void* glMapBufferOES(GLenum target, GLenum access)
1111{
1112	GET_CONTEXT;
1113	 return ctx->glMapBufferOES(ctx, target, access);
1114}
1115
1116GLboolean glUnmapBufferOES(GLenum target)
1117{
1118	GET_CONTEXT;
1119	 return ctx->glUnmapBufferOES(ctx, target);
1120}
1121
1122void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
1123{
1124	GET_CONTEXT;
1125	 ctx->glTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, format, type, pixels);
1126}
1127
1128void glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
1129{
1130	GET_CONTEXT;
1131	 ctx->glTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
1132}
1133
1134void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
1135{
1136	GET_CONTEXT;
1137	 ctx->glCopyTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
1138}
1139
1140void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
1141{
1142	GET_CONTEXT;
1143	 ctx->glCompressedTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
1144}
1145
1146void glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
1147{
1148	GET_CONTEXT;
1149	 ctx->glCompressedTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
1150}
1151
1152void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
1153{
1154	GET_CONTEXT;
1155	 ctx->glFramebufferTexture3DOES(ctx, target, attachment, textarget, texture, level, zoffset);
1156}
1157
1158void glBindVertexArrayOES(GLuint array)
1159{
1160	GET_CONTEXT;
1161	 ctx->glBindVertexArrayOES(ctx, array);
1162}
1163
1164void glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays)
1165{
1166	GET_CONTEXT;
1167	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
1168	 ctx->glDeleteVertexArraysOES(ctx, n, arrays);
1169}
1170
1171void glGenVertexArraysOES(GLsizei n, GLuint* arrays)
1172{
1173	GET_CONTEXT;
1174	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
1175	 ctx->glGenVertexArraysOES(ctx, n, arrays);
1176}
1177
1178GLboolean glIsVertexArrayOES(GLuint array)
1179{
1180	GET_CONTEXT;
1181	 return ctx->glIsVertexArrayOES(ctx, array);
1182}
1183
1184void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
1185{
1186	GET_CONTEXT;
1187	 ctx->glDiscardFramebufferEXT(ctx, target, numAttachments, attachments);
1188}
1189
1190void glMultiDrawArraysEXT(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount)
1191{
1192	GET_CONTEXT;
1193	 ctx->glMultiDrawArraysEXT(ctx, mode, first, count, primcount);
1194}
1195
1196void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount)
1197{
1198	GET_CONTEXT;
1199	 ctx->glMultiDrawElementsEXT(ctx, mode, count, type, indices, primcount);
1200}
1201
1202void glGetPerfMonitorGroupsAMD(GLint* numGroups, GLsizei groupsSize, GLuint* groups)
1203{
1204	GET_CONTEXT;
1205	 ctx->glGetPerfMonitorGroupsAMD(ctx, numGroups, groupsSize, groups);
1206}
1207
1208void glGetPerfMonitorCountersAMD(GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters)
1209{
1210	GET_CONTEXT;
1211	 ctx->glGetPerfMonitorCountersAMD(ctx, group, numCounters, maxActiveCounters, counterSize, counters);
1212}
1213
1214void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString)
1215{
1216	GET_CONTEXT;
1217	 ctx->glGetPerfMonitorGroupStringAMD(ctx, group, bufSize, length, groupString);
1218}
1219
1220void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString)
1221{
1222	GET_CONTEXT;
1223	 ctx->glGetPerfMonitorCounterStringAMD(ctx, group, counter, bufSize, length, counterString);
1224}
1225
1226void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid* data)
1227{
1228	GET_CONTEXT;
1229	 ctx->glGetPerfMonitorCounterInfoAMD(ctx, group, counter, pname, data);
1230}
1231
1232void glGenPerfMonitorsAMD(GLsizei n, GLuint* monitors)
1233{
1234	GET_CONTEXT;
1235	 ctx->glGenPerfMonitorsAMD(ctx, n, monitors);
1236}
1237
1238void glDeletePerfMonitorsAMD(GLsizei n, GLuint* monitors)
1239{
1240	GET_CONTEXT;
1241	 ctx->glDeletePerfMonitorsAMD(ctx, n, monitors);
1242}
1243
1244void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList)
1245{
1246	GET_CONTEXT;
1247	 ctx->glSelectPerfMonitorCountersAMD(ctx, monitor, enable, group, numCounters, countersList);
1248}
1249
1250void glBeginPerfMonitorAMD(GLuint monitor)
1251{
1252	GET_CONTEXT;
1253	 ctx->glBeginPerfMonitorAMD(ctx, monitor);
1254}
1255
1256void glEndPerfMonitorAMD(GLuint monitor)
1257{
1258	GET_CONTEXT;
1259	 ctx->glEndPerfMonitorAMD(ctx, monitor);
1260}
1261
1262void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten)
1263{
1264	GET_CONTEXT;
1265	 ctx->glGetPerfMonitorCounterDataAMD(ctx, monitor, pname, dataSize, data, bytesWritten);
1266}
1267
1268void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
1269{
1270	GET_CONTEXT;
1271	 ctx->glRenderbufferStorageMultisampleIMG(ctx, target, samples, internalformat, width, height);
1272}
1273
1274void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
1275{
1276	GET_CONTEXT;
1277	 ctx->glFramebufferTexture2DMultisampleIMG(ctx, target, attachment, textarget, texture, level, samples);
1278}
1279
1280void glDeleteFencesNV(GLsizei n, const GLuint* fences)
1281{
1282	GET_CONTEXT;
1283	 ctx->glDeleteFencesNV(ctx, n, fences);
1284}
1285
1286void glGenFencesNV(GLsizei n, GLuint* fences)
1287{
1288	GET_CONTEXT;
1289	 ctx->glGenFencesNV(ctx, n, fences);
1290}
1291
1292GLboolean glIsFenceNV(GLuint fence)
1293{
1294	GET_CONTEXT;
1295	 return ctx->glIsFenceNV(ctx, fence);
1296}
1297
1298GLboolean glTestFenceNV(GLuint fence)
1299{
1300	GET_CONTEXT;
1301	 return ctx->glTestFenceNV(ctx, fence);
1302}
1303
1304void glGetFenceivNV(GLuint fence, GLenum pname, GLint* params)
1305{
1306	GET_CONTEXT;
1307	 ctx->glGetFenceivNV(ctx, fence, pname, params);
1308}
1309
1310void glFinishFenceNV(GLuint fence)
1311{
1312	GET_CONTEXT;
1313	 ctx->glFinishFenceNV(ctx, fence);
1314}
1315
1316void glSetFenceNV(GLuint fence, GLenum condition)
1317{
1318	GET_CONTEXT;
1319	 ctx->glSetFenceNV(ctx, fence, condition);
1320}
1321
1322void glCoverageMaskNV(GLboolean mask)
1323{
1324	GET_CONTEXT;
1325	 ctx->glCoverageMaskNV(ctx, mask);
1326}
1327
1328void glCoverageOperationNV(GLenum operation)
1329{
1330	GET_CONTEXT;
1331	 ctx->glCoverageOperationNV(ctx, operation);
1332}
1333
1334void glGetDriverControlsQCOM(GLint* num, GLsizei size, GLuint* driverControls)
1335{
1336	GET_CONTEXT;
1337	 ctx->glGetDriverControlsQCOM(ctx, num, size, driverControls);
1338}
1339
1340void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
1341{
1342	GET_CONTEXT;
1343	 ctx->glGetDriverControlStringQCOM(ctx, driverControl, bufSize, length, driverControlString);
1344}
1345
1346void glEnableDriverControlQCOM(GLuint driverControl)
1347{
1348	GET_CONTEXT;
1349	 ctx->glEnableDriverControlQCOM(ctx, driverControl);
1350}
1351
1352void glDisableDriverControlQCOM(GLuint driverControl)
1353{
1354	GET_CONTEXT;
1355	 ctx->glDisableDriverControlQCOM(ctx, driverControl);
1356}
1357
1358void glExtGetTexturesQCOM(GLuint* textures, GLint maxTextures, GLint* numTextures)
1359{
1360	GET_CONTEXT;
1361	 ctx->glExtGetTexturesQCOM(ctx, textures, maxTextures, numTextures);
1362}
1363
1364void glExtGetBuffersQCOM(GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
1365{
1366	GET_CONTEXT;
1367	 ctx->glExtGetBuffersQCOM(ctx, buffers, maxBuffers, numBuffers);
1368}
1369
1370void glExtGetRenderbuffersQCOM(GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
1371{
1372	GET_CONTEXT;
1373	 ctx->glExtGetRenderbuffersQCOM(ctx, renderbuffers, maxRenderbuffers, numRenderbuffers);
1374}
1375
1376void glExtGetFramebuffersQCOM(GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
1377{
1378	GET_CONTEXT;
1379	 ctx->glExtGetFramebuffersQCOM(ctx, framebuffers, maxFramebuffers, numFramebuffers);
1380}
1381
1382void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
1383{
1384	GET_CONTEXT;
1385	 ctx->glExtGetTexLevelParameterivQCOM(ctx, texture, face, level, pname, params);
1386}
1387
1388void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
1389{
1390	GET_CONTEXT;
1391	 ctx->glExtTexObjectStateOverrideiQCOM(ctx, target, pname, param);
1392}
1393
1394void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
1395{
1396	GET_CONTEXT;
1397	 ctx->glExtGetTexSubImageQCOM(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
1398}
1399
1400void glExtGetBufferPointervQCOM(GLenum target, GLvoidptr* params)
1401{
1402	GET_CONTEXT;
1403	 ctx->glExtGetBufferPointervQCOM(ctx, target, params);
1404}
1405
1406void glExtGetShadersQCOM(GLuint* shaders, GLint maxShaders, GLint* numShaders)
1407{
1408	GET_CONTEXT;
1409	 ctx->glExtGetShadersQCOM(ctx, shaders, maxShaders, numShaders);
1410}
1411
1412void glExtGetProgramsQCOM(GLuint* programs, GLint maxPrograms, GLint* numPrograms)
1413{
1414	GET_CONTEXT;
1415	 ctx->glExtGetProgramsQCOM(ctx, programs, maxPrograms, numPrograms);
1416}
1417
1418GLboolean glExtIsProgramBinaryQCOM(GLuint program)
1419{
1420	GET_CONTEXT;
1421	 return ctx->glExtIsProgramBinaryQCOM(ctx, program);
1422}
1423
1424void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar* source, GLint* length)
1425{
1426	GET_CONTEXT;
1427	 ctx->glExtGetProgramBinarySourceQCOM(ctx, program, shadertype, source, length);
1428}
1429
1430void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
1431{
1432	GET_CONTEXT;
1433	 ctx->glStartTilingQCOM(ctx, x, y, width, height, preserveMask);
1434}
1435
1436void glEndTilingQCOM(GLbitfield preserveMask)
1437{
1438	GET_CONTEXT;
1439	 ctx->glEndTilingQCOM(ctx, preserveMask);
1440}
1441
1442void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen)
1443{
1444	GET_CONTEXT;
1445	 ctx->glVertexAttribPointerData(ctx, indx, size, type, normalized, stride, data, datalen);
1446}
1447
1448void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset)
1449{
1450	GET_CONTEXT;
1451	 ctx->glVertexAttribPointerOffset(ctx, indx, size, type, normalized, stride, offset);
1452}
1453
1454void glDrawElementsOffset(GLenum mode, GLsizei count, GLenum type, GLuint offset)
1455{
1456	GET_CONTEXT;
1457	 ctx->glDrawElementsOffset(ctx, mode, count, type, offset);
1458}
1459
1460void glDrawElementsData(GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
1461{
1462	GET_CONTEXT;
1463	 ctx->glDrawElementsData(ctx, mode, count, type, data, datalen);
1464}
1465
1466void glGetCompressedTextureFormats(int count, GLint* formats)
1467{
1468	GET_CONTEXT;
1469	 ctx->glGetCompressedTextureFormats(ctx, count, formats);
1470}
1471
1472void glShaderString(GLuint shader, const GLchar* string, GLsizei len)
1473{
1474	GET_CONTEXT;
1475	 ctx->glShaderString(ctx, shader, string, len);
1476}
1477
1478int glFinishRoundTrip()
1479{
1480	GET_CONTEXT;
1481	 return ctx->glFinishRoundTrip(ctx);
1482}
1483
1484