• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated Code - DO NOT EDIT !!
2 // generated by 'emugen'
3 
4 
5 #include <string.h>
6 #include "gl2_opcodes.h"
7 
8 #include "gl2_enc.h"
9 
10 
11 #include <stdio.h>
12 
13 namespace {
14 
enc_unsupported()15 void enc_unsupported()
16 {
17 	ALOGE("Function is unsupported\n");
18 }
19 
glActiveTexture_enc(void * self,GLenum texture)20 void glActiveTexture_enc(void *self , GLenum texture)
21 {
22 
23 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
24 	IOStream *stream = ctx->m_stream;
25 
26 	 unsigned char *ptr;
27 	 const size_t packetSize = 8 + 4;
28 	ptr = stream->alloc(packetSize);
29 	int tmp = OP_glActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
30 	memcpy(ptr, &packetSize, 4);  ptr += 4;
31 
32 		memcpy(ptr, &texture, 4); ptr += 4;
33 }
34 
glAttachShader_enc(void * self,GLuint program,GLuint shader)35 void glAttachShader_enc(void *self , GLuint program, GLuint shader)
36 {
37 
38 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
39 	IOStream *stream = ctx->m_stream;
40 
41 	 unsigned char *ptr;
42 	 const size_t packetSize = 8 + 4 + 4;
43 	ptr = stream->alloc(packetSize);
44 	int tmp = OP_glAttachShader;memcpy(ptr, &tmp, 4); ptr += 4;
45 	memcpy(ptr, &packetSize, 4);  ptr += 4;
46 
47 		memcpy(ptr, &program, 4); ptr += 4;
48 		memcpy(ptr, &shader, 4); ptr += 4;
49 }
50 
glBindAttribLocation_enc(void * self,GLuint program,GLuint index,const GLchar * name)51 void glBindAttribLocation_enc(void *self , GLuint program, GLuint index, const GLchar* name)
52 {
53 
54 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
55 	IOStream *stream = ctx->m_stream;
56 
57 	const unsigned int __size_name =  (strlen(name) + 1);
58 	 unsigned char *ptr;
59 	 const size_t packetSize = 8 + 4 + 4 + __size_name + 1*4;
60 	ptr = stream->alloc(packetSize);
61 	int tmp = OP_glBindAttribLocation;memcpy(ptr, &tmp, 4); ptr += 4;
62 	memcpy(ptr, &packetSize, 4);  ptr += 4;
63 
64 		memcpy(ptr, &program, 4); ptr += 4;
65 		memcpy(ptr, &index, 4); ptr += 4;
66 	*(unsigned int *)(ptr) = __size_name; ptr += 4;
67 	memcpy(ptr, name, __size_name);ptr += __size_name;
68 }
69 
glBindBuffer_enc(void * self,GLenum target,GLuint buffer)70 void glBindBuffer_enc(void *self , GLenum target, GLuint buffer)
71 {
72 
73 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
74 	IOStream *stream = ctx->m_stream;
75 
76 	 unsigned char *ptr;
77 	 const size_t packetSize = 8 + 4 + 4;
78 	ptr = stream->alloc(packetSize);
79 	int tmp = OP_glBindBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
80 	memcpy(ptr, &packetSize, 4);  ptr += 4;
81 
82 		memcpy(ptr, &target, 4); ptr += 4;
83 		memcpy(ptr, &buffer, 4); ptr += 4;
84 }
85 
glBindFramebuffer_enc(void * self,GLenum target,GLuint framebuffer)86 void glBindFramebuffer_enc(void *self , GLenum target, GLuint framebuffer)
87 {
88 
89 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
90 	IOStream *stream = ctx->m_stream;
91 
92 	 unsigned char *ptr;
93 	 const size_t packetSize = 8 + 4 + 4;
94 	ptr = stream->alloc(packetSize);
95 	int tmp = OP_glBindFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
96 	memcpy(ptr, &packetSize, 4);  ptr += 4;
97 
98 		memcpy(ptr, &target, 4); ptr += 4;
99 		memcpy(ptr, &framebuffer, 4); ptr += 4;
100 }
101 
glBindRenderbuffer_enc(void * self,GLenum target,GLuint renderbuffer)102 void glBindRenderbuffer_enc(void *self , GLenum target, GLuint renderbuffer)
103 {
104 
105 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
106 	IOStream *stream = ctx->m_stream;
107 
108 	 unsigned char *ptr;
109 	 const size_t packetSize = 8 + 4 + 4;
110 	ptr = stream->alloc(packetSize);
111 	int tmp = OP_glBindRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
112 	memcpy(ptr, &packetSize, 4);  ptr += 4;
113 
114 		memcpy(ptr, &target, 4); ptr += 4;
115 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
116 }
117 
glBindTexture_enc(void * self,GLenum target,GLuint texture)118 void glBindTexture_enc(void *self , GLenum target, GLuint texture)
119 {
120 
121 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
122 	IOStream *stream = ctx->m_stream;
123 
124 	 unsigned char *ptr;
125 	 const size_t packetSize = 8 + 4 + 4;
126 	ptr = stream->alloc(packetSize);
127 	int tmp = OP_glBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
128 	memcpy(ptr, &packetSize, 4);  ptr += 4;
129 
130 		memcpy(ptr, &target, 4); ptr += 4;
131 		memcpy(ptr, &texture, 4); ptr += 4;
132 }
133 
glBlendColor_enc(void * self,GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha)134 void glBlendColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
135 {
136 
137 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
138 	IOStream *stream = ctx->m_stream;
139 
140 	 unsigned char *ptr;
141 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
142 	ptr = stream->alloc(packetSize);
143 	int tmp = OP_glBlendColor;memcpy(ptr, &tmp, 4); ptr += 4;
144 	memcpy(ptr, &packetSize, 4);  ptr += 4;
145 
146 		memcpy(ptr, &red, 4); ptr += 4;
147 		memcpy(ptr, &green, 4); ptr += 4;
148 		memcpy(ptr, &blue, 4); ptr += 4;
149 		memcpy(ptr, &alpha, 4); ptr += 4;
150 }
151 
glBlendEquation_enc(void * self,GLenum mode)152 void glBlendEquation_enc(void *self , GLenum mode)
153 {
154 
155 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
156 	IOStream *stream = ctx->m_stream;
157 
158 	 unsigned char *ptr;
159 	 const size_t packetSize = 8 + 4;
160 	ptr = stream->alloc(packetSize);
161 	int tmp = OP_glBlendEquation;memcpy(ptr, &tmp, 4); ptr += 4;
162 	memcpy(ptr, &packetSize, 4);  ptr += 4;
163 
164 		memcpy(ptr, &mode, 4); ptr += 4;
165 }
166 
glBlendEquationSeparate_enc(void * self,GLenum modeRGB,GLenum modeAlpha)167 void glBlendEquationSeparate_enc(void *self , GLenum modeRGB, GLenum modeAlpha)
168 {
169 
170 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
171 	IOStream *stream = ctx->m_stream;
172 
173 	 unsigned char *ptr;
174 	 const size_t packetSize = 8 + 4 + 4;
175 	ptr = stream->alloc(packetSize);
176 	int tmp = OP_glBlendEquationSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
177 	memcpy(ptr, &packetSize, 4);  ptr += 4;
178 
179 		memcpy(ptr, &modeRGB, 4); ptr += 4;
180 		memcpy(ptr, &modeAlpha, 4); ptr += 4;
181 }
182 
glBlendFunc_enc(void * self,GLenum sfactor,GLenum dfactor)183 void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor)
184 {
185 
186 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
187 	IOStream *stream = ctx->m_stream;
188 
189 	 unsigned char *ptr;
190 	 const size_t packetSize = 8 + 4 + 4;
191 	ptr = stream->alloc(packetSize);
192 	int tmp = OP_glBlendFunc;memcpy(ptr, &tmp, 4); ptr += 4;
193 	memcpy(ptr, &packetSize, 4);  ptr += 4;
194 
195 		memcpy(ptr, &sfactor, 4); ptr += 4;
196 		memcpy(ptr, &dfactor, 4); ptr += 4;
197 }
198 
glBlendFuncSeparate_enc(void * self,GLenum srcRGB,GLenum dstRGB,GLenum srcAlpha,GLenum dstAlpha)199 void glBlendFuncSeparate_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
200 {
201 
202 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
203 	IOStream *stream = ctx->m_stream;
204 
205 	 unsigned char *ptr;
206 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
207 	ptr = stream->alloc(packetSize);
208 	int tmp = OP_glBlendFuncSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
209 	memcpy(ptr, &packetSize, 4);  ptr += 4;
210 
211 		memcpy(ptr, &srcRGB, 4); ptr += 4;
212 		memcpy(ptr, &dstRGB, 4); ptr += 4;
213 		memcpy(ptr, &srcAlpha, 4); ptr += 4;
214 		memcpy(ptr, &dstAlpha, 4); ptr += 4;
215 }
216 
glBufferData_enc(void * self,GLenum target,GLsizeiptr size,const GLvoid * data,GLenum usage)217 void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
218 {
219 
220 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
221 	IOStream *stream = ctx->m_stream;
222 
223 	const unsigned int __size_data = ((data != NULL) ?  size : 0);
224 	 unsigned char *ptr;
225 	 const size_t packetSize = 8 + 4 + 4 + __size_data + 4 + 1*4;
226 	ptr = stream->alloc(8 + 4 + 4);
227 	int tmp = OP_glBufferData;memcpy(ptr, &tmp, 4); ptr += 4;
228 	memcpy(ptr, &packetSize, 4);  ptr += 4;
229 
230 		memcpy(ptr, &target, 4); ptr += 4;
231 		memcpy(ptr, &size, 4); ptr += 4;
232 	stream->flush();
233 	stream->writeFully(&__size_data,4);
234 	if (data != NULL) stream->writeFully(data, __size_data);
235 	ptr = stream->alloc(4);
236 		memcpy(ptr, &usage, 4); ptr += 4;
237 }
238 
glBufferSubData_enc(void * self,GLenum target,GLintptr offset,GLsizeiptr size,const GLvoid * data)239 void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
240 {
241 
242 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
243 	IOStream *stream = ctx->m_stream;
244 
245 	const unsigned int __size_data =  size;
246 	 unsigned char *ptr;
247 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 1*4;
248 	ptr = stream->alloc(8 + 4 + 4 + 4);
249 	int tmp = OP_glBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
250 	memcpy(ptr, &packetSize, 4);  ptr += 4;
251 
252 		memcpy(ptr, &target, 4); ptr += 4;
253 		memcpy(ptr, &offset, 4); ptr += 4;
254 		memcpy(ptr, &size, 4); ptr += 4;
255 	stream->flush();
256 	stream->writeFully(&__size_data,4);
257 	stream->writeFully(data, __size_data);
258 }
259 
glCheckFramebufferStatus_enc(void * self,GLenum target)260 GLenum glCheckFramebufferStatus_enc(void *self , GLenum target)
261 {
262 
263 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
264 	IOStream *stream = ctx->m_stream;
265 
266 	 unsigned char *ptr;
267 	 const size_t packetSize = 8 + 4;
268 	ptr = stream->alloc(packetSize);
269 	int tmp = OP_glCheckFramebufferStatus;memcpy(ptr, &tmp, 4); ptr += 4;
270 	memcpy(ptr, &packetSize, 4);  ptr += 4;
271 
272 		memcpy(ptr, &target, 4); ptr += 4;
273 
274 	GLenum retval;
275 	stream->readback(&retval, 4);
276 	return retval;
277 }
278 
glClear_enc(void * self,GLbitfield mask)279 void glClear_enc(void *self , GLbitfield mask)
280 {
281 
282 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
283 	IOStream *stream = ctx->m_stream;
284 
285 	 unsigned char *ptr;
286 	 const size_t packetSize = 8 + 4;
287 	ptr = stream->alloc(packetSize);
288 	int tmp = OP_glClear;memcpy(ptr, &tmp, 4); ptr += 4;
289 	memcpy(ptr, &packetSize, 4);  ptr += 4;
290 
291 		memcpy(ptr, &mask, 4); ptr += 4;
292 }
293 
glClearColor_enc(void * self,GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha)294 void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
295 {
296 
297 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
298 	IOStream *stream = ctx->m_stream;
299 
300 	 unsigned char *ptr;
301 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
302 	ptr = stream->alloc(packetSize);
303 	int tmp = OP_glClearColor;memcpy(ptr, &tmp, 4); ptr += 4;
304 	memcpy(ptr, &packetSize, 4);  ptr += 4;
305 
306 		memcpy(ptr, &red, 4); ptr += 4;
307 		memcpy(ptr, &green, 4); ptr += 4;
308 		memcpy(ptr, &blue, 4); ptr += 4;
309 		memcpy(ptr, &alpha, 4); ptr += 4;
310 }
311 
glClearDepthf_enc(void * self,GLclampf depth)312 void glClearDepthf_enc(void *self , GLclampf depth)
313 {
314 
315 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
316 	IOStream *stream = ctx->m_stream;
317 
318 	 unsigned char *ptr;
319 	 const size_t packetSize = 8 + 4;
320 	ptr = stream->alloc(packetSize);
321 	int tmp = OP_glClearDepthf;memcpy(ptr, &tmp, 4); ptr += 4;
322 	memcpy(ptr, &packetSize, 4);  ptr += 4;
323 
324 		memcpy(ptr, &depth, 4); ptr += 4;
325 }
326 
glClearStencil_enc(void * self,GLint s)327 void glClearStencil_enc(void *self , GLint s)
328 {
329 
330 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
331 	IOStream *stream = ctx->m_stream;
332 
333 	 unsigned char *ptr;
334 	 const size_t packetSize = 8 + 4;
335 	ptr = stream->alloc(packetSize);
336 	int tmp = OP_glClearStencil;memcpy(ptr, &tmp, 4); ptr += 4;
337 	memcpy(ptr, &packetSize, 4);  ptr += 4;
338 
339 		memcpy(ptr, &s, 4); ptr += 4;
340 }
341 
glColorMask_enc(void * self,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)342 void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
343 {
344 
345 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
346 	IOStream *stream = ctx->m_stream;
347 
348 	 unsigned char *ptr;
349 	 const size_t packetSize = 8 + 1 + 1 + 1 + 1;
350 	ptr = stream->alloc(packetSize);
351 	int tmp = OP_glColorMask;memcpy(ptr, &tmp, 4); ptr += 4;
352 	memcpy(ptr, &packetSize, 4);  ptr += 4;
353 
354 		memcpy(ptr, &red, 1); ptr += 1;
355 		memcpy(ptr, &green, 1); ptr += 1;
356 		memcpy(ptr, &blue, 1); ptr += 1;
357 		memcpy(ptr, &alpha, 1); ptr += 1;
358 }
359 
glCompileShader_enc(void * self,GLuint shader)360 void glCompileShader_enc(void *self , GLuint shader)
361 {
362 
363 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
364 	IOStream *stream = ctx->m_stream;
365 
366 	 unsigned char *ptr;
367 	 const size_t packetSize = 8 + 4;
368 	ptr = stream->alloc(packetSize);
369 	int tmp = OP_glCompileShader;memcpy(ptr, &tmp, 4); ptr += 4;
370 	memcpy(ptr, &packetSize, 4);  ptr += 4;
371 
372 		memcpy(ptr, &shader, 4); ptr += 4;
373 }
374 
glCompressedTexImage2D_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)375 void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
376 {
377 
378 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
379 	IOStream *stream = ctx->m_stream;
380 
381 	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
382 	 unsigned char *ptr;
383 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
384 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
385 	int tmp = OP_glCompressedTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
386 	memcpy(ptr, &packetSize, 4);  ptr += 4;
387 
388 		memcpy(ptr, &target, 4); ptr += 4;
389 		memcpy(ptr, &level, 4); ptr += 4;
390 		memcpy(ptr, &internalformat, 4); ptr += 4;
391 		memcpy(ptr, &width, 4); ptr += 4;
392 		memcpy(ptr, &height, 4); ptr += 4;
393 		memcpy(ptr, &border, 4); ptr += 4;
394 		memcpy(ptr, &imageSize, 4); ptr += 4;
395 	stream->flush();
396 	stream->writeFully(&__size_data,4);
397 	if (data != NULL) stream->writeFully(data, __size_data);
398 }
399 
glCompressedTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)400 void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
401 {
402 
403 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
404 	IOStream *stream = ctx->m_stream;
405 
406 	const unsigned int __size_data =  imageSize;
407 	 unsigned char *ptr;
408 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
409 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
410 	int tmp = OP_glCompressedTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
411 	memcpy(ptr, &packetSize, 4);  ptr += 4;
412 
413 		memcpy(ptr, &target, 4); ptr += 4;
414 		memcpy(ptr, &level, 4); ptr += 4;
415 		memcpy(ptr, &xoffset, 4); ptr += 4;
416 		memcpy(ptr, &yoffset, 4); ptr += 4;
417 		memcpy(ptr, &width, 4); ptr += 4;
418 		memcpy(ptr, &height, 4); ptr += 4;
419 		memcpy(ptr, &format, 4); ptr += 4;
420 		memcpy(ptr, &imageSize, 4); ptr += 4;
421 	stream->flush();
422 	stream->writeFully(&__size_data,4);
423 	stream->writeFully(data, __size_data);
424 }
425 
glCopyTexImage2D_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)426 void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
427 {
428 
429 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
430 	IOStream *stream = ctx->m_stream;
431 
432 	 unsigned char *ptr;
433 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
434 	ptr = stream->alloc(packetSize);
435 	int tmp = OP_glCopyTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
436 	memcpy(ptr, &packetSize, 4);  ptr += 4;
437 
438 		memcpy(ptr, &target, 4); ptr += 4;
439 		memcpy(ptr, &level, 4); ptr += 4;
440 		memcpy(ptr, &internalformat, 4); ptr += 4;
441 		memcpy(ptr, &x, 4); ptr += 4;
442 		memcpy(ptr, &y, 4); ptr += 4;
443 		memcpy(ptr, &width, 4); ptr += 4;
444 		memcpy(ptr, &height, 4); ptr += 4;
445 		memcpy(ptr, &border, 4); ptr += 4;
446 }
447 
glCopyTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)448 void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
449 {
450 
451 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
452 	IOStream *stream = ctx->m_stream;
453 
454 	 unsigned char *ptr;
455 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
456 	ptr = stream->alloc(packetSize);
457 	int tmp = OP_glCopyTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
458 	memcpy(ptr, &packetSize, 4);  ptr += 4;
459 
460 		memcpy(ptr, &target, 4); ptr += 4;
461 		memcpy(ptr, &level, 4); ptr += 4;
462 		memcpy(ptr, &xoffset, 4); ptr += 4;
463 		memcpy(ptr, &yoffset, 4); ptr += 4;
464 		memcpy(ptr, &x, 4); ptr += 4;
465 		memcpy(ptr, &y, 4); ptr += 4;
466 		memcpy(ptr, &width, 4); ptr += 4;
467 		memcpy(ptr, &height, 4); ptr += 4;
468 }
469 
glCreateProgram_enc(void * self)470 GLuint glCreateProgram_enc(void *self )
471 {
472 
473 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
474 	IOStream *stream = ctx->m_stream;
475 
476 	 unsigned char *ptr;
477 	 const size_t packetSize = 8;
478 	ptr = stream->alloc(packetSize);
479 	int tmp = OP_glCreateProgram;memcpy(ptr, &tmp, 4); ptr += 4;
480 	memcpy(ptr, &packetSize, 4);  ptr += 4;
481 
482 
483 	GLuint retval;
484 	stream->readback(&retval, 4);
485 	return retval;
486 }
487 
glCreateShader_enc(void * self,GLenum type)488 GLuint glCreateShader_enc(void *self , GLenum type)
489 {
490 
491 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
492 	IOStream *stream = ctx->m_stream;
493 
494 	 unsigned char *ptr;
495 	 const size_t packetSize = 8 + 4;
496 	ptr = stream->alloc(packetSize);
497 	int tmp = OP_glCreateShader;memcpy(ptr, &tmp, 4); ptr += 4;
498 	memcpy(ptr, &packetSize, 4);  ptr += 4;
499 
500 		memcpy(ptr, &type, 4); ptr += 4;
501 
502 	GLuint retval;
503 	stream->readback(&retval, 4);
504 	return retval;
505 }
506 
glCullFace_enc(void * self,GLenum mode)507 void glCullFace_enc(void *self , GLenum mode)
508 {
509 
510 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
511 	IOStream *stream = ctx->m_stream;
512 
513 	 unsigned char *ptr;
514 	 const size_t packetSize = 8 + 4;
515 	ptr = stream->alloc(packetSize);
516 	int tmp = OP_glCullFace;memcpy(ptr, &tmp, 4); ptr += 4;
517 	memcpy(ptr, &packetSize, 4);  ptr += 4;
518 
519 		memcpy(ptr, &mode, 4); ptr += 4;
520 }
521 
glDeleteBuffers_enc(void * self,GLsizei n,const GLuint * buffers)522 void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers)
523 {
524 
525 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
526 	IOStream *stream = ctx->m_stream;
527 
528 	const unsigned int __size_buffers =  (n * sizeof(GLuint));
529 	 unsigned char *ptr;
530 	 const size_t packetSize = 8 + 4 + __size_buffers + 1*4;
531 	ptr = stream->alloc(packetSize);
532 	int tmp = OP_glDeleteBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
533 	memcpy(ptr, &packetSize, 4);  ptr += 4;
534 
535 		memcpy(ptr, &n, 4); ptr += 4;
536 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
537 	memcpy(ptr, buffers, __size_buffers);ptr += __size_buffers;
538 }
539 
glDeleteFramebuffers_enc(void * self,GLsizei n,const GLuint * framebuffers)540 void glDeleteFramebuffers_enc(void *self , GLsizei n, const GLuint* framebuffers)
541 {
542 
543 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
544 	IOStream *stream = ctx->m_stream;
545 
546 	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
547 	 unsigned char *ptr;
548 	 const size_t packetSize = 8 + 4 + __size_framebuffers + 1*4;
549 	ptr = stream->alloc(packetSize);
550 	int tmp = OP_glDeleteFramebuffers;memcpy(ptr, &tmp, 4); ptr += 4;
551 	memcpy(ptr, &packetSize, 4);  ptr += 4;
552 
553 		memcpy(ptr, &n, 4); ptr += 4;
554 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
555 	memcpy(ptr, framebuffers, __size_framebuffers);ptr += __size_framebuffers;
556 }
557 
glDeleteProgram_enc(void * self,GLuint program)558 void glDeleteProgram_enc(void *self , GLuint program)
559 {
560 
561 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
562 	IOStream *stream = ctx->m_stream;
563 
564 	 unsigned char *ptr;
565 	 const size_t packetSize = 8 + 4;
566 	ptr = stream->alloc(packetSize);
567 	int tmp = OP_glDeleteProgram;memcpy(ptr, &tmp, 4); ptr += 4;
568 	memcpy(ptr, &packetSize, 4);  ptr += 4;
569 
570 		memcpy(ptr, &program, 4); ptr += 4;
571 }
572 
glDeleteRenderbuffers_enc(void * self,GLsizei n,const GLuint * renderbuffers)573 void glDeleteRenderbuffers_enc(void *self , GLsizei n, const GLuint* renderbuffers)
574 {
575 
576 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
577 	IOStream *stream = ctx->m_stream;
578 
579 	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
580 	 unsigned char *ptr;
581 	 const size_t packetSize = 8 + 4 + __size_renderbuffers + 1*4;
582 	ptr = stream->alloc(packetSize);
583 	int tmp = OP_glDeleteRenderbuffers;memcpy(ptr, &tmp, 4); ptr += 4;
584 	memcpy(ptr, &packetSize, 4);  ptr += 4;
585 
586 		memcpy(ptr, &n, 4); ptr += 4;
587 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
588 	memcpy(ptr, renderbuffers, __size_renderbuffers);ptr += __size_renderbuffers;
589 }
590 
glDeleteShader_enc(void * self,GLuint shader)591 void glDeleteShader_enc(void *self , GLuint shader)
592 {
593 
594 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
595 	IOStream *stream = ctx->m_stream;
596 
597 	 unsigned char *ptr;
598 	 const size_t packetSize = 8 + 4;
599 	ptr = stream->alloc(packetSize);
600 	int tmp = OP_glDeleteShader;memcpy(ptr, &tmp, 4); ptr += 4;
601 	memcpy(ptr, &packetSize, 4);  ptr += 4;
602 
603 		memcpy(ptr, &shader, 4); ptr += 4;
604 }
605 
glDeleteTextures_enc(void * self,GLsizei n,const GLuint * textures)606 void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures)
607 {
608 
609 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
610 	IOStream *stream = ctx->m_stream;
611 
612 	const unsigned int __size_textures =  (n * sizeof(GLuint));
613 	 unsigned char *ptr;
614 	 const size_t packetSize = 8 + 4 + __size_textures + 1*4;
615 	ptr = stream->alloc(packetSize);
616 	int tmp = OP_glDeleteTextures;memcpy(ptr, &tmp, 4); ptr += 4;
617 	memcpy(ptr, &packetSize, 4);  ptr += 4;
618 
619 		memcpy(ptr, &n, 4); ptr += 4;
620 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
621 	memcpy(ptr, textures, __size_textures);ptr += __size_textures;
622 }
623 
glDepthFunc_enc(void * self,GLenum func)624 void glDepthFunc_enc(void *self , GLenum func)
625 {
626 
627 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
628 	IOStream *stream = ctx->m_stream;
629 
630 	 unsigned char *ptr;
631 	 const size_t packetSize = 8 + 4;
632 	ptr = stream->alloc(packetSize);
633 	int tmp = OP_glDepthFunc;memcpy(ptr, &tmp, 4); ptr += 4;
634 	memcpy(ptr, &packetSize, 4);  ptr += 4;
635 
636 		memcpy(ptr, &func, 4); ptr += 4;
637 }
638 
glDepthMask_enc(void * self,GLboolean flag)639 void glDepthMask_enc(void *self , GLboolean flag)
640 {
641 
642 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
643 	IOStream *stream = ctx->m_stream;
644 
645 	 unsigned char *ptr;
646 	 const size_t packetSize = 8 + 1;
647 	ptr = stream->alloc(packetSize);
648 	int tmp = OP_glDepthMask;memcpy(ptr, &tmp, 4); ptr += 4;
649 	memcpy(ptr, &packetSize, 4);  ptr += 4;
650 
651 		memcpy(ptr, &flag, 1); ptr += 1;
652 }
653 
glDepthRangef_enc(void * self,GLclampf zNear,GLclampf zFar)654 void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar)
655 {
656 
657 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
658 	IOStream *stream = ctx->m_stream;
659 
660 	 unsigned char *ptr;
661 	 const size_t packetSize = 8 + 4 + 4;
662 	ptr = stream->alloc(packetSize);
663 	int tmp = OP_glDepthRangef;memcpy(ptr, &tmp, 4); ptr += 4;
664 	memcpy(ptr, &packetSize, 4);  ptr += 4;
665 
666 		memcpy(ptr, &zNear, 4); ptr += 4;
667 		memcpy(ptr, &zFar, 4); ptr += 4;
668 }
669 
glDetachShader_enc(void * self,GLuint program,GLuint shader)670 void glDetachShader_enc(void *self , GLuint program, GLuint shader)
671 {
672 
673 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
674 	IOStream *stream = ctx->m_stream;
675 
676 	 unsigned char *ptr;
677 	 const size_t packetSize = 8 + 4 + 4;
678 	ptr = stream->alloc(packetSize);
679 	int tmp = OP_glDetachShader;memcpy(ptr, &tmp, 4); ptr += 4;
680 	memcpy(ptr, &packetSize, 4);  ptr += 4;
681 
682 		memcpy(ptr, &program, 4); ptr += 4;
683 		memcpy(ptr, &shader, 4); ptr += 4;
684 }
685 
glDisable_enc(void * self,GLenum cap)686 void glDisable_enc(void *self , GLenum cap)
687 {
688 
689 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
690 	IOStream *stream = ctx->m_stream;
691 
692 	 unsigned char *ptr;
693 	 const size_t packetSize = 8 + 4;
694 	ptr = stream->alloc(packetSize);
695 	int tmp = OP_glDisable;memcpy(ptr, &tmp, 4); ptr += 4;
696 	memcpy(ptr, &packetSize, 4);  ptr += 4;
697 
698 		memcpy(ptr, &cap, 4); ptr += 4;
699 }
700 
glDisableVertexAttribArray_enc(void * self,GLuint index)701 void glDisableVertexAttribArray_enc(void *self , GLuint index)
702 {
703 
704 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
705 	IOStream *stream = ctx->m_stream;
706 
707 	 unsigned char *ptr;
708 	 const size_t packetSize = 8 + 4;
709 	ptr = stream->alloc(packetSize);
710 	int tmp = OP_glDisableVertexAttribArray;memcpy(ptr, &tmp, 4); ptr += 4;
711 	memcpy(ptr, &packetSize, 4);  ptr += 4;
712 
713 		memcpy(ptr, &index, 4); ptr += 4;
714 }
715 
glDrawArrays_enc(void * self,GLenum mode,GLint first,GLsizei count)716 void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count)
717 {
718 
719 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
720 	IOStream *stream = ctx->m_stream;
721 
722 	 unsigned char *ptr;
723 	 const size_t packetSize = 8 + 4 + 4 + 4;
724 	ptr = stream->alloc(packetSize);
725 	int tmp = OP_glDrawArrays;memcpy(ptr, &tmp, 4); ptr += 4;
726 	memcpy(ptr, &packetSize, 4);  ptr += 4;
727 
728 		memcpy(ptr, &mode, 4); ptr += 4;
729 		memcpy(ptr, &first, 4); ptr += 4;
730 		memcpy(ptr, &count, 4); ptr += 4;
731 }
732 
glEnable_enc(void * self,GLenum cap)733 void glEnable_enc(void *self , GLenum cap)
734 {
735 
736 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
737 	IOStream *stream = ctx->m_stream;
738 
739 	 unsigned char *ptr;
740 	 const size_t packetSize = 8 + 4;
741 	ptr = stream->alloc(packetSize);
742 	int tmp = OP_glEnable;memcpy(ptr, &tmp, 4); ptr += 4;
743 	memcpy(ptr, &packetSize, 4);  ptr += 4;
744 
745 		memcpy(ptr, &cap, 4); ptr += 4;
746 }
747 
glEnableVertexAttribArray_enc(void * self,GLuint index)748 void glEnableVertexAttribArray_enc(void *self , GLuint index)
749 {
750 
751 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
752 	IOStream *stream = ctx->m_stream;
753 
754 	 unsigned char *ptr;
755 	 const size_t packetSize = 8 + 4;
756 	ptr = stream->alloc(packetSize);
757 	int tmp = OP_glEnableVertexAttribArray;memcpy(ptr, &tmp, 4); ptr += 4;
758 	memcpy(ptr, &packetSize, 4);  ptr += 4;
759 
760 		memcpy(ptr, &index, 4); ptr += 4;
761 }
762 
glFinish_enc(void * self)763 void glFinish_enc(void *self )
764 {
765 
766 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
767 	IOStream *stream = ctx->m_stream;
768 
769 	 unsigned char *ptr;
770 	 const size_t packetSize = 8;
771 	ptr = stream->alloc(packetSize);
772 	int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
773 	memcpy(ptr, &packetSize, 4);  ptr += 4;
774 
775 }
776 
glFlush_enc(void * self)777 void glFlush_enc(void *self )
778 {
779 
780 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
781 	IOStream *stream = ctx->m_stream;
782 
783 	 unsigned char *ptr;
784 	 const size_t packetSize = 8;
785 	ptr = stream->alloc(packetSize);
786 	int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
787 	memcpy(ptr, &packetSize, 4);  ptr += 4;
788 
789 }
790 
glFramebufferRenderbuffer_enc(void * self,GLenum target,GLenum attachment,GLenum renderbuffertarget,GLuint renderbuffer)791 void glFramebufferRenderbuffer_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
792 {
793 
794 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
795 	IOStream *stream = ctx->m_stream;
796 
797 	 unsigned char *ptr;
798 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
799 	ptr = stream->alloc(packetSize);
800 	int tmp = OP_glFramebufferRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
801 	memcpy(ptr, &packetSize, 4);  ptr += 4;
802 
803 		memcpy(ptr, &target, 4); ptr += 4;
804 		memcpy(ptr, &attachment, 4); ptr += 4;
805 		memcpy(ptr, &renderbuffertarget, 4); ptr += 4;
806 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
807 }
808 
glFramebufferTexture2D_enc(void * self,GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level)809 void glFramebufferTexture2D_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
810 {
811 
812 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
813 	IOStream *stream = ctx->m_stream;
814 
815 	 unsigned char *ptr;
816 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
817 	ptr = stream->alloc(packetSize);
818 	int tmp = OP_glFramebufferTexture2D;memcpy(ptr, &tmp, 4); ptr += 4;
819 	memcpy(ptr, &packetSize, 4);  ptr += 4;
820 
821 		memcpy(ptr, &target, 4); ptr += 4;
822 		memcpy(ptr, &attachment, 4); ptr += 4;
823 		memcpy(ptr, &textarget, 4); ptr += 4;
824 		memcpy(ptr, &texture, 4); ptr += 4;
825 		memcpy(ptr, &level, 4); ptr += 4;
826 }
827 
glFrontFace_enc(void * self,GLenum mode)828 void glFrontFace_enc(void *self , GLenum mode)
829 {
830 
831 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
832 	IOStream *stream = ctx->m_stream;
833 
834 	 unsigned char *ptr;
835 	 const size_t packetSize = 8 + 4;
836 	ptr = stream->alloc(packetSize);
837 	int tmp = OP_glFrontFace;memcpy(ptr, &tmp, 4); ptr += 4;
838 	memcpy(ptr, &packetSize, 4);  ptr += 4;
839 
840 		memcpy(ptr, &mode, 4); ptr += 4;
841 }
842 
glGenBuffers_enc(void * self,GLsizei n,GLuint * buffers)843 void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers)
844 {
845 
846 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
847 	IOStream *stream = ctx->m_stream;
848 
849 	const unsigned int __size_buffers =  (n * sizeof(GLuint));
850 	 unsigned char *ptr;
851 	 const size_t packetSize = 8 + 4 + __size_buffers + 1*4;
852 	ptr = stream->alloc(packetSize);
853 	int tmp = OP_glGenBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
854 	memcpy(ptr, &packetSize, 4);  ptr += 4;
855 
856 		memcpy(ptr, &n, 4); ptr += 4;
857 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
858 	stream->readback(buffers, __size_buffers);
859 }
860 
glGenerateMipmap_enc(void * self,GLenum target)861 void glGenerateMipmap_enc(void *self , GLenum target)
862 {
863 
864 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
865 	IOStream *stream = ctx->m_stream;
866 
867 	 unsigned char *ptr;
868 	 const size_t packetSize = 8 + 4;
869 	ptr = stream->alloc(packetSize);
870 	int tmp = OP_glGenerateMipmap;memcpy(ptr, &tmp, 4); ptr += 4;
871 	memcpy(ptr, &packetSize, 4);  ptr += 4;
872 
873 		memcpy(ptr, &target, 4); ptr += 4;
874 }
875 
glGenFramebuffers_enc(void * self,GLsizei n,GLuint * framebuffers)876 void glGenFramebuffers_enc(void *self , GLsizei n, GLuint* framebuffers)
877 {
878 
879 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
880 	IOStream *stream = ctx->m_stream;
881 
882 	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
883 	 unsigned char *ptr;
884 	 const size_t packetSize = 8 + 4 + __size_framebuffers + 1*4;
885 	ptr = stream->alloc(packetSize);
886 	int tmp = OP_glGenFramebuffers;memcpy(ptr, &tmp, 4); ptr += 4;
887 	memcpy(ptr, &packetSize, 4);  ptr += 4;
888 
889 		memcpy(ptr, &n, 4); ptr += 4;
890 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
891 	stream->readback(framebuffers, __size_framebuffers);
892 }
893 
glGenRenderbuffers_enc(void * self,GLsizei n,GLuint * renderbuffers)894 void glGenRenderbuffers_enc(void *self , GLsizei n, GLuint* renderbuffers)
895 {
896 
897 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
898 	IOStream *stream = ctx->m_stream;
899 
900 	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
901 	 unsigned char *ptr;
902 	 const size_t packetSize = 8 + 4 + __size_renderbuffers + 1*4;
903 	ptr = stream->alloc(packetSize);
904 	int tmp = OP_glGenRenderbuffers;memcpy(ptr, &tmp, 4); ptr += 4;
905 	memcpy(ptr, &packetSize, 4);  ptr += 4;
906 
907 		memcpy(ptr, &n, 4); ptr += 4;
908 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
909 	stream->readback(renderbuffers, __size_renderbuffers);
910 }
911 
glGenTextures_enc(void * self,GLsizei n,GLuint * textures)912 void glGenTextures_enc(void *self , GLsizei n, GLuint* textures)
913 {
914 
915 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
916 	IOStream *stream = ctx->m_stream;
917 
918 	const unsigned int __size_textures =  (n * sizeof(GLuint));
919 	 unsigned char *ptr;
920 	 const size_t packetSize = 8 + 4 + __size_textures + 1*4;
921 	ptr = stream->alloc(packetSize);
922 	int tmp = OP_glGenTextures;memcpy(ptr, &tmp, 4); ptr += 4;
923 	memcpy(ptr, &packetSize, 4);  ptr += 4;
924 
925 		memcpy(ptr, &n, 4); ptr += 4;
926 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
927 	stream->readback(textures, __size_textures);
928 }
929 
glGetActiveAttrib_enc(void * self,GLuint program,GLuint index,GLsizei bufsize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)930 void glGetActiveAttrib_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
931 {
932 
933 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
934 	IOStream *stream = ctx->m_stream;
935 
936 	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
937 	const unsigned int __size_size =  (sizeof(GLint));
938 	const unsigned int __size_type =  (sizeof(GLenum));
939 	const unsigned int __size_name = ((name != NULL) ?  bufsize : 0);
940 	 unsigned char *ptr;
941 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_length + __size_size + __size_type + __size_name + 4*4;
942 	ptr = stream->alloc(packetSize);
943 	int tmp = OP_glGetActiveAttrib;memcpy(ptr, &tmp, 4); ptr += 4;
944 	memcpy(ptr, &packetSize, 4);  ptr += 4;
945 
946 		memcpy(ptr, &program, 4); ptr += 4;
947 		memcpy(ptr, &index, 4); ptr += 4;
948 		memcpy(ptr, &bufsize, 4); ptr += 4;
949 	*(unsigned int *)(ptr) = __size_length; ptr += 4;
950 	*(unsigned int *)(ptr) = __size_size; ptr += 4;
951 	*(unsigned int *)(ptr) = __size_type; ptr += 4;
952 	*(unsigned int *)(ptr) = __size_name; ptr += 4;
953 	if (length != NULL) stream->readback(length, __size_length);
954 	stream->readback(size, __size_size);
955 	stream->readback(type, __size_type);
956 	if (name != NULL) stream->readback(name, __size_name);
957 }
958 
glGetActiveUniform_enc(void * self,GLuint program,GLuint index,GLsizei bufsize,GLsizei * length,GLint * size,GLenum * type,GLchar * name)959 void glGetActiveUniform_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
960 {
961 
962 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
963 	IOStream *stream = ctx->m_stream;
964 
965 	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
966 	const unsigned int __size_size =  (sizeof(GLint));
967 	const unsigned int __size_type =  (sizeof(GLenum));
968 	const unsigned int __size_name = ((name != NULL) ?  bufsize : 0);
969 	 unsigned char *ptr;
970 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_length + __size_size + __size_type + __size_name + 4*4;
971 	ptr = stream->alloc(packetSize);
972 	int tmp = OP_glGetActiveUniform;memcpy(ptr, &tmp, 4); ptr += 4;
973 	memcpy(ptr, &packetSize, 4);  ptr += 4;
974 
975 		memcpy(ptr, &program, 4); ptr += 4;
976 		memcpy(ptr, &index, 4); ptr += 4;
977 		memcpy(ptr, &bufsize, 4); ptr += 4;
978 	*(unsigned int *)(ptr) = __size_length; ptr += 4;
979 	*(unsigned int *)(ptr) = __size_size; ptr += 4;
980 	*(unsigned int *)(ptr) = __size_type; ptr += 4;
981 	*(unsigned int *)(ptr) = __size_name; ptr += 4;
982 	if (length != NULL) stream->readback(length, __size_length);
983 	stream->readback(size, __size_size);
984 	stream->readback(type, __size_type);
985 	if (name != NULL) stream->readback(name, __size_name);
986 }
987 
glGetAttachedShaders_enc(void * self,GLuint program,GLsizei maxcount,GLsizei * count,GLuint * shaders)988 void glGetAttachedShaders_enc(void *self , GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
989 {
990 
991 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
992 	IOStream *stream = ctx->m_stream;
993 
994 	const unsigned int __size_count = ((count != NULL) ?  (sizeof(GLsizei)) : 0);
995 	const unsigned int __size_shaders =  (maxcount*sizeof(GLuint));
996 	 unsigned char *ptr;
997 	 const size_t packetSize = 8 + 4 + 4 + __size_count + __size_shaders + 2*4;
998 	ptr = stream->alloc(packetSize);
999 	int tmp = OP_glGetAttachedShaders;memcpy(ptr, &tmp, 4); ptr += 4;
1000 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1001 
1002 		memcpy(ptr, &program, 4); ptr += 4;
1003 		memcpy(ptr, &maxcount, 4); ptr += 4;
1004 	*(unsigned int *)(ptr) = __size_count; ptr += 4;
1005 	*(unsigned int *)(ptr) = __size_shaders; ptr += 4;
1006 	if (count != NULL) stream->readback(count, __size_count);
1007 	stream->readback(shaders, __size_shaders);
1008 }
1009 
glGetAttribLocation_enc(void * self,GLuint program,const GLchar * name)1010 int glGetAttribLocation_enc(void *self , GLuint program, const GLchar* name)
1011 {
1012 
1013 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1014 	IOStream *stream = ctx->m_stream;
1015 
1016 	const unsigned int __size_name =  (strlen(name) + 1);
1017 	 unsigned char *ptr;
1018 	 const size_t packetSize = 8 + 4 + __size_name + 1*4;
1019 	ptr = stream->alloc(packetSize);
1020 	int tmp = OP_glGetAttribLocation;memcpy(ptr, &tmp, 4); ptr += 4;
1021 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1022 
1023 		memcpy(ptr, &program, 4); ptr += 4;
1024 	*(unsigned int *)(ptr) = __size_name; ptr += 4;
1025 	memcpy(ptr, name, __size_name);ptr += __size_name;
1026 
1027 	int retval;
1028 	stream->readback(&retval, 4);
1029 	return retval;
1030 }
1031 
glGetBooleanv_enc(void * self,GLenum pname,GLboolean * params)1032 void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params)
1033 {
1034 
1035 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1036 	IOStream *stream = ctx->m_stream;
1037 
1038 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLboolean));
1039 	 unsigned char *ptr;
1040 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1041 	ptr = stream->alloc(packetSize);
1042 	int tmp = OP_glGetBooleanv;memcpy(ptr, &tmp, 4); ptr += 4;
1043 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1044 
1045 		memcpy(ptr, &pname, 4); ptr += 4;
1046 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1047 	stream->readback(params, __size_params);
1048 }
1049 
glGetBufferParameteriv_enc(void * self,GLenum target,GLenum pname,GLint * params)1050 void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
1051 {
1052 
1053 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1054 	IOStream *stream = ctx->m_stream;
1055 
1056 	const unsigned int __size_params =  (sizeof(GLint));
1057 	 unsigned char *ptr;
1058 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1059 	ptr = stream->alloc(packetSize);
1060 	int tmp = OP_glGetBufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
1061 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1062 
1063 		memcpy(ptr, &target, 4); ptr += 4;
1064 		memcpy(ptr, &pname, 4); ptr += 4;
1065 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1066 	stream->readback(params, __size_params);
1067 }
1068 
glGetError_enc(void * self)1069 GLenum glGetError_enc(void *self )
1070 {
1071 
1072 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1073 	IOStream *stream = ctx->m_stream;
1074 
1075 	 unsigned char *ptr;
1076 	 const size_t packetSize = 8;
1077 	ptr = stream->alloc(packetSize);
1078 	int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
1079 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1080 
1081 
1082 	GLenum retval;
1083 	stream->readback(&retval, 4);
1084 	return retval;
1085 }
1086 
glGetFloatv_enc(void * self,GLenum pname,GLfloat * params)1087 void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params)
1088 {
1089 
1090 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1091 	IOStream *stream = ctx->m_stream;
1092 
1093 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
1094 	 unsigned char *ptr;
1095 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1096 	ptr = stream->alloc(packetSize);
1097 	int tmp = OP_glGetFloatv;memcpy(ptr, &tmp, 4); ptr += 4;
1098 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1099 
1100 		memcpy(ptr, &pname, 4); ptr += 4;
1101 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1102 	stream->readback(params, __size_params);
1103 }
1104 
glGetFramebufferAttachmentParameteriv_enc(void * self,GLenum target,GLenum attachment,GLenum pname,GLint * params)1105 void glGetFramebufferAttachmentParameteriv_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params)
1106 {
1107 
1108 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1109 	IOStream *stream = ctx->m_stream;
1110 
1111 	const unsigned int __size_params =  (sizeof(GLint));
1112 	 unsigned char *ptr;
1113 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_params + 1*4;
1114 	ptr = stream->alloc(packetSize);
1115 	int tmp = OP_glGetFramebufferAttachmentParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
1116 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1117 
1118 		memcpy(ptr, &target, 4); ptr += 4;
1119 		memcpy(ptr, &attachment, 4); ptr += 4;
1120 		memcpy(ptr, &pname, 4); ptr += 4;
1121 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1122 	stream->readback(params, __size_params);
1123 }
1124 
glGetIntegerv_enc(void * self,GLenum pname,GLint * params)1125 void glGetIntegerv_enc(void *self , GLenum pname, GLint* params)
1126 {
1127 
1128 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1129 	IOStream *stream = ctx->m_stream;
1130 
1131 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
1132 	 unsigned char *ptr;
1133 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1134 	ptr = stream->alloc(packetSize);
1135 	int tmp = OP_glGetIntegerv;memcpy(ptr, &tmp, 4); ptr += 4;
1136 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1137 
1138 		memcpy(ptr, &pname, 4); ptr += 4;
1139 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1140 	stream->readback(params, __size_params);
1141 }
1142 
glGetProgramiv_enc(void * self,GLuint program,GLenum pname,GLint * params)1143 void glGetProgramiv_enc(void *self , GLuint program, GLenum pname, GLint* params)
1144 {
1145 
1146 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1147 	IOStream *stream = ctx->m_stream;
1148 
1149 	const unsigned int __size_params =  sizeof(GLint);
1150 	 unsigned char *ptr;
1151 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1152 	ptr = stream->alloc(packetSize);
1153 	int tmp = OP_glGetProgramiv;memcpy(ptr, &tmp, 4); ptr += 4;
1154 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1155 
1156 		memcpy(ptr, &program, 4); ptr += 4;
1157 		memcpy(ptr, &pname, 4); ptr += 4;
1158 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1159 	stream->readback(params, __size_params);
1160 }
1161 
glGetProgramInfoLog_enc(void * self,GLuint program,GLsizei bufsize,GLsizei * length,GLchar * infolog)1162 void glGetProgramInfoLog_enc(void *self , GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
1163 {
1164 
1165 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1166 	IOStream *stream = ctx->m_stream;
1167 
1168 	const unsigned int __size_length = ((length != NULL) ?  sizeof(GLsizei) : 0);
1169 	const unsigned int __size_infolog =  bufsize;
1170 	 unsigned char *ptr;
1171 	 const size_t packetSize = 8 + 4 + 4 + __size_length + __size_infolog + 2*4;
1172 	ptr = stream->alloc(packetSize);
1173 	int tmp = OP_glGetProgramInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
1174 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1175 
1176 		memcpy(ptr, &program, 4); ptr += 4;
1177 		memcpy(ptr, &bufsize, 4); ptr += 4;
1178 	*(unsigned int *)(ptr) = __size_length; ptr += 4;
1179 	*(unsigned int *)(ptr) = __size_infolog; ptr += 4;
1180 	if (length != NULL) stream->readback(length, __size_length);
1181 	stream->readback(infolog, __size_infolog);
1182 }
1183 
glGetRenderbufferParameteriv_enc(void * self,GLenum target,GLenum pname,GLint * params)1184 void glGetRenderbufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
1185 {
1186 
1187 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1188 	IOStream *stream = ctx->m_stream;
1189 
1190 	const unsigned int __size_params =  sizeof(GLint);
1191 	 unsigned char *ptr;
1192 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1193 	ptr = stream->alloc(packetSize);
1194 	int tmp = OP_glGetRenderbufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
1195 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1196 
1197 		memcpy(ptr, &target, 4); ptr += 4;
1198 		memcpy(ptr, &pname, 4); ptr += 4;
1199 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1200 	stream->readback(params, __size_params);
1201 }
1202 
glGetShaderiv_enc(void * self,GLuint shader,GLenum pname,GLint * params)1203 void glGetShaderiv_enc(void *self , GLuint shader, GLenum pname, GLint* params)
1204 {
1205 
1206 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1207 	IOStream *stream = ctx->m_stream;
1208 
1209 	const unsigned int __size_params =  sizeof(GLint);
1210 	 unsigned char *ptr;
1211 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1212 	ptr = stream->alloc(packetSize);
1213 	int tmp = OP_glGetShaderiv;memcpy(ptr, &tmp, 4); ptr += 4;
1214 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1215 
1216 		memcpy(ptr, &shader, 4); ptr += 4;
1217 		memcpy(ptr, &pname, 4); ptr += 4;
1218 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1219 	stream->readback(params, __size_params);
1220 }
1221 
glGetShaderInfoLog_enc(void * self,GLuint shader,GLsizei bufsize,GLsizei * length,GLchar * infolog)1222 void glGetShaderInfoLog_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
1223 {
1224 
1225 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1226 	IOStream *stream = ctx->m_stream;
1227 
1228 	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
1229 	const unsigned int __size_infolog =  bufsize;
1230 	 unsigned char *ptr;
1231 	 const size_t packetSize = 8 + 4 + 4 + __size_length + __size_infolog + 2*4;
1232 	ptr = stream->alloc(packetSize);
1233 	int tmp = OP_glGetShaderInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
1234 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1235 
1236 		memcpy(ptr, &shader, 4); ptr += 4;
1237 		memcpy(ptr, &bufsize, 4); ptr += 4;
1238 	*(unsigned int *)(ptr) = __size_length; ptr += 4;
1239 	*(unsigned int *)(ptr) = __size_infolog; ptr += 4;
1240 	if (length != NULL) stream->readback(length, __size_length);
1241 	stream->readback(infolog, __size_infolog);
1242 }
1243 
glGetShaderPrecisionFormat_enc(void * self,GLenum shadertype,GLenum precisiontype,GLint * range,GLint * precision)1244 void glGetShaderPrecisionFormat_enc(void *self , GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
1245 {
1246 
1247 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1248 	IOStream *stream = ctx->m_stream;
1249 
1250 	const unsigned int __size_range =  (2 * sizeof(GLint));
1251 	const unsigned int __size_precision =  (sizeof(GLint));
1252 	 unsigned char *ptr;
1253 	 const size_t packetSize = 8 + 4 + 4 + __size_range + __size_precision + 2*4;
1254 	ptr = stream->alloc(packetSize);
1255 	int tmp = OP_glGetShaderPrecisionFormat;memcpy(ptr, &tmp, 4); ptr += 4;
1256 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1257 
1258 		memcpy(ptr, &shadertype, 4); ptr += 4;
1259 		memcpy(ptr, &precisiontype, 4); ptr += 4;
1260 	*(unsigned int *)(ptr) = __size_range; ptr += 4;
1261 	*(unsigned int *)(ptr) = __size_precision; ptr += 4;
1262 	stream->readback(range, __size_range);
1263 	stream->readback(precision, __size_precision);
1264 }
1265 
glGetShaderSource_enc(void * self,GLuint shader,GLsizei bufsize,GLsizei * length,GLchar * source)1266 void glGetShaderSource_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
1267 {
1268 
1269 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1270 	IOStream *stream = ctx->m_stream;
1271 
1272 	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
1273 	const unsigned int __size_source =  bufsize;
1274 	 unsigned char *ptr;
1275 	 const size_t packetSize = 8 + 4 + 4 + __size_length + __size_source + 2*4;
1276 	ptr = stream->alloc(packetSize);
1277 	int tmp = OP_glGetShaderSource;memcpy(ptr, &tmp, 4); ptr += 4;
1278 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1279 
1280 		memcpy(ptr, &shader, 4); ptr += 4;
1281 		memcpy(ptr, &bufsize, 4); ptr += 4;
1282 	*(unsigned int *)(ptr) = __size_length; ptr += 4;
1283 	*(unsigned int *)(ptr) = __size_source; ptr += 4;
1284 	if (length != NULL) stream->readback(length, __size_length);
1285 	stream->readback(source, __size_source);
1286 }
1287 
glGetTexParameterfv_enc(void * self,GLenum target,GLenum pname,GLfloat * params)1288 void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params)
1289 {
1290 
1291 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1292 	IOStream *stream = ctx->m_stream;
1293 
1294 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
1295 	 unsigned char *ptr;
1296 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1297 	ptr = stream->alloc(packetSize);
1298 	int tmp = OP_glGetTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
1299 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1300 
1301 		memcpy(ptr, &target, 4); ptr += 4;
1302 		memcpy(ptr, &pname, 4); ptr += 4;
1303 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1304 	stream->readback(params, __size_params);
1305 }
1306 
glGetTexParameteriv_enc(void * self,GLenum target,GLenum pname,GLint * params)1307 void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
1308 {
1309 
1310 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1311 	IOStream *stream = ctx->m_stream;
1312 
1313 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
1314 	 unsigned char *ptr;
1315 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1316 	ptr = stream->alloc(packetSize);
1317 	int tmp = OP_glGetTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
1318 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1319 
1320 		memcpy(ptr, &target, 4); ptr += 4;
1321 		memcpy(ptr, &pname, 4); ptr += 4;
1322 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1323 	stream->readback(params, __size_params);
1324 }
1325 
glGetUniformfv_enc(void * self,GLuint program,GLint location,GLfloat * params)1326 void glGetUniformfv_enc(void *self , GLuint program, GLint location, GLfloat* params)
1327 {
1328 
1329 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1330 	IOStream *stream = ctx->m_stream;
1331 
1332 	const unsigned int __size_params =  glSizeof(glesv2_enc::uniformType(self, program, location));
1333 	 unsigned char *ptr;
1334 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1335 	ptr = stream->alloc(packetSize);
1336 	int tmp = OP_glGetUniformfv;memcpy(ptr, &tmp, 4); ptr += 4;
1337 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1338 
1339 		memcpy(ptr, &program, 4); ptr += 4;
1340 		memcpy(ptr, &location, 4); ptr += 4;
1341 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1342 	stream->readback(params, __size_params);
1343 }
1344 
glGetUniformiv_enc(void * self,GLuint program,GLint location,GLint * params)1345 void glGetUniformiv_enc(void *self , GLuint program, GLint location, GLint* params)
1346 {
1347 
1348 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1349 	IOStream *stream = ctx->m_stream;
1350 
1351 	const unsigned int __size_params =  glSizeof(glesv2_enc::uniformType(self, program, location));
1352 	 unsigned char *ptr;
1353 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1354 	ptr = stream->alloc(packetSize);
1355 	int tmp = OP_glGetUniformiv;memcpy(ptr, &tmp, 4); ptr += 4;
1356 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1357 
1358 		memcpy(ptr, &program, 4); ptr += 4;
1359 		memcpy(ptr, &location, 4); ptr += 4;
1360 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1361 	stream->readback(params, __size_params);
1362 }
1363 
glGetUniformLocation_enc(void * self,GLuint program,const GLchar * name)1364 int glGetUniformLocation_enc(void *self , GLuint program, const GLchar* name)
1365 {
1366 
1367 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1368 	IOStream *stream = ctx->m_stream;
1369 
1370 	const unsigned int __size_name =  (strlen(name) + 1);
1371 	 unsigned char *ptr;
1372 	 const size_t packetSize = 8 + 4 + __size_name + 1*4;
1373 	ptr = stream->alloc(packetSize);
1374 	int tmp = OP_glGetUniformLocation;memcpy(ptr, &tmp, 4); ptr += 4;
1375 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1376 
1377 		memcpy(ptr, &program, 4); ptr += 4;
1378 	*(unsigned int *)(ptr) = __size_name; ptr += 4;
1379 	memcpy(ptr, name, __size_name);ptr += __size_name;
1380 
1381 	int retval;
1382 	stream->readback(&retval, 4);
1383 	return retval;
1384 }
1385 
glGetVertexAttribfv_enc(void * self,GLuint index,GLenum pname,GLfloat * params)1386 void glGetVertexAttribfv_enc(void *self , GLuint index, GLenum pname, GLfloat* params)
1387 {
1388 
1389 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1390 	IOStream *stream = ctx->m_stream;
1391 
1392 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
1393 	 unsigned char *ptr;
1394 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1395 	ptr = stream->alloc(packetSize);
1396 	int tmp = OP_glGetVertexAttribfv;memcpy(ptr, &tmp, 4); ptr += 4;
1397 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1398 
1399 		memcpy(ptr, &index, 4); ptr += 4;
1400 		memcpy(ptr, &pname, 4); ptr += 4;
1401 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1402 	stream->readback(params, __size_params);
1403 }
1404 
glGetVertexAttribiv_enc(void * self,GLuint index,GLenum pname,GLint * params)1405 void glGetVertexAttribiv_enc(void *self , GLuint index, GLenum pname, GLint* params)
1406 {
1407 
1408 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1409 	IOStream *stream = ctx->m_stream;
1410 
1411 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
1412 	 unsigned char *ptr;
1413 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1414 	ptr = stream->alloc(packetSize);
1415 	int tmp = OP_glGetVertexAttribiv;memcpy(ptr, &tmp, 4); ptr += 4;
1416 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1417 
1418 		memcpy(ptr, &index, 4); ptr += 4;
1419 		memcpy(ptr, &pname, 4); ptr += 4;
1420 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1421 	stream->readback(params, __size_params);
1422 }
1423 
glHint_enc(void * self,GLenum target,GLenum mode)1424 void glHint_enc(void *self , GLenum target, GLenum mode)
1425 {
1426 
1427 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1428 	IOStream *stream = ctx->m_stream;
1429 
1430 	 unsigned char *ptr;
1431 	 const size_t packetSize = 8 + 4 + 4;
1432 	ptr = stream->alloc(packetSize);
1433 	int tmp = OP_glHint;memcpy(ptr, &tmp, 4); ptr += 4;
1434 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1435 
1436 		memcpy(ptr, &target, 4); ptr += 4;
1437 		memcpy(ptr, &mode, 4); ptr += 4;
1438 }
1439 
glIsBuffer_enc(void * self,GLuint buffer)1440 GLboolean glIsBuffer_enc(void *self , GLuint buffer)
1441 {
1442 
1443 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1444 	IOStream *stream = ctx->m_stream;
1445 
1446 	 unsigned char *ptr;
1447 	 const size_t packetSize = 8 + 4;
1448 	ptr = stream->alloc(packetSize);
1449 	int tmp = OP_glIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
1450 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1451 
1452 		memcpy(ptr, &buffer, 4); ptr += 4;
1453 
1454 	GLboolean retval;
1455 	stream->readback(&retval, 1);
1456 	return retval;
1457 }
1458 
glIsEnabled_enc(void * self,GLenum cap)1459 GLboolean glIsEnabled_enc(void *self , GLenum cap)
1460 {
1461 
1462 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1463 	IOStream *stream = ctx->m_stream;
1464 
1465 	 unsigned char *ptr;
1466 	 const size_t packetSize = 8 + 4;
1467 	ptr = stream->alloc(packetSize);
1468 	int tmp = OP_glIsEnabled;memcpy(ptr, &tmp, 4); ptr += 4;
1469 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1470 
1471 		memcpy(ptr, &cap, 4); ptr += 4;
1472 
1473 	GLboolean retval;
1474 	stream->readback(&retval, 1);
1475 	return retval;
1476 }
1477 
glIsFramebuffer_enc(void * self,GLuint framebuffer)1478 GLboolean glIsFramebuffer_enc(void *self , GLuint framebuffer)
1479 {
1480 
1481 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1482 	IOStream *stream = ctx->m_stream;
1483 
1484 	 unsigned char *ptr;
1485 	 const size_t packetSize = 8 + 4;
1486 	ptr = stream->alloc(packetSize);
1487 	int tmp = OP_glIsFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
1488 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1489 
1490 		memcpy(ptr, &framebuffer, 4); ptr += 4;
1491 
1492 	GLboolean retval;
1493 	stream->readback(&retval, 1);
1494 	return retval;
1495 }
1496 
glIsProgram_enc(void * self,GLuint program)1497 GLboolean glIsProgram_enc(void *self , GLuint program)
1498 {
1499 
1500 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1501 	IOStream *stream = ctx->m_stream;
1502 
1503 	 unsigned char *ptr;
1504 	 const size_t packetSize = 8 + 4;
1505 	ptr = stream->alloc(packetSize);
1506 	int tmp = OP_glIsProgram;memcpy(ptr, &tmp, 4); ptr += 4;
1507 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1508 
1509 		memcpy(ptr, &program, 4); ptr += 4;
1510 
1511 	GLboolean retval;
1512 	stream->readback(&retval, 1);
1513 	return retval;
1514 }
1515 
glIsRenderbuffer_enc(void * self,GLuint renderbuffer)1516 GLboolean glIsRenderbuffer_enc(void *self , GLuint renderbuffer)
1517 {
1518 
1519 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1520 	IOStream *stream = ctx->m_stream;
1521 
1522 	 unsigned char *ptr;
1523 	 const size_t packetSize = 8 + 4;
1524 	ptr = stream->alloc(packetSize);
1525 	int tmp = OP_glIsRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
1526 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1527 
1528 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
1529 
1530 	GLboolean retval;
1531 	stream->readback(&retval, 1);
1532 	return retval;
1533 }
1534 
glIsShader_enc(void * self,GLuint shader)1535 GLboolean glIsShader_enc(void *self , GLuint shader)
1536 {
1537 
1538 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1539 	IOStream *stream = ctx->m_stream;
1540 
1541 	 unsigned char *ptr;
1542 	 const size_t packetSize = 8 + 4;
1543 	ptr = stream->alloc(packetSize);
1544 	int tmp = OP_glIsShader;memcpy(ptr, &tmp, 4); ptr += 4;
1545 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1546 
1547 		memcpy(ptr, &shader, 4); ptr += 4;
1548 
1549 	GLboolean retval;
1550 	stream->readback(&retval, 1);
1551 	return retval;
1552 }
1553 
glIsTexture_enc(void * self,GLuint texture)1554 GLboolean glIsTexture_enc(void *self , GLuint texture)
1555 {
1556 
1557 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1558 	IOStream *stream = ctx->m_stream;
1559 
1560 	 unsigned char *ptr;
1561 	 const size_t packetSize = 8 + 4;
1562 	ptr = stream->alloc(packetSize);
1563 	int tmp = OP_glIsTexture;memcpy(ptr, &tmp, 4); ptr += 4;
1564 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1565 
1566 		memcpy(ptr, &texture, 4); ptr += 4;
1567 
1568 	GLboolean retval;
1569 	stream->readback(&retval, 1);
1570 	return retval;
1571 }
1572 
glLineWidth_enc(void * self,GLfloat width)1573 void glLineWidth_enc(void *self , GLfloat width)
1574 {
1575 
1576 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1577 	IOStream *stream = ctx->m_stream;
1578 
1579 	 unsigned char *ptr;
1580 	 const size_t packetSize = 8 + 4;
1581 	ptr = stream->alloc(packetSize);
1582 	int tmp = OP_glLineWidth;memcpy(ptr, &tmp, 4); ptr += 4;
1583 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1584 
1585 		memcpy(ptr, &width, 4); ptr += 4;
1586 }
1587 
glLinkProgram_enc(void * self,GLuint program)1588 void glLinkProgram_enc(void *self , GLuint program)
1589 {
1590 
1591 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1592 	IOStream *stream = ctx->m_stream;
1593 
1594 	 unsigned char *ptr;
1595 	 const size_t packetSize = 8 + 4;
1596 	ptr = stream->alloc(packetSize);
1597 	int tmp = OP_glLinkProgram;memcpy(ptr, &tmp, 4); ptr += 4;
1598 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1599 
1600 		memcpy(ptr, &program, 4); ptr += 4;
1601 }
1602 
glPixelStorei_enc(void * self,GLenum pname,GLint param)1603 void glPixelStorei_enc(void *self , GLenum pname, GLint param)
1604 {
1605 
1606 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1607 	IOStream *stream = ctx->m_stream;
1608 
1609 	 unsigned char *ptr;
1610 	 const size_t packetSize = 8 + 4 + 4;
1611 	ptr = stream->alloc(packetSize);
1612 	int tmp = OP_glPixelStorei;memcpy(ptr, &tmp, 4); ptr += 4;
1613 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1614 
1615 		memcpy(ptr, &pname, 4); ptr += 4;
1616 		memcpy(ptr, &param, 4); ptr += 4;
1617 }
1618 
glPolygonOffset_enc(void * self,GLfloat factor,GLfloat units)1619 void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units)
1620 {
1621 
1622 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1623 	IOStream *stream = ctx->m_stream;
1624 
1625 	 unsigned char *ptr;
1626 	 const size_t packetSize = 8 + 4 + 4;
1627 	ptr = stream->alloc(packetSize);
1628 	int tmp = OP_glPolygonOffset;memcpy(ptr, &tmp, 4); ptr += 4;
1629 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1630 
1631 		memcpy(ptr, &factor, 4); ptr += 4;
1632 		memcpy(ptr, &units, 4); ptr += 4;
1633 }
1634 
glReadPixels_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,GLvoid * pixels)1635 void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
1636 {
1637 
1638 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1639 	IOStream *stream = ctx->m_stream;
1640 
1641 	const unsigned int __size_pixels =  glesv2_enc::pixelDataSize(self, width, height, format, type, 1);
1642 	 unsigned char *ptr;
1643 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
1644 	ptr = stream->alloc(packetSize);
1645 	int tmp = OP_glReadPixels;memcpy(ptr, &tmp, 4); ptr += 4;
1646 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1647 
1648 		memcpy(ptr, &x, 4); ptr += 4;
1649 		memcpy(ptr, &y, 4); ptr += 4;
1650 		memcpy(ptr, &width, 4); ptr += 4;
1651 		memcpy(ptr, &height, 4); ptr += 4;
1652 		memcpy(ptr, &format, 4); ptr += 4;
1653 		memcpy(ptr, &type, 4); ptr += 4;
1654 	*(unsigned int *)(ptr) = __size_pixels; ptr += 4;
1655 	stream->readback(pixels, __size_pixels);
1656 }
1657 
glReleaseShaderCompiler_enc(void * self)1658 void glReleaseShaderCompiler_enc(void *self )
1659 {
1660 
1661 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1662 	IOStream *stream = ctx->m_stream;
1663 
1664 	 unsigned char *ptr;
1665 	 const size_t packetSize = 8;
1666 	ptr = stream->alloc(packetSize);
1667 	int tmp = OP_glReleaseShaderCompiler;memcpy(ptr, &tmp, 4); ptr += 4;
1668 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1669 
1670 }
1671 
glRenderbufferStorage_enc(void * self,GLenum target,GLenum internalformat,GLsizei width,GLsizei height)1672 void glRenderbufferStorage_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
1673 {
1674 
1675 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1676 	IOStream *stream = ctx->m_stream;
1677 
1678 	 unsigned char *ptr;
1679 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
1680 	ptr = stream->alloc(packetSize);
1681 	int tmp = OP_glRenderbufferStorage;memcpy(ptr, &tmp, 4); ptr += 4;
1682 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1683 
1684 		memcpy(ptr, &target, 4); ptr += 4;
1685 		memcpy(ptr, &internalformat, 4); ptr += 4;
1686 		memcpy(ptr, &width, 4); ptr += 4;
1687 		memcpy(ptr, &height, 4); ptr += 4;
1688 }
1689 
glSampleCoverage_enc(void * self,GLclampf value,GLboolean invert)1690 void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert)
1691 {
1692 
1693 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1694 	IOStream *stream = ctx->m_stream;
1695 
1696 	 unsigned char *ptr;
1697 	 const size_t packetSize = 8 + 4 + 1;
1698 	ptr = stream->alloc(packetSize);
1699 	int tmp = OP_glSampleCoverage;memcpy(ptr, &tmp, 4); ptr += 4;
1700 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1701 
1702 		memcpy(ptr, &value, 4); ptr += 4;
1703 		memcpy(ptr, &invert, 1); ptr += 1;
1704 }
1705 
glScissor_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height)1706 void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
1707 {
1708 
1709 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1710 	IOStream *stream = ctx->m_stream;
1711 
1712 	 unsigned char *ptr;
1713 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
1714 	ptr = stream->alloc(packetSize);
1715 	int tmp = OP_glScissor;memcpy(ptr, &tmp, 4); ptr += 4;
1716 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1717 
1718 		memcpy(ptr, &x, 4); ptr += 4;
1719 		memcpy(ptr, &y, 4); ptr += 4;
1720 		memcpy(ptr, &width, 4); ptr += 4;
1721 		memcpy(ptr, &height, 4); ptr += 4;
1722 }
1723 
glStencilFunc_enc(void * self,GLenum func,GLint ref,GLuint mask)1724 void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask)
1725 {
1726 
1727 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1728 	IOStream *stream = ctx->m_stream;
1729 
1730 	 unsigned char *ptr;
1731 	 const size_t packetSize = 8 + 4 + 4 + 4;
1732 	ptr = stream->alloc(packetSize);
1733 	int tmp = OP_glStencilFunc;memcpy(ptr, &tmp, 4); ptr += 4;
1734 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1735 
1736 		memcpy(ptr, &func, 4); ptr += 4;
1737 		memcpy(ptr, &ref, 4); ptr += 4;
1738 		memcpy(ptr, &mask, 4); ptr += 4;
1739 }
1740 
glStencilFuncSeparate_enc(void * self,GLenum face,GLenum func,GLint ref,GLuint mask)1741 void glStencilFuncSeparate_enc(void *self , GLenum face, GLenum func, GLint ref, GLuint mask)
1742 {
1743 
1744 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1745 	IOStream *stream = ctx->m_stream;
1746 
1747 	 unsigned char *ptr;
1748 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
1749 	ptr = stream->alloc(packetSize);
1750 	int tmp = OP_glStencilFuncSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
1751 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1752 
1753 		memcpy(ptr, &face, 4); ptr += 4;
1754 		memcpy(ptr, &func, 4); ptr += 4;
1755 		memcpy(ptr, &ref, 4); ptr += 4;
1756 		memcpy(ptr, &mask, 4); ptr += 4;
1757 }
1758 
glStencilMask_enc(void * self,GLuint mask)1759 void glStencilMask_enc(void *self , GLuint mask)
1760 {
1761 
1762 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1763 	IOStream *stream = ctx->m_stream;
1764 
1765 	 unsigned char *ptr;
1766 	 const size_t packetSize = 8 + 4;
1767 	ptr = stream->alloc(packetSize);
1768 	int tmp = OP_glStencilMask;memcpy(ptr, &tmp, 4); ptr += 4;
1769 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1770 
1771 		memcpy(ptr, &mask, 4); ptr += 4;
1772 }
1773 
glStencilMaskSeparate_enc(void * self,GLenum face,GLuint mask)1774 void glStencilMaskSeparate_enc(void *self , GLenum face, GLuint mask)
1775 {
1776 
1777 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1778 	IOStream *stream = ctx->m_stream;
1779 
1780 	 unsigned char *ptr;
1781 	 const size_t packetSize = 8 + 4 + 4;
1782 	ptr = stream->alloc(packetSize);
1783 	int tmp = OP_glStencilMaskSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
1784 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1785 
1786 		memcpy(ptr, &face, 4); ptr += 4;
1787 		memcpy(ptr, &mask, 4); ptr += 4;
1788 }
1789 
glStencilOp_enc(void * self,GLenum fail,GLenum zfail,GLenum zpass)1790 void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass)
1791 {
1792 
1793 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1794 	IOStream *stream = ctx->m_stream;
1795 
1796 	 unsigned char *ptr;
1797 	 const size_t packetSize = 8 + 4 + 4 + 4;
1798 	ptr = stream->alloc(packetSize);
1799 	int tmp = OP_glStencilOp;memcpy(ptr, &tmp, 4); ptr += 4;
1800 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1801 
1802 		memcpy(ptr, &fail, 4); ptr += 4;
1803 		memcpy(ptr, &zfail, 4); ptr += 4;
1804 		memcpy(ptr, &zpass, 4); ptr += 4;
1805 }
1806 
glStencilOpSeparate_enc(void * self,GLenum face,GLenum fail,GLenum zfail,GLenum zpass)1807 void glStencilOpSeparate_enc(void *self , GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
1808 {
1809 
1810 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1811 	IOStream *stream = ctx->m_stream;
1812 
1813 	 unsigned char *ptr;
1814 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
1815 	ptr = stream->alloc(packetSize);
1816 	int tmp = OP_glStencilOpSeparate;memcpy(ptr, &tmp, 4); ptr += 4;
1817 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1818 
1819 		memcpy(ptr, &face, 4); ptr += 4;
1820 		memcpy(ptr, &fail, 4); ptr += 4;
1821 		memcpy(ptr, &zfail, 4); ptr += 4;
1822 		memcpy(ptr, &zpass, 4); ptr += 4;
1823 }
1824 
glTexImage2D_enc(void * self,GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)1825 void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
1826 {
1827 
1828 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1829 	IOStream *stream = ctx->m_stream;
1830 
1831 	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
1832 	 unsigned char *ptr;
1833 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
1834 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
1835 	int tmp = OP_glTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
1836 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1837 
1838 		memcpy(ptr, &target, 4); ptr += 4;
1839 		memcpy(ptr, &level, 4); ptr += 4;
1840 		memcpy(ptr, &internalformat, 4); ptr += 4;
1841 		memcpy(ptr, &width, 4); ptr += 4;
1842 		memcpy(ptr, &height, 4); ptr += 4;
1843 		memcpy(ptr, &border, 4); ptr += 4;
1844 		memcpy(ptr, &format, 4); ptr += 4;
1845 		memcpy(ptr, &type, 4); ptr += 4;
1846 	stream->flush();
1847 	stream->writeFully(&__size_pixels,4);
1848 	if (pixels != NULL) stream->writeFully(pixels, __size_pixels);
1849 }
1850 
glTexParameterf_enc(void * self,GLenum target,GLenum pname,GLfloat param)1851 void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
1852 {
1853 
1854 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1855 	IOStream *stream = ctx->m_stream;
1856 
1857 	 unsigned char *ptr;
1858 	 const size_t packetSize = 8 + 4 + 4 + 4;
1859 	ptr = stream->alloc(packetSize);
1860 	int tmp = OP_glTexParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
1861 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1862 
1863 		memcpy(ptr, &target, 4); ptr += 4;
1864 		memcpy(ptr, &pname, 4); ptr += 4;
1865 		memcpy(ptr, &param, 4); ptr += 4;
1866 }
1867 
glTexParameterfv_enc(void * self,GLenum target,GLenum pname,const GLfloat * params)1868 void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
1869 {
1870 
1871 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1872 	IOStream *stream = ctx->m_stream;
1873 
1874 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
1875 	 unsigned char *ptr;
1876 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1877 	ptr = stream->alloc(packetSize);
1878 	int tmp = OP_glTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
1879 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1880 
1881 		memcpy(ptr, &target, 4); ptr += 4;
1882 		memcpy(ptr, &pname, 4); ptr += 4;
1883 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1884 	memcpy(ptr, params, __size_params);ptr += __size_params;
1885 }
1886 
glTexParameteri_enc(void * self,GLenum target,GLenum pname,GLint param)1887 void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
1888 {
1889 
1890 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1891 	IOStream *stream = ctx->m_stream;
1892 
1893 	 unsigned char *ptr;
1894 	 const size_t packetSize = 8 + 4 + 4 + 4;
1895 	ptr = stream->alloc(packetSize);
1896 	int tmp = OP_glTexParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
1897 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1898 
1899 		memcpy(ptr, &target, 4); ptr += 4;
1900 		memcpy(ptr, &pname, 4); ptr += 4;
1901 		memcpy(ptr, &param, 4); ptr += 4;
1902 }
1903 
glTexParameteriv_enc(void * self,GLenum target,GLenum pname,const GLint * params)1904 void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
1905 {
1906 
1907 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1908 	IOStream *stream = ctx->m_stream;
1909 
1910 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
1911 	 unsigned char *ptr;
1912 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1913 	ptr = stream->alloc(packetSize);
1914 	int tmp = OP_glTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
1915 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1916 
1917 		memcpy(ptr, &target, 4); ptr += 4;
1918 		memcpy(ptr, &pname, 4); ptr += 4;
1919 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1920 	memcpy(ptr, params, __size_params);ptr += __size_params;
1921 }
1922 
glTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)1923 void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
1924 {
1925 
1926 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1927 	IOStream *stream = ctx->m_stream;
1928 
1929 	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
1930 	 unsigned char *ptr;
1931 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
1932 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
1933 	int tmp = OP_glTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
1934 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1935 
1936 		memcpy(ptr, &target, 4); ptr += 4;
1937 		memcpy(ptr, &level, 4); ptr += 4;
1938 		memcpy(ptr, &xoffset, 4); ptr += 4;
1939 		memcpy(ptr, &yoffset, 4); ptr += 4;
1940 		memcpy(ptr, &width, 4); ptr += 4;
1941 		memcpy(ptr, &height, 4); ptr += 4;
1942 		memcpy(ptr, &format, 4); ptr += 4;
1943 		memcpy(ptr, &type, 4); ptr += 4;
1944 	stream->flush();
1945 	stream->writeFully(&__size_pixels,4);
1946 	if (pixels != NULL) stream->writeFully(pixels, __size_pixels);
1947 }
1948 
glUniform1f_enc(void * self,GLint location,GLfloat x)1949 void glUniform1f_enc(void *self , GLint location, GLfloat x)
1950 {
1951 
1952 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1953 	IOStream *stream = ctx->m_stream;
1954 
1955 	 unsigned char *ptr;
1956 	 const size_t packetSize = 8 + 4 + 4;
1957 	ptr = stream->alloc(packetSize);
1958 	int tmp = OP_glUniform1f;memcpy(ptr, &tmp, 4); ptr += 4;
1959 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1960 
1961 		memcpy(ptr, &location, 4); ptr += 4;
1962 		memcpy(ptr, &x, 4); ptr += 4;
1963 }
1964 
glUniform1fv_enc(void * self,GLint location,GLsizei count,const GLfloat * v)1965 void glUniform1fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
1966 {
1967 
1968 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1969 	IOStream *stream = ctx->m_stream;
1970 
1971 	const unsigned int __size_v =  (count * sizeof(GLfloat));
1972 	 unsigned char *ptr;
1973 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
1974 	ptr = stream->alloc(packetSize);
1975 	int tmp = OP_glUniform1fv;memcpy(ptr, &tmp, 4); ptr += 4;
1976 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1977 
1978 		memcpy(ptr, &location, 4); ptr += 4;
1979 		memcpy(ptr, &count, 4); ptr += 4;
1980 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
1981 	memcpy(ptr, v, __size_v);ptr += __size_v;
1982 }
1983 
glUniform1i_enc(void * self,GLint location,GLint x)1984 void glUniform1i_enc(void *self , GLint location, GLint x)
1985 {
1986 
1987 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
1988 	IOStream *stream = ctx->m_stream;
1989 
1990 	 unsigned char *ptr;
1991 	 const size_t packetSize = 8 + 4 + 4;
1992 	ptr = stream->alloc(packetSize);
1993 	int tmp = OP_glUniform1i;memcpy(ptr, &tmp, 4); ptr += 4;
1994 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1995 
1996 		memcpy(ptr, &location, 4); ptr += 4;
1997 		memcpy(ptr, &x, 4); ptr += 4;
1998 }
1999 
glUniform1iv_enc(void * self,GLint location,GLsizei count,const GLint * v)2000 void glUniform1iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
2001 {
2002 
2003 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2004 	IOStream *stream = ctx->m_stream;
2005 
2006 	const unsigned int __size_v =  (count * sizeof(GLint));
2007 	 unsigned char *ptr;
2008 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
2009 	ptr = stream->alloc(packetSize);
2010 	int tmp = OP_glUniform1iv;memcpy(ptr, &tmp, 4); ptr += 4;
2011 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2012 
2013 		memcpy(ptr, &location, 4); ptr += 4;
2014 		memcpy(ptr, &count, 4); ptr += 4;
2015 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
2016 	memcpy(ptr, v, __size_v);ptr += __size_v;
2017 }
2018 
glUniform2f_enc(void * self,GLint location,GLfloat x,GLfloat y)2019 void glUniform2f_enc(void *self , GLint location, GLfloat x, GLfloat y)
2020 {
2021 
2022 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2023 	IOStream *stream = ctx->m_stream;
2024 
2025 	 unsigned char *ptr;
2026 	 const size_t packetSize = 8 + 4 + 4 + 4;
2027 	ptr = stream->alloc(packetSize);
2028 	int tmp = OP_glUniform2f;memcpy(ptr, &tmp, 4); ptr += 4;
2029 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2030 
2031 		memcpy(ptr, &location, 4); ptr += 4;
2032 		memcpy(ptr, &x, 4); ptr += 4;
2033 		memcpy(ptr, &y, 4); ptr += 4;
2034 }
2035 
glUniform2fv_enc(void * self,GLint location,GLsizei count,const GLfloat * v)2036 void glUniform2fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
2037 {
2038 
2039 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2040 	IOStream *stream = ctx->m_stream;
2041 
2042 	const unsigned int __size_v =  (count * 2 * sizeof(GLfloat));
2043 	 unsigned char *ptr;
2044 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
2045 	ptr = stream->alloc(packetSize);
2046 	int tmp = OP_glUniform2fv;memcpy(ptr, &tmp, 4); ptr += 4;
2047 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2048 
2049 		memcpy(ptr, &location, 4); ptr += 4;
2050 		memcpy(ptr, &count, 4); ptr += 4;
2051 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
2052 	memcpy(ptr, v, __size_v);ptr += __size_v;
2053 }
2054 
glUniform2i_enc(void * self,GLint location,GLint x,GLint y)2055 void glUniform2i_enc(void *self , GLint location, GLint x, GLint y)
2056 {
2057 
2058 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2059 	IOStream *stream = ctx->m_stream;
2060 
2061 	 unsigned char *ptr;
2062 	 const size_t packetSize = 8 + 4 + 4 + 4;
2063 	ptr = stream->alloc(packetSize);
2064 	int tmp = OP_glUniform2i;memcpy(ptr, &tmp, 4); ptr += 4;
2065 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2066 
2067 		memcpy(ptr, &location, 4); ptr += 4;
2068 		memcpy(ptr, &x, 4); ptr += 4;
2069 		memcpy(ptr, &y, 4); ptr += 4;
2070 }
2071 
glUniform2iv_enc(void * self,GLint location,GLsizei count,const GLint * v)2072 void glUniform2iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
2073 {
2074 
2075 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2076 	IOStream *stream = ctx->m_stream;
2077 
2078 	const unsigned int __size_v =  (count * 2 * sizeof(GLint));
2079 	 unsigned char *ptr;
2080 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
2081 	ptr = stream->alloc(packetSize);
2082 	int tmp = OP_glUniform2iv;memcpy(ptr, &tmp, 4); ptr += 4;
2083 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2084 
2085 		memcpy(ptr, &location, 4); ptr += 4;
2086 		memcpy(ptr, &count, 4); ptr += 4;
2087 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
2088 	memcpy(ptr, v, __size_v);ptr += __size_v;
2089 }
2090 
glUniform3f_enc(void * self,GLint location,GLfloat x,GLfloat y,GLfloat z)2091 void glUniform3f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z)
2092 {
2093 
2094 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2095 	IOStream *stream = ctx->m_stream;
2096 
2097 	 unsigned char *ptr;
2098 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2099 	ptr = stream->alloc(packetSize);
2100 	int tmp = OP_glUniform3f;memcpy(ptr, &tmp, 4); ptr += 4;
2101 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2102 
2103 		memcpy(ptr, &location, 4); ptr += 4;
2104 		memcpy(ptr, &x, 4); ptr += 4;
2105 		memcpy(ptr, &y, 4); ptr += 4;
2106 		memcpy(ptr, &z, 4); ptr += 4;
2107 }
2108 
glUniform3fv_enc(void * self,GLint location,GLsizei count,const GLfloat * v)2109 void glUniform3fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
2110 {
2111 
2112 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2113 	IOStream *stream = ctx->m_stream;
2114 
2115 	const unsigned int __size_v =  (count * 3 * sizeof(GLfloat));
2116 	 unsigned char *ptr;
2117 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
2118 	ptr = stream->alloc(packetSize);
2119 	int tmp = OP_glUniform3fv;memcpy(ptr, &tmp, 4); ptr += 4;
2120 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2121 
2122 		memcpy(ptr, &location, 4); ptr += 4;
2123 		memcpy(ptr, &count, 4); ptr += 4;
2124 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
2125 	memcpy(ptr, v, __size_v);ptr += __size_v;
2126 }
2127 
glUniform3i_enc(void * self,GLint location,GLint x,GLint y,GLint z)2128 void glUniform3i_enc(void *self , GLint location, GLint x, GLint y, GLint z)
2129 {
2130 
2131 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2132 	IOStream *stream = ctx->m_stream;
2133 
2134 	 unsigned char *ptr;
2135 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2136 	ptr = stream->alloc(packetSize);
2137 	int tmp = OP_glUniform3i;memcpy(ptr, &tmp, 4); ptr += 4;
2138 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2139 
2140 		memcpy(ptr, &location, 4); ptr += 4;
2141 		memcpy(ptr, &x, 4); ptr += 4;
2142 		memcpy(ptr, &y, 4); ptr += 4;
2143 		memcpy(ptr, &z, 4); ptr += 4;
2144 }
2145 
glUniform3iv_enc(void * self,GLint location,GLsizei count,const GLint * v)2146 void glUniform3iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
2147 {
2148 
2149 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2150 	IOStream *stream = ctx->m_stream;
2151 
2152 	const unsigned int __size_v =  (3 * count * sizeof(GLint));
2153 	 unsigned char *ptr;
2154 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
2155 	ptr = stream->alloc(packetSize);
2156 	int tmp = OP_glUniform3iv;memcpy(ptr, &tmp, 4); ptr += 4;
2157 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2158 
2159 		memcpy(ptr, &location, 4); ptr += 4;
2160 		memcpy(ptr, &count, 4); ptr += 4;
2161 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
2162 	memcpy(ptr, v, __size_v);ptr += __size_v;
2163 }
2164 
glUniform4f_enc(void * self,GLint location,GLfloat x,GLfloat y,GLfloat z,GLfloat w)2165 void glUniform4f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2166 {
2167 
2168 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2169 	IOStream *stream = ctx->m_stream;
2170 
2171 	 unsigned char *ptr;
2172 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
2173 	ptr = stream->alloc(packetSize);
2174 	int tmp = OP_glUniform4f;memcpy(ptr, &tmp, 4); ptr += 4;
2175 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2176 
2177 		memcpy(ptr, &location, 4); ptr += 4;
2178 		memcpy(ptr, &x, 4); ptr += 4;
2179 		memcpy(ptr, &y, 4); ptr += 4;
2180 		memcpy(ptr, &z, 4); ptr += 4;
2181 		memcpy(ptr, &w, 4); ptr += 4;
2182 }
2183 
glUniform4fv_enc(void * self,GLint location,GLsizei count,const GLfloat * v)2184 void glUniform4fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v)
2185 {
2186 
2187 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2188 	IOStream *stream = ctx->m_stream;
2189 
2190 	const unsigned int __size_v =  (4 * count * sizeof(GLfloat));
2191 	 unsigned char *ptr;
2192 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
2193 	ptr = stream->alloc(packetSize);
2194 	int tmp = OP_glUniform4fv;memcpy(ptr, &tmp, 4); ptr += 4;
2195 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2196 
2197 		memcpy(ptr, &location, 4); ptr += 4;
2198 		memcpy(ptr, &count, 4); ptr += 4;
2199 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
2200 	memcpy(ptr, v, __size_v);ptr += __size_v;
2201 }
2202 
glUniform4i_enc(void * self,GLint location,GLint x,GLint y,GLint z,GLint w)2203 void glUniform4i_enc(void *self , GLint location, GLint x, GLint y, GLint z, GLint w)
2204 {
2205 
2206 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2207 	IOStream *stream = ctx->m_stream;
2208 
2209 	 unsigned char *ptr;
2210 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
2211 	ptr = stream->alloc(packetSize);
2212 	int tmp = OP_glUniform4i;memcpy(ptr, &tmp, 4); ptr += 4;
2213 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2214 
2215 		memcpy(ptr, &location, 4); ptr += 4;
2216 		memcpy(ptr, &x, 4); ptr += 4;
2217 		memcpy(ptr, &y, 4); ptr += 4;
2218 		memcpy(ptr, &z, 4); ptr += 4;
2219 		memcpy(ptr, &w, 4); ptr += 4;
2220 }
2221 
glUniform4iv_enc(void * self,GLint location,GLsizei count,const GLint * v)2222 void glUniform4iv_enc(void *self , GLint location, GLsizei count, const GLint* v)
2223 {
2224 
2225 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2226 	IOStream *stream = ctx->m_stream;
2227 
2228 	const unsigned int __size_v =  (4 * count * sizeof(GLint));
2229 	 unsigned char *ptr;
2230 	 const size_t packetSize = 8 + 4 + 4 + __size_v + 1*4;
2231 	ptr = stream->alloc(packetSize);
2232 	int tmp = OP_glUniform4iv;memcpy(ptr, &tmp, 4); ptr += 4;
2233 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2234 
2235 		memcpy(ptr, &location, 4); ptr += 4;
2236 		memcpy(ptr, &count, 4); ptr += 4;
2237 	*(unsigned int *)(ptr) = __size_v; ptr += 4;
2238 	memcpy(ptr, v, __size_v);ptr += __size_v;
2239 }
2240 
glUniformMatrix2fv_enc(void * self,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)2241 void glUniformMatrix2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2242 {
2243 
2244 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2245 	IOStream *stream = ctx->m_stream;
2246 
2247 	const unsigned int __size_value =  (count * 4 * sizeof(GLfloat));
2248 	 unsigned char *ptr;
2249 	 const size_t packetSize = 8 + 4 + 4 + 1 + __size_value + 1*4;
2250 	ptr = stream->alloc(packetSize);
2251 	int tmp = OP_glUniformMatrix2fv;memcpy(ptr, &tmp, 4); ptr += 4;
2252 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2253 
2254 		memcpy(ptr, &location, 4); ptr += 4;
2255 		memcpy(ptr, &count, 4); ptr += 4;
2256 		memcpy(ptr, &transpose, 1); ptr += 1;
2257 	*(unsigned int *)(ptr) = __size_value; ptr += 4;
2258 	memcpy(ptr, value, __size_value);ptr += __size_value;
2259 }
2260 
glUniformMatrix3fv_enc(void * self,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)2261 void glUniformMatrix3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2262 {
2263 
2264 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2265 	IOStream *stream = ctx->m_stream;
2266 
2267 	const unsigned int __size_value =  (count * 9 * sizeof(GLfloat));
2268 	 unsigned char *ptr;
2269 	 const size_t packetSize = 8 + 4 + 4 + 1 + __size_value + 1*4;
2270 	ptr = stream->alloc(packetSize);
2271 	int tmp = OP_glUniformMatrix3fv;memcpy(ptr, &tmp, 4); ptr += 4;
2272 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2273 
2274 		memcpy(ptr, &location, 4); ptr += 4;
2275 		memcpy(ptr, &count, 4); ptr += 4;
2276 		memcpy(ptr, &transpose, 1); ptr += 1;
2277 	*(unsigned int *)(ptr) = __size_value; ptr += 4;
2278 	memcpy(ptr, value, __size_value);ptr += __size_value;
2279 }
2280 
glUniformMatrix4fv_enc(void * self,GLint location,GLsizei count,GLboolean transpose,const GLfloat * value)2281 void glUniformMatrix4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
2282 {
2283 
2284 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2285 	IOStream *stream = ctx->m_stream;
2286 
2287 	const unsigned int __size_value =  (count * 16 * sizeof(GLfloat));
2288 	 unsigned char *ptr;
2289 	 const size_t packetSize = 8 + 4 + 4 + 1 + __size_value + 1*4;
2290 	ptr = stream->alloc(packetSize);
2291 	int tmp = OP_glUniformMatrix4fv;memcpy(ptr, &tmp, 4); ptr += 4;
2292 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2293 
2294 		memcpy(ptr, &location, 4); ptr += 4;
2295 		memcpy(ptr, &count, 4); ptr += 4;
2296 		memcpy(ptr, &transpose, 1); ptr += 1;
2297 	*(unsigned int *)(ptr) = __size_value; ptr += 4;
2298 	memcpy(ptr, value, __size_value);ptr += __size_value;
2299 }
2300 
glUseProgram_enc(void * self,GLuint program)2301 void glUseProgram_enc(void *self , GLuint program)
2302 {
2303 
2304 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2305 	IOStream *stream = ctx->m_stream;
2306 
2307 	 unsigned char *ptr;
2308 	 const size_t packetSize = 8 + 4;
2309 	ptr = stream->alloc(packetSize);
2310 	int tmp = OP_glUseProgram;memcpy(ptr, &tmp, 4); ptr += 4;
2311 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2312 
2313 		memcpy(ptr, &program, 4); ptr += 4;
2314 }
2315 
glValidateProgram_enc(void * self,GLuint program)2316 void glValidateProgram_enc(void *self , GLuint program)
2317 {
2318 
2319 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2320 	IOStream *stream = ctx->m_stream;
2321 
2322 	 unsigned char *ptr;
2323 	 const size_t packetSize = 8 + 4;
2324 	ptr = stream->alloc(packetSize);
2325 	int tmp = OP_glValidateProgram;memcpy(ptr, &tmp, 4); ptr += 4;
2326 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2327 
2328 		memcpy(ptr, &program, 4); ptr += 4;
2329 }
2330 
glVertexAttrib1f_enc(void * self,GLuint indx,GLfloat x)2331 void glVertexAttrib1f_enc(void *self , GLuint indx, GLfloat x)
2332 {
2333 
2334 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2335 	IOStream *stream = ctx->m_stream;
2336 
2337 	 unsigned char *ptr;
2338 	 const size_t packetSize = 8 + 4 + 4;
2339 	ptr = stream->alloc(packetSize);
2340 	int tmp = OP_glVertexAttrib1f;memcpy(ptr, &tmp, 4); ptr += 4;
2341 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2342 
2343 		memcpy(ptr, &indx, 4); ptr += 4;
2344 		memcpy(ptr, &x, 4); ptr += 4;
2345 }
2346 
glVertexAttrib1fv_enc(void * self,GLuint indx,const GLfloat * values)2347 void glVertexAttrib1fv_enc(void *self , GLuint indx, const GLfloat* values)
2348 {
2349 
2350 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2351 	IOStream *stream = ctx->m_stream;
2352 
2353 	const unsigned int __size_values =  (sizeof(GLfloat));
2354 	 unsigned char *ptr;
2355 	 const size_t packetSize = 8 + 4 + __size_values + 1*4;
2356 	ptr = stream->alloc(packetSize);
2357 	int tmp = OP_glVertexAttrib1fv;memcpy(ptr, &tmp, 4); ptr += 4;
2358 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2359 
2360 		memcpy(ptr, &indx, 4); ptr += 4;
2361 	*(unsigned int *)(ptr) = __size_values; ptr += 4;
2362 	memcpy(ptr, values, __size_values);ptr += __size_values;
2363 }
2364 
glVertexAttrib2f_enc(void * self,GLuint indx,GLfloat x,GLfloat y)2365 void glVertexAttrib2f_enc(void *self , GLuint indx, GLfloat x, GLfloat y)
2366 {
2367 
2368 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2369 	IOStream *stream = ctx->m_stream;
2370 
2371 	 unsigned char *ptr;
2372 	 const size_t packetSize = 8 + 4 + 4 + 4;
2373 	ptr = stream->alloc(packetSize);
2374 	int tmp = OP_glVertexAttrib2f;memcpy(ptr, &tmp, 4); ptr += 4;
2375 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2376 
2377 		memcpy(ptr, &indx, 4); ptr += 4;
2378 		memcpy(ptr, &x, 4); ptr += 4;
2379 		memcpy(ptr, &y, 4); ptr += 4;
2380 }
2381 
glVertexAttrib2fv_enc(void * self,GLuint indx,const GLfloat * values)2382 void glVertexAttrib2fv_enc(void *self , GLuint indx, const GLfloat* values)
2383 {
2384 
2385 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2386 	IOStream *stream = ctx->m_stream;
2387 
2388 	const unsigned int __size_values =  (2 * sizeof(GLfloat));
2389 	 unsigned char *ptr;
2390 	 const size_t packetSize = 8 + 4 + __size_values + 1*4;
2391 	ptr = stream->alloc(packetSize);
2392 	int tmp = OP_glVertexAttrib2fv;memcpy(ptr, &tmp, 4); ptr += 4;
2393 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2394 
2395 		memcpy(ptr, &indx, 4); ptr += 4;
2396 	*(unsigned int *)(ptr) = __size_values; ptr += 4;
2397 	memcpy(ptr, values, __size_values);ptr += __size_values;
2398 }
2399 
glVertexAttrib3f_enc(void * self,GLuint indx,GLfloat x,GLfloat y,GLfloat z)2400 void glVertexAttrib3f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z)
2401 {
2402 
2403 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2404 	IOStream *stream = ctx->m_stream;
2405 
2406 	 unsigned char *ptr;
2407 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2408 	ptr = stream->alloc(packetSize);
2409 	int tmp = OP_glVertexAttrib3f;memcpy(ptr, &tmp, 4); ptr += 4;
2410 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2411 
2412 		memcpy(ptr, &indx, 4); ptr += 4;
2413 		memcpy(ptr, &x, 4); ptr += 4;
2414 		memcpy(ptr, &y, 4); ptr += 4;
2415 		memcpy(ptr, &z, 4); ptr += 4;
2416 }
2417 
glVertexAttrib3fv_enc(void * self,GLuint indx,const GLfloat * values)2418 void glVertexAttrib3fv_enc(void *self , GLuint indx, const GLfloat* values)
2419 {
2420 
2421 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2422 	IOStream *stream = ctx->m_stream;
2423 
2424 	const unsigned int __size_values =  (3 * sizeof(GLfloat));
2425 	 unsigned char *ptr;
2426 	 const size_t packetSize = 8 + 4 + __size_values + 1*4;
2427 	ptr = stream->alloc(packetSize);
2428 	int tmp = OP_glVertexAttrib3fv;memcpy(ptr, &tmp, 4); ptr += 4;
2429 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2430 
2431 		memcpy(ptr, &indx, 4); ptr += 4;
2432 	*(unsigned int *)(ptr) = __size_values; ptr += 4;
2433 	memcpy(ptr, values, __size_values);ptr += __size_values;
2434 }
2435 
glVertexAttrib4f_enc(void * self,GLuint indx,GLfloat x,GLfloat y,GLfloat z,GLfloat w)2436 void glVertexAttrib4f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2437 {
2438 
2439 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2440 	IOStream *stream = ctx->m_stream;
2441 
2442 	 unsigned char *ptr;
2443 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
2444 	ptr = stream->alloc(packetSize);
2445 	int tmp = OP_glVertexAttrib4f;memcpy(ptr, &tmp, 4); ptr += 4;
2446 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2447 
2448 		memcpy(ptr, &indx, 4); ptr += 4;
2449 		memcpy(ptr, &x, 4); ptr += 4;
2450 		memcpy(ptr, &y, 4); ptr += 4;
2451 		memcpy(ptr, &z, 4); ptr += 4;
2452 		memcpy(ptr, &w, 4); ptr += 4;
2453 }
2454 
glVertexAttrib4fv_enc(void * self,GLuint indx,const GLfloat * values)2455 void glVertexAttrib4fv_enc(void *self , GLuint indx, const GLfloat* values)
2456 {
2457 
2458 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2459 	IOStream *stream = ctx->m_stream;
2460 
2461 	const unsigned int __size_values =  (4 * sizeof(GLfloat));
2462 	 unsigned char *ptr;
2463 	 const size_t packetSize = 8 + 4 + __size_values + 1*4;
2464 	ptr = stream->alloc(packetSize);
2465 	int tmp = OP_glVertexAttrib4fv;memcpy(ptr, &tmp, 4); ptr += 4;
2466 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2467 
2468 		memcpy(ptr, &indx, 4); ptr += 4;
2469 	*(unsigned int *)(ptr) = __size_values; ptr += 4;
2470 	memcpy(ptr, values, __size_values);ptr += __size_values;
2471 }
2472 
glViewport_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height)2473 void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
2474 {
2475 
2476 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2477 	IOStream *stream = ctx->m_stream;
2478 
2479 	 unsigned char *ptr;
2480 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2481 	ptr = stream->alloc(packetSize);
2482 	int tmp = OP_glViewport;memcpy(ptr, &tmp, 4); ptr += 4;
2483 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2484 
2485 		memcpy(ptr, &x, 4); ptr += 4;
2486 		memcpy(ptr, &y, 4); ptr += 4;
2487 		memcpy(ptr, &width, 4); ptr += 4;
2488 		memcpy(ptr, &height, 4); ptr += 4;
2489 }
2490 
glEGLImageTargetTexture2DOES_enc(void * self,GLenum target,GLeglImageOES image)2491 void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image)
2492 {
2493 
2494 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2495 	IOStream *stream = ctx->m_stream;
2496 
2497 	 unsigned char *ptr;
2498 	 const size_t packetSize = 8 + 4 + 4;
2499 	ptr = stream->alloc(packetSize);
2500 	int tmp = OP_glEGLImageTargetTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2501 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2502 
2503 		memcpy(ptr, &target, 4); ptr += 4;
2504 		memcpy(ptr, &image, 4); ptr += 4;
2505 }
2506 
glEGLImageTargetRenderbufferStorageOES_enc(void * self,GLenum target,GLeglImageOES image)2507 void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image)
2508 {
2509 
2510 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2511 	IOStream *stream = ctx->m_stream;
2512 
2513 	 unsigned char *ptr;
2514 	 const size_t packetSize = 8 + 4 + 4;
2515 	ptr = stream->alloc(packetSize);
2516 	int tmp = OP_glEGLImageTargetRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
2517 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2518 
2519 		memcpy(ptr, &target, 4); ptr += 4;
2520 		memcpy(ptr, &image, 4); ptr += 4;
2521 }
2522 
glUnmapBufferOES_enc(void * self,GLenum target)2523 GLboolean glUnmapBufferOES_enc(void *self , GLenum target)
2524 {
2525 
2526 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2527 	IOStream *stream = ctx->m_stream;
2528 
2529 	 unsigned char *ptr;
2530 	 const size_t packetSize = 8 + 4;
2531 	ptr = stream->alloc(packetSize);
2532 	int tmp = OP_glUnmapBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
2533 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2534 
2535 		memcpy(ptr, &target, 4); ptr += 4;
2536 
2537 	GLboolean retval;
2538 	stream->readback(&retval, 1);
2539 	return retval;
2540 }
2541 
glTexImage3DOES_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const GLvoid * pixels)2542 void glTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
2543 {
2544 
2545 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2546 	IOStream *stream = ctx->m_stream;
2547 
2548 	const unsigned int __size_pixels = ((pixels != NULL) ?  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
2549 	 unsigned char *ptr;
2550 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
2551 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
2552 	int tmp = OP_glTexImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2553 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2554 
2555 		memcpy(ptr, &target, 4); ptr += 4;
2556 		memcpy(ptr, &level, 4); ptr += 4;
2557 		memcpy(ptr, &internalformat, 4); ptr += 4;
2558 		memcpy(ptr, &width, 4); ptr += 4;
2559 		memcpy(ptr, &height, 4); ptr += 4;
2560 		memcpy(ptr, &depth, 4); ptr += 4;
2561 		memcpy(ptr, &border, 4); ptr += 4;
2562 		memcpy(ptr, &format, 4); ptr += 4;
2563 		memcpy(ptr, &type, 4); ptr += 4;
2564 	stream->flush();
2565 	stream->writeFully(&__size_pixels,4);
2566 	if (pixels != NULL) stream->writeFully(pixels, __size_pixels);
2567 }
2568 
glTexSubImage3DOES_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const GLvoid * pixels)2569 void glTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
2570 {
2571 
2572 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2573 	IOStream *stream = ctx->m_stream;
2574 
2575 	const unsigned int __size_pixels =  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0);
2576 	 unsigned char *ptr;
2577 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
2578 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
2579 	int tmp = OP_glTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2580 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2581 
2582 		memcpy(ptr, &target, 4); ptr += 4;
2583 		memcpy(ptr, &level, 4); ptr += 4;
2584 		memcpy(ptr, &xoffset, 4); ptr += 4;
2585 		memcpy(ptr, &yoffset, 4); ptr += 4;
2586 		memcpy(ptr, &zoffset, 4); ptr += 4;
2587 		memcpy(ptr, &width, 4); ptr += 4;
2588 		memcpy(ptr, &height, 4); ptr += 4;
2589 		memcpy(ptr, &depth, 4); ptr += 4;
2590 		memcpy(ptr, &format, 4); ptr += 4;
2591 		memcpy(ptr, &type, 4); ptr += 4;
2592 	stream->flush();
2593 	stream->writeFully(&__size_pixels,4);
2594 	stream->writeFully(pixels, __size_pixels);
2595 }
2596 
glCopyTexSubImage3DOES_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLsizei height)2597 void glCopyTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
2598 {
2599 
2600 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2601 	IOStream *stream = ctx->m_stream;
2602 
2603 	 unsigned char *ptr;
2604 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
2605 	ptr = stream->alloc(packetSize);
2606 	int tmp = OP_glCopyTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2607 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2608 
2609 		memcpy(ptr, &target, 4); ptr += 4;
2610 		memcpy(ptr, &level, 4); ptr += 4;
2611 		memcpy(ptr, &xoffset, 4); ptr += 4;
2612 		memcpy(ptr, &yoffset, 4); ptr += 4;
2613 		memcpy(ptr, &zoffset, 4); ptr += 4;
2614 		memcpy(ptr, &x, 4); ptr += 4;
2615 		memcpy(ptr, &y, 4); ptr += 4;
2616 		memcpy(ptr, &width, 4); ptr += 4;
2617 		memcpy(ptr, &height, 4); ptr += 4;
2618 }
2619 
glCompressedTexImage3DOES_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const GLvoid * data)2620 void glCompressedTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
2621 {
2622 
2623 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2624 	IOStream *stream = ctx->m_stream;
2625 
2626 	const unsigned int __size_data =  imageSize;
2627 	 unsigned char *ptr;
2628 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
2629 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
2630 	int tmp = OP_glCompressedTexImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2631 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2632 
2633 		memcpy(ptr, &target, 4); ptr += 4;
2634 		memcpy(ptr, &level, 4); ptr += 4;
2635 		memcpy(ptr, &internalformat, 4); ptr += 4;
2636 		memcpy(ptr, &width, 4); ptr += 4;
2637 		memcpy(ptr, &height, 4); ptr += 4;
2638 		memcpy(ptr, &depth, 4); ptr += 4;
2639 		memcpy(ptr, &border, 4); ptr += 4;
2640 		memcpy(ptr, &imageSize, 4); ptr += 4;
2641 	stream->flush();
2642 	stream->writeFully(&__size_data,4);
2643 	stream->writeFully(data, __size_data);
2644 }
2645 
glCompressedTexSubImage3DOES_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const GLvoid * data)2646 void glCompressedTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
2647 {
2648 
2649 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2650 	IOStream *stream = ctx->m_stream;
2651 
2652 	const unsigned int __size_data =  imageSize;
2653 	 unsigned char *ptr;
2654 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
2655 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
2656 	int tmp = OP_glCompressedTexSubImage3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2657 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2658 
2659 		memcpy(ptr, &target, 4); ptr += 4;
2660 		memcpy(ptr, &level, 4); ptr += 4;
2661 		memcpy(ptr, &xoffset, 4); ptr += 4;
2662 		memcpy(ptr, &yoffset, 4); ptr += 4;
2663 		memcpy(ptr, &zoffset, 4); ptr += 4;
2664 		memcpy(ptr, &width, 4); ptr += 4;
2665 		memcpy(ptr, &height, 4); ptr += 4;
2666 		memcpy(ptr, &depth, 4); ptr += 4;
2667 		memcpy(ptr, &format, 4); ptr += 4;
2668 		memcpy(ptr, &imageSize, 4); ptr += 4;
2669 	stream->flush();
2670 	stream->writeFully(&__size_data,4);
2671 	stream->writeFully(data, __size_data);
2672 }
2673 
glFramebufferTexture3DOES_enc(void * self,GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level,GLint zoffset)2674 void glFramebufferTexture3DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
2675 {
2676 
2677 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2678 	IOStream *stream = ctx->m_stream;
2679 
2680 	 unsigned char *ptr;
2681 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
2682 	ptr = stream->alloc(packetSize);
2683 	int tmp = OP_glFramebufferTexture3DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2684 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2685 
2686 		memcpy(ptr, &target, 4); ptr += 4;
2687 		memcpy(ptr, &attachment, 4); ptr += 4;
2688 		memcpy(ptr, &textarget, 4); ptr += 4;
2689 		memcpy(ptr, &texture, 4); ptr += 4;
2690 		memcpy(ptr, &level, 4); ptr += 4;
2691 		memcpy(ptr, &zoffset, 4); ptr += 4;
2692 }
2693 
glBindVertexArrayOES_enc(void * self,GLuint array)2694 void glBindVertexArrayOES_enc(void *self , GLuint array)
2695 {
2696 
2697 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2698 	IOStream *stream = ctx->m_stream;
2699 
2700 	 unsigned char *ptr;
2701 	 const size_t packetSize = 8 + 4;
2702 	ptr = stream->alloc(packetSize);
2703 	int tmp = OP_glBindVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
2704 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2705 
2706 		memcpy(ptr, &array, 4); ptr += 4;
2707 }
2708 
glDeleteVertexArraysOES_enc(void * self,GLsizei n,const GLuint * arrays)2709 void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays)
2710 {
2711 
2712 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2713 	IOStream *stream = ctx->m_stream;
2714 
2715 	const unsigned int __size_arrays =  (n * sizeof(GLuint));
2716 	 unsigned char *ptr;
2717 	 const size_t packetSize = 8 + 4 + __size_arrays + 1*4;
2718 	ptr = stream->alloc(packetSize);
2719 	int tmp = OP_glDeleteVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
2720 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2721 
2722 		memcpy(ptr, &n, 4); ptr += 4;
2723 	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
2724 	memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
2725 }
2726 
glGenVertexArraysOES_enc(void * self,GLsizei n,GLuint * arrays)2727 void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays)
2728 {
2729 
2730 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2731 	IOStream *stream = ctx->m_stream;
2732 
2733 	const unsigned int __size_arrays =  (n * sizeof(GLuint));
2734 	 unsigned char *ptr;
2735 	 const size_t packetSize = 8 + 4 + __size_arrays + 1*4;
2736 	ptr = stream->alloc(packetSize);
2737 	int tmp = OP_glGenVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
2738 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2739 
2740 		memcpy(ptr, &n, 4); ptr += 4;
2741 	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
2742 	stream->readback(arrays, __size_arrays);
2743 }
2744 
glIsVertexArrayOES_enc(void * self,GLuint array)2745 GLboolean glIsVertexArrayOES_enc(void *self , GLuint array)
2746 {
2747 
2748 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2749 	IOStream *stream = ctx->m_stream;
2750 
2751 	 unsigned char *ptr;
2752 	 const size_t packetSize = 8 + 4;
2753 	ptr = stream->alloc(packetSize);
2754 	int tmp = OP_glIsVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
2755 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2756 
2757 		memcpy(ptr, &array, 4); ptr += 4;
2758 
2759 	GLboolean retval;
2760 	stream->readback(&retval, 1);
2761 	return retval;
2762 }
2763 
glDiscardFramebufferEXT_enc(void * self,GLenum target,GLsizei numAttachments,const GLenum * attachments)2764 void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
2765 {
2766 
2767 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2768 	IOStream *stream = ctx->m_stream;
2769 
2770 	const unsigned int __size_attachments =  (numAttachments * sizeof(GLenum));
2771 	 unsigned char *ptr;
2772 	 const size_t packetSize = 8 + 4 + 4 + __size_attachments + 1*4;
2773 	ptr = stream->alloc(packetSize);
2774 	int tmp = OP_glDiscardFramebufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
2775 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2776 
2777 		memcpy(ptr, &target, 4); ptr += 4;
2778 		memcpy(ptr, &numAttachments, 4); ptr += 4;
2779 	*(unsigned int *)(ptr) = __size_attachments; ptr += 4;
2780 	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
2781 }
2782 
glVertexAttribPointerData_enc(void * self,GLuint indx,GLint size,GLenum type,GLboolean normalized,GLsizei stride,void * data,GLuint datalen)2783 void glVertexAttribPointerData_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen)
2784 {
2785 
2786 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2787 	IOStream *stream = ctx->m_stream;
2788 
2789 	const unsigned int __size_data =  datalen;
2790 	 unsigned char *ptr;
2791 	 const size_t packetSize = 8 + 4 + 4 + 4 + 1 + 4 + __size_data + 4 + 1*4;
2792 	ptr = stream->alloc(packetSize);
2793 	int tmp = OP_glVertexAttribPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2794 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2795 
2796 		memcpy(ptr, &indx, 4); ptr += 4;
2797 		memcpy(ptr, &size, 4); ptr += 4;
2798 		memcpy(ptr, &type, 4); ptr += 4;
2799 		memcpy(ptr, &normalized, 1); ptr += 1;
2800 		memcpy(ptr, &stride, 4); ptr += 4;
2801 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2802 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
2803 		memcpy(ptr, &datalen, 4); ptr += 4;
2804 }
2805 
glVertexAttribPointerOffset_enc(void * self,GLuint indx,GLint size,GLenum type,GLboolean normalized,GLsizei stride,GLuint offset)2806 void glVertexAttribPointerOffset_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset)
2807 {
2808 
2809 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2810 	IOStream *stream = ctx->m_stream;
2811 
2812 	 unsigned char *ptr;
2813 	 const size_t packetSize = 8 + 4 + 4 + 4 + 1 + 4 + 4;
2814 	ptr = stream->alloc(packetSize);
2815 	int tmp = OP_glVertexAttribPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2816 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2817 
2818 		memcpy(ptr, &indx, 4); ptr += 4;
2819 		memcpy(ptr, &size, 4); ptr += 4;
2820 		memcpy(ptr, &type, 4); ptr += 4;
2821 		memcpy(ptr, &normalized, 1); ptr += 1;
2822 		memcpy(ptr, &stride, 4); ptr += 4;
2823 		memcpy(ptr, &offset, 4); ptr += 4;
2824 }
2825 
glDrawElementsOffset_enc(void * self,GLenum mode,GLsizei count,GLenum type,GLuint offset)2826 void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
2827 {
2828 
2829 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2830 	IOStream *stream = ctx->m_stream;
2831 
2832 	 unsigned char *ptr;
2833 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2834 	ptr = stream->alloc(packetSize);
2835 	int tmp = OP_glDrawElementsOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2836 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2837 
2838 		memcpy(ptr, &mode, 4); ptr += 4;
2839 		memcpy(ptr, &count, 4); ptr += 4;
2840 		memcpy(ptr, &type, 4); ptr += 4;
2841 		memcpy(ptr, &offset, 4); ptr += 4;
2842 }
2843 
glDrawElementsData_enc(void * self,GLenum mode,GLsizei count,GLenum type,void * data,GLuint datalen)2844 void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
2845 {
2846 
2847 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2848 	IOStream *stream = ctx->m_stream;
2849 
2850 	const unsigned int __size_data =  datalen;
2851 	 unsigned char *ptr;
2852 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
2853 	ptr = stream->alloc(packetSize);
2854 	int tmp = OP_glDrawElementsData;memcpy(ptr, &tmp, 4); ptr += 4;
2855 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2856 
2857 		memcpy(ptr, &mode, 4); ptr += 4;
2858 		memcpy(ptr, &count, 4); ptr += 4;
2859 		memcpy(ptr, &type, 4); ptr += 4;
2860 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2861 	memcpy(ptr, data, __size_data);ptr += __size_data;
2862 		memcpy(ptr, &datalen, 4); ptr += 4;
2863 }
2864 
glGetCompressedTextureFormats_enc(void * self,int count,GLint * formats)2865 void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats)
2866 {
2867 
2868 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2869 	IOStream *stream = ctx->m_stream;
2870 
2871 	const unsigned int __size_formats =  (count * sizeof(GLint));
2872 	 unsigned char *ptr;
2873 	 const size_t packetSize = 8 + 4 + __size_formats + 1*4;
2874 	ptr = stream->alloc(packetSize);
2875 	int tmp = OP_glGetCompressedTextureFormats;memcpy(ptr, &tmp, 4); ptr += 4;
2876 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2877 
2878 		memcpy(ptr, &count, 4); ptr += 4;
2879 	*(unsigned int *)(ptr) = __size_formats; ptr += 4;
2880 	stream->readback(formats, __size_formats);
2881 }
2882 
glShaderString_enc(void * self,GLuint shader,const GLchar * string,GLsizei len)2883 void glShaderString_enc(void *self , GLuint shader, const GLchar* string, GLsizei len)
2884 {
2885 
2886 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2887 	IOStream *stream = ctx->m_stream;
2888 
2889 	const unsigned int __size_string =  len;
2890 	 unsigned char *ptr;
2891 	 const size_t packetSize = 8 + 4 + __size_string + 4 + 1*4;
2892 	ptr = stream->alloc(packetSize);
2893 	int tmp = OP_glShaderString;memcpy(ptr, &tmp, 4); ptr += 4;
2894 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2895 
2896 		memcpy(ptr, &shader, 4); ptr += 4;
2897 	*(unsigned int *)(ptr) = __size_string; ptr += 4;
2898 	memcpy(ptr, string, __size_string);ptr += __size_string;
2899 		memcpy(ptr, &len, 4); ptr += 4;
2900 }
2901 
glFinishRoundTrip_enc(void * self)2902 int glFinishRoundTrip_enc(void *self )
2903 {
2904 
2905 	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
2906 	IOStream *stream = ctx->m_stream;
2907 
2908 	 unsigned char *ptr;
2909 	 const size_t packetSize = 8;
2910 	ptr = stream->alloc(packetSize);
2911 	int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
2912 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2913 
2914 
2915 	int retval;
2916 	stream->readback(&retval, 4);
2917 	return retval;
2918 }
2919 
2920 }  // namespace
2921 
gl2_encoder_context_t(IOStream * stream)2922 gl2_encoder_context_t::gl2_encoder_context_t(IOStream *stream)
2923 {
2924 	m_stream = stream;
2925 
2926 	this->glActiveTexture = &glActiveTexture_enc;
2927 	this->glAttachShader = &glAttachShader_enc;
2928 	this->glBindAttribLocation = &glBindAttribLocation_enc;
2929 	this->glBindBuffer = &glBindBuffer_enc;
2930 	this->glBindFramebuffer = &glBindFramebuffer_enc;
2931 	this->glBindRenderbuffer = &glBindRenderbuffer_enc;
2932 	this->glBindTexture = &glBindTexture_enc;
2933 	this->glBlendColor = &glBlendColor_enc;
2934 	this->glBlendEquation = &glBlendEquation_enc;
2935 	this->glBlendEquationSeparate = &glBlendEquationSeparate_enc;
2936 	this->glBlendFunc = &glBlendFunc_enc;
2937 	this->glBlendFuncSeparate = &glBlendFuncSeparate_enc;
2938 	this->glBufferData = &glBufferData_enc;
2939 	this->glBufferSubData = &glBufferSubData_enc;
2940 	this->glCheckFramebufferStatus = &glCheckFramebufferStatus_enc;
2941 	this->glClear = &glClear_enc;
2942 	this->glClearColor = &glClearColor_enc;
2943 	this->glClearDepthf = &glClearDepthf_enc;
2944 	this->glClearStencil = &glClearStencil_enc;
2945 	this->glColorMask = &glColorMask_enc;
2946 	this->glCompileShader = &glCompileShader_enc;
2947 	this->glCompressedTexImage2D = &glCompressedTexImage2D_enc;
2948 	this->glCompressedTexSubImage2D = &glCompressedTexSubImage2D_enc;
2949 	this->glCopyTexImage2D = &glCopyTexImage2D_enc;
2950 	this->glCopyTexSubImage2D = &glCopyTexSubImage2D_enc;
2951 	this->glCreateProgram = &glCreateProgram_enc;
2952 	this->glCreateShader = &glCreateShader_enc;
2953 	this->glCullFace = &glCullFace_enc;
2954 	this->glDeleteBuffers = &glDeleteBuffers_enc;
2955 	this->glDeleteFramebuffers = &glDeleteFramebuffers_enc;
2956 	this->glDeleteProgram = &glDeleteProgram_enc;
2957 	this->glDeleteRenderbuffers = &glDeleteRenderbuffers_enc;
2958 	this->glDeleteShader = &glDeleteShader_enc;
2959 	this->glDeleteTextures = &glDeleteTextures_enc;
2960 	this->glDepthFunc = &glDepthFunc_enc;
2961 	this->glDepthMask = &glDepthMask_enc;
2962 	this->glDepthRangef = &glDepthRangef_enc;
2963 	this->glDetachShader = &glDetachShader_enc;
2964 	this->glDisable = &glDisable_enc;
2965 	this->glDisableVertexAttribArray = &glDisableVertexAttribArray_enc;
2966 	this->glDrawArrays = &glDrawArrays_enc;
2967 	this->glDrawElements = (glDrawElements_client_proc_t) &enc_unsupported;
2968 	this->glEnable = &glEnable_enc;
2969 	this->glEnableVertexAttribArray = &glEnableVertexAttribArray_enc;
2970 	this->glFinish = &glFinish_enc;
2971 	this->glFlush = &glFlush_enc;
2972 	this->glFramebufferRenderbuffer = &glFramebufferRenderbuffer_enc;
2973 	this->glFramebufferTexture2D = &glFramebufferTexture2D_enc;
2974 	this->glFrontFace = &glFrontFace_enc;
2975 	this->glGenBuffers = &glGenBuffers_enc;
2976 	this->glGenerateMipmap = &glGenerateMipmap_enc;
2977 	this->glGenFramebuffers = &glGenFramebuffers_enc;
2978 	this->glGenRenderbuffers = &glGenRenderbuffers_enc;
2979 	this->glGenTextures = &glGenTextures_enc;
2980 	this->glGetActiveAttrib = &glGetActiveAttrib_enc;
2981 	this->glGetActiveUniform = &glGetActiveUniform_enc;
2982 	this->glGetAttachedShaders = &glGetAttachedShaders_enc;
2983 	this->glGetAttribLocation = &glGetAttribLocation_enc;
2984 	this->glGetBooleanv = &glGetBooleanv_enc;
2985 	this->glGetBufferParameteriv = &glGetBufferParameteriv_enc;
2986 	this->glGetError = &glGetError_enc;
2987 	this->glGetFloatv = &glGetFloatv_enc;
2988 	this->glGetFramebufferAttachmentParameteriv = &glGetFramebufferAttachmentParameteriv_enc;
2989 	this->glGetIntegerv = &glGetIntegerv_enc;
2990 	this->glGetProgramiv = &glGetProgramiv_enc;
2991 	this->glGetProgramInfoLog = &glGetProgramInfoLog_enc;
2992 	this->glGetRenderbufferParameteriv = &glGetRenderbufferParameteriv_enc;
2993 	this->glGetShaderiv = &glGetShaderiv_enc;
2994 	this->glGetShaderInfoLog = &glGetShaderInfoLog_enc;
2995 	this->glGetShaderPrecisionFormat = &glGetShaderPrecisionFormat_enc;
2996 	this->glGetShaderSource = &glGetShaderSource_enc;
2997 	this->glGetString = (glGetString_client_proc_t) &enc_unsupported;
2998 	this->glGetTexParameterfv = &glGetTexParameterfv_enc;
2999 	this->glGetTexParameteriv = &glGetTexParameteriv_enc;
3000 	this->glGetUniformfv = &glGetUniformfv_enc;
3001 	this->glGetUniformiv = &glGetUniformiv_enc;
3002 	this->glGetUniformLocation = &glGetUniformLocation_enc;
3003 	this->glGetVertexAttribfv = &glGetVertexAttribfv_enc;
3004 	this->glGetVertexAttribiv = &glGetVertexAttribiv_enc;
3005 	this->glGetVertexAttribPointerv = (glGetVertexAttribPointerv_client_proc_t) &enc_unsupported;
3006 	this->glHint = &glHint_enc;
3007 	this->glIsBuffer = &glIsBuffer_enc;
3008 	this->glIsEnabled = &glIsEnabled_enc;
3009 	this->glIsFramebuffer = &glIsFramebuffer_enc;
3010 	this->glIsProgram = &glIsProgram_enc;
3011 	this->glIsRenderbuffer = &glIsRenderbuffer_enc;
3012 	this->glIsShader = &glIsShader_enc;
3013 	this->glIsTexture = &glIsTexture_enc;
3014 	this->glLineWidth = &glLineWidth_enc;
3015 	this->glLinkProgram = &glLinkProgram_enc;
3016 	this->glPixelStorei = &glPixelStorei_enc;
3017 	this->glPolygonOffset = &glPolygonOffset_enc;
3018 	this->glReadPixels = &glReadPixels_enc;
3019 	this->glReleaseShaderCompiler = &glReleaseShaderCompiler_enc;
3020 	this->glRenderbufferStorage = &glRenderbufferStorage_enc;
3021 	this->glSampleCoverage = &glSampleCoverage_enc;
3022 	this->glScissor = &glScissor_enc;
3023 	this->glShaderBinary = (glShaderBinary_client_proc_t) &enc_unsupported;
3024 	this->glShaderSource = (glShaderSource_client_proc_t) &enc_unsupported;
3025 	this->glStencilFunc = &glStencilFunc_enc;
3026 	this->glStencilFuncSeparate = &glStencilFuncSeparate_enc;
3027 	this->glStencilMask = &glStencilMask_enc;
3028 	this->glStencilMaskSeparate = &glStencilMaskSeparate_enc;
3029 	this->glStencilOp = &glStencilOp_enc;
3030 	this->glStencilOpSeparate = &glStencilOpSeparate_enc;
3031 	this->glTexImage2D = &glTexImage2D_enc;
3032 	this->glTexParameterf = &glTexParameterf_enc;
3033 	this->glTexParameterfv = &glTexParameterfv_enc;
3034 	this->glTexParameteri = &glTexParameteri_enc;
3035 	this->glTexParameteriv = &glTexParameteriv_enc;
3036 	this->glTexSubImage2D = &glTexSubImage2D_enc;
3037 	this->glUniform1f = &glUniform1f_enc;
3038 	this->glUniform1fv = &glUniform1fv_enc;
3039 	this->glUniform1i = &glUniform1i_enc;
3040 	this->glUniform1iv = &glUniform1iv_enc;
3041 	this->glUniform2f = &glUniform2f_enc;
3042 	this->glUniform2fv = &glUniform2fv_enc;
3043 	this->glUniform2i = &glUniform2i_enc;
3044 	this->glUniform2iv = &glUniform2iv_enc;
3045 	this->glUniform3f = &glUniform3f_enc;
3046 	this->glUniform3fv = &glUniform3fv_enc;
3047 	this->glUniform3i = &glUniform3i_enc;
3048 	this->glUniform3iv = &glUniform3iv_enc;
3049 	this->glUniform4f = &glUniform4f_enc;
3050 	this->glUniform4fv = &glUniform4fv_enc;
3051 	this->glUniform4i = &glUniform4i_enc;
3052 	this->glUniform4iv = &glUniform4iv_enc;
3053 	this->glUniformMatrix2fv = &glUniformMatrix2fv_enc;
3054 	this->glUniformMatrix3fv = &glUniformMatrix3fv_enc;
3055 	this->glUniformMatrix4fv = &glUniformMatrix4fv_enc;
3056 	this->glUseProgram = &glUseProgram_enc;
3057 	this->glValidateProgram = &glValidateProgram_enc;
3058 	this->glVertexAttrib1f = &glVertexAttrib1f_enc;
3059 	this->glVertexAttrib1fv = &glVertexAttrib1fv_enc;
3060 	this->glVertexAttrib2f = &glVertexAttrib2f_enc;
3061 	this->glVertexAttrib2fv = &glVertexAttrib2fv_enc;
3062 	this->glVertexAttrib3f = &glVertexAttrib3f_enc;
3063 	this->glVertexAttrib3fv = &glVertexAttrib3fv_enc;
3064 	this->glVertexAttrib4f = &glVertexAttrib4f_enc;
3065 	this->glVertexAttrib4fv = &glVertexAttrib4fv_enc;
3066 	this->glVertexAttribPointer = (glVertexAttribPointer_client_proc_t) &enc_unsupported;
3067 	this->glViewport = &glViewport_enc;
3068 	this->glEGLImageTargetTexture2DOES = &glEGLImageTargetTexture2DOES_enc;
3069 	this->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES_enc;
3070 	this->glGetProgramBinaryOES = (glGetProgramBinaryOES_client_proc_t) &enc_unsupported;
3071 	this->glProgramBinaryOES = (glProgramBinaryOES_client_proc_t) &enc_unsupported;
3072 	this->glMapBufferOES = (glMapBufferOES_client_proc_t) &enc_unsupported;
3073 	this->glUnmapBufferOES = &glUnmapBufferOES_enc;
3074 	this->glTexImage3DOES = &glTexImage3DOES_enc;
3075 	this->glTexSubImage3DOES = &glTexSubImage3DOES_enc;
3076 	this->glCopyTexSubImage3DOES = &glCopyTexSubImage3DOES_enc;
3077 	this->glCompressedTexImage3DOES = &glCompressedTexImage3DOES_enc;
3078 	this->glCompressedTexSubImage3DOES = &glCompressedTexSubImage3DOES_enc;
3079 	this->glFramebufferTexture3DOES = &glFramebufferTexture3DOES_enc;
3080 	this->glBindVertexArrayOES = &glBindVertexArrayOES_enc;
3081 	this->glDeleteVertexArraysOES = &glDeleteVertexArraysOES_enc;
3082 	this->glGenVertexArraysOES = &glGenVertexArraysOES_enc;
3083 	this->glIsVertexArrayOES = &glIsVertexArrayOES_enc;
3084 	this->glDiscardFramebufferEXT = &glDiscardFramebufferEXT_enc;
3085 	this->glMultiDrawArraysEXT = (glMultiDrawArraysEXT_client_proc_t) &enc_unsupported;
3086 	this->glMultiDrawElementsEXT = (glMultiDrawElementsEXT_client_proc_t) &enc_unsupported;
3087 	this->glGetPerfMonitorGroupsAMD = (glGetPerfMonitorGroupsAMD_client_proc_t) &enc_unsupported;
3088 	this->glGetPerfMonitorCountersAMD = (glGetPerfMonitorCountersAMD_client_proc_t) &enc_unsupported;
3089 	this->glGetPerfMonitorGroupStringAMD = (glGetPerfMonitorGroupStringAMD_client_proc_t) &enc_unsupported;
3090 	this->glGetPerfMonitorCounterStringAMD = (glGetPerfMonitorCounterStringAMD_client_proc_t) &enc_unsupported;
3091 	this->glGetPerfMonitorCounterInfoAMD = (glGetPerfMonitorCounterInfoAMD_client_proc_t) &enc_unsupported;
3092 	this->glGenPerfMonitorsAMD = (glGenPerfMonitorsAMD_client_proc_t) &enc_unsupported;
3093 	this->glDeletePerfMonitorsAMD = (glDeletePerfMonitorsAMD_client_proc_t) &enc_unsupported;
3094 	this->glSelectPerfMonitorCountersAMD = (glSelectPerfMonitorCountersAMD_client_proc_t) &enc_unsupported;
3095 	this->glBeginPerfMonitorAMD = (glBeginPerfMonitorAMD_client_proc_t) &enc_unsupported;
3096 	this->glEndPerfMonitorAMD = (glEndPerfMonitorAMD_client_proc_t) &enc_unsupported;
3097 	this->glGetPerfMonitorCounterDataAMD = (glGetPerfMonitorCounterDataAMD_client_proc_t) &enc_unsupported;
3098 	this->glRenderbufferStorageMultisampleIMG = (glRenderbufferStorageMultisampleIMG_client_proc_t) &enc_unsupported;
3099 	this->glFramebufferTexture2DMultisampleIMG = (glFramebufferTexture2DMultisampleIMG_client_proc_t) &enc_unsupported;
3100 	this->glDeleteFencesNV = (glDeleteFencesNV_client_proc_t) &enc_unsupported;
3101 	this->glGenFencesNV = (glGenFencesNV_client_proc_t) &enc_unsupported;
3102 	this->glIsFenceNV = (glIsFenceNV_client_proc_t) &enc_unsupported;
3103 	this->glTestFenceNV = (glTestFenceNV_client_proc_t) &enc_unsupported;
3104 	this->glGetFenceivNV = (glGetFenceivNV_client_proc_t) &enc_unsupported;
3105 	this->glFinishFenceNV = (glFinishFenceNV_client_proc_t) &enc_unsupported;
3106 	this->glSetFenceNV = (glSetFenceNV_client_proc_t) &enc_unsupported;
3107 	this->glCoverageMaskNV = (glCoverageMaskNV_client_proc_t) &enc_unsupported;
3108 	this->glCoverageOperationNV = (glCoverageOperationNV_client_proc_t) &enc_unsupported;
3109 	this->glGetDriverControlsQCOM = (glGetDriverControlsQCOM_client_proc_t) &enc_unsupported;
3110 	this->glGetDriverControlStringQCOM = (glGetDriverControlStringQCOM_client_proc_t) &enc_unsupported;
3111 	this->glEnableDriverControlQCOM = (glEnableDriverControlQCOM_client_proc_t) &enc_unsupported;
3112 	this->glDisableDriverControlQCOM = (glDisableDriverControlQCOM_client_proc_t) &enc_unsupported;
3113 	this->glExtGetTexturesQCOM = (glExtGetTexturesQCOM_client_proc_t) &enc_unsupported;
3114 	this->glExtGetBuffersQCOM = (glExtGetBuffersQCOM_client_proc_t) &enc_unsupported;
3115 	this->glExtGetRenderbuffersQCOM = (glExtGetRenderbuffersQCOM_client_proc_t) &enc_unsupported;
3116 	this->glExtGetFramebuffersQCOM = (glExtGetFramebuffersQCOM_client_proc_t) &enc_unsupported;
3117 	this->glExtGetTexLevelParameterivQCOM = (glExtGetTexLevelParameterivQCOM_client_proc_t) &enc_unsupported;
3118 	this->glExtTexObjectStateOverrideiQCOM = (glExtTexObjectStateOverrideiQCOM_client_proc_t) &enc_unsupported;
3119 	this->glExtGetTexSubImageQCOM = (glExtGetTexSubImageQCOM_client_proc_t) &enc_unsupported;
3120 	this->glExtGetBufferPointervQCOM = (glExtGetBufferPointervQCOM_client_proc_t) &enc_unsupported;
3121 	this->glExtGetShadersQCOM = (glExtGetShadersQCOM_client_proc_t) &enc_unsupported;
3122 	this->glExtGetProgramsQCOM = (glExtGetProgramsQCOM_client_proc_t) &enc_unsupported;
3123 	this->glExtIsProgramBinaryQCOM = (glExtIsProgramBinaryQCOM_client_proc_t) &enc_unsupported;
3124 	this->glExtGetProgramBinarySourceQCOM = (glExtGetProgramBinarySourceQCOM_client_proc_t) &enc_unsupported;
3125 	this->glStartTilingQCOM = (glStartTilingQCOM_client_proc_t) &enc_unsupported;
3126 	this->glEndTilingQCOM = (glEndTilingQCOM_client_proc_t) &enc_unsupported;
3127 	this->glVertexAttribPointerData = &glVertexAttribPointerData_enc;
3128 	this->glVertexAttribPointerOffset = &glVertexAttribPointerOffset_enc;
3129 	this->glDrawElementsOffset = &glDrawElementsOffset_enc;
3130 	this->glDrawElementsData = &glDrawElementsData_enc;
3131 	this->glGetCompressedTextureFormats = &glGetCompressedTextureFormats_enc;
3132 	this->glShaderString = &glShaderString_enc;
3133 	this->glFinishRoundTrip = &glFinishRoundTrip_enc;
3134 }
3135 
3136