• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated Code - DO NOT EDIT !!
2 // generated by 'emugen'
3 
4 
5 #include <string.h>
6 #include "gl_opcodes.h"
7 
8 #include "gl_enc.h"
9 
10 
11 #include <stdio.h>
enc_unsupported()12 static void enc_unsupported()
13 {
14 	ALOGE("Function is unsupported\n");
15 }
16 
glAlphaFunc_enc(void * self,GLenum func,GLclampf ref)17 void glAlphaFunc_enc(void *self , GLenum func, GLclampf ref)
18 {
19 
20 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
21 	IOStream *stream = ctx->m_stream;
22 
23 	 unsigned char *ptr;
24 	 const size_t packetSize = 8 + 4 + 4;
25 	ptr = stream->alloc(packetSize);
26 	int tmp = OP_glAlphaFunc;memcpy(ptr, &tmp, 4); ptr += 4;
27 	memcpy(ptr, &packetSize, 4);  ptr += 4;
28 
29 		memcpy(ptr, &func, 4); ptr += 4;
30 		memcpy(ptr, &ref, 4); ptr += 4;
31 }
32 
glClearColor_enc(void * self,GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha)33 void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
34 {
35 
36 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
37 	IOStream *stream = ctx->m_stream;
38 
39 	 unsigned char *ptr;
40 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
41 	ptr = stream->alloc(packetSize);
42 	int tmp = OP_glClearColor;memcpy(ptr, &tmp, 4); ptr += 4;
43 	memcpy(ptr, &packetSize, 4);  ptr += 4;
44 
45 		memcpy(ptr, &red, 4); ptr += 4;
46 		memcpy(ptr, &green, 4); ptr += 4;
47 		memcpy(ptr, &blue, 4); ptr += 4;
48 		memcpy(ptr, &alpha, 4); ptr += 4;
49 }
50 
glClearDepthf_enc(void * self,GLclampf depth)51 void glClearDepthf_enc(void *self , GLclampf depth)
52 {
53 
54 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
55 	IOStream *stream = ctx->m_stream;
56 
57 	 unsigned char *ptr;
58 	 const size_t packetSize = 8 + 4;
59 	ptr = stream->alloc(packetSize);
60 	int tmp = OP_glClearDepthf;memcpy(ptr, &tmp, 4); ptr += 4;
61 	memcpy(ptr, &packetSize, 4);  ptr += 4;
62 
63 		memcpy(ptr, &depth, 4); ptr += 4;
64 }
65 
glClipPlanef_enc(void * self,GLenum plane,const GLfloat * equation)66 void glClipPlanef_enc(void *self , GLenum plane, const GLfloat* equation)
67 {
68 
69 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
70 	IOStream *stream = ctx->m_stream;
71 
72 	const unsigned int __size_equation =  (4 * sizeof(float));
73 	 unsigned char *ptr;
74 	 const size_t packetSize = 8 + 4 + __size_equation + 1*4;
75 	ptr = stream->alloc(packetSize);
76 	int tmp = OP_glClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
77 	memcpy(ptr, &packetSize, 4);  ptr += 4;
78 
79 		memcpy(ptr, &plane, 4); ptr += 4;
80 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
81 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
82 }
83 
glColor4f_enc(void * self,GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)84 void glColor4f_enc(void *self , GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
85 {
86 
87 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
88 	IOStream *stream = ctx->m_stream;
89 
90 	 unsigned char *ptr;
91 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
92 	ptr = stream->alloc(packetSize);
93 	int tmp = OP_glColor4f;memcpy(ptr, &tmp, 4); ptr += 4;
94 	memcpy(ptr, &packetSize, 4);  ptr += 4;
95 
96 		memcpy(ptr, &red, 4); ptr += 4;
97 		memcpy(ptr, &green, 4); ptr += 4;
98 		memcpy(ptr, &blue, 4); ptr += 4;
99 		memcpy(ptr, &alpha, 4); ptr += 4;
100 }
101 
glDepthRangef_enc(void * self,GLclampf zNear,GLclampf zFar)102 void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar)
103 {
104 
105 	gl_encoder_context_t *ctx = (gl_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_glDepthRangef;memcpy(ptr, &tmp, 4); ptr += 4;
112 	memcpy(ptr, &packetSize, 4);  ptr += 4;
113 
114 		memcpy(ptr, &zNear, 4); ptr += 4;
115 		memcpy(ptr, &zFar, 4); ptr += 4;
116 }
117 
glFogf_enc(void * self,GLenum pname,GLfloat param)118 void glFogf_enc(void *self , GLenum pname, GLfloat param)
119 {
120 
121 	gl_encoder_context_t *ctx = (gl_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_glFogf;memcpy(ptr, &tmp, 4); ptr += 4;
128 	memcpy(ptr, &packetSize, 4);  ptr += 4;
129 
130 		memcpy(ptr, &pname, 4); ptr += 4;
131 		memcpy(ptr, &param, 4); ptr += 4;
132 }
133 
glFogfv_enc(void * self,GLenum pname,const GLfloat * params)134 void glFogfv_enc(void *self , GLenum pname, const GLfloat* params)
135 {
136 
137 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
138 	IOStream *stream = ctx->m_stream;
139 
140 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
141 	 unsigned char *ptr;
142 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
143 	ptr = stream->alloc(packetSize);
144 	int tmp = OP_glFogfv;memcpy(ptr, &tmp, 4); ptr += 4;
145 	memcpy(ptr, &packetSize, 4);  ptr += 4;
146 
147 		memcpy(ptr, &pname, 4); ptr += 4;
148 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
149 	memcpy(ptr, params, __size_params);ptr += __size_params;
150 }
151 
glFrustumf_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)152 void glFrustumf_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
153 {
154 
155 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
156 	IOStream *stream = ctx->m_stream;
157 
158 	 unsigned char *ptr;
159 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
160 	ptr = stream->alloc(packetSize);
161 	int tmp = OP_glFrustumf;memcpy(ptr, &tmp, 4); ptr += 4;
162 	memcpy(ptr, &packetSize, 4);  ptr += 4;
163 
164 		memcpy(ptr, &left, 4); ptr += 4;
165 		memcpy(ptr, &right, 4); ptr += 4;
166 		memcpy(ptr, &bottom, 4); ptr += 4;
167 		memcpy(ptr, &top, 4); ptr += 4;
168 		memcpy(ptr, &zNear, 4); ptr += 4;
169 		memcpy(ptr, &zFar, 4); ptr += 4;
170 }
171 
glGetClipPlanef_enc(void * self,GLenum pname,GLfloat * eqn)172 void glGetClipPlanef_enc(void *self , GLenum pname, GLfloat* eqn)
173 {
174 
175 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
176 	IOStream *stream = ctx->m_stream;
177 
178 	const unsigned int __size_eqn =  (4 * sizeof(GLfloat));
179 	 unsigned char *ptr;
180 	 const size_t packetSize = 8 + 4 + __size_eqn + 1*4;
181 	ptr = stream->alloc(packetSize);
182 	int tmp = OP_glGetClipPlanef;memcpy(ptr, &tmp, 4); ptr += 4;
183 	memcpy(ptr, &packetSize, 4);  ptr += 4;
184 
185 		memcpy(ptr, &pname, 4); ptr += 4;
186 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
187 	stream->readback(eqn, __size_eqn);
188 }
189 
glGetFloatv_enc(void * self,GLenum pname,GLfloat * params)190 void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params)
191 {
192 
193 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
194 	IOStream *stream = ctx->m_stream;
195 
196 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
197 	 unsigned char *ptr;
198 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
199 	ptr = stream->alloc(packetSize);
200 	int tmp = OP_glGetFloatv;memcpy(ptr, &tmp, 4); ptr += 4;
201 	memcpy(ptr, &packetSize, 4);  ptr += 4;
202 
203 		memcpy(ptr, &pname, 4); ptr += 4;
204 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
205 	stream->readback(params, __size_params);
206 }
207 
glGetLightfv_enc(void * self,GLenum light,GLenum pname,GLfloat * params)208 void glGetLightfv_enc(void *self , GLenum light, GLenum pname, GLfloat* params)
209 {
210 
211 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
212 	IOStream *stream = ctx->m_stream;
213 
214 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
215 	 unsigned char *ptr;
216 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
217 	ptr = stream->alloc(packetSize);
218 	int tmp = OP_glGetLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
219 	memcpy(ptr, &packetSize, 4);  ptr += 4;
220 
221 		memcpy(ptr, &light, 4); ptr += 4;
222 		memcpy(ptr, &pname, 4); ptr += 4;
223 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
224 	stream->readback(params, __size_params);
225 }
226 
glGetMaterialfv_enc(void * self,GLenum face,GLenum pname,GLfloat * params)227 void glGetMaterialfv_enc(void *self , GLenum face, GLenum pname, GLfloat* params)
228 {
229 
230 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
231 	IOStream *stream = ctx->m_stream;
232 
233 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
234 	 unsigned char *ptr;
235 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
236 	ptr = stream->alloc(packetSize);
237 	int tmp = OP_glGetMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
238 	memcpy(ptr, &packetSize, 4);  ptr += 4;
239 
240 		memcpy(ptr, &face, 4); ptr += 4;
241 		memcpy(ptr, &pname, 4); ptr += 4;
242 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
243 	stream->readback(params, __size_params);
244 }
245 
glGetTexEnvfv_enc(void * self,GLenum env,GLenum pname,GLfloat * params)246 void glGetTexEnvfv_enc(void *self , GLenum env, GLenum pname, GLfloat* params)
247 {
248 
249 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
250 	IOStream *stream = ctx->m_stream;
251 
252 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
253 	 unsigned char *ptr;
254 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
255 	ptr = stream->alloc(packetSize);
256 	int tmp = OP_glGetTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
257 	memcpy(ptr, &packetSize, 4);  ptr += 4;
258 
259 		memcpy(ptr, &env, 4); ptr += 4;
260 		memcpy(ptr, &pname, 4); ptr += 4;
261 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
262 	stream->readback(params, __size_params);
263 }
264 
glGetTexParameterfv_enc(void * self,GLenum target,GLenum pname,GLfloat * params)265 void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params)
266 {
267 
268 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
269 	IOStream *stream = ctx->m_stream;
270 
271 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
272 	 unsigned char *ptr;
273 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
274 	ptr = stream->alloc(packetSize);
275 	int tmp = OP_glGetTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
276 	memcpy(ptr, &packetSize, 4);  ptr += 4;
277 
278 		memcpy(ptr, &target, 4); ptr += 4;
279 		memcpy(ptr, &pname, 4); ptr += 4;
280 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
281 	stream->readback(params, __size_params);
282 }
283 
glLightModelf_enc(void * self,GLenum pname,GLfloat param)284 void glLightModelf_enc(void *self , GLenum pname, GLfloat param)
285 {
286 
287 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
288 	IOStream *stream = ctx->m_stream;
289 
290 	 unsigned char *ptr;
291 	 const size_t packetSize = 8 + 4 + 4;
292 	ptr = stream->alloc(packetSize);
293 	int tmp = OP_glLightModelf;memcpy(ptr, &tmp, 4); ptr += 4;
294 	memcpy(ptr, &packetSize, 4);  ptr += 4;
295 
296 		memcpy(ptr, &pname, 4); ptr += 4;
297 		memcpy(ptr, &param, 4); ptr += 4;
298 }
299 
glLightModelfv_enc(void * self,GLenum pname,const GLfloat * params)300 void glLightModelfv_enc(void *self , GLenum pname, const GLfloat* params)
301 {
302 
303 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
304 	IOStream *stream = ctx->m_stream;
305 
306 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
307 	 unsigned char *ptr;
308 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
309 	ptr = stream->alloc(packetSize);
310 	int tmp = OP_glLightModelfv;memcpy(ptr, &tmp, 4); ptr += 4;
311 	memcpy(ptr, &packetSize, 4);  ptr += 4;
312 
313 		memcpy(ptr, &pname, 4); ptr += 4;
314 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
315 	memcpy(ptr, params, __size_params);ptr += __size_params;
316 }
317 
glLightf_enc(void * self,GLenum light,GLenum pname,GLfloat param)318 void glLightf_enc(void *self , GLenum light, GLenum pname, GLfloat param)
319 {
320 
321 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
322 	IOStream *stream = ctx->m_stream;
323 
324 	 unsigned char *ptr;
325 	 const size_t packetSize = 8 + 4 + 4 + 4;
326 	ptr = stream->alloc(packetSize);
327 	int tmp = OP_glLightf;memcpy(ptr, &tmp, 4); ptr += 4;
328 	memcpy(ptr, &packetSize, 4);  ptr += 4;
329 
330 		memcpy(ptr, &light, 4); ptr += 4;
331 		memcpy(ptr, &pname, 4); ptr += 4;
332 		memcpy(ptr, &param, 4); ptr += 4;
333 }
334 
glLightfv_enc(void * self,GLenum light,GLenum pname,const GLfloat * params)335 void glLightfv_enc(void *self , GLenum light, GLenum pname, const GLfloat* params)
336 {
337 
338 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
339 	IOStream *stream = ctx->m_stream;
340 
341 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
342 	 unsigned char *ptr;
343 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
344 	ptr = stream->alloc(packetSize);
345 	int tmp = OP_glLightfv;memcpy(ptr, &tmp, 4); ptr += 4;
346 	memcpy(ptr, &packetSize, 4);  ptr += 4;
347 
348 		memcpy(ptr, &light, 4); ptr += 4;
349 		memcpy(ptr, &pname, 4); ptr += 4;
350 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
351 	memcpy(ptr, params, __size_params);ptr += __size_params;
352 }
353 
glLineWidth_enc(void * self,GLfloat width)354 void glLineWidth_enc(void *self , GLfloat width)
355 {
356 
357 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
358 	IOStream *stream = ctx->m_stream;
359 
360 	 unsigned char *ptr;
361 	 const size_t packetSize = 8 + 4;
362 	ptr = stream->alloc(packetSize);
363 	int tmp = OP_glLineWidth;memcpy(ptr, &tmp, 4); ptr += 4;
364 	memcpy(ptr, &packetSize, 4);  ptr += 4;
365 
366 		memcpy(ptr, &width, 4); ptr += 4;
367 }
368 
glLoadMatrixf_enc(void * self,const GLfloat * m)369 void glLoadMatrixf_enc(void *self , const GLfloat* m)
370 {
371 
372 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
373 	IOStream *stream = ctx->m_stream;
374 
375 	const unsigned int __size_m =  (16 * sizeof(GLfloat));
376 	 unsigned char *ptr;
377 	 const size_t packetSize = 8 + __size_m + 1*4;
378 	ptr = stream->alloc(packetSize);
379 	int tmp = OP_glLoadMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
380 	memcpy(ptr, &packetSize, 4);  ptr += 4;
381 
382 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
383 	memcpy(ptr, m, __size_m);ptr += __size_m;
384 }
385 
glMaterialf_enc(void * self,GLenum face,GLenum pname,GLfloat param)386 void glMaterialf_enc(void *self , GLenum face, GLenum pname, GLfloat param)
387 {
388 
389 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
390 	IOStream *stream = ctx->m_stream;
391 
392 	 unsigned char *ptr;
393 	 const size_t packetSize = 8 + 4 + 4 + 4;
394 	ptr = stream->alloc(packetSize);
395 	int tmp = OP_glMaterialf;memcpy(ptr, &tmp, 4); ptr += 4;
396 	memcpy(ptr, &packetSize, 4);  ptr += 4;
397 
398 		memcpy(ptr, &face, 4); ptr += 4;
399 		memcpy(ptr, &pname, 4); ptr += 4;
400 		memcpy(ptr, &param, 4); ptr += 4;
401 }
402 
glMaterialfv_enc(void * self,GLenum face,GLenum pname,const GLfloat * params)403 void glMaterialfv_enc(void *self , GLenum face, GLenum pname, const GLfloat* params)
404 {
405 
406 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
407 	IOStream *stream = ctx->m_stream;
408 
409 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
410 	 unsigned char *ptr;
411 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
412 	ptr = stream->alloc(packetSize);
413 	int tmp = OP_glMaterialfv;memcpy(ptr, &tmp, 4); ptr += 4;
414 	memcpy(ptr, &packetSize, 4);  ptr += 4;
415 
416 		memcpy(ptr, &face, 4); ptr += 4;
417 		memcpy(ptr, &pname, 4); ptr += 4;
418 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
419 	memcpy(ptr, params, __size_params);ptr += __size_params;
420 }
421 
glMultMatrixf_enc(void * self,const GLfloat * m)422 void glMultMatrixf_enc(void *self , const GLfloat* m)
423 {
424 
425 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
426 	IOStream *stream = ctx->m_stream;
427 
428 	const unsigned int __size_m =  (16 * sizeof(GLfloat));
429 	 unsigned char *ptr;
430 	 const size_t packetSize = 8 + __size_m + 1*4;
431 	ptr = stream->alloc(packetSize);
432 	int tmp = OP_glMultMatrixf;memcpy(ptr, &tmp, 4); ptr += 4;
433 	memcpy(ptr, &packetSize, 4);  ptr += 4;
434 
435 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
436 	memcpy(ptr, m, __size_m);ptr += __size_m;
437 }
438 
glMultiTexCoord4f_enc(void * self,GLenum target,GLfloat s,GLfloat t,GLfloat r,GLfloat q)439 void glMultiTexCoord4f_enc(void *self , GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
440 {
441 
442 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
443 	IOStream *stream = ctx->m_stream;
444 
445 	 unsigned char *ptr;
446 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
447 	ptr = stream->alloc(packetSize);
448 	int tmp = OP_glMultiTexCoord4f;memcpy(ptr, &tmp, 4); ptr += 4;
449 	memcpy(ptr, &packetSize, 4);  ptr += 4;
450 
451 		memcpy(ptr, &target, 4); ptr += 4;
452 		memcpy(ptr, &s, 4); ptr += 4;
453 		memcpy(ptr, &t, 4); ptr += 4;
454 		memcpy(ptr, &r, 4); ptr += 4;
455 		memcpy(ptr, &q, 4); ptr += 4;
456 }
457 
glNormal3f_enc(void * self,GLfloat nx,GLfloat ny,GLfloat nz)458 void glNormal3f_enc(void *self , GLfloat nx, GLfloat ny, GLfloat nz)
459 {
460 
461 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
462 	IOStream *stream = ctx->m_stream;
463 
464 	 unsigned char *ptr;
465 	 const size_t packetSize = 8 + 4 + 4 + 4;
466 	ptr = stream->alloc(packetSize);
467 	int tmp = OP_glNormal3f;memcpy(ptr, &tmp, 4); ptr += 4;
468 	memcpy(ptr, &packetSize, 4);  ptr += 4;
469 
470 		memcpy(ptr, &nx, 4); ptr += 4;
471 		memcpy(ptr, &ny, 4); ptr += 4;
472 		memcpy(ptr, &nz, 4); ptr += 4;
473 }
474 
glOrthof_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)475 void glOrthof_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
476 {
477 
478 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
479 	IOStream *stream = ctx->m_stream;
480 
481 	 unsigned char *ptr;
482 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
483 	ptr = stream->alloc(packetSize);
484 	int tmp = OP_glOrthof;memcpy(ptr, &tmp, 4); ptr += 4;
485 	memcpy(ptr, &packetSize, 4);  ptr += 4;
486 
487 		memcpy(ptr, &left, 4); ptr += 4;
488 		memcpy(ptr, &right, 4); ptr += 4;
489 		memcpy(ptr, &bottom, 4); ptr += 4;
490 		memcpy(ptr, &top, 4); ptr += 4;
491 		memcpy(ptr, &zNear, 4); ptr += 4;
492 		memcpy(ptr, &zFar, 4); ptr += 4;
493 }
494 
glPointParameterf_enc(void * self,GLenum pname,GLfloat param)495 void glPointParameterf_enc(void *self , GLenum pname, GLfloat param)
496 {
497 
498 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
499 	IOStream *stream = ctx->m_stream;
500 
501 	 unsigned char *ptr;
502 	 const size_t packetSize = 8 + 4 + 4;
503 	ptr = stream->alloc(packetSize);
504 	int tmp = OP_glPointParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
505 	memcpy(ptr, &packetSize, 4);  ptr += 4;
506 
507 		memcpy(ptr, &pname, 4); ptr += 4;
508 		memcpy(ptr, &param, 4); ptr += 4;
509 }
510 
glPointParameterfv_enc(void * self,GLenum pname,const GLfloat * params)511 void glPointParameterfv_enc(void *self , GLenum pname, const GLfloat* params)
512 {
513 
514 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
515 	IOStream *stream = ctx->m_stream;
516 
517 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
518 	 unsigned char *ptr;
519 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
520 	ptr = stream->alloc(packetSize);
521 	int tmp = OP_glPointParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
522 	memcpy(ptr, &packetSize, 4);  ptr += 4;
523 
524 		memcpy(ptr, &pname, 4); ptr += 4;
525 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
526 	memcpy(ptr, params, __size_params);ptr += __size_params;
527 }
528 
glPointSize_enc(void * self,GLfloat size)529 void glPointSize_enc(void *self , GLfloat size)
530 {
531 
532 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
533 	IOStream *stream = ctx->m_stream;
534 
535 	 unsigned char *ptr;
536 	 const size_t packetSize = 8 + 4;
537 	ptr = stream->alloc(packetSize);
538 	int tmp = OP_glPointSize;memcpy(ptr, &tmp, 4); ptr += 4;
539 	memcpy(ptr, &packetSize, 4);  ptr += 4;
540 
541 		memcpy(ptr, &size, 4); ptr += 4;
542 }
543 
glPolygonOffset_enc(void * self,GLfloat factor,GLfloat units)544 void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units)
545 {
546 
547 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
548 	IOStream *stream = ctx->m_stream;
549 
550 	 unsigned char *ptr;
551 	 const size_t packetSize = 8 + 4 + 4;
552 	ptr = stream->alloc(packetSize);
553 	int tmp = OP_glPolygonOffset;memcpy(ptr, &tmp, 4); ptr += 4;
554 	memcpy(ptr, &packetSize, 4);  ptr += 4;
555 
556 		memcpy(ptr, &factor, 4); ptr += 4;
557 		memcpy(ptr, &units, 4); ptr += 4;
558 }
559 
glRotatef_enc(void * self,GLfloat angle,GLfloat x,GLfloat y,GLfloat z)560 void glRotatef_enc(void *self , GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
561 {
562 
563 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
564 	IOStream *stream = ctx->m_stream;
565 
566 	 unsigned char *ptr;
567 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
568 	ptr = stream->alloc(packetSize);
569 	int tmp = OP_glRotatef;memcpy(ptr, &tmp, 4); ptr += 4;
570 	memcpy(ptr, &packetSize, 4);  ptr += 4;
571 
572 		memcpy(ptr, &angle, 4); ptr += 4;
573 		memcpy(ptr, &x, 4); ptr += 4;
574 		memcpy(ptr, &y, 4); ptr += 4;
575 		memcpy(ptr, &z, 4); ptr += 4;
576 }
577 
glScalef_enc(void * self,GLfloat x,GLfloat y,GLfloat z)578 void glScalef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
579 {
580 
581 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
582 	IOStream *stream = ctx->m_stream;
583 
584 	 unsigned char *ptr;
585 	 const size_t packetSize = 8 + 4 + 4 + 4;
586 	ptr = stream->alloc(packetSize);
587 	int tmp = OP_glScalef;memcpy(ptr, &tmp, 4); ptr += 4;
588 	memcpy(ptr, &packetSize, 4);  ptr += 4;
589 
590 		memcpy(ptr, &x, 4); ptr += 4;
591 		memcpy(ptr, &y, 4); ptr += 4;
592 		memcpy(ptr, &z, 4); ptr += 4;
593 }
594 
glTexEnvf_enc(void * self,GLenum target,GLenum pname,GLfloat param)595 void glTexEnvf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
596 {
597 
598 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
599 	IOStream *stream = ctx->m_stream;
600 
601 	 unsigned char *ptr;
602 	 const size_t packetSize = 8 + 4 + 4 + 4;
603 	ptr = stream->alloc(packetSize);
604 	int tmp = OP_glTexEnvf;memcpy(ptr, &tmp, 4); ptr += 4;
605 	memcpy(ptr, &packetSize, 4);  ptr += 4;
606 
607 		memcpy(ptr, &target, 4); ptr += 4;
608 		memcpy(ptr, &pname, 4); ptr += 4;
609 		memcpy(ptr, &param, 4); ptr += 4;
610 }
611 
glTexEnvfv_enc(void * self,GLenum target,GLenum pname,const GLfloat * params)612 void glTexEnvfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
613 {
614 
615 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
616 	IOStream *stream = ctx->m_stream;
617 
618 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
619 	 unsigned char *ptr;
620 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
621 	ptr = stream->alloc(packetSize);
622 	int tmp = OP_glTexEnvfv;memcpy(ptr, &tmp, 4); ptr += 4;
623 	memcpy(ptr, &packetSize, 4);  ptr += 4;
624 
625 		memcpy(ptr, &target, 4); ptr += 4;
626 		memcpy(ptr, &pname, 4); ptr += 4;
627 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
628 	memcpy(ptr, params, __size_params);ptr += __size_params;
629 }
630 
glTexParameterf_enc(void * self,GLenum target,GLenum pname,GLfloat param)631 void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param)
632 {
633 
634 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
635 	IOStream *stream = ctx->m_stream;
636 
637 	 unsigned char *ptr;
638 	 const size_t packetSize = 8 + 4 + 4 + 4;
639 	ptr = stream->alloc(packetSize);
640 	int tmp = OP_glTexParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
641 	memcpy(ptr, &packetSize, 4);  ptr += 4;
642 
643 		memcpy(ptr, &target, 4); ptr += 4;
644 		memcpy(ptr, &pname, 4); ptr += 4;
645 		memcpy(ptr, &param, 4); ptr += 4;
646 }
647 
glTexParameterfv_enc(void * self,GLenum target,GLenum pname,const GLfloat * params)648 void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params)
649 {
650 
651 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
652 	IOStream *stream = ctx->m_stream;
653 
654 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
655 	 unsigned char *ptr;
656 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
657 	ptr = stream->alloc(packetSize);
658 	int tmp = OP_glTexParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
659 	memcpy(ptr, &packetSize, 4);  ptr += 4;
660 
661 		memcpy(ptr, &target, 4); ptr += 4;
662 		memcpy(ptr, &pname, 4); ptr += 4;
663 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
664 	memcpy(ptr, params, __size_params);ptr += __size_params;
665 }
666 
glTranslatef_enc(void * self,GLfloat x,GLfloat y,GLfloat z)667 void glTranslatef_enc(void *self , GLfloat x, GLfloat y, GLfloat z)
668 {
669 
670 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
671 	IOStream *stream = ctx->m_stream;
672 
673 	 unsigned char *ptr;
674 	 const size_t packetSize = 8 + 4 + 4 + 4;
675 	ptr = stream->alloc(packetSize);
676 	int tmp = OP_glTranslatef;memcpy(ptr, &tmp, 4); ptr += 4;
677 	memcpy(ptr, &packetSize, 4);  ptr += 4;
678 
679 		memcpy(ptr, &x, 4); ptr += 4;
680 		memcpy(ptr, &y, 4); ptr += 4;
681 		memcpy(ptr, &z, 4); ptr += 4;
682 }
683 
glActiveTexture_enc(void * self,GLenum texture)684 void glActiveTexture_enc(void *self , GLenum texture)
685 {
686 
687 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
688 	IOStream *stream = ctx->m_stream;
689 
690 	 unsigned char *ptr;
691 	 const size_t packetSize = 8 + 4;
692 	ptr = stream->alloc(packetSize);
693 	int tmp = OP_glActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
694 	memcpy(ptr, &packetSize, 4);  ptr += 4;
695 
696 		memcpy(ptr, &texture, 4); ptr += 4;
697 }
698 
glAlphaFuncx_enc(void * self,GLenum func,GLclampx ref)699 void glAlphaFuncx_enc(void *self , GLenum func, GLclampx ref)
700 {
701 
702 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
703 	IOStream *stream = ctx->m_stream;
704 
705 	 unsigned char *ptr;
706 	 const size_t packetSize = 8 + 4 + 4;
707 	ptr = stream->alloc(packetSize);
708 	int tmp = OP_glAlphaFuncx;memcpy(ptr, &tmp, 4); ptr += 4;
709 	memcpy(ptr, &packetSize, 4);  ptr += 4;
710 
711 		memcpy(ptr, &func, 4); ptr += 4;
712 		memcpy(ptr, &ref, 4); ptr += 4;
713 }
714 
glBindBuffer_enc(void * self,GLenum target,GLuint buffer)715 void glBindBuffer_enc(void *self , GLenum target, GLuint buffer)
716 {
717 
718 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
719 	IOStream *stream = ctx->m_stream;
720 
721 	 unsigned char *ptr;
722 	 const size_t packetSize = 8 + 4 + 4;
723 	ptr = stream->alloc(packetSize);
724 	int tmp = OP_glBindBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
725 	memcpy(ptr, &packetSize, 4);  ptr += 4;
726 
727 		memcpy(ptr, &target, 4); ptr += 4;
728 		memcpy(ptr, &buffer, 4); ptr += 4;
729 }
730 
glBindTexture_enc(void * self,GLenum target,GLuint texture)731 void glBindTexture_enc(void *self , GLenum target, GLuint texture)
732 {
733 
734 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
735 	IOStream *stream = ctx->m_stream;
736 
737 	 unsigned char *ptr;
738 	 const size_t packetSize = 8 + 4 + 4;
739 	ptr = stream->alloc(packetSize);
740 	int tmp = OP_glBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
741 	memcpy(ptr, &packetSize, 4);  ptr += 4;
742 
743 		memcpy(ptr, &target, 4); ptr += 4;
744 		memcpy(ptr, &texture, 4); ptr += 4;
745 }
746 
glBlendFunc_enc(void * self,GLenum sfactor,GLenum dfactor)747 void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor)
748 {
749 
750 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
751 	IOStream *stream = ctx->m_stream;
752 
753 	 unsigned char *ptr;
754 	 const size_t packetSize = 8 + 4 + 4;
755 	ptr = stream->alloc(packetSize);
756 	int tmp = OP_glBlendFunc;memcpy(ptr, &tmp, 4); ptr += 4;
757 	memcpy(ptr, &packetSize, 4);  ptr += 4;
758 
759 		memcpy(ptr, &sfactor, 4); ptr += 4;
760 		memcpy(ptr, &dfactor, 4); ptr += 4;
761 }
762 
glBufferData_enc(void * self,GLenum target,GLsizeiptr size,const GLvoid * data,GLenum usage)763 void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage)
764 {
765 
766 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
767 	IOStream *stream = ctx->m_stream;
768 
769 	const unsigned int __size_data =  size;
770 	 unsigned char *ptr;
771 	 const size_t packetSize = 8 + 4 + 4 + __size_data + 4 + 1*4;
772 	ptr = stream->alloc(packetSize);
773 	int tmp = OP_glBufferData;memcpy(ptr, &tmp, 4); ptr += 4;
774 	memcpy(ptr, &packetSize, 4);  ptr += 4;
775 
776 		memcpy(ptr, &target, 4); ptr += 4;
777 		memcpy(ptr, &size, 4); ptr += 4;
778 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
779 	memcpy(ptr, data, __size_data);ptr += __size_data;
780 		memcpy(ptr, &usage, 4); ptr += 4;
781 }
782 
glBufferSubData_enc(void * self,GLenum target,GLintptr offset,GLsizeiptr size,const GLvoid * data)783 void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data)
784 {
785 
786 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
787 	IOStream *stream = ctx->m_stream;
788 
789 	const unsigned int __size_data =  size;
790 	 unsigned char *ptr;
791 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 1*4;
792 	ptr = stream->alloc(packetSize);
793 	int tmp = OP_glBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
794 	memcpy(ptr, &packetSize, 4);  ptr += 4;
795 
796 		memcpy(ptr, &target, 4); ptr += 4;
797 		memcpy(ptr, &offset, 4); ptr += 4;
798 		memcpy(ptr, &size, 4); ptr += 4;
799 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
800 	memcpy(ptr, data, __size_data);ptr += __size_data;
801 }
802 
glClear_enc(void * self,GLbitfield mask)803 void glClear_enc(void *self , GLbitfield mask)
804 {
805 
806 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
807 	IOStream *stream = ctx->m_stream;
808 
809 	 unsigned char *ptr;
810 	 const size_t packetSize = 8 + 4;
811 	ptr = stream->alloc(packetSize);
812 	int tmp = OP_glClear;memcpy(ptr, &tmp, 4); ptr += 4;
813 	memcpy(ptr, &packetSize, 4);  ptr += 4;
814 
815 		memcpy(ptr, &mask, 4); ptr += 4;
816 }
817 
glClearColorx_enc(void * self,GLclampx red,GLclampx green,GLclampx blue,GLclampx alpha)818 void glClearColorx_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
819 {
820 
821 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
822 	IOStream *stream = ctx->m_stream;
823 
824 	 unsigned char *ptr;
825 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
826 	ptr = stream->alloc(packetSize);
827 	int tmp = OP_glClearColorx;memcpy(ptr, &tmp, 4); ptr += 4;
828 	memcpy(ptr, &packetSize, 4);  ptr += 4;
829 
830 		memcpy(ptr, &red, 4); ptr += 4;
831 		memcpy(ptr, &green, 4); ptr += 4;
832 		memcpy(ptr, &blue, 4); ptr += 4;
833 		memcpy(ptr, &alpha, 4); ptr += 4;
834 }
835 
glClearDepthx_enc(void * self,GLclampx depth)836 void glClearDepthx_enc(void *self , GLclampx depth)
837 {
838 
839 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
840 	IOStream *stream = ctx->m_stream;
841 
842 	 unsigned char *ptr;
843 	 const size_t packetSize = 8 + 4;
844 	ptr = stream->alloc(packetSize);
845 	int tmp = OP_glClearDepthx;memcpy(ptr, &tmp, 4); ptr += 4;
846 	memcpy(ptr, &packetSize, 4);  ptr += 4;
847 
848 		memcpy(ptr, &depth, 4); ptr += 4;
849 }
850 
glClearStencil_enc(void * self,GLint s)851 void glClearStencil_enc(void *self , GLint s)
852 {
853 
854 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
855 	IOStream *stream = ctx->m_stream;
856 
857 	 unsigned char *ptr;
858 	 const size_t packetSize = 8 + 4;
859 	ptr = stream->alloc(packetSize);
860 	int tmp = OP_glClearStencil;memcpy(ptr, &tmp, 4); ptr += 4;
861 	memcpy(ptr, &packetSize, 4);  ptr += 4;
862 
863 		memcpy(ptr, &s, 4); ptr += 4;
864 }
865 
glClientActiveTexture_enc(void * self,GLenum texture)866 void glClientActiveTexture_enc(void *self , GLenum texture)
867 {
868 
869 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
870 	IOStream *stream = ctx->m_stream;
871 
872 	 unsigned char *ptr;
873 	 const size_t packetSize = 8 + 4;
874 	ptr = stream->alloc(packetSize);
875 	int tmp = OP_glClientActiveTexture;memcpy(ptr, &tmp, 4); ptr += 4;
876 	memcpy(ptr, &packetSize, 4);  ptr += 4;
877 
878 		memcpy(ptr, &texture, 4); ptr += 4;
879 }
880 
glColor4ub_enc(void * self,GLubyte red,GLubyte green,GLubyte blue,GLubyte alpha)881 void glColor4ub_enc(void *self , GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
882 {
883 
884 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
885 	IOStream *stream = ctx->m_stream;
886 
887 	 unsigned char *ptr;
888 	 const size_t packetSize = 8 + 1 + 1 + 1 + 1;
889 	ptr = stream->alloc(packetSize);
890 	int tmp = OP_glColor4ub;memcpy(ptr, &tmp, 4); ptr += 4;
891 	memcpy(ptr, &packetSize, 4);  ptr += 4;
892 
893 		memcpy(ptr, &red, 1); ptr += 1;
894 		memcpy(ptr, &green, 1); ptr += 1;
895 		memcpy(ptr, &blue, 1); ptr += 1;
896 		memcpy(ptr, &alpha, 1); ptr += 1;
897 }
898 
glColor4x_enc(void * self,GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)899 void glColor4x_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
900 {
901 
902 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
903 	IOStream *stream = ctx->m_stream;
904 
905 	 unsigned char *ptr;
906 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
907 	ptr = stream->alloc(packetSize);
908 	int tmp = OP_glColor4x;memcpy(ptr, &tmp, 4); ptr += 4;
909 	memcpy(ptr, &packetSize, 4);  ptr += 4;
910 
911 		memcpy(ptr, &red, 4); ptr += 4;
912 		memcpy(ptr, &green, 4); ptr += 4;
913 		memcpy(ptr, &blue, 4); ptr += 4;
914 		memcpy(ptr, &alpha, 4); ptr += 4;
915 }
916 
glColorMask_enc(void * self,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)917 void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
918 {
919 
920 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
921 	IOStream *stream = ctx->m_stream;
922 
923 	 unsigned char *ptr;
924 	 const size_t packetSize = 8 + 1 + 1 + 1 + 1;
925 	ptr = stream->alloc(packetSize);
926 	int tmp = OP_glColorMask;memcpy(ptr, &tmp, 4); ptr += 4;
927 	memcpy(ptr, &packetSize, 4);  ptr += 4;
928 
929 		memcpy(ptr, &red, 1); ptr += 1;
930 		memcpy(ptr, &green, 1); ptr += 1;
931 		memcpy(ptr, &blue, 1); ptr += 1;
932 		memcpy(ptr, &alpha, 1); ptr += 1;
933 }
934 
glCompressedTexImage2D_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)935 void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
936 {
937 
938 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
939 	IOStream *stream = ctx->m_stream;
940 
941 	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
942 	 unsigned char *ptr;
943 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
944 	ptr = stream->alloc(packetSize);
945 	int tmp = OP_glCompressedTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
946 	memcpy(ptr, &packetSize, 4);  ptr += 4;
947 
948 		memcpy(ptr, &target, 4); ptr += 4;
949 		memcpy(ptr, &level, 4); ptr += 4;
950 		memcpy(ptr, &internalformat, 4); ptr += 4;
951 		memcpy(ptr, &width, 4); ptr += 4;
952 		memcpy(ptr, &height, 4); ptr += 4;
953 		memcpy(ptr, &border, 4); ptr += 4;
954 		memcpy(ptr, &imageSize, 4); ptr += 4;
955 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
956 	if (data != NULL) memcpy(ptr, data, __size_data);ptr += __size_data;
957 }
958 
glCompressedTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)959 void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
960 {
961 
962 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
963 	IOStream *stream = ctx->m_stream;
964 
965 	const unsigned int __size_data =  imageSize;
966 	 unsigned char *ptr;
967 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
968 	ptr = stream->alloc(packetSize);
969 	int tmp = OP_glCompressedTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
970 	memcpy(ptr, &packetSize, 4);  ptr += 4;
971 
972 		memcpy(ptr, &target, 4); ptr += 4;
973 		memcpy(ptr, &level, 4); ptr += 4;
974 		memcpy(ptr, &xoffset, 4); ptr += 4;
975 		memcpy(ptr, &yoffset, 4); ptr += 4;
976 		memcpy(ptr, &width, 4); ptr += 4;
977 		memcpy(ptr, &height, 4); ptr += 4;
978 		memcpy(ptr, &format, 4); ptr += 4;
979 		memcpy(ptr, &imageSize, 4); ptr += 4;
980 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
981 	memcpy(ptr, data, __size_data);ptr += __size_data;
982 }
983 
glCopyTexImage2D_enc(void * self,GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)984 void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
985 {
986 
987 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
988 	IOStream *stream = ctx->m_stream;
989 
990 	 unsigned char *ptr;
991 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
992 	ptr = stream->alloc(packetSize);
993 	int tmp = OP_glCopyTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
994 	memcpy(ptr, &packetSize, 4);  ptr += 4;
995 
996 		memcpy(ptr, &target, 4); ptr += 4;
997 		memcpy(ptr, &level, 4); ptr += 4;
998 		memcpy(ptr, &internalformat, 4); ptr += 4;
999 		memcpy(ptr, &x, 4); ptr += 4;
1000 		memcpy(ptr, &y, 4); ptr += 4;
1001 		memcpy(ptr, &width, 4); ptr += 4;
1002 		memcpy(ptr, &height, 4); ptr += 4;
1003 		memcpy(ptr, &border, 4); ptr += 4;
1004 }
1005 
glCopyTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLsizei height)1006 void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
1007 {
1008 
1009 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1010 	IOStream *stream = ctx->m_stream;
1011 
1012 	 unsigned char *ptr;
1013 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
1014 	ptr = stream->alloc(packetSize);
1015 	int tmp = OP_glCopyTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
1016 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1017 
1018 		memcpy(ptr, &target, 4); ptr += 4;
1019 		memcpy(ptr, &level, 4); ptr += 4;
1020 		memcpy(ptr, &xoffset, 4); ptr += 4;
1021 		memcpy(ptr, &yoffset, 4); ptr += 4;
1022 		memcpy(ptr, &x, 4); ptr += 4;
1023 		memcpy(ptr, &y, 4); ptr += 4;
1024 		memcpy(ptr, &width, 4); ptr += 4;
1025 		memcpy(ptr, &height, 4); ptr += 4;
1026 }
1027 
glCullFace_enc(void * self,GLenum mode)1028 void glCullFace_enc(void *self , GLenum mode)
1029 {
1030 
1031 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1032 	IOStream *stream = ctx->m_stream;
1033 
1034 	 unsigned char *ptr;
1035 	 const size_t packetSize = 8 + 4;
1036 	ptr = stream->alloc(packetSize);
1037 	int tmp = OP_glCullFace;memcpy(ptr, &tmp, 4); ptr += 4;
1038 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1039 
1040 		memcpy(ptr, &mode, 4); ptr += 4;
1041 }
1042 
glDeleteBuffers_enc(void * self,GLsizei n,const GLuint * buffers)1043 void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers)
1044 {
1045 
1046 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1047 	IOStream *stream = ctx->m_stream;
1048 
1049 	const unsigned int __size_buffers =  (n * sizeof(GLuint));
1050 	 unsigned char *ptr;
1051 	 const size_t packetSize = 8 + 4 + __size_buffers + 1*4;
1052 	ptr = stream->alloc(packetSize);
1053 	int tmp = OP_glDeleteBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
1054 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1055 
1056 		memcpy(ptr, &n, 4); ptr += 4;
1057 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
1058 	memcpy(ptr, buffers, __size_buffers);ptr += __size_buffers;
1059 }
1060 
glDeleteTextures_enc(void * self,GLsizei n,const GLuint * textures)1061 void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures)
1062 {
1063 
1064 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1065 	IOStream *stream = ctx->m_stream;
1066 
1067 	const unsigned int __size_textures =  (n * sizeof(GLuint));
1068 	 unsigned char *ptr;
1069 	 const size_t packetSize = 8 + 4 + __size_textures + 1*4;
1070 	ptr = stream->alloc(packetSize);
1071 	int tmp = OP_glDeleteTextures;memcpy(ptr, &tmp, 4); ptr += 4;
1072 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1073 
1074 		memcpy(ptr, &n, 4); ptr += 4;
1075 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
1076 	memcpy(ptr, textures, __size_textures);ptr += __size_textures;
1077 }
1078 
glDepthFunc_enc(void * self,GLenum func)1079 void glDepthFunc_enc(void *self , GLenum func)
1080 {
1081 
1082 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1083 	IOStream *stream = ctx->m_stream;
1084 
1085 	 unsigned char *ptr;
1086 	 const size_t packetSize = 8 + 4;
1087 	ptr = stream->alloc(packetSize);
1088 	int tmp = OP_glDepthFunc;memcpy(ptr, &tmp, 4); ptr += 4;
1089 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1090 
1091 		memcpy(ptr, &func, 4); ptr += 4;
1092 }
1093 
glDepthMask_enc(void * self,GLboolean flag)1094 void glDepthMask_enc(void *self , GLboolean flag)
1095 {
1096 
1097 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1098 	IOStream *stream = ctx->m_stream;
1099 
1100 	 unsigned char *ptr;
1101 	 const size_t packetSize = 8 + 1;
1102 	ptr = stream->alloc(packetSize);
1103 	int tmp = OP_glDepthMask;memcpy(ptr, &tmp, 4); ptr += 4;
1104 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1105 
1106 		memcpy(ptr, &flag, 1); ptr += 1;
1107 }
1108 
glDepthRangex_enc(void * self,GLclampx zNear,GLclampx zFar)1109 void glDepthRangex_enc(void *self , GLclampx zNear, GLclampx zFar)
1110 {
1111 
1112 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1113 	IOStream *stream = ctx->m_stream;
1114 
1115 	 unsigned char *ptr;
1116 	 const size_t packetSize = 8 + 4 + 4;
1117 	ptr = stream->alloc(packetSize);
1118 	int tmp = OP_glDepthRangex;memcpy(ptr, &tmp, 4); ptr += 4;
1119 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1120 
1121 		memcpy(ptr, &zNear, 4); ptr += 4;
1122 		memcpy(ptr, &zFar, 4); ptr += 4;
1123 }
1124 
glDisable_enc(void * self,GLenum cap)1125 void glDisable_enc(void *self , GLenum cap)
1126 {
1127 
1128 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1129 	IOStream *stream = ctx->m_stream;
1130 
1131 	 unsigned char *ptr;
1132 	 const size_t packetSize = 8 + 4;
1133 	ptr = stream->alloc(packetSize);
1134 	int tmp = OP_glDisable;memcpy(ptr, &tmp, 4); ptr += 4;
1135 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1136 
1137 		memcpy(ptr, &cap, 4); ptr += 4;
1138 }
1139 
glDisableClientState_enc(void * self,GLenum array)1140 void glDisableClientState_enc(void *self , GLenum array)
1141 {
1142 
1143 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1144 	IOStream *stream = ctx->m_stream;
1145 
1146 	 unsigned char *ptr;
1147 	 const size_t packetSize = 8 + 4;
1148 	ptr = stream->alloc(packetSize);
1149 	int tmp = OP_glDisableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
1150 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1151 
1152 		memcpy(ptr, &array, 4); ptr += 4;
1153 }
1154 
glDrawArrays_enc(void * self,GLenum mode,GLint first,GLsizei count)1155 void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count)
1156 {
1157 
1158 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1159 	IOStream *stream = ctx->m_stream;
1160 
1161 	 unsigned char *ptr;
1162 	 const size_t packetSize = 8 + 4 + 4 + 4;
1163 	ptr = stream->alloc(packetSize);
1164 	int tmp = OP_glDrawArrays;memcpy(ptr, &tmp, 4); ptr += 4;
1165 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1166 
1167 		memcpy(ptr, &mode, 4); ptr += 4;
1168 		memcpy(ptr, &first, 4); ptr += 4;
1169 		memcpy(ptr, &count, 4); ptr += 4;
1170 }
1171 
glEnable_enc(void * self,GLenum cap)1172 void glEnable_enc(void *self , GLenum cap)
1173 {
1174 
1175 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1176 	IOStream *stream = ctx->m_stream;
1177 
1178 	 unsigned char *ptr;
1179 	 const size_t packetSize = 8 + 4;
1180 	ptr = stream->alloc(packetSize);
1181 	int tmp = OP_glEnable;memcpy(ptr, &tmp, 4); ptr += 4;
1182 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1183 
1184 		memcpy(ptr, &cap, 4); ptr += 4;
1185 }
1186 
glEnableClientState_enc(void * self,GLenum array)1187 void glEnableClientState_enc(void *self , GLenum array)
1188 {
1189 
1190 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1191 	IOStream *stream = ctx->m_stream;
1192 
1193 	 unsigned char *ptr;
1194 	 const size_t packetSize = 8 + 4;
1195 	ptr = stream->alloc(packetSize);
1196 	int tmp = OP_glEnableClientState;memcpy(ptr, &tmp, 4); ptr += 4;
1197 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1198 
1199 		memcpy(ptr, &array, 4); ptr += 4;
1200 }
1201 
glFinish_enc(void * self)1202 void glFinish_enc(void *self )
1203 {
1204 
1205 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1206 	IOStream *stream = ctx->m_stream;
1207 
1208 	 unsigned char *ptr;
1209 	 const size_t packetSize = 8 + 0;
1210 	ptr = stream->alloc(packetSize);
1211 	int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
1212 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1213 
1214 }
1215 
glFlush_enc(void * self)1216 void glFlush_enc(void *self )
1217 {
1218 
1219 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1220 	IOStream *stream = ctx->m_stream;
1221 
1222 	 unsigned char *ptr;
1223 	 const size_t packetSize = 8 + 0;
1224 	ptr = stream->alloc(packetSize);
1225 	int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
1226 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1227 
1228 }
1229 
glFogx_enc(void * self,GLenum pname,GLfixed param)1230 void glFogx_enc(void *self , GLenum pname, GLfixed param)
1231 {
1232 
1233 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1234 	IOStream *stream = ctx->m_stream;
1235 
1236 	 unsigned char *ptr;
1237 	 const size_t packetSize = 8 + 4 + 4;
1238 	ptr = stream->alloc(packetSize);
1239 	int tmp = OP_glFogx;memcpy(ptr, &tmp, 4); ptr += 4;
1240 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1241 
1242 		memcpy(ptr, &pname, 4); ptr += 4;
1243 		memcpy(ptr, &param, 4); ptr += 4;
1244 }
1245 
glFogxv_enc(void * self,GLenum pname,const GLfixed * params)1246 void glFogxv_enc(void *self , GLenum pname, const GLfixed* params)
1247 {
1248 
1249 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1250 	IOStream *stream = ctx->m_stream;
1251 
1252 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1253 	 unsigned char *ptr;
1254 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1255 	ptr = stream->alloc(packetSize);
1256 	int tmp = OP_glFogxv;memcpy(ptr, &tmp, 4); ptr += 4;
1257 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1258 
1259 		memcpy(ptr, &pname, 4); ptr += 4;
1260 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1261 	memcpy(ptr, params, __size_params);ptr += __size_params;
1262 }
1263 
glFrontFace_enc(void * self,GLenum mode)1264 void glFrontFace_enc(void *self , GLenum mode)
1265 {
1266 
1267 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1268 	IOStream *stream = ctx->m_stream;
1269 
1270 	 unsigned char *ptr;
1271 	 const size_t packetSize = 8 + 4;
1272 	ptr = stream->alloc(packetSize);
1273 	int tmp = OP_glFrontFace;memcpy(ptr, &tmp, 4); ptr += 4;
1274 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1275 
1276 		memcpy(ptr, &mode, 4); ptr += 4;
1277 }
1278 
glFrustumx_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)1279 void glFrustumx_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
1280 {
1281 
1282 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1283 	IOStream *stream = ctx->m_stream;
1284 
1285 	 unsigned char *ptr;
1286 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
1287 	ptr = stream->alloc(packetSize);
1288 	int tmp = OP_glFrustumx;memcpy(ptr, &tmp, 4); ptr += 4;
1289 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1290 
1291 		memcpy(ptr, &left, 4); ptr += 4;
1292 		memcpy(ptr, &right, 4); ptr += 4;
1293 		memcpy(ptr, &bottom, 4); ptr += 4;
1294 		memcpy(ptr, &top, 4); ptr += 4;
1295 		memcpy(ptr, &zNear, 4); ptr += 4;
1296 		memcpy(ptr, &zFar, 4); ptr += 4;
1297 }
1298 
glGetBooleanv_enc(void * self,GLenum pname,GLboolean * params)1299 void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params)
1300 {
1301 
1302 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1303 	IOStream *stream = ctx->m_stream;
1304 
1305 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLboolean));
1306 	 unsigned char *ptr;
1307 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1308 	ptr = stream->alloc(packetSize);
1309 	int tmp = OP_glGetBooleanv;memcpy(ptr, &tmp, 4); ptr += 4;
1310 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1311 
1312 		memcpy(ptr, &pname, 4); ptr += 4;
1313 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1314 	stream->readback(params, __size_params);
1315 }
1316 
glGetBufferParameteriv_enc(void * self,GLenum target,GLenum pname,GLint * params)1317 void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
1318 {
1319 
1320 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1321 	IOStream *stream = ctx->m_stream;
1322 
1323 	const unsigned int __size_params =  (sizeof(GLint));
1324 	 unsigned char *ptr;
1325 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1326 	ptr = stream->alloc(packetSize);
1327 	int tmp = OP_glGetBufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
1328 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1329 
1330 		memcpy(ptr, &target, 4); ptr += 4;
1331 		memcpy(ptr, &pname, 4); ptr += 4;
1332 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1333 	stream->readback(params, __size_params);
1334 }
1335 
glClipPlanex_enc(void * self,GLenum pname,const GLfixed * eqn)1336 void glClipPlanex_enc(void *self , GLenum pname, const GLfixed* eqn)
1337 {
1338 
1339 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1340 	IOStream *stream = ctx->m_stream;
1341 
1342 	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
1343 	 unsigned char *ptr;
1344 	 const size_t packetSize = 8 + 4 + __size_eqn + 1*4;
1345 	ptr = stream->alloc(packetSize);
1346 	int tmp = OP_glClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
1347 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1348 
1349 		memcpy(ptr, &pname, 4); ptr += 4;
1350 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
1351 	memcpy(ptr, eqn, __size_eqn);ptr += __size_eqn;
1352 }
1353 
glGenBuffers_enc(void * self,GLsizei n,GLuint * buffers)1354 void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers)
1355 {
1356 
1357 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1358 	IOStream *stream = ctx->m_stream;
1359 
1360 	const unsigned int __size_buffers =  (n * sizeof(GLuint));
1361 	 unsigned char *ptr;
1362 	 const size_t packetSize = 8 + 4 + __size_buffers + 1*4;
1363 	ptr = stream->alloc(packetSize);
1364 	int tmp = OP_glGenBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
1365 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1366 
1367 		memcpy(ptr, &n, 4); ptr += 4;
1368 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
1369 	stream->readback(buffers, __size_buffers);
1370 }
1371 
glGenTextures_enc(void * self,GLsizei n,GLuint * textures)1372 void glGenTextures_enc(void *self , GLsizei n, GLuint* textures)
1373 {
1374 
1375 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1376 	IOStream *stream = ctx->m_stream;
1377 
1378 	const unsigned int __size_textures =  (n * sizeof(GLuint));
1379 	 unsigned char *ptr;
1380 	 const size_t packetSize = 8 + 4 + __size_textures + 1*4;
1381 	ptr = stream->alloc(packetSize);
1382 	int tmp = OP_glGenTextures;memcpy(ptr, &tmp, 4); ptr += 4;
1383 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1384 
1385 		memcpy(ptr, &n, 4); ptr += 4;
1386 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
1387 	stream->readback(textures, __size_textures);
1388 }
1389 
glGetError_enc(void * self)1390 GLenum glGetError_enc(void *self )
1391 {
1392 
1393 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1394 	IOStream *stream = ctx->m_stream;
1395 
1396 	 unsigned char *ptr;
1397 	 const size_t packetSize = 8 + 0;
1398 	ptr = stream->alloc(packetSize);
1399 	int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
1400 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1401 
1402 
1403 	GLenum retval;
1404 	stream->readback(&retval, 4);
1405 	return retval;
1406 }
1407 
glGetFixedv_enc(void * self,GLenum pname,GLfixed * params)1408 void glGetFixedv_enc(void *self , GLenum pname, GLfixed* params)
1409 {
1410 
1411 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1412 	IOStream *stream = ctx->m_stream;
1413 
1414 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1415 	 unsigned char *ptr;
1416 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1417 	ptr = stream->alloc(packetSize);
1418 	int tmp = OP_glGetFixedv;memcpy(ptr, &tmp, 4); ptr += 4;
1419 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1420 
1421 		memcpy(ptr, &pname, 4); ptr += 4;
1422 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1423 	stream->readback(params, __size_params);
1424 }
1425 
glGetIntegerv_enc(void * self,GLenum pname,GLint * params)1426 void glGetIntegerv_enc(void *self , GLenum pname, GLint* params)
1427 {
1428 
1429 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1430 	IOStream *stream = ctx->m_stream;
1431 
1432 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
1433 	 unsigned char *ptr;
1434 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1435 	ptr = stream->alloc(packetSize);
1436 	int tmp = OP_glGetIntegerv;memcpy(ptr, &tmp, 4); ptr += 4;
1437 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1438 
1439 		memcpy(ptr, &pname, 4); ptr += 4;
1440 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1441 	stream->readback(params, __size_params);
1442 }
1443 
glGetLightxv_enc(void * self,GLenum light,GLenum pname,GLfixed * params)1444 void glGetLightxv_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
1445 {
1446 
1447 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1448 	IOStream *stream = ctx->m_stream;
1449 
1450 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1451 	 unsigned char *ptr;
1452 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1453 	ptr = stream->alloc(packetSize);
1454 	int tmp = OP_glGetLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
1455 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1456 
1457 		memcpy(ptr, &light, 4); ptr += 4;
1458 		memcpy(ptr, &pname, 4); ptr += 4;
1459 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1460 	stream->readback(params, __size_params);
1461 }
1462 
glGetMaterialxv_enc(void * self,GLenum face,GLenum pname,GLfixed * params)1463 void glGetMaterialxv_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
1464 {
1465 
1466 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1467 	IOStream *stream = ctx->m_stream;
1468 
1469 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1470 	 unsigned char *ptr;
1471 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1472 	ptr = stream->alloc(packetSize);
1473 	int tmp = OP_glGetMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
1474 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1475 
1476 		memcpy(ptr, &face, 4); ptr += 4;
1477 		memcpy(ptr, &pname, 4); ptr += 4;
1478 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1479 	stream->readback(params, __size_params);
1480 }
1481 
glGetTexEnviv_enc(void * self,GLenum env,GLenum pname,GLint * params)1482 void glGetTexEnviv_enc(void *self , GLenum env, GLenum pname, GLint* params)
1483 {
1484 
1485 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1486 	IOStream *stream = ctx->m_stream;
1487 
1488 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
1489 	 unsigned char *ptr;
1490 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1491 	ptr = stream->alloc(packetSize);
1492 	int tmp = OP_glGetTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
1493 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1494 
1495 		memcpy(ptr, &env, 4); ptr += 4;
1496 		memcpy(ptr, &pname, 4); ptr += 4;
1497 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1498 	stream->readback(params, __size_params);
1499 }
1500 
glGetTexEnvxv_enc(void * self,GLenum env,GLenum pname,GLfixed * params)1501 void glGetTexEnvxv_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
1502 {
1503 
1504 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1505 	IOStream *stream = ctx->m_stream;
1506 
1507 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1508 	 unsigned char *ptr;
1509 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1510 	ptr = stream->alloc(packetSize);
1511 	int tmp = OP_glGetTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
1512 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1513 
1514 		memcpy(ptr, &env, 4); ptr += 4;
1515 		memcpy(ptr, &pname, 4); ptr += 4;
1516 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1517 	stream->readback(params, __size_params);
1518 }
1519 
glGetTexParameteriv_enc(void * self,GLenum target,GLenum pname,GLint * params)1520 void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
1521 {
1522 
1523 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1524 	IOStream *stream = ctx->m_stream;
1525 
1526 	const unsigned int __size_params =  (sizeof(GLint));
1527 	 unsigned char *ptr;
1528 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1529 	ptr = stream->alloc(packetSize);
1530 	int tmp = OP_glGetTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
1531 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1532 
1533 		memcpy(ptr, &target, 4); ptr += 4;
1534 		memcpy(ptr, &pname, 4); ptr += 4;
1535 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1536 	stream->readback(params, __size_params);
1537 }
1538 
glGetTexParameterxv_enc(void * self,GLenum target,GLenum pname,GLfixed * params)1539 void glGetTexParameterxv_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
1540 {
1541 
1542 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1543 	IOStream *stream = ctx->m_stream;
1544 
1545 	const unsigned int __size_params =  (sizeof(GLfixed));
1546 	 unsigned char *ptr;
1547 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1548 	ptr = stream->alloc(packetSize);
1549 	int tmp = OP_glGetTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
1550 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1551 
1552 		memcpy(ptr, &target, 4); ptr += 4;
1553 		memcpy(ptr, &pname, 4); ptr += 4;
1554 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1555 	stream->readback(params, __size_params);
1556 }
1557 
glHint_enc(void * self,GLenum target,GLenum mode)1558 void glHint_enc(void *self , GLenum target, GLenum mode)
1559 {
1560 
1561 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1562 	IOStream *stream = ctx->m_stream;
1563 
1564 	 unsigned char *ptr;
1565 	 const size_t packetSize = 8 + 4 + 4;
1566 	ptr = stream->alloc(packetSize);
1567 	int tmp = OP_glHint;memcpy(ptr, &tmp, 4); ptr += 4;
1568 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1569 
1570 		memcpy(ptr, &target, 4); ptr += 4;
1571 		memcpy(ptr, &mode, 4); ptr += 4;
1572 }
1573 
glIsBuffer_enc(void * self,GLuint buffer)1574 GLboolean glIsBuffer_enc(void *self , GLuint buffer)
1575 {
1576 
1577 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1578 	IOStream *stream = ctx->m_stream;
1579 
1580 	 unsigned char *ptr;
1581 	 const size_t packetSize = 8 + 4;
1582 	ptr = stream->alloc(packetSize);
1583 	int tmp = OP_glIsBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
1584 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1585 
1586 		memcpy(ptr, &buffer, 4); ptr += 4;
1587 
1588 	GLboolean retval;
1589 	stream->readback(&retval, 1);
1590 	return retval;
1591 }
1592 
glIsEnabled_enc(void * self,GLenum cap)1593 GLboolean glIsEnabled_enc(void *self , GLenum cap)
1594 {
1595 
1596 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1597 	IOStream *stream = ctx->m_stream;
1598 
1599 	 unsigned char *ptr;
1600 	 const size_t packetSize = 8 + 4;
1601 	ptr = stream->alloc(packetSize);
1602 	int tmp = OP_glIsEnabled;memcpy(ptr, &tmp, 4); ptr += 4;
1603 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1604 
1605 		memcpy(ptr, &cap, 4); ptr += 4;
1606 
1607 	GLboolean retval;
1608 	stream->readback(&retval, 1);
1609 	return retval;
1610 }
1611 
glIsTexture_enc(void * self,GLuint texture)1612 GLboolean glIsTexture_enc(void *self , GLuint texture)
1613 {
1614 
1615 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1616 	IOStream *stream = ctx->m_stream;
1617 
1618 	 unsigned char *ptr;
1619 	 const size_t packetSize = 8 + 4;
1620 	ptr = stream->alloc(packetSize);
1621 	int tmp = OP_glIsTexture;memcpy(ptr, &tmp, 4); ptr += 4;
1622 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1623 
1624 		memcpy(ptr, &texture, 4); ptr += 4;
1625 
1626 	GLboolean retval;
1627 	stream->readback(&retval, 1);
1628 	return retval;
1629 }
1630 
glLightModelx_enc(void * self,GLenum pname,GLfixed param)1631 void glLightModelx_enc(void *self , GLenum pname, GLfixed param)
1632 {
1633 
1634 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1635 	IOStream *stream = ctx->m_stream;
1636 
1637 	 unsigned char *ptr;
1638 	 const size_t packetSize = 8 + 4 + 4;
1639 	ptr = stream->alloc(packetSize);
1640 	int tmp = OP_glLightModelx;memcpy(ptr, &tmp, 4); ptr += 4;
1641 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1642 
1643 		memcpy(ptr, &pname, 4); ptr += 4;
1644 		memcpy(ptr, &param, 4); ptr += 4;
1645 }
1646 
glLightModelxv_enc(void * self,GLenum pname,const GLfixed * params)1647 void glLightModelxv_enc(void *self , GLenum pname, const GLfixed* params)
1648 {
1649 
1650 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1651 	IOStream *stream = ctx->m_stream;
1652 
1653 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1654 	 unsigned char *ptr;
1655 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1656 	ptr = stream->alloc(packetSize);
1657 	int tmp = OP_glLightModelxv;memcpy(ptr, &tmp, 4); ptr += 4;
1658 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1659 
1660 		memcpy(ptr, &pname, 4); ptr += 4;
1661 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1662 	memcpy(ptr, params, __size_params);ptr += __size_params;
1663 }
1664 
glLightx_enc(void * self,GLenum light,GLenum pname,GLfixed param)1665 void glLightx_enc(void *self , GLenum light, GLenum pname, GLfixed param)
1666 {
1667 
1668 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1669 	IOStream *stream = ctx->m_stream;
1670 
1671 	 unsigned char *ptr;
1672 	 const size_t packetSize = 8 + 4 + 4 + 4;
1673 	ptr = stream->alloc(packetSize);
1674 	int tmp = OP_glLightx;memcpy(ptr, &tmp, 4); ptr += 4;
1675 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1676 
1677 		memcpy(ptr, &light, 4); ptr += 4;
1678 		memcpy(ptr, &pname, 4); ptr += 4;
1679 		memcpy(ptr, &param, 4); ptr += 4;
1680 }
1681 
glLightxv_enc(void * self,GLenum light,GLenum pname,const GLfixed * params)1682 void glLightxv_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
1683 {
1684 
1685 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1686 	IOStream *stream = ctx->m_stream;
1687 
1688 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1689 	 unsigned char *ptr;
1690 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1691 	ptr = stream->alloc(packetSize);
1692 	int tmp = OP_glLightxv;memcpy(ptr, &tmp, 4); ptr += 4;
1693 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1694 
1695 		memcpy(ptr, &light, 4); ptr += 4;
1696 		memcpy(ptr, &pname, 4); ptr += 4;
1697 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1698 	memcpy(ptr, params, __size_params);ptr += __size_params;
1699 }
1700 
glLineWidthx_enc(void * self,GLfixed width)1701 void glLineWidthx_enc(void *self , GLfixed width)
1702 {
1703 
1704 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1705 	IOStream *stream = ctx->m_stream;
1706 
1707 	 unsigned char *ptr;
1708 	 const size_t packetSize = 8 + 4;
1709 	ptr = stream->alloc(packetSize);
1710 	int tmp = OP_glLineWidthx;memcpy(ptr, &tmp, 4); ptr += 4;
1711 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1712 
1713 		memcpy(ptr, &width, 4); ptr += 4;
1714 }
1715 
glLoadIdentity_enc(void * self)1716 void glLoadIdentity_enc(void *self )
1717 {
1718 
1719 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1720 	IOStream *stream = ctx->m_stream;
1721 
1722 	 unsigned char *ptr;
1723 	 const size_t packetSize = 8 + 0;
1724 	ptr = stream->alloc(packetSize);
1725 	int tmp = OP_glLoadIdentity;memcpy(ptr, &tmp, 4); ptr += 4;
1726 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1727 
1728 }
1729 
glLoadMatrixx_enc(void * self,const GLfixed * m)1730 void glLoadMatrixx_enc(void *self , const GLfixed* m)
1731 {
1732 
1733 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1734 	IOStream *stream = ctx->m_stream;
1735 
1736 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
1737 	 unsigned char *ptr;
1738 	 const size_t packetSize = 8 + __size_m + 1*4;
1739 	ptr = stream->alloc(packetSize);
1740 	int tmp = OP_glLoadMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
1741 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1742 
1743 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
1744 	memcpy(ptr, m, __size_m);ptr += __size_m;
1745 }
1746 
glLogicOp_enc(void * self,GLenum opcode)1747 void glLogicOp_enc(void *self , GLenum opcode)
1748 {
1749 
1750 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1751 	IOStream *stream = ctx->m_stream;
1752 
1753 	 unsigned char *ptr;
1754 	 const size_t packetSize = 8 + 4;
1755 	ptr = stream->alloc(packetSize);
1756 	int tmp = OP_glLogicOp;memcpy(ptr, &tmp, 4); ptr += 4;
1757 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1758 
1759 		memcpy(ptr, &opcode, 4); ptr += 4;
1760 }
1761 
glMaterialx_enc(void * self,GLenum face,GLenum pname,GLfixed param)1762 void glMaterialx_enc(void *self , GLenum face, GLenum pname, GLfixed param)
1763 {
1764 
1765 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1766 	IOStream *stream = ctx->m_stream;
1767 
1768 	 unsigned char *ptr;
1769 	 const size_t packetSize = 8 + 4 + 4 + 4;
1770 	ptr = stream->alloc(packetSize);
1771 	int tmp = OP_glMaterialx;memcpy(ptr, &tmp, 4); ptr += 4;
1772 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1773 
1774 		memcpy(ptr, &face, 4); ptr += 4;
1775 		memcpy(ptr, &pname, 4); ptr += 4;
1776 		memcpy(ptr, &param, 4); ptr += 4;
1777 }
1778 
glMaterialxv_enc(void * self,GLenum face,GLenum pname,const GLfixed * params)1779 void glMaterialxv_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
1780 {
1781 
1782 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1783 	IOStream *stream = ctx->m_stream;
1784 
1785 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1786 	 unsigned char *ptr;
1787 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
1788 	ptr = stream->alloc(packetSize);
1789 	int tmp = OP_glMaterialxv;memcpy(ptr, &tmp, 4); ptr += 4;
1790 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1791 
1792 		memcpy(ptr, &face, 4); ptr += 4;
1793 		memcpy(ptr, &pname, 4); ptr += 4;
1794 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1795 	memcpy(ptr, params, __size_params);ptr += __size_params;
1796 }
1797 
glMatrixMode_enc(void * self,GLenum mode)1798 void glMatrixMode_enc(void *self , GLenum mode)
1799 {
1800 
1801 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1802 	IOStream *stream = ctx->m_stream;
1803 
1804 	 unsigned char *ptr;
1805 	 const size_t packetSize = 8 + 4;
1806 	ptr = stream->alloc(packetSize);
1807 	int tmp = OP_glMatrixMode;memcpy(ptr, &tmp, 4); ptr += 4;
1808 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1809 
1810 		memcpy(ptr, &mode, 4); ptr += 4;
1811 }
1812 
glMultMatrixx_enc(void * self,const GLfixed * m)1813 void glMultMatrixx_enc(void *self , const GLfixed* m)
1814 {
1815 
1816 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1817 	IOStream *stream = ctx->m_stream;
1818 
1819 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
1820 	 unsigned char *ptr;
1821 	 const size_t packetSize = 8 + __size_m + 1*4;
1822 	ptr = stream->alloc(packetSize);
1823 	int tmp = OP_glMultMatrixx;memcpy(ptr, &tmp, 4); ptr += 4;
1824 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1825 
1826 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
1827 	memcpy(ptr, m, __size_m);ptr += __size_m;
1828 }
1829 
glMultiTexCoord4x_enc(void * self,GLenum target,GLfixed s,GLfixed t,GLfixed r,GLfixed q)1830 void glMultiTexCoord4x_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
1831 {
1832 
1833 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1834 	IOStream *stream = ctx->m_stream;
1835 
1836 	 unsigned char *ptr;
1837 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
1838 	ptr = stream->alloc(packetSize);
1839 	int tmp = OP_glMultiTexCoord4x;memcpy(ptr, &tmp, 4); ptr += 4;
1840 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1841 
1842 		memcpy(ptr, &target, 4); ptr += 4;
1843 		memcpy(ptr, &s, 4); ptr += 4;
1844 		memcpy(ptr, &t, 4); ptr += 4;
1845 		memcpy(ptr, &r, 4); ptr += 4;
1846 		memcpy(ptr, &q, 4); ptr += 4;
1847 }
1848 
glNormal3x_enc(void * self,GLfixed nx,GLfixed ny,GLfixed nz)1849 void glNormal3x_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
1850 {
1851 
1852 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1853 	IOStream *stream = ctx->m_stream;
1854 
1855 	 unsigned char *ptr;
1856 	 const size_t packetSize = 8 + 4 + 4 + 4;
1857 	ptr = stream->alloc(packetSize);
1858 	int tmp = OP_glNormal3x;memcpy(ptr, &tmp, 4); ptr += 4;
1859 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1860 
1861 		memcpy(ptr, &nx, 4); ptr += 4;
1862 		memcpy(ptr, &ny, 4); ptr += 4;
1863 		memcpy(ptr, &nz, 4); ptr += 4;
1864 }
1865 
glOrthox_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)1866 void glOrthox_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
1867 {
1868 
1869 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1870 	IOStream *stream = ctx->m_stream;
1871 
1872 	 unsigned char *ptr;
1873 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
1874 	ptr = stream->alloc(packetSize);
1875 	int tmp = OP_glOrthox;memcpy(ptr, &tmp, 4); ptr += 4;
1876 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1877 
1878 		memcpy(ptr, &left, 4); ptr += 4;
1879 		memcpy(ptr, &right, 4); ptr += 4;
1880 		memcpy(ptr, &bottom, 4); ptr += 4;
1881 		memcpy(ptr, &top, 4); ptr += 4;
1882 		memcpy(ptr, &zNear, 4); ptr += 4;
1883 		memcpy(ptr, &zFar, 4); ptr += 4;
1884 }
1885 
glPixelStorei_enc(void * self,GLenum pname,GLint param)1886 void glPixelStorei_enc(void *self , GLenum pname, GLint param)
1887 {
1888 
1889 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1890 	IOStream *stream = ctx->m_stream;
1891 
1892 	 unsigned char *ptr;
1893 	 const size_t packetSize = 8 + 4 + 4;
1894 	ptr = stream->alloc(packetSize);
1895 	int tmp = OP_glPixelStorei;memcpy(ptr, &tmp, 4); ptr += 4;
1896 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1897 
1898 		memcpy(ptr, &pname, 4); ptr += 4;
1899 		memcpy(ptr, &param, 4); ptr += 4;
1900 }
1901 
glPointParameterx_enc(void * self,GLenum pname,GLfixed param)1902 void glPointParameterx_enc(void *self , GLenum pname, GLfixed param)
1903 {
1904 
1905 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1906 	IOStream *stream = ctx->m_stream;
1907 
1908 	 unsigned char *ptr;
1909 	 const size_t packetSize = 8 + 4 + 4;
1910 	ptr = stream->alloc(packetSize);
1911 	int tmp = OP_glPointParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
1912 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1913 
1914 		memcpy(ptr, &pname, 4); ptr += 4;
1915 		memcpy(ptr, &param, 4); ptr += 4;
1916 }
1917 
glPointParameterxv_enc(void * self,GLenum pname,const GLfixed * params)1918 void glPointParameterxv_enc(void *self , GLenum pname, const GLfixed* params)
1919 {
1920 
1921 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1922 	IOStream *stream = ctx->m_stream;
1923 
1924 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
1925 	 unsigned char *ptr;
1926 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
1927 	ptr = stream->alloc(packetSize);
1928 	int tmp = OP_glPointParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
1929 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1930 
1931 		memcpy(ptr, &pname, 4); ptr += 4;
1932 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
1933 	memcpy(ptr, params, __size_params);ptr += __size_params;
1934 }
1935 
glPointSizex_enc(void * self,GLfixed size)1936 void glPointSizex_enc(void *self , GLfixed size)
1937 {
1938 
1939 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1940 	IOStream *stream = ctx->m_stream;
1941 
1942 	 unsigned char *ptr;
1943 	 const size_t packetSize = 8 + 4;
1944 	ptr = stream->alloc(packetSize);
1945 	int tmp = OP_glPointSizex;memcpy(ptr, &tmp, 4); ptr += 4;
1946 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1947 
1948 		memcpy(ptr, &size, 4); ptr += 4;
1949 }
1950 
glPolygonOffsetx_enc(void * self,GLfixed factor,GLfixed units)1951 void glPolygonOffsetx_enc(void *self , GLfixed factor, GLfixed units)
1952 {
1953 
1954 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1955 	IOStream *stream = ctx->m_stream;
1956 
1957 	 unsigned char *ptr;
1958 	 const size_t packetSize = 8 + 4 + 4;
1959 	ptr = stream->alloc(packetSize);
1960 	int tmp = OP_glPolygonOffsetx;memcpy(ptr, &tmp, 4); ptr += 4;
1961 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1962 
1963 		memcpy(ptr, &factor, 4); ptr += 4;
1964 		memcpy(ptr, &units, 4); ptr += 4;
1965 }
1966 
glPopMatrix_enc(void * self)1967 void glPopMatrix_enc(void *self )
1968 {
1969 
1970 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1971 	IOStream *stream = ctx->m_stream;
1972 
1973 	 unsigned char *ptr;
1974 	 const size_t packetSize = 8 + 0;
1975 	ptr = stream->alloc(packetSize);
1976 	int tmp = OP_glPopMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
1977 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1978 
1979 }
1980 
glPushMatrix_enc(void * self)1981 void glPushMatrix_enc(void *self )
1982 {
1983 
1984 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1985 	IOStream *stream = ctx->m_stream;
1986 
1987 	 unsigned char *ptr;
1988 	 const size_t packetSize = 8 + 0;
1989 	ptr = stream->alloc(packetSize);
1990 	int tmp = OP_glPushMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
1991 	memcpy(ptr, &packetSize, 4);  ptr += 4;
1992 
1993 }
1994 
glReadPixels_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height,GLenum format,GLenum type,GLvoid * pixels)1995 void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
1996 {
1997 
1998 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
1999 	IOStream *stream = ctx->m_stream;
2000 
2001 	const unsigned int __size_pixels =  pixelDataSize(self, width, height, format, type, 1);
2002 	 unsigned char *ptr;
2003 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
2004 	ptr = stream->alloc(packetSize);
2005 	int tmp = OP_glReadPixels;memcpy(ptr, &tmp, 4); ptr += 4;
2006 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2007 
2008 		memcpy(ptr, &x, 4); ptr += 4;
2009 		memcpy(ptr, &y, 4); ptr += 4;
2010 		memcpy(ptr, &width, 4); ptr += 4;
2011 		memcpy(ptr, &height, 4); ptr += 4;
2012 		memcpy(ptr, &format, 4); ptr += 4;
2013 		memcpy(ptr, &type, 4); ptr += 4;
2014 	*(unsigned int *)(ptr) = __size_pixels; ptr += 4;
2015 	stream->readback(pixels, __size_pixels);
2016 }
2017 
glRotatex_enc(void * self,GLfixed angle,GLfixed x,GLfixed y,GLfixed z)2018 void glRotatex_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
2019 {
2020 
2021 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2022 	IOStream *stream = ctx->m_stream;
2023 
2024 	 unsigned char *ptr;
2025 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2026 	ptr = stream->alloc(packetSize);
2027 	int tmp = OP_glRotatex;memcpy(ptr, &tmp, 4); ptr += 4;
2028 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2029 
2030 		memcpy(ptr, &angle, 4); ptr += 4;
2031 		memcpy(ptr, &x, 4); ptr += 4;
2032 		memcpy(ptr, &y, 4); ptr += 4;
2033 		memcpy(ptr, &z, 4); ptr += 4;
2034 }
2035 
glSampleCoverage_enc(void * self,GLclampf value,GLboolean invert)2036 void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert)
2037 {
2038 
2039 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2040 	IOStream *stream = ctx->m_stream;
2041 
2042 	 unsigned char *ptr;
2043 	 const size_t packetSize = 8 + 4 + 1;
2044 	ptr = stream->alloc(packetSize);
2045 	int tmp = OP_glSampleCoverage;memcpy(ptr, &tmp, 4); ptr += 4;
2046 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2047 
2048 		memcpy(ptr, &value, 4); ptr += 4;
2049 		memcpy(ptr, &invert, 1); ptr += 1;
2050 }
2051 
glSampleCoveragex_enc(void * self,GLclampx value,GLboolean invert)2052 void glSampleCoveragex_enc(void *self , GLclampx value, GLboolean invert)
2053 {
2054 
2055 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2056 	IOStream *stream = ctx->m_stream;
2057 
2058 	 unsigned char *ptr;
2059 	 const size_t packetSize = 8 + 4 + 1;
2060 	ptr = stream->alloc(packetSize);
2061 	int tmp = OP_glSampleCoveragex;memcpy(ptr, &tmp, 4); ptr += 4;
2062 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2063 
2064 		memcpy(ptr, &value, 4); ptr += 4;
2065 		memcpy(ptr, &invert, 1); ptr += 1;
2066 }
2067 
glScalex_enc(void * self,GLfixed x,GLfixed y,GLfixed z)2068 void glScalex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
2069 {
2070 
2071 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2072 	IOStream *stream = ctx->m_stream;
2073 
2074 	 unsigned char *ptr;
2075 	 const size_t packetSize = 8 + 4 + 4 + 4;
2076 	ptr = stream->alloc(packetSize);
2077 	int tmp = OP_glScalex;memcpy(ptr, &tmp, 4); ptr += 4;
2078 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2079 
2080 		memcpy(ptr, &x, 4); ptr += 4;
2081 		memcpy(ptr, &y, 4); ptr += 4;
2082 		memcpy(ptr, &z, 4); ptr += 4;
2083 }
2084 
glScissor_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height)2085 void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
2086 {
2087 
2088 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2089 	IOStream *stream = ctx->m_stream;
2090 
2091 	 unsigned char *ptr;
2092 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2093 	ptr = stream->alloc(packetSize);
2094 	int tmp = OP_glScissor;memcpy(ptr, &tmp, 4); ptr += 4;
2095 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2096 
2097 		memcpy(ptr, &x, 4); ptr += 4;
2098 		memcpy(ptr, &y, 4); ptr += 4;
2099 		memcpy(ptr, &width, 4); ptr += 4;
2100 		memcpy(ptr, &height, 4); ptr += 4;
2101 }
2102 
glShadeModel_enc(void * self,GLenum mode)2103 void glShadeModel_enc(void *self , GLenum mode)
2104 {
2105 
2106 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2107 	IOStream *stream = ctx->m_stream;
2108 
2109 	 unsigned char *ptr;
2110 	 const size_t packetSize = 8 + 4;
2111 	ptr = stream->alloc(packetSize);
2112 	int tmp = OP_glShadeModel;memcpy(ptr, &tmp, 4); ptr += 4;
2113 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2114 
2115 		memcpy(ptr, &mode, 4); ptr += 4;
2116 }
2117 
glStencilFunc_enc(void * self,GLenum func,GLint ref,GLuint mask)2118 void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask)
2119 {
2120 
2121 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2122 	IOStream *stream = ctx->m_stream;
2123 
2124 	 unsigned char *ptr;
2125 	 const size_t packetSize = 8 + 4 + 4 + 4;
2126 	ptr = stream->alloc(packetSize);
2127 	int tmp = OP_glStencilFunc;memcpy(ptr, &tmp, 4); ptr += 4;
2128 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2129 
2130 		memcpy(ptr, &func, 4); ptr += 4;
2131 		memcpy(ptr, &ref, 4); ptr += 4;
2132 		memcpy(ptr, &mask, 4); ptr += 4;
2133 }
2134 
glStencilMask_enc(void * self,GLuint mask)2135 void glStencilMask_enc(void *self , GLuint mask)
2136 {
2137 
2138 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2139 	IOStream *stream = ctx->m_stream;
2140 
2141 	 unsigned char *ptr;
2142 	 const size_t packetSize = 8 + 4;
2143 	ptr = stream->alloc(packetSize);
2144 	int tmp = OP_glStencilMask;memcpy(ptr, &tmp, 4); ptr += 4;
2145 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2146 
2147 		memcpy(ptr, &mask, 4); ptr += 4;
2148 }
2149 
glStencilOp_enc(void * self,GLenum fail,GLenum zfail,GLenum zpass)2150 void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass)
2151 {
2152 
2153 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2154 	IOStream *stream = ctx->m_stream;
2155 
2156 	 unsigned char *ptr;
2157 	 const size_t packetSize = 8 + 4 + 4 + 4;
2158 	ptr = stream->alloc(packetSize);
2159 	int tmp = OP_glStencilOp;memcpy(ptr, &tmp, 4); ptr += 4;
2160 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2161 
2162 		memcpy(ptr, &fail, 4); ptr += 4;
2163 		memcpy(ptr, &zfail, 4); ptr += 4;
2164 		memcpy(ptr, &zpass, 4); ptr += 4;
2165 }
2166 
glTexEnvi_enc(void * self,GLenum target,GLenum pname,GLint param)2167 void glTexEnvi_enc(void *self , GLenum target, GLenum pname, GLint param)
2168 {
2169 
2170 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2171 	IOStream *stream = ctx->m_stream;
2172 
2173 	 unsigned char *ptr;
2174 	 const size_t packetSize = 8 + 4 + 4 + 4;
2175 	ptr = stream->alloc(packetSize);
2176 	int tmp = OP_glTexEnvi;memcpy(ptr, &tmp, 4); ptr += 4;
2177 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2178 
2179 		memcpy(ptr, &target, 4); ptr += 4;
2180 		memcpy(ptr, &pname, 4); ptr += 4;
2181 		memcpy(ptr, &param, 4); ptr += 4;
2182 }
2183 
glTexEnvx_enc(void * self,GLenum target,GLenum pname,GLfixed param)2184 void glTexEnvx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
2185 {
2186 
2187 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2188 	IOStream *stream = ctx->m_stream;
2189 
2190 	 unsigned char *ptr;
2191 	 const size_t packetSize = 8 + 4 + 4 + 4;
2192 	ptr = stream->alloc(packetSize);
2193 	int tmp = OP_glTexEnvx;memcpy(ptr, &tmp, 4); ptr += 4;
2194 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2195 
2196 		memcpy(ptr, &target, 4); ptr += 4;
2197 		memcpy(ptr, &pname, 4); ptr += 4;
2198 		memcpy(ptr, &param, 4); ptr += 4;
2199 }
2200 
glTexEnviv_enc(void * self,GLenum target,GLenum pname,const GLint * params)2201 void glTexEnviv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
2202 {
2203 
2204 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2205 	IOStream *stream = ctx->m_stream;
2206 
2207 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
2208 	 unsigned char *ptr;
2209 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
2210 	ptr = stream->alloc(packetSize);
2211 	int tmp = OP_glTexEnviv;memcpy(ptr, &tmp, 4); ptr += 4;
2212 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2213 
2214 		memcpy(ptr, &target, 4); ptr += 4;
2215 		memcpy(ptr, &pname, 4); ptr += 4;
2216 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2217 	memcpy(ptr, params, __size_params);ptr += __size_params;
2218 }
2219 
glTexEnvxv_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)2220 void glTexEnvxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
2221 {
2222 
2223 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2224 	IOStream *stream = ctx->m_stream;
2225 
2226 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2227 	 unsigned char *ptr;
2228 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
2229 	ptr = stream->alloc(packetSize);
2230 	int tmp = OP_glTexEnvxv;memcpy(ptr, &tmp, 4); ptr += 4;
2231 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2232 
2233 		memcpy(ptr, &target, 4); ptr += 4;
2234 		memcpy(ptr, &pname, 4); ptr += 4;
2235 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2236 	memcpy(ptr, params, __size_params);ptr += __size_params;
2237 }
2238 
glTexImage2D_enc(void * self,GLenum target,GLint level,GLint internalformat,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)2239 void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
2240 {
2241 
2242 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2243 	IOStream *stream = ctx->m_stream;
2244 
2245 	const unsigned int __size_pixels = ((pixels != NULL) ?  pixelDataSize(self, width, height, format, type, 0) : 0);
2246 	 unsigned char *ptr;
2247 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
2248 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
2249 	int tmp = OP_glTexImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
2250 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2251 
2252 		memcpy(ptr, &target, 4); ptr += 4;
2253 		memcpy(ptr, &level, 4); ptr += 4;
2254 		memcpy(ptr, &internalformat, 4); ptr += 4;
2255 		memcpy(ptr, &width, 4); ptr += 4;
2256 		memcpy(ptr, &height, 4); ptr += 4;
2257 		memcpy(ptr, &border, 4); ptr += 4;
2258 		memcpy(ptr, &format, 4); ptr += 4;
2259 		memcpy(ptr, &type, 4); ptr += 4;
2260 	stream->flush();
2261 	stream->writeFully(&__size_pixels,4);
2262 	if (pixels != NULL) stream->writeFully(pixels, __size_pixels);
2263 }
2264 
glTexParameteri_enc(void * self,GLenum target,GLenum pname,GLint param)2265 void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
2266 {
2267 
2268 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2269 	IOStream *stream = ctx->m_stream;
2270 
2271 	 unsigned char *ptr;
2272 	 const size_t packetSize = 8 + 4 + 4 + 4;
2273 	ptr = stream->alloc(packetSize);
2274 	int tmp = OP_glTexParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
2275 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2276 
2277 		memcpy(ptr, &target, 4); ptr += 4;
2278 		memcpy(ptr, &pname, 4); ptr += 4;
2279 		memcpy(ptr, &param, 4); ptr += 4;
2280 }
2281 
glTexParameterx_enc(void * self,GLenum target,GLenum pname,GLfixed param)2282 void glTexParameterx_enc(void *self , GLenum target, GLenum pname, GLfixed param)
2283 {
2284 
2285 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2286 	IOStream *stream = ctx->m_stream;
2287 
2288 	 unsigned char *ptr;
2289 	 const size_t packetSize = 8 + 4 + 4 + 4;
2290 	ptr = stream->alloc(packetSize);
2291 	int tmp = OP_glTexParameterx;memcpy(ptr, &tmp, 4); ptr += 4;
2292 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2293 
2294 		memcpy(ptr, &target, 4); ptr += 4;
2295 		memcpy(ptr, &pname, 4); ptr += 4;
2296 		memcpy(ptr, &param, 4); ptr += 4;
2297 }
2298 
glTexParameteriv_enc(void * self,GLenum target,GLenum pname,const GLint * params)2299 void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params)
2300 {
2301 
2302 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2303 	IOStream *stream = ctx->m_stream;
2304 
2305 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
2306 	 unsigned char *ptr;
2307 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
2308 	ptr = stream->alloc(packetSize);
2309 	int tmp = OP_glTexParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
2310 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2311 
2312 		memcpy(ptr, &target, 4); ptr += 4;
2313 		memcpy(ptr, &pname, 4); ptr += 4;
2314 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2315 	memcpy(ptr, params, __size_params);ptr += __size_params;
2316 }
2317 
glTexParameterxv_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)2318 void glTexParameterxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
2319 {
2320 
2321 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2322 	IOStream *stream = ctx->m_stream;
2323 
2324 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
2325 	 unsigned char *ptr;
2326 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
2327 	ptr = stream->alloc(packetSize);
2328 	int tmp = OP_glTexParameterxv;memcpy(ptr, &tmp, 4); ptr += 4;
2329 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2330 
2331 		memcpy(ptr, &target, 4); ptr += 4;
2332 		memcpy(ptr, &pname, 4); ptr += 4;
2333 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
2334 	memcpy(ptr, params, __size_params);ptr += __size_params;
2335 }
2336 
glTexSubImage2D_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)2337 void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels)
2338 {
2339 
2340 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2341 	IOStream *stream = ctx->m_stream;
2342 
2343 	const unsigned int __size_pixels =  pixelDataSize(self, width, height, format, type, 0);
2344 	 unsigned char *ptr;
2345 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
2346 	ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
2347 	int tmp = OP_glTexSubImage2D;memcpy(ptr, &tmp, 4); ptr += 4;
2348 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2349 
2350 		memcpy(ptr, &target, 4); ptr += 4;
2351 		memcpy(ptr, &level, 4); ptr += 4;
2352 		memcpy(ptr, &xoffset, 4); ptr += 4;
2353 		memcpy(ptr, &yoffset, 4); ptr += 4;
2354 		memcpy(ptr, &width, 4); ptr += 4;
2355 		memcpy(ptr, &height, 4); ptr += 4;
2356 		memcpy(ptr, &format, 4); ptr += 4;
2357 		memcpy(ptr, &type, 4); ptr += 4;
2358 	stream->flush();
2359 	stream->writeFully(&__size_pixels,4);
2360 	stream->writeFully(pixels, __size_pixels);
2361 }
2362 
glTranslatex_enc(void * self,GLfixed x,GLfixed y,GLfixed z)2363 void glTranslatex_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
2364 {
2365 
2366 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2367 	IOStream *stream = ctx->m_stream;
2368 
2369 	 unsigned char *ptr;
2370 	 const size_t packetSize = 8 + 4 + 4 + 4;
2371 	ptr = stream->alloc(packetSize);
2372 	int tmp = OP_glTranslatex;memcpy(ptr, &tmp, 4); ptr += 4;
2373 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2374 
2375 		memcpy(ptr, &x, 4); ptr += 4;
2376 		memcpy(ptr, &y, 4); ptr += 4;
2377 		memcpy(ptr, &z, 4); ptr += 4;
2378 }
2379 
glViewport_enc(void * self,GLint x,GLint y,GLsizei width,GLsizei height)2380 void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height)
2381 {
2382 
2383 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2384 	IOStream *stream = ctx->m_stream;
2385 
2386 	 unsigned char *ptr;
2387 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2388 	ptr = stream->alloc(packetSize);
2389 	int tmp = OP_glViewport;memcpy(ptr, &tmp, 4); ptr += 4;
2390 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2391 
2392 		memcpy(ptr, &x, 4); ptr += 4;
2393 		memcpy(ptr, &y, 4); ptr += 4;
2394 		memcpy(ptr, &width, 4); ptr += 4;
2395 		memcpy(ptr, &height, 4); ptr += 4;
2396 }
2397 
glVertexPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)2398 void glVertexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
2399 {
2400 
2401 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2402 	IOStream *stream = ctx->m_stream;
2403 
2404 	 unsigned char *ptr;
2405 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2406 	ptr = stream->alloc(packetSize);
2407 	int tmp = OP_glVertexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2408 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2409 
2410 		memcpy(ptr, &size, 4); ptr += 4;
2411 		memcpy(ptr, &type, 4); ptr += 4;
2412 		memcpy(ptr, &stride, 4); ptr += 4;
2413 		memcpy(ptr, &offset, 4); ptr += 4;
2414 }
2415 
glColorPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)2416 void glColorPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
2417 {
2418 
2419 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2420 	IOStream *stream = ctx->m_stream;
2421 
2422 	 unsigned char *ptr;
2423 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2424 	ptr = stream->alloc(packetSize);
2425 	int tmp = OP_glColorPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2426 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2427 
2428 		memcpy(ptr, &size, 4); ptr += 4;
2429 		memcpy(ptr, &type, 4); ptr += 4;
2430 		memcpy(ptr, &stride, 4); ptr += 4;
2431 		memcpy(ptr, &offset, 4); ptr += 4;
2432 }
2433 
glNormalPointerOffset_enc(void * self,GLenum type,GLsizei stride,GLuint offset)2434 void glNormalPointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
2435 {
2436 
2437 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2438 	IOStream *stream = ctx->m_stream;
2439 
2440 	 unsigned char *ptr;
2441 	 const size_t packetSize = 8 + 4 + 4 + 4;
2442 	ptr = stream->alloc(packetSize);
2443 	int tmp = OP_glNormalPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2444 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2445 
2446 		memcpy(ptr, &type, 4); ptr += 4;
2447 		memcpy(ptr, &stride, 4); ptr += 4;
2448 		memcpy(ptr, &offset, 4); ptr += 4;
2449 }
2450 
glPointSizePointerOffset_enc(void * self,GLenum type,GLsizei stride,GLuint offset)2451 void glPointSizePointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset)
2452 {
2453 
2454 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2455 	IOStream *stream = ctx->m_stream;
2456 
2457 	 unsigned char *ptr;
2458 	 const size_t packetSize = 8 + 4 + 4 + 4;
2459 	ptr = stream->alloc(packetSize);
2460 	int tmp = OP_glPointSizePointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2461 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2462 
2463 		memcpy(ptr, &type, 4); ptr += 4;
2464 		memcpy(ptr, &stride, 4); ptr += 4;
2465 		memcpy(ptr, &offset, 4); ptr += 4;
2466 }
2467 
glTexCoordPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)2468 void glTexCoordPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
2469 {
2470 
2471 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2472 	IOStream *stream = ctx->m_stream;
2473 
2474 	 unsigned char *ptr;
2475 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2476 	ptr = stream->alloc(packetSize);
2477 	int tmp = OP_glTexCoordPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2478 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2479 
2480 		memcpy(ptr, &size, 4); ptr += 4;
2481 		memcpy(ptr, &type, 4); ptr += 4;
2482 		memcpy(ptr, &stride, 4); ptr += 4;
2483 		memcpy(ptr, &offset, 4); ptr += 4;
2484 }
2485 
glWeightPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)2486 void glWeightPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
2487 {
2488 
2489 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2490 	IOStream *stream = ctx->m_stream;
2491 
2492 	 unsigned char *ptr;
2493 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2494 	ptr = stream->alloc(packetSize);
2495 	int tmp = OP_glWeightPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2496 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2497 
2498 		memcpy(ptr, &size, 4); ptr += 4;
2499 		memcpy(ptr, &type, 4); ptr += 4;
2500 		memcpy(ptr, &stride, 4); ptr += 4;
2501 		memcpy(ptr, &offset, 4); ptr += 4;
2502 }
2503 
glMatrixIndexPointerOffset_enc(void * self,GLint size,GLenum type,GLsizei stride,GLuint offset)2504 void glMatrixIndexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset)
2505 {
2506 
2507 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2508 	IOStream *stream = ctx->m_stream;
2509 
2510 	 unsigned char *ptr;
2511 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2512 	ptr = stream->alloc(packetSize);
2513 	int tmp = OP_glMatrixIndexPointerOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2514 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2515 
2516 		memcpy(ptr, &size, 4); ptr += 4;
2517 		memcpy(ptr, &type, 4); ptr += 4;
2518 		memcpy(ptr, &stride, 4); ptr += 4;
2519 		memcpy(ptr, &offset, 4); ptr += 4;
2520 }
2521 
glVertexPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)2522 void glVertexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
2523 {
2524 
2525 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2526 	IOStream *stream = ctx->m_stream;
2527 
2528 	const unsigned int __size_data =  datalen;
2529 	 unsigned char *ptr;
2530 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
2531 	ptr = stream->alloc(packetSize);
2532 	int tmp = OP_glVertexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2533 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2534 
2535 		memcpy(ptr, &size, 4); ptr += 4;
2536 		memcpy(ptr, &type, 4); ptr += 4;
2537 		memcpy(ptr, &stride, 4); ptr += 4;
2538 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2539 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
2540 		memcpy(ptr, &datalen, 4); ptr += 4;
2541 }
2542 
glColorPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)2543 void glColorPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
2544 {
2545 
2546 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2547 	IOStream *stream = ctx->m_stream;
2548 
2549 	const unsigned int __size_data =  datalen;
2550 	 unsigned char *ptr;
2551 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
2552 	ptr = stream->alloc(packetSize);
2553 	int tmp = OP_glColorPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2554 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2555 
2556 		memcpy(ptr, &size, 4); ptr += 4;
2557 		memcpy(ptr, &type, 4); ptr += 4;
2558 		memcpy(ptr, &stride, 4); ptr += 4;
2559 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2560 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
2561 		memcpy(ptr, &datalen, 4); ptr += 4;
2562 }
2563 
glNormalPointerData_enc(void * self,GLenum type,GLsizei stride,void * data,GLuint datalen)2564 void glNormalPointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
2565 {
2566 
2567 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2568 	IOStream *stream = ctx->m_stream;
2569 
2570 	const unsigned int __size_data =  datalen;
2571 	 unsigned char *ptr;
2572 	 const size_t packetSize = 8 + 4 + 4 + __size_data + 4 + 1*4;
2573 	ptr = stream->alloc(packetSize);
2574 	int tmp = OP_glNormalPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2575 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2576 
2577 		memcpy(ptr, &type, 4); ptr += 4;
2578 		memcpy(ptr, &stride, 4); ptr += 4;
2579 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2580 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 3, type, stride, datalen);ptr += __size_data;
2581 		memcpy(ptr, &datalen, 4); ptr += 4;
2582 }
2583 
glTexCoordPointerData_enc(void * self,GLint unit,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)2584 void glTexCoordPointerData_enc(void *self , GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
2585 {
2586 
2587 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2588 	IOStream *stream = ctx->m_stream;
2589 
2590 	const unsigned int __size_data =  datalen;
2591 	 unsigned char *ptr;
2592 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + __size_data + 4 + 1*4;
2593 	ptr = stream->alloc(packetSize);
2594 	int tmp = OP_glTexCoordPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2595 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2596 
2597 		memcpy(ptr, &unit, 4); ptr += 4;
2598 		memcpy(ptr, &size, 4); ptr += 4;
2599 		memcpy(ptr, &type, 4); ptr += 4;
2600 		memcpy(ptr, &stride, 4); ptr += 4;
2601 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2602 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
2603 		memcpy(ptr, &datalen, 4); ptr += 4;
2604 }
2605 
glPointSizePointerData_enc(void * self,GLenum type,GLsizei stride,void * data,GLuint datalen)2606 void glPointSizePointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen)
2607 {
2608 
2609 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2610 	IOStream *stream = ctx->m_stream;
2611 
2612 	const unsigned int __size_data =  datalen;
2613 	 unsigned char *ptr;
2614 	 const size_t packetSize = 8 + 4 + 4 + __size_data + 4 + 1*4;
2615 	ptr = stream->alloc(packetSize);
2616 	int tmp = OP_glPointSizePointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2617 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2618 
2619 		memcpy(ptr, &type, 4); ptr += 4;
2620 		memcpy(ptr, &stride, 4); ptr += 4;
2621 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2622 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, 1, type, stride, datalen);ptr += __size_data;
2623 		memcpy(ptr, &datalen, 4); ptr += 4;
2624 }
2625 
glWeightPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)2626 void glWeightPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
2627 {
2628 
2629 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2630 	IOStream *stream = ctx->m_stream;
2631 
2632 	const unsigned int __size_data =  datalen;
2633 	 unsigned char *ptr;
2634 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
2635 	ptr = stream->alloc(packetSize);
2636 	int tmp = OP_glWeightPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2637 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2638 
2639 		memcpy(ptr, &size, 4); ptr += 4;
2640 		memcpy(ptr, &type, 4); ptr += 4;
2641 		memcpy(ptr, &stride, 4); ptr += 4;
2642 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2643 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
2644 		memcpy(ptr, &datalen, 4); ptr += 4;
2645 }
2646 
glMatrixIndexPointerData_enc(void * self,GLint size,GLenum type,GLsizei stride,void * data,GLuint datalen)2647 void glMatrixIndexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
2648 {
2649 
2650 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2651 	IOStream *stream = ctx->m_stream;
2652 
2653 	const unsigned int __size_data =  datalen;
2654 	 unsigned char *ptr;
2655 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
2656 	ptr = stream->alloc(packetSize);
2657 	int tmp = OP_glMatrixIndexPointerData;memcpy(ptr, &tmp, 4); ptr += 4;
2658 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2659 
2660 		memcpy(ptr, &size, 4); ptr += 4;
2661 		memcpy(ptr, &type, 4); ptr += 4;
2662 		memcpy(ptr, &stride, 4); ptr += 4;
2663 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2664 	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char*)data, size, type, stride, datalen);ptr += __size_data;
2665 		memcpy(ptr, &datalen, 4); ptr += 4;
2666 }
2667 
glDrawElementsOffset_enc(void * self,GLenum mode,GLsizei count,GLenum type,GLuint offset)2668 void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset)
2669 {
2670 
2671 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2672 	IOStream *stream = ctx->m_stream;
2673 
2674 	 unsigned char *ptr;
2675 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2676 	ptr = stream->alloc(packetSize);
2677 	int tmp = OP_glDrawElementsOffset;memcpy(ptr, &tmp, 4); ptr += 4;
2678 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2679 
2680 		memcpy(ptr, &mode, 4); ptr += 4;
2681 		memcpy(ptr, &count, 4); ptr += 4;
2682 		memcpy(ptr, &type, 4); ptr += 4;
2683 		memcpy(ptr, &offset, 4); ptr += 4;
2684 }
2685 
glDrawElementsData_enc(void * self,GLenum mode,GLsizei count,GLenum type,void * data,GLuint datalen)2686 void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen)
2687 {
2688 
2689 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2690 	IOStream *stream = ctx->m_stream;
2691 
2692 	const unsigned int __size_data =  datalen;
2693 	 unsigned char *ptr;
2694 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_data + 4 + 1*4;
2695 	ptr = stream->alloc(packetSize);
2696 	int tmp = OP_glDrawElementsData;memcpy(ptr, &tmp, 4); ptr += 4;
2697 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2698 
2699 		memcpy(ptr, &mode, 4); ptr += 4;
2700 		memcpy(ptr, &count, 4); ptr += 4;
2701 		memcpy(ptr, &type, 4); ptr += 4;
2702 	*(unsigned int *)(ptr) = __size_data; ptr += 4;
2703 	memcpy(ptr, data, __size_data);ptr += __size_data;
2704 		memcpy(ptr, &datalen, 4); ptr += 4;
2705 }
2706 
glGetCompressedTextureFormats_enc(void * self,int count,GLint * formats)2707 void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats)
2708 {
2709 
2710 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2711 	IOStream *stream = ctx->m_stream;
2712 
2713 	const unsigned int __size_formats =  (count * sizeof(GLint));
2714 	 unsigned char *ptr;
2715 	 const size_t packetSize = 8 + 4 + __size_formats + 1*4;
2716 	ptr = stream->alloc(packetSize);
2717 	int tmp = OP_glGetCompressedTextureFormats;memcpy(ptr, &tmp, 4); ptr += 4;
2718 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2719 
2720 		memcpy(ptr, &count, 4); ptr += 4;
2721 	*(unsigned int *)(ptr) = __size_formats; ptr += 4;
2722 	stream->readback(formats, __size_formats);
2723 }
2724 
glFinishRoundTrip_enc(void * self)2725 int glFinishRoundTrip_enc(void *self )
2726 {
2727 
2728 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2729 	IOStream *stream = ctx->m_stream;
2730 
2731 	 unsigned char *ptr;
2732 	 const size_t packetSize = 8 + 0;
2733 	ptr = stream->alloc(packetSize);
2734 	int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
2735 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2736 
2737 
2738 	int retval;
2739 	stream->readback(&retval, 4);
2740 	return retval;
2741 }
2742 
glBlendEquationSeparateOES_enc(void * self,GLenum modeRGB,GLenum modeAlpha)2743 void glBlendEquationSeparateOES_enc(void *self , GLenum modeRGB, GLenum modeAlpha)
2744 {
2745 
2746 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2747 	IOStream *stream = ctx->m_stream;
2748 
2749 	 unsigned char *ptr;
2750 	 const size_t packetSize = 8 + 4 + 4;
2751 	ptr = stream->alloc(packetSize);
2752 	int tmp = OP_glBlendEquationSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
2753 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2754 
2755 		memcpy(ptr, &modeRGB, 4); ptr += 4;
2756 		memcpy(ptr, &modeAlpha, 4); ptr += 4;
2757 }
2758 
glBlendFuncSeparateOES_enc(void * self,GLenum srcRGB,GLenum dstRGB,GLenum srcAlpha,GLenum dstAlpha)2759 void glBlendFuncSeparateOES_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
2760 {
2761 
2762 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2763 	IOStream *stream = ctx->m_stream;
2764 
2765 	 unsigned char *ptr;
2766 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2767 	ptr = stream->alloc(packetSize);
2768 	int tmp = OP_glBlendFuncSeparateOES;memcpy(ptr, &tmp, 4); ptr += 4;
2769 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2770 
2771 		memcpy(ptr, &srcRGB, 4); ptr += 4;
2772 		memcpy(ptr, &dstRGB, 4); ptr += 4;
2773 		memcpy(ptr, &srcAlpha, 4); ptr += 4;
2774 		memcpy(ptr, &dstAlpha, 4); ptr += 4;
2775 }
2776 
glBlendEquationOES_enc(void * self,GLenum mode)2777 void glBlendEquationOES_enc(void *self , GLenum mode)
2778 {
2779 
2780 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2781 	IOStream *stream = ctx->m_stream;
2782 
2783 	 unsigned char *ptr;
2784 	 const size_t packetSize = 8 + 4;
2785 	ptr = stream->alloc(packetSize);
2786 	int tmp = OP_glBlendEquationOES;memcpy(ptr, &tmp, 4); ptr += 4;
2787 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2788 
2789 		memcpy(ptr, &mode, 4); ptr += 4;
2790 }
2791 
glDrawTexsOES_enc(void * self,GLshort x,GLshort y,GLshort z,GLshort width,GLshort height)2792 void glDrawTexsOES_enc(void *self , GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
2793 {
2794 
2795 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2796 	IOStream *stream = ctx->m_stream;
2797 
2798 	 unsigned char *ptr;
2799 	 const size_t packetSize = 8 + 2 + 2 + 2 + 2 + 2;
2800 	ptr = stream->alloc(packetSize);
2801 	int tmp = OP_glDrawTexsOES;memcpy(ptr, &tmp, 4); ptr += 4;
2802 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2803 
2804 		memcpy(ptr, &x, 2); ptr += 2;
2805 		memcpy(ptr, &y, 2); ptr += 2;
2806 		memcpy(ptr, &z, 2); ptr += 2;
2807 		memcpy(ptr, &width, 2); ptr += 2;
2808 		memcpy(ptr, &height, 2); ptr += 2;
2809 }
2810 
glDrawTexiOES_enc(void * self,GLint x,GLint y,GLint z,GLint width,GLint height)2811 void glDrawTexiOES_enc(void *self , GLint x, GLint y, GLint z, GLint width, GLint height)
2812 {
2813 
2814 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2815 	IOStream *stream = ctx->m_stream;
2816 
2817 	 unsigned char *ptr;
2818 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
2819 	ptr = stream->alloc(packetSize);
2820 	int tmp = OP_glDrawTexiOES;memcpy(ptr, &tmp, 4); ptr += 4;
2821 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2822 
2823 		memcpy(ptr, &x, 4); ptr += 4;
2824 		memcpy(ptr, &y, 4); ptr += 4;
2825 		memcpy(ptr, &z, 4); ptr += 4;
2826 		memcpy(ptr, &width, 4); ptr += 4;
2827 		memcpy(ptr, &height, 4); ptr += 4;
2828 }
2829 
glDrawTexxOES_enc(void * self,GLfixed x,GLfixed y,GLfixed z,GLfixed width,GLfixed height)2830 void glDrawTexxOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
2831 {
2832 
2833 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2834 	IOStream *stream = ctx->m_stream;
2835 
2836 	 unsigned char *ptr;
2837 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
2838 	ptr = stream->alloc(packetSize);
2839 	int tmp = OP_glDrawTexxOES;memcpy(ptr, &tmp, 4); ptr += 4;
2840 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2841 
2842 		memcpy(ptr, &x, 4); ptr += 4;
2843 		memcpy(ptr, &y, 4); ptr += 4;
2844 		memcpy(ptr, &z, 4); ptr += 4;
2845 		memcpy(ptr, &width, 4); ptr += 4;
2846 		memcpy(ptr, &height, 4); ptr += 4;
2847 }
2848 
glDrawTexsvOES_enc(void * self,const GLshort * coords)2849 void glDrawTexsvOES_enc(void *self , const GLshort* coords)
2850 {
2851 
2852 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2853 	IOStream *stream = ctx->m_stream;
2854 
2855 	const unsigned int __size_coords =  (5 * sizeof(GLshort));
2856 	 unsigned char *ptr;
2857 	 const size_t packetSize = 8 + __size_coords + 1*4;
2858 	ptr = stream->alloc(packetSize);
2859 	int tmp = OP_glDrawTexsvOES;memcpy(ptr, &tmp, 4); ptr += 4;
2860 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2861 
2862 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
2863 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
2864 }
2865 
glDrawTexivOES_enc(void * self,const GLint * coords)2866 void glDrawTexivOES_enc(void *self , const GLint* coords)
2867 {
2868 
2869 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2870 	IOStream *stream = ctx->m_stream;
2871 
2872 	const unsigned int __size_coords =  (5 * sizeof(GLint));
2873 	 unsigned char *ptr;
2874 	 const size_t packetSize = 8 + __size_coords + 1*4;
2875 	ptr = stream->alloc(packetSize);
2876 	int tmp = OP_glDrawTexivOES;memcpy(ptr, &tmp, 4); ptr += 4;
2877 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2878 
2879 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
2880 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
2881 }
2882 
glDrawTexxvOES_enc(void * self,const GLfixed * coords)2883 void glDrawTexxvOES_enc(void *self , const GLfixed* coords)
2884 {
2885 
2886 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2887 	IOStream *stream = ctx->m_stream;
2888 
2889 	const unsigned int __size_coords =  (5 * sizeof(GLfixed));
2890 	 unsigned char *ptr;
2891 	 const size_t packetSize = 8 + __size_coords + 1*4;
2892 	ptr = stream->alloc(packetSize);
2893 	int tmp = OP_glDrawTexxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
2894 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2895 
2896 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
2897 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
2898 }
2899 
glDrawTexfOES_enc(void * self,GLfloat x,GLfloat y,GLfloat z,GLfloat width,GLfloat height)2900 void glDrawTexfOES_enc(void *self , GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
2901 {
2902 
2903 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2904 	IOStream *stream = ctx->m_stream;
2905 
2906 	 unsigned char *ptr;
2907 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
2908 	ptr = stream->alloc(packetSize);
2909 	int tmp = OP_glDrawTexfOES;memcpy(ptr, &tmp, 4); ptr += 4;
2910 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2911 
2912 		memcpy(ptr, &x, 4); ptr += 4;
2913 		memcpy(ptr, &y, 4); ptr += 4;
2914 		memcpy(ptr, &z, 4); ptr += 4;
2915 		memcpy(ptr, &width, 4); ptr += 4;
2916 		memcpy(ptr, &height, 4); ptr += 4;
2917 }
2918 
glDrawTexfvOES_enc(void * self,const GLfloat * coords)2919 void glDrawTexfvOES_enc(void *self , const GLfloat* coords)
2920 {
2921 
2922 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2923 	IOStream *stream = ctx->m_stream;
2924 
2925 	const unsigned int __size_coords =  (5 * sizeof(GLfloat));
2926 	 unsigned char *ptr;
2927 	 const size_t packetSize = 8 + __size_coords + 1*4;
2928 	ptr = stream->alloc(packetSize);
2929 	int tmp = OP_glDrawTexfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
2930 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2931 
2932 	*(unsigned int *)(ptr) = __size_coords; ptr += 4;
2933 	memcpy(ptr, coords, __size_coords);ptr += __size_coords;
2934 }
2935 
glEGLImageTargetTexture2DOES_enc(void * self,GLenum target,GLeglImageOES image)2936 void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image)
2937 {
2938 
2939 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2940 	IOStream *stream = ctx->m_stream;
2941 
2942 	 unsigned char *ptr;
2943 	 const size_t packetSize = 8 + 4 + 4;
2944 	ptr = stream->alloc(packetSize);
2945 	int tmp = OP_glEGLImageTargetTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
2946 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2947 
2948 		memcpy(ptr, &target, 4); ptr += 4;
2949 		memcpy(ptr, &image, 4); ptr += 4;
2950 }
2951 
glEGLImageTargetRenderbufferStorageOES_enc(void * self,GLenum target,GLeglImageOES image)2952 void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image)
2953 {
2954 
2955 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2956 	IOStream *stream = ctx->m_stream;
2957 
2958 	 unsigned char *ptr;
2959 	 const size_t packetSize = 8 + 4 + 4;
2960 	ptr = stream->alloc(packetSize);
2961 	int tmp = OP_glEGLImageTargetRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
2962 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2963 
2964 		memcpy(ptr, &target, 4); ptr += 4;
2965 		memcpy(ptr, &image, 4); ptr += 4;
2966 }
2967 
glAlphaFuncxOES_enc(void * self,GLenum func,GLclampx ref)2968 void glAlphaFuncxOES_enc(void *self , GLenum func, GLclampx ref)
2969 {
2970 
2971 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2972 	IOStream *stream = ctx->m_stream;
2973 
2974 	 unsigned char *ptr;
2975 	 const size_t packetSize = 8 + 4 + 4;
2976 	ptr = stream->alloc(packetSize);
2977 	int tmp = OP_glAlphaFuncxOES;memcpy(ptr, &tmp, 4); ptr += 4;
2978 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2979 
2980 		memcpy(ptr, &func, 4); ptr += 4;
2981 		memcpy(ptr, &ref, 4); ptr += 4;
2982 }
2983 
glClearColorxOES_enc(void * self,GLclampx red,GLclampx green,GLclampx blue,GLclampx alpha)2984 void glClearColorxOES_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
2985 {
2986 
2987 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
2988 	IOStream *stream = ctx->m_stream;
2989 
2990 	 unsigned char *ptr;
2991 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
2992 	ptr = stream->alloc(packetSize);
2993 	int tmp = OP_glClearColorxOES;memcpy(ptr, &tmp, 4); ptr += 4;
2994 	memcpy(ptr, &packetSize, 4);  ptr += 4;
2995 
2996 		memcpy(ptr, &red, 4); ptr += 4;
2997 		memcpy(ptr, &green, 4); ptr += 4;
2998 		memcpy(ptr, &blue, 4); ptr += 4;
2999 		memcpy(ptr, &alpha, 4); ptr += 4;
3000 }
3001 
glClearDepthxOES_enc(void * self,GLclampx depth)3002 void glClearDepthxOES_enc(void *self , GLclampx depth)
3003 {
3004 
3005 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3006 	IOStream *stream = ctx->m_stream;
3007 
3008 	 unsigned char *ptr;
3009 	 const size_t packetSize = 8 + 4;
3010 	ptr = stream->alloc(packetSize);
3011 	int tmp = OP_glClearDepthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3012 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3013 
3014 		memcpy(ptr, &depth, 4); ptr += 4;
3015 }
3016 
glClipPlanexOES_enc(void * self,GLenum plane,const GLfixed * equation)3017 void glClipPlanexOES_enc(void *self , GLenum plane, const GLfixed* equation)
3018 {
3019 
3020 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3021 	IOStream *stream = ctx->m_stream;
3022 
3023 	const unsigned int __size_equation =  (4 * sizeof(GLfixed));
3024 	 unsigned char *ptr;
3025 	 const size_t packetSize = 8 + 4 + __size_equation + 1*4;
3026 	ptr = stream->alloc(packetSize);
3027 	int tmp = OP_glClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3028 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3029 
3030 		memcpy(ptr, &plane, 4); ptr += 4;
3031 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
3032 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
3033 }
3034 
glClipPlanexIMG_enc(void * self,GLenum plane,const GLfixed * equation)3035 void glClipPlanexIMG_enc(void *self , GLenum plane, const GLfixed* equation)
3036 {
3037 
3038 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3039 	IOStream *stream = ctx->m_stream;
3040 
3041 	const unsigned int __size_equation =  (4 * sizeof(GLfixed));
3042 	 unsigned char *ptr;
3043 	 const size_t packetSize = 8 + 4 + __size_equation + 1*4;
3044 	ptr = stream->alloc(packetSize);
3045 	int tmp = OP_glClipPlanexIMG;memcpy(ptr, &tmp, 4); ptr += 4;
3046 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3047 
3048 		memcpy(ptr, &plane, 4); ptr += 4;
3049 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
3050 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
3051 }
3052 
glColor4xOES_enc(void * self,GLfixed red,GLfixed green,GLfixed blue,GLfixed alpha)3053 void glColor4xOES_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
3054 {
3055 
3056 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3057 	IOStream *stream = ctx->m_stream;
3058 
3059 	 unsigned char *ptr;
3060 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
3061 	ptr = stream->alloc(packetSize);
3062 	int tmp = OP_glColor4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
3063 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3064 
3065 		memcpy(ptr, &red, 4); ptr += 4;
3066 		memcpy(ptr, &green, 4); ptr += 4;
3067 		memcpy(ptr, &blue, 4); ptr += 4;
3068 		memcpy(ptr, &alpha, 4); ptr += 4;
3069 }
3070 
glDepthRangexOES_enc(void * self,GLclampx zNear,GLclampx zFar)3071 void glDepthRangexOES_enc(void *self , GLclampx zNear, GLclampx zFar)
3072 {
3073 
3074 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3075 	IOStream *stream = ctx->m_stream;
3076 
3077 	 unsigned char *ptr;
3078 	 const size_t packetSize = 8 + 4 + 4;
3079 	ptr = stream->alloc(packetSize);
3080 	int tmp = OP_glDepthRangexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3081 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3082 
3083 		memcpy(ptr, &zNear, 4); ptr += 4;
3084 		memcpy(ptr, &zFar, 4); ptr += 4;
3085 }
3086 
glFogxOES_enc(void * self,GLenum pname,GLfixed param)3087 void glFogxOES_enc(void *self , GLenum pname, GLfixed param)
3088 {
3089 
3090 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3091 	IOStream *stream = ctx->m_stream;
3092 
3093 	 unsigned char *ptr;
3094 	 const size_t packetSize = 8 + 4 + 4;
3095 	ptr = stream->alloc(packetSize);
3096 	int tmp = OP_glFogxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3097 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3098 
3099 		memcpy(ptr, &pname, 4); ptr += 4;
3100 		memcpy(ptr, &param, 4); ptr += 4;
3101 }
3102 
glFogxvOES_enc(void * self,GLenum pname,const GLfixed * params)3103 void glFogxvOES_enc(void *self , GLenum pname, const GLfixed* params)
3104 {
3105 
3106 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3107 	IOStream *stream = ctx->m_stream;
3108 
3109 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3110 	 unsigned char *ptr;
3111 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
3112 	ptr = stream->alloc(packetSize);
3113 	int tmp = OP_glFogxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3114 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3115 
3116 		memcpy(ptr, &pname, 4); ptr += 4;
3117 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3118 	memcpy(ptr, params, __size_params);ptr += __size_params;
3119 }
3120 
glFrustumxOES_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)3121 void glFrustumxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
3122 {
3123 
3124 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3125 	IOStream *stream = ctx->m_stream;
3126 
3127 	 unsigned char *ptr;
3128 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
3129 	ptr = stream->alloc(packetSize);
3130 	int tmp = OP_glFrustumxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3131 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3132 
3133 		memcpy(ptr, &left, 4); ptr += 4;
3134 		memcpy(ptr, &right, 4); ptr += 4;
3135 		memcpy(ptr, &bottom, 4); ptr += 4;
3136 		memcpy(ptr, &top, 4); ptr += 4;
3137 		memcpy(ptr, &zNear, 4); ptr += 4;
3138 		memcpy(ptr, &zFar, 4); ptr += 4;
3139 }
3140 
glGetClipPlanexOES_enc(void * self,GLenum pname,GLfixed * eqn)3141 void glGetClipPlanexOES_enc(void *self , GLenum pname, GLfixed* eqn)
3142 {
3143 
3144 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3145 	IOStream *stream = ctx->m_stream;
3146 
3147 	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
3148 	 unsigned char *ptr;
3149 	 const size_t packetSize = 8 + 4 + __size_eqn + 1*4;
3150 	ptr = stream->alloc(packetSize);
3151 	int tmp = OP_glGetClipPlanexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3152 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3153 
3154 		memcpy(ptr, &pname, 4); ptr += 4;
3155 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
3156 	stream->readback(eqn, __size_eqn);
3157 }
3158 
glGetClipPlanex_enc(void * self,GLenum pname,GLfixed * eqn)3159 void glGetClipPlanex_enc(void *self , GLenum pname, GLfixed* eqn)
3160 {
3161 
3162 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3163 	IOStream *stream = ctx->m_stream;
3164 
3165 	const unsigned int __size_eqn =  (4 * sizeof(GLfixed));
3166 	 unsigned char *ptr;
3167 	 const size_t packetSize = 8 + 4 + __size_eqn + 1*4;
3168 	ptr = stream->alloc(packetSize);
3169 	int tmp = OP_glGetClipPlanex;memcpy(ptr, &tmp, 4); ptr += 4;
3170 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3171 
3172 		memcpy(ptr, &pname, 4); ptr += 4;
3173 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
3174 	stream->readback(eqn, __size_eqn);
3175 }
3176 
glGetFixedvOES_enc(void * self,GLenum pname,GLfixed * params)3177 void glGetFixedvOES_enc(void *self , GLenum pname, GLfixed* params)
3178 {
3179 
3180 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3181 	IOStream *stream = ctx->m_stream;
3182 
3183 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3184 	 unsigned char *ptr;
3185 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
3186 	ptr = stream->alloc(packetSize);
3187 	int tmp = OP_glGetFixedvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3188 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3189 
3190 		memcpy(ptr, &pname, 4); ptr += 4;
3191 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3192 	stream->readback(params, __size_params);
3193 }
3194 
glGetLightxvOES_enc(void * self,GLenum light,GLenum pname,GLfixed * params)3195 void glGetLightxvOES_enc(void *self , GLenum light, GLenum pname, GLfixed* params)
3196 {
3197 
3198 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3199 	IOStream *stream = ctx->m_stream;
3200 
3201 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3202 	 unsigned char *ptr;
3203 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3204 	ptr = stream->alloc(packetSize);
3205 	int tmp = OP_glGetLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3206 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3207 
3208 		memcpy(ptr, &light, 4); ptr += 4;
3209 		memcpy(ptr, &pname, 4); ptr += 4;
3210 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3211 	stream->readback(params, __size_params);
3212 }
3213 
glGetMaterialxvOES_enc(void * self,GLenum face,GLenum pname,GLfixed * params)3214 void glGetMaterialxvOES_enc(void *self , GLenum face, GLenum pname, GLfixed* params)
3215 {
3216 
3217 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3218 	IOStream *stream = ctx->m_stream;
3219 
3220 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3221 	 unsigned char *ptr;
3222 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3223 	ptr = stream->alloc(packetSize);
3224 	int tmp = OP_glGetMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3225 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3226 
3227 		memcpy(ptr, &face, 4); ptr += 4;
3228 		memcpy(ptr, &pname, 4); ptr += 4;
3229 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3230 	stream->readback(params, __size_params);
3231 }
3232 
glGetTexEnvxvOES_enc(void * self,GLenum env,GLenum pname,GLfixed * params)3233 void glGetTexEnvxvOES_enc(void *self , GLenum env, GLenum pname, GLfixed* params)
3234 {
3235 
3236 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3237 	IOStream *stream = ctx->m_stream;
3238 
3239 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3240 	 unsigned char *ptr;
3241 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3242 	ptr = stream->alloc(packetSize);
3243 	int tmp = OP_glGetTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3244 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3245 
3246 		memcpy(ptr, &env, 4); ptr += 4;
3247 		memcpy(ptr, &pname, 4); ptr += 4;
3248 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3249 	stream->readback(params, __size_params);
3250 }
3251 
glGetTexParameterxvOES_enc(void * self,GLenum target,GLenum pname,GLfixed * params)3252 void glGetTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, GLfixed* params)
3253 {
3254 
3255 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3256 	IOStream *stream = ctx->m_stream;
3257 
3258 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3259 	 unsigned char *ptr;
3260 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3261 	ptr = stream->alloc(packetSize);
3262 	int tmp = OP_glGetTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3263 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3264 
3265 		memcpy(ptr, &target, 4); ptr += 4;
3266 		memcpy(ptr, &pname, 4); ptr += 4;
3267 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3268 	stream->readback(params, __size_params);
3269 }
3270 
glLightModelxOES_enc(void * self,GLenum pname,GLfixed param)3271 void glLightModelxOES_enc(void *self , GLenum pname, GLfixed param)
3272 {
3273 
3274 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3275 	IOStream *stream = ctx->m_stream;
3276 
3277 	 unsigned char *ptr;
3278 	 const size_t packetSize = 8 + 4 + 4;
3279 	ptr = stream->alloc(packetSize);
3280 	int tmp = OP_glLightModelxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3281 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3282 
3283 		memcpy(ptr, &pname, 4); ptr += 4;
3284 		memcpy(ptr, &param, 4); ptr += 4;
3285 }
3286 
glLightModelxvOES_enc(void * self,GLenum pname,const GLfixed * params)3287 void glLightModelxvOES_enc(void *self , GLenum pname, const GLfixed* params)
3288 {
3289 
3290 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3291 	IOStream *stream = ctx->m_stream;
3292 
3293 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3294 	 unsigned char *ptr;
3295 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
3296 	ptr = stream->alloc(packetSize);
3297 	int tmp = OP_glLightModelxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3298 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3299 
3300 		memcpy(ptr, &pname, 4); ptr += 4;
3301 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3302 	memcpy(ptr, params, __size_params);ptr += __size_params;
3303 }
3304 
glLightxOES_enc(void * self,GLenum light,GLenum pname,GLfixed param)3305 void glLightxOES_enc(void *self , GLenum light, GLenum pname, GLfixed param)
3306 {
3307 
3308 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3309 	IOStream *stream = ctx->m_stream;
3310 
3311 	 unsigned char *ptr;
3312 	 const size_t packetSize = 8 + 4 + 4 + 4;
3313 	ptr = stream->alloc(packetSize);
3314 	int tmp = OP_glLightxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3315 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3316 
3317 		memcpy(ptr, &light, 4); ptr += 4;
3318 		memcpy(ptr, &pname, 4); ptr += 4;
3319 		memcpy(ptr, &param, 4); ptr += 4;
3320 }
3321 
glLightxvOES_enc(void * self,GLenum light,GLenum pname,const GLfixed * params)3322 void glLightxvOES_enc(void *self , GLenum light, GLenum pname, const GLfixed* params)
3323 {
3324 
3325 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3326 	IOStream *stream = ctx->m_stream;
3327 
3328 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3329 	 unsigned char *ptr;
3330 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3331 	ptr = stream->alloc(packetSize);
3332 	int tmp = OP_glLightxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3333 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3334 
3335 		memcpy(ptr, &light, 4); ptr += 4;
3336 		memcpy(ptr, &pname, 4); ptr += 4;
3337 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3338 	memcpy(ptr, params, __size_params);ptr += __size_params;
3339 }
3340 
glLineWidthxOES_enc(void * self,GLfixed width)3341 void glLineWidthxOES_enc(void *self , GLfixed width)
3342 {
3343 
3344 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3345 	IOStream *stream = ctx->m_stream;
3346 
3347 	 unsigned char *ptr;
3348 	 const size_t packetSize = 8 + 4;
3349 	ptr = stream->alloc(packetSize);
3350 	int tmp = OP_glLineWidthxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3351 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3352 
3353 		memcpy(ptr, &width, 4); ptr += 4;
3354 }
3355 
glLoadMatrixxOES_enc(void * self,const GLfixed * m)3356 void glLoadMatrixxOES_enc(void *self , const GLfixed* m)
3357 {
3358 
3359 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3360 	IOStream *stream = ctx->m_stream;
3361 
3362 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
3363 	 unsigned char *ptr;
3364 	 const size_t packetSize = 8 + __size_m + 1*4;
3365 	ptr = stream->alloc(packetSize);
3366 	int tmp = OP_glLoadMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3367 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3368 
3369 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
3370 	memcpy(ptr, m, __size_m);ptr += __size_m;
3371 }
3372 
glMaterialxOES_enc(void * self,GLenum face,GLenum pname,GLfixed param)3373 void glMaterialxOES_enc(void *self , GLenum face, GLenum pname, GLfixed param)
3374 {
3375 
3376 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3377 	IOStream *stream = ctx->m_stream;
3378 
3379 	 unsigned char *ptr;
3380 	 const size_t packetSize = 8 + 4 + 4 + 4;
3381 	ptr = stream->alloc(packetSize);
3382 	int tmp = OP_glMaterialxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3383 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3384 
3385 		memcpy(ptr, &face, 4); ptr += 4;
3386 		memcpy(ptr, &pname, 4); ptr += 4;
3387 		memcpy(ptr, &param, 4); ptr += 4;
3388 }
3389 
glMaterialxvOES_enc(void * self,GLenum face,GLenum pname,const GLfixed * params)3390 void glMaterialxvOES_enc(void *self , GLenum face, GLenum pname, const GLfixed* params)
3391 {
3392 
3393 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3394 	IOStream *stream = ctx->m_stream;
3395 
3396 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3397 	 unsigned char *ptr;
3398 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3399 	ptr = stream->alloc(packetSize);
3400 	int tmp = OP_glMaterialxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3401 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3402 
3403 		memcpy(ptr, &face, 4); ptr += 4;
3404 		memcpy(ptr, &pname, 4); ptr += 4;
3405 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3406 	memcpy(ptr, params, __size_params);ptr += __size_params;
3407 }
3408 
glMultMatrixxOES_enc(void * self,const GLfixed * m)3409 void glMultMatrixxOES_enc(void *self , const GLfixed* m)
3410 {
3411 
3412 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3413 	IOStream *stream = ctx->m_stream;
3414 
3415 	const unsigned int __size_m =  (16 * sizeof(GLfixed));
3416 	 unsigned char *ptr;
3417 	 const size_t packetSize = 8 + __size_m + 1*4;
3418 	ptr = stream->alloc(packetSize);
3419 	int tmp = OP_glMultMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3420 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3421 
3422 	*(unsigned int *)(ptr) = __size_m; ptr += 4;
3423 	memcpy(ptr, m, __size_m);ptr += __size_m;
3424 }
3425 
glMultiTexCoord4xOES_enc(void * self,GLenum target,GLfixed s,GLfixed t,GLfixed r,GLfixed q)3426 void glMultiTexCoord4xOES_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
3427 {
3428 
3429 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3430 	IOStream *stream = ctx->m_stream;
3431 
3432 	 unsigned char *ptr;
3433 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
3434 	ptr = stream->alloc(packetSize);
3435 	int tmp = OP_glMultiTexCoord4xOES;memcpy(ptr, &tmp, 4); ptr += 4;
3436 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3437 
3438 		memcpy(ptr, &target, 4); ptr += 4;
3439 		memcpy(ptr, &s, 4); ptr += 4;
3440 		memcpy(ptr, &t, 4); ptr += 4;
3441 		memcpy(ptr, &r, 4); ptr += 4;
3442 		memcpy(ptr, &q, 4); ptr += 4;
3443 }
3444 
glNormal3xOES_enc(void * self,GLfixed nx,GLfixed ny,GLfixed nz)3445 void glNormal3xOES_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz)
3446 {
3447 
3448 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3449 	IOStream *stream = ctx->m_stream;
3450 
3451 	 unsigned char *ptr;
3452 	 const size_t packetSize = 8 + 4 + 4 + 4;
3453 	ptr = stream->alloc(packetSize);
3454 	int tmp = OP_glNormal3xOES;memcpy(ptr, &tmp, 4); ptr += 4;
3455 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3456 
3457 		memcpy(ptr, &nx, 4); ptr += 4;
3458 		memcpy(ptr, &ny, 4); ptr += 4;
3459 		memcpy(ptr, &nz, 4); ptr += 4;
3460 }
3461 
glOrthoxOES_enc(void * self,GLfixed left,GLfixed right,GLfixed bottom,GLfixed top,GLfixed zNear,GLfixed zFar)3462 void glOrthoxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
3463 {
3464 
3465 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3466 	IOStream *stream = ctx->m_stream;
3467 
3468 	 unsigned char *ptr;
3469 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
3470 	ptr = stream->alloc(packetSize);
3471 	int tmp = OP_glOrthoxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3472 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3473 
3474 		memcpy(ptr, &left, 4); ptr += 4;
3475 		memcpy(ptr, &right, 4); ptr += 4;
3476 		memcpy(ptr, &bottom, 4); ptr += 4;
3477 		memcpy(ptr, &top, 4); ptr += 4;
3478 		memcpy(ptr, &zNear, 4); ptr += 4;
3479 		memcpy(ptr, &zFar, 4); ptr += 4;
3480 }
3481 
glPointParameterxOES_enc(void * self,GLenum pname,GLfixed param)3482 void glPointParameterxOES_enc(void *self , GLenum pname, GLfixed param)
3483 {
3484 
3485 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3486 	IOStream *stream = ctx->m_stream;
3487 
3488 	 unsigned char *ptr;
3489 	 const size_t packetSize = 8 + 4 + 4;
3490 	ptr = stream->alloc(packetSize);
3491 	int tmp = OP_glPointParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3492 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3493 
3494 		memcpy(ptr, &pname, 4); ptr += 4;
3495 		memcpy(ptr, &param, 4); ptr += 4;
3496 }
3497 
glPointParameterxvOES_enc(void * self,GLenum pname,const GLfixed * params)3498 void glPointParameterxvOES_enc(void *self , GLenum pname, const GLfixed* params)
3499 {
3500 
3501 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3502 	IOStream *stream = ctx->m_stream;
3503 
3504 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3505 	 unsigned char *ptr;
3506 	 const size_t packetSize = 8 + 4 + __size_params + 1*4;
3507 	ptr = stream->alloc(packetSize);
3508 	int tmp = OP_glPointParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3509 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3510 
3511 		memcpy(ptr, &pname, 4); ptr += 4;
3512 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3513 	memcpy(ptr, params, __size_params);ptr += __size_params;
3514 }
3515 
glPointSizexOES_enc(void * self,GLfixed size)3516 void glPointSizexOES_enc(void *self , GLfixed size)
3517 {
3518 
3519 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3520 	IOStream *stream = ctx->m_stream;
3521 
3522 	 unsigned char *ptr;
3523 	 const size_t packetSize = 8 + 4;
3524 	ptr = stream->alloc(packetSize);
3525 	int tmp = OP_glPointSizexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3526 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3527 
3528 		memcpy(ptr, &size, 4); ptr += 4;
3529 }
3530 
glPolygonOffsetxOES_enc(void * self,GLfixed factor,GLfixed units)3531 void glPolygonOffsetxOES_enc(void *self , GLfixed factor, GLfixed units)
3532 {
3533 
3534 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3535 	IOStream *stream = ctx->m_stream;
3536 
3537 	 unsigned char *ptr;
3538 	 const size_t packetSize = 8 + 4 + 4;
3539 	ptr = stream->alloc(packetSize);
3540 	int tmp = OP_glPolygonOffsetxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3541 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3542 
3543 		memcpy(ptr, &factor, 4); ptr += 4;
3544 		memcpy(ptr, &units, 4); ptr += 4;
3545 }
3546 
glRotatexOES_enc(void * self,GLfixed angle,GLfixed x,GLfixed y,GLfixed z)3547 void glRotatexOES_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
3548 {
3549 
3550 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3551 	IOStream *stream = ctx->m_stream;
3552 
3553 	 unsigned char *ptr;
3554 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
3555 	ptr = stream->alloc(packetSize);
3556 	int tmp = OP_glRotatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3557 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3558 
3559 		memcpy(ptr, &angle, 4); ptr += 4;
3560 		memcpy(ptr, &x, 4); ptr += 4;
3561 		memcpy(ptr, &y, 4); ptr += 4;
3562 		memcpy(ptr, &z, 4); ptr += 4;
3563 }
3564 
glSampleCoveragexOES_enc(void * self,GLclampx value,GLboolean invert)3565 void glSampleCoveragexOES_enc(void *self , GLclampx value, GLboolean invert)
3566 {
3567 
3568 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3569 	IOStream *stream = ctx->m_stream;
3570 
3571 	 unsigned char *ptr;
3572 	 const size_t packetSize = 8 + 4 + 1;
3573 	ptr = stream->alloc(packetSize);
3574 	int tmp = OP_glSampleCoveragexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3575 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3576 
3577 		memcpy(ptr, &value, 4); ptr += 4;
3578 		memcpy(ptr, &invert, 1); ptr += 1;
3579 }
3580 
glScalexOES_enc(void * self,GLfixed x,GLfixed y,GLfixed z)3581 void glScalexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
3582 {
3583 
3584 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3585 	IOStream *stream = ctx->m_stream;
3586 
3587 	 unsigned char *ptr;
3588 	 const size_t packetSize = 8 + 4 + 4 + 4;
3589 	ptr = stream->alloc(packetSize);
3590 	int tmp = OP_glScalexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3591 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3592 
3593 		memcpy(ptr, &x, 4); ptr += 4;
3594 		memcpy(ptr, &y, 4); ptr += 4;
3595 		memcpy(ptr, &z, 4); ptr += 4;
3596 }
3597 
glTexEnvxOES_enc(void * self,GLenum target,GLenum pname,GLfixed param)3598 void glTexEnvxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
3599 {
3600 
3601 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3602 	IOStream *stream = ctx->m_stream;
3603 
3604 	 unsigned char *ptr;
3605 	 const size_t packetSize = 8 + 4 + 4 + 4;
3606 	ptr = stream->alloc(packetSize);
3607 	int tmp = OP_glTexEnvxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3608 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3609 
3610 		memcpy(ptr, &target, 4); ptr += 4;
3611 		memcpy(ptr, &pname, 4); ptr += 4;
3612 		memcpy(ptr, &param, 4); ptr += 4;
3613 }
3614 
glTexEnvxvOES_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)3615 void glTexEnvxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
3616 {
3617 
3618 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3619 	IOStream *stream = ctx->m_stream;
3620 
3621 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3622 	 unsigned char *ptr;
3623 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3624 	ptr = stream->alloc(packetSize);
3625 	int tmp = OP_glTexEnvxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3626 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3627 
3628 		memcpy(ptr, &target, 4); ptr += 4;
3629 		memcpy(ptr, &pname, 4); ptr += 4;
3630 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3631 	memcpy(ptr, params, __size_params);ptr += __size_params;
3632 }
3633 
glTexParameterxOES_enc(void * self,GLenum target,GLenum pname,GLfixed param)3634 void glTexParameterxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param)
3635 {
3636 
3637 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3638 	IOStream *stream = ctx->m_stream;
3639 
3640 	 unsigned char *ptr;
3641 	 const size_t packetSize = 8 + 4 + 4 + 4;
3642 	ptr = stream->alloc(packetSize);
3643 	int tmp = OP_glTexParameterxOES;memcpy(ptr, &tmp, 4); ptr += 4;
3644 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3645 
3646 		memcpy(ptr, &target, 4); ptr += 4;
3647 		memcpy(ptr, &pname, 4); ptr += 4;
3648 		memcpy(ptr, &param, 4); ptr += 4;
3649 }
3650 
glTexParameterxvOES_enc(void * self,GLenum target,GLenum pname,const GLfixed * params)3651 void glTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params)
3652 {
3653 
3654 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3655 	IOStream *stream = ctx->m_stream;
3656 
3657 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
3658 	 unsigned char *ptr;
3659 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3660 	ptr = stream->alloc(packetSize);
3661 	int tmp = OP_glTexParameterxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
3662 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3663 
3664 		memcpy(ptr, &target, 4); ptr += 4;
3665 		memcpy(ptr, &pname, 4); ptr += 4;
3666 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3667 	memcpy(ptr, params, __size_params);ptr += __size_params;
3668 }
3669 
glTranslatexOES_enc(void * self,GLfixed x,GLfixed y,GLfixed z)3670 void glTranslatexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z)
3671 {
3672 
3673 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3674 	IOStream *stream = ctx->m_stream;
3675 
3676 	 unsigned char *ptr;
3677 	 const size_t packetSize = 8 + 4 + 4 + 4;
3678 	ptr = stream->alloc(packetSize);
3679 	int tmp = OP_glTranslatexOES;memcpy(ptr, &tmp, 4); ptr += 4;
3680 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3681 
3682 		memcpy(ptr, &x, 4); ptr += 4;
3683 		memcpy(ptr, &y, 4); ptr += 4;
3684 		memcpy(ptr, &z, 4); ptr += 4;
3685 }
3686 
glIsRenderbufferOES_enc(void * self,GLuint renderbuffer)3687 GLboolean glIsRenderbufferOES_enc(void *self , GLuint renderbuffer)
3688 {
3689 
3690 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3691 	IOStream *stream = ctx->m_stream;
3692 
3693 	 unsigned char *ptr;
3694 	 const size_t packetSize = 8 + 4;
3695 	ptr = stream->alloc(packetSize);
3696 	int tmp = OP_glIsRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
3697 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3698 
3699 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
3700 
3701 	GLboolean retval;
3702 	stream->readback(&retval, 1);
3703 	return retval;
3704 }
3705 
glBindRenderbufferOES_enc(void * self,GLenum target,GLuint renderbuffer)3706 void glBindRenderbufferOES_enc(void *self , GLenum target, GLuint renderbuffer)
3707 {
3708 
3709 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3710 	IOStream *stream = ctx->m_stream;
3711 
3712 	 unsigned char *ptr;
3713 	 const size_t packetSize = 8 + 4 + 4;
3714 	ptr = stream->alloc(packetSize);
3715 	int tmp = OP_glBindRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
3716 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3717 
3718 		memcpy(ptr, &target, 4); ptr += 4;
3719 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
3720 }
3721 
glDeleteRenderbuffersOES_enc(void * self,GLsizei n,const GLuint * renderbuffers)3722 void glDeleteRenderbuffersOES_enc(void *self , GLsizei n, const GLuint* renderbuffers)
3723 {
3724 
3725 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3726 	IOStream *stream = ctx->m_stream;
3727 
3728 	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
3729 	 unsigned char *ptr;
3730 	 const size_t packetSize = 8 + 4 + __size_renderbuffers + 1*4;
3731 	ptr = stream->alloc(packetSize);
3732 	int tmp = OP_glDeleteRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
3733 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3734 
3735 		memcpy(ptr, &n, 4); ptr += 4;
3736 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
3737 	memcpy(ptr, renderbuffers, __size_renderbuffers);ptr += __size_renderbuffers;
3738 }
3739 
glGenRenderbuffersOES_enc(void * self,GLsizei n,GLuint * renderbuffers)3740 void glGenRenderbuffersOES_enc(void *self , GLsizei n, GLuint* renderbuffers)
3741 {
3742 
3743 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3744 	IOStream *stream = ctx->m_stream;
3745 
3746 	const unsigned int __size_renderbuffers =  (n * sizeof(GLuint));
3747 	 unsigned char *ptr;
3748 	 const size_t packetSize = 8 + 4 + __size_renderbuffers + 1*4;
3749 	ptr = stream->alloc(packetSize);
3750 	int tmp = OP_glGenRenderbuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
3751 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3752 
3753 		memcpy(ptr, &n, 4); ptr += 4;
3754 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
3755 	stream->readback(renderbuffers, __size_renderbuffers);
3756 }
3757 
glRenderbufferStorageOES_enc(void * self,GLenum target,GLenum internalformat,GLsizei width,GLsizei height)3758 void glRenderbufferStorageOES_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
3759 {
3760 
3761 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3762 	IOStream *stream = ctx->m_stream;
3763 
3764 	 unsigned char *ptr;
3765 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
3766 	ptr = stream->alloc(packetSize);
3767 	int tmp = OP_glRenderbufferStorageOES;memcpy(ptr, &tmp, 4); ptr += 4;
3768 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3769 
3770 		memcpy(ptr, &target, 4); ptr += 4;
3771 		memcpy(ptr, &internalformat, 4); ptr += 4;
3772 		memcpy(ptr, &width, 4); ptr += 4;
3773 		memcpy(ptr, &height, 4); ptr += 4;
3774 }
3775 
glGetRenderbufferParameterivOES_enc(void * self,GLenum target,GLenum pname,GLint * params)3776 void glGetRenderbufferParameterivOES_enc(void *self , GLenum target, GLenum pname, GLint* params)
3777 {
3778 
3779 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3780 	IOStream *stream = ctx->m_stream;
3781 
3782 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
3783 	 unsigned char *ptr;
3784 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
3785 	ptr = stream->alloc(packetSize);
3786 	int tmp = OP_glGetRenderbufferParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
3787 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3788 
3789 		memcpy(ptr, &target, 4); ptr += 4;
3790 		memcpy(ptr, &pname, 4); ptr += 4;
3791 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3792 	stream->readback(params, __size_params);
3793 }
3794 
glIsFramebufferOES_enc(void * self,GLuint framebuffer)3795 GLboolean glIsFramebufferOES_enc(void *self , GLuint framebuffer)
3796 {
3797 
3798 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3799 	IOStream *stream = ctx->m_stream;
3800 
3801 	 unsigned char *ptr;
3802 	 const size_t packetSize = 8 + 4;
3803 	ptr = stream->alloc(packetSize);
3804 	int tmp = OP_glIsFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
3805 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3806 
3807 		memcpy(ptr, &framebuffer, 4); ptr += 4;
3808 
3809 	GLboolean retval;
3810 	stream->readback(&retval, 1);
3811 	return retval;
3812 }
3813 
glBindFramebufferOES_enc(void * self,GLenum target,GLuint framebuffer)3814 void glBindFramebufferOES_enc(void *self , GLenum target, GLuint framebuffer)
3815 {
3816 
3817 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3818 	IOStream *stream = ctx->m_stream;
3819 
3820 	 unsigned char *ptr;
3821 	 const size_t packetSize = 8 + 4 + 4;
3822 	ptr = stream->alloc(packetSize);
3823 	int tmp = OP_glBindFramebufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
3824 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3825 
3826 		memcpy(ptr, &target, 4); ptr += 4;
3827 		memcpy(ptr, &framebuffer, 4); ptr += 4;
3828 }
3829 
glDeleteFramebuffersOES_enc(void * self,GLsizei n,const GLuint * framebuffers)3830 void glDeleteFramebuffersOES_enc(void *self , GLsizei n, const GLuint* framebuffers)
3831 {
3832 
3833 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3834 	IOStream *stream = ctx->m_stream;
3835 
3836 	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
3837 	 unsigned char *ptr;
3838 	 const size_t packetSize = 8 + 4 + __size_framebuffers + 1*4;
3839 	ptr = stream->alloc(packetSize);
3840 	int tmp = OP_glDeleteFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
3841 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3842 
3843 		memcpy(ptr, &n, 4); ptr += 4;
3844 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
3845 	memcpy(ptr, framebuffers, __size_framebuffers);ptr += __size_framebuffers;
3846 }
3847 
glGenFramebuffersOES_enc(void * self,GLsizei n,GLuint * framebuffers)3848 void glGenFramebuffersOES_enc(void *self , GLsizei n, GLuint* framebuffers)
3849 {
3850 
3851 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3852 	IOStream *stream = ctx->m_stream;
3853 
3854 	const unsigned int __size_framebuffers =  (n * sizeof(GLuint));
3855 	 unsigned char *ptr;
3856 	 const size_t packetSize = 8 + 4 + __size_framebuffers + 1*4;
3857 	ptr = stream->alloc(packetSize);
3858 	int tmp = OP_glGenFramebuffersOES;memcpy(ptr, &tmp, 4); ptr += 4;
3859 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3860 
3861 		memcpy(ptr, &n, 4); ptr += 4;
3862 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
3863 	stream->readback(framebuffers, __size_framebuffers);
3864 }
3865 
glCheckFramebufferStatusOES_enc(void * self,GLenum target)3866 GLenum glCheckFramebufferStatusOES_enc(void *self , GLenum target)
3867 {
3868 
3869 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3870 	IOStream *stream = ctx->m_stream;
3871 
3872 	 unsigned char *ptr;
3873 	 const size_t packetSize = 8 + 4;
3874 	ptr = stream->alloc(packetSize);
3875 	int tmp = OP_glCheckFramebufferStatusOES;memcpy(ptr, &tmp, 4); ptr += 4;
3876 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3877 
3878 		memcpy(ptr, &target, 4); ptr += 4;
3879 
3880 	GLenum retval;
3881 	stream->readback(&retval, 4);
3882 	return retval;
3883 }
3884 
glFramebufferRenderbufferOES_enc(void * self,GLenum target,GLenum attachment,GLenum renderbuffertarget,GLuint renderbuffer)3885 void glFramebufferRenderbufferOES_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
3886 {
3887 
3888 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3889 	IOStream *stream = ctx->m_stream;
3890 
3891 	 unsigned char *ptr;
3892 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4;
3893 	ptr = stream->alloc(packetSize);
3894 	int tmp = OP_glFramebufferRenderbufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
3895 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3896 
3897 		memcpy(ptr, &target, 4); ptr += 4;
3898 		memcpy(ptr, &attachment, 4); ptr += 4;
3899 		memcpy(ptr, &renderbuffertarget, 4); ptr += 4;
3900 		memcpy(ptr, &renderbuffer, 4); ptr += 4;
3901 }
3902 
glFramebufferTexture2DOES_enc(void * self,GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level)3903 void glFramebufferTexture2DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
3904 {
3905 
3906 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3907 	IOStream *stream = ctx->m_stream;
3908 
3909 	 unsigned char *ptr;
3910 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
3911 	ptr = stream->alloc(packetSize);
3912 	int tmp = OP_glFramebufferTexture2DOES;memcpy(ptr, &tmp, 4); ptr += 4;
3913 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3914 
3915 		memcpy(ptr, &target, 4); ptr += 4;
3916 		memcpy(ptr, &attachment, 4); ptr += 4;
3917 		memcpy(ptr, &textarget, 4); ptr += 4;
3918 		memcpy(ptr, &texture, 4); ptr += 4;
3919 		memcpy(ptr, &level, 4); ptr += 4;
3920 }
3921 
glGetFramebufferAttachmentParameterivOES_enc(void * self,GLenum target,GLenum attachment,GLenum pname,GLint * params)3922 void glGetFramebufferAttachmentParameterivOES_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params)
3923 {
3924 
3925 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3926 	IOStream *stream = ctx->m_stream;
3927 
3928 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
3929 	 unsigned char *ptr;
3930 	 const size_t packetSize = 8 + 4 + 4 + 4 + __size_params + 1*4;
3931 	ptr = stream->alloc(packetSize);
3932 	int tmp = OP_glGetFramebufferAttachmentParameterivOES;memcpy(ptr, &tmp, 4); ptr += 4;
3933 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3934 
3935 		memcpy(ptr, &target, 4); ptr += 4;
3936 		memcpy(ptr, &attachment, 4); ptr += 4;
3937 		memcpy(ptr, &pname, 4); ptr += 4;
3938 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
3939 	stream->readback(params, __size_params);
3940 }
3941 
glGenerateMipmapOES_enc(void * self,GLenum target)3942 void glGenerateMipmapOES_enc(void *self , GLenum target)
3943 {
3944 
3945 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3946 	IOStream *stream = ctx->m_stream;
3947 
3948 	 unsigned char *ptr;
3949 	 const size_t packetSize = 8 + 4;
3950 	ptr = stream->alloc(packetSize);
3951 	int tmp = OP_glGenerateMipmapOES;memcpy(ptr, &tmp, 4); ptr += 4;
3952 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3953 
3954 		memcpy(ptr, &target, 4); ptr += 4;
3955 }
3956 
glUnmapBufferOES_enc(void * self,GLenum target)3957 GLboolean glUnmapBufferOES_enc(void *self , GLenum target)
3958 {
3959 
3960 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3961 	IOStream *stream = ctx->m_stream;
3962 
3963 	 unsigned char *ptr;
3964 	 const size_t packetSize = 8 + 4;
3965 	ptr = stream->alloc(packetSize);
3966 	int tmp = OP_glUnmapBufferOES;memcpy(ptr, &tmp, 4); ptr += 4;
3967 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3968 
3969 		memcpy(ptr, &target, 4); ptr += 4;
3970 
3971 	GLboolean retval;
3972 	stream->readback(&retval, 1);
3973 	return retval;
3974 }
3975 
glCurrentPaletteMatrixOES_enc(void * self,GLuint matrixpaletteindex)3976 void glCurrentPaletteMatrixOES_enc(void *self , GLuint matrixpaletteindex)
3977 {
3978 
3979 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3980 	IOStream *stream = ctx->m_stream;
3981 
3982 	 unsigned char *ptr;
3983 	 const size_t packetSize = 8 + 4;
3984 	ptr = stream->alloc(packetSize);
3985 	int tmp = OP_glCurrentPaletteMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
3986 	memcpy(ptr, &packetSize, 4);  ptr += 4;
3987 
3988 		memcpy(ptr, &matrixpaletteindex, 4); ptr += 4;
3989 }
3990 
glLoadPaletteFromModelViewMatrixOES_enc(void * self)3991 void glLoadPaletteFromModelViewMatrixOES_enc(void *self )
3992 {
3993 
3994 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
3995 	IOStream *stream = ctx->m_stream;
3996 
3997 	 unsigned char *ptr;
3998 	 const size_t packetSize = 8 + 0;
3999 	ptr = stream->alloc(packetSize);
4000 	int tmp = OP_glLoadPaletteFromModelViewMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
4001 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4002 
4003 }
4004 
glQueryMatrixxOES_enc(void * self,GLfixed * mantissa,GLint * exponent)4005 GLbitfield glQueryMatrixxOES_enc(void *self , GLfixed* mantissa, GLint* exponent)
4006 {
4007 
4008 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4009 	IOStream *stream = ctx->m_stream;
4010 
4011 	const unsigned int __size_mantissa =  (16 * sizeof(GLfixed));
4012 	const unsigned int __size_exponent =  (16 * sizeof(GLfixed));
4013 	 unsigned char *ptr;
4014 	 const size_t packetSize = 8 + __size_mantissa + __size_exponent + 2*4;
4015 	ptr = stream->alloc(packetSize);
4016 	int tmp = OP_glQueryMatrixxOES;memcpy(ptr, &tmp, 4); ptr += 4;
4017 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4018 
4019 	*(unsigned int *)(ptr) = __size_mantissa; ptr += 4;
4020 	*(unsigned int *)(ptr) = __size_exponent; ptr += 4;
4021 	stream->readback(mantissa, __size_mantissa);
4022 	stream->readback(exponent, __size_exponent);
4023 
4024 	GLbitfield retval;
4025 	stream->readback(&retval, 4);
4026 	return retval;
4027 }
4028 
glDepthRangefOES_enc(void * self,GLclampf zNear,GLclampf zFar)4029 void glDepthRangefOES_enc(void *self , GLclampf zNear, GLclampf zFar)
4030 {
4031 
4032 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4033 	IOStream *stream = ctx->m_stream;
4034 
4035 	 unsigned char *ptr;
4036 	 const size_t packetSize = 8 + 4 + 4;
4037 	ptr = stream->alloc(packetSize);
4038 	int tmp = OP_glDepthRangefOES;memcpy(ptr, &tmp, 4); ptr += 4;
4039 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4040 
4041 		memcpy(ptr, &zNear, 4); ptr += 4;
4042 		memcpy(ptr, &zFar, 4); ptr += 4;
4043 }
4044 
glFrustumfOES_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)4045 void glFrustumfOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
4046 {
4047 
4048 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4049 	IOStream *stream = ctx->m_stream;
4050 
4051 	 unsigned char *ptr;
4052 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
4053 	ptr = stream->alloc(packetSize);
4054 	int tmp = OP_glFrustumfOES;memcpy(ptr, &tmp, 4); ptr += 4;
4055 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4056 
4057 		memcpy(ptr, &left, 4); ptr += 4;
4058 		memcpy(ptr, &right, 4); ptr += 4;
4059 		memcpy(ptr, &bottom, 4); ptr += 4;
4060 		memcpy(ptr, &top, 4); ptr += 4;
4061 		memcpy(ptr, &zNear, 4); ptr += 4;
4062 		memcpy(ptr, &zFar, 4); ptr += 4;
4063 }
4064 
glOrthofOES_enc(void * self,GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat zNear,GLfloat zFar)4065 void glOrthofOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
4066 {
4067 
4068 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4069 	IOStream *stream = ctx->m_stream;
4070 
4071 	 unsigned char *ptr;
4072 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
4073 	ptr = stream->alloc(packetSize);
4074 	int tmp = OP_glOrthofOES;memcpy(ptr, &tmp, 4); ptr += 4;
4075 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4076 
4077 		memcpy(ptr, &left, 4); ptr += 4;
4078 		memcpy(ptr, &right, 4); ptr += 4;
4079 		memcpy(ptr, &bottom, 4); ptr += 4;
4080 		memcpy(ptr, &top, 4); ptr += 4;
4081 		memcpy(ptr, &zNear, 4); ptr += 4;
4082 		memcpy(ptr, &zFar, 4); ptr += 4;
4083 }
4084 
glClipPlanefOES_enc(void * self,GLenum plane,const GLfloat * equation)4085 void glClipPlanefOES_enc(void *self , GLenum plane, const GLfloat* equation)
4086 {
4087 
4088 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4089 	IOStream *stream = ctx->m_stream;
4090 
4091 	const unsigned int __size_equation =  (4 * sizeof(GLfloat));
4092 	 unsigned char *ptr;
4093 	 const size_t packetSize = 8 + 4 + __size_equation + 1*4;
4094 	ptr = stream->alloc(packetSize);
4095 	int tmp = OP_glClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
4096 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4097 
4098 		memcpy(ptr, &plane, 4); ptr += 4;
4099 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
4100 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
4101 }
4102 
glClipPlanefIMG_enc(void * self,GLenum plane,const GLfloat * equation)4103 void glClipPlanefIMG_enc(void *self , GLenum plane, const GLfloat* equation)
4104 {
4105 
4106 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4107 	IOStream *stream = ctx->m_stream;
4108 
4109 	const unsigned int __size_equation =  (4 * sizeof(GLfloat));
4110 	 unsigned char *ptr;
4111 	 const size_t packetSize = 8 + 4 + __size_equation + 1*4;
4112 	ptr = stream->alloc(packetSize);
4113 	int tmp = OP_glClipPlanefIMG;memcpy(ptr, &tmp, 4); ptr += 4;
4114 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4115 
4116 		memcpy(ptr, &plane, 4); ptr += 4;
4117 	*(unsigned int *)(ptr) = __size_equation; ptr += 4;
4118 	memcpy(ptr, equation, __size_equation);ptr += __size_equation;
4119 }
4120 
glGetClipPlanefOES_enc(void * self,GLenum pname,GLfloat * eqn)4121 void glGetClipPlanefOES_enc(void *self , GLenum pname, GLfloat* eqn)
4122 {
4123 
4124 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4125 	IOStream *stream = ctx->m_stream;
4126 
4127 	const unsigned int __size_eqn =  (4 * sizeof(GLfloat));
4128 	 unsigned char *ptr;
4129 	 const size_t packetSize = 8 + 4 + __size_eqn + 1*4;
4130 	ptr = stream->alloc(packetSize);
4131 	int tmp = OP_glGetClipPlanefOES;memcpy(ptr, &tmp, 4); ptr += 4;
4132 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4133 
4134 		memcpy(ptr, &pname, 4); ptr += 4;
4135 	*(unsigned int *)(ptr) = __size_eqn; ptr += 4;
4136 	stream->readback(eqn, __size_eqn);
4137 }
4138 
glClearDepthfOES_enc(void * self,GLclampf depth)4139 void glClearDepthfOES_enc(void *self , GLclampf depth)
4140 {
4141 
4142 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4143 	IOStream *stream = ctx->m_stream;
4144 
4145 	 unsigned char *ptr;
4146 	 const size_t packetSize = 8 + 4;
4147 	ptr = stream->alloc(packetSize);
4148 	int tmp = OP_glClearDepthfOES;memcpy(ptr, &tmp, 4); ptr += 4;
4149 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4150 
4151 		memcpy(ptr, &depth, 4); ptr += 4;
4152 }
4153 
glTexGenfOES_enc(void * self,GLenum coord,GLenum pname,GLfloat param)4154 void glTexGenfOES_enc(void *self , GLenum coord, GLenum pname, GLfloat param)
4155 {
4156 
4157 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4158 	IOStream *stream = ctx->m_stream;
4159 
4160 	 unsigned char *ptr;
4161 	 const size_t packetSize = 8 + 4 + 4 + 4;
4162 	ptr = stream->alloc(packetSize);
4163 	int tmp = OP_glTexGenfOES;memcpy(ptr, &tmp, 4); ptr += 4;
4164 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4165 
4166 		memcpy(ptr, &coord, 4); ptr += 4;
4167 		memcpy(ptr, &pname, 4); ptr += 4;
4168 		memcpy(ptr, &param, 4); ptr += 4;
4169 }
4170 
glTexGenfvOES_enc(void * self,GLenum coord,GLenum pname,const GLfloat * params)4171 void glTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, const GLfloat* params)
4172 {
4173 
4174 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4175 	IOStream *stream = ctx->m_stream;
4176 
4177 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
4178 	 unsigned char *ptr;
4179 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
4180 	ptr = stream->alloc(packetSize);
4181 	int tmp = OP_glTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
4182 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4183 
4184 		memcpy(ptr, &coord, 4); ptr += 4;
4185 		memcpy(ptr, &pname, 4); ptr += 4;
4186 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4187 	memcpy(ptr, params, __size_params);ptr += __size_params;
4188 }
4189 
glTexGeniOES_enc(void * self,GLenum coord,GLenum pname,GLint param)4190 void glTexGeniOES_enc(void *self , GLenum coord, GLenum pname, GLint param)
4191 {
4192 
4193 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4194 	IOStream *stream = ctx->m_stream;
4195 
4196 	 unsigned char *ptr;
4197 	 const size_t packetSize = 8 + 4 + 4 + 4;
4198 	ptr = stream->alloc(packetSize);
4199 	int tmp = OP_glTexGeniOES;memcpy(ptr, &tmp, 4); ptr += 4;
4200 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4201 
4202 		memcpy(ptr, &coord, 4); ptr += 4;
4203 		memcpy(ptr, &pname, 4); ptr += 4;
4204 		memcpy(ptr, &param, 4); ptr += 4;
4205 }
4206 
glTexGenivOES_enc(void * self,GLenum coord,GLenum pname,const GLint * params)4207 void glTexGenivOES_enc(void *self , GLenum coord, GLenum pname, const GLint* params)
4208 {
4209 
4210 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4211 	IOStream *stream = ctx->m_stream;
4212 
4213 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
4214 	 unsigned char *ptr;
4215 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
4216 	ptr = stream->alloc(packetSize);
4217 	int tmp = OP_glTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
4218 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4219 
4220 		memcpy(ptr, &coord, 4); ptr += 4;
4221 		memcpy(ptr, &pname, 4); ptr += 4;
4222 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4223 	memcpy(ptr, params, __size_params);ptr += __size_params;
4224 }
4225 
glTexGenxOES_enc(void * self,GLenum coord,GLenum pname,GLfixed param)4226 void glTexGenxOES_enc(void *self , GLenum coord, GLenum pname, GLfixed param)
4227 {
4228 
4229 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4230 	IOStream *stream = ctx->m_stream;
4231 
4232 	 unsigned char *ptr;
4233 	 const size_t packetSize = 8 + 4 + 4 + 4;
4234 	ptr = stream->alloc(packetSize);
4235 	int tmp = OP_glTexGenxOES;memcpy(ptr, &tmp, 4); ptr += 4;
4236 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4237 
4238 		memcpy(ptr, &coord, 4); ptr += 4;
4239 		memcpy(ptr, &pname, 4); ptr += 4;
4240 		memcpy(ptr, &param, 4); ptr += 4;
4241 }
4242 
glTexGenxvOES_enc(void * self,GLenum coord,GLenum pname,const GLfixed * params)4243 void glTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, const GLfixed* params)
4244 {
4245 
4246 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4247 	IOStream *stream = ctx->m_stream;
4248 
4249 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
4250 	 unsigned char *ptr;
4251 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
4252 	ptr = stream->alloc(packetSize);
4253 	int tmp = OP_glTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
4254 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4255 
4256 		memcpy(ptr, &coord, 4); ptr += 4;
4257 		memcpy(ptr, &pname, 4); ptr += 4;
4258 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4259 	memcpy(ptr, params, __size_params);ptr += __size_params;
4260 }
4261 
glGetTexGenfvOES_enc(void * self,GLenum coord,GLenum pname,GLfloat * params)4262 void glGetTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, GLfloat* params)
4263 {
4264 
4265 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4266 	IOStream *stream = ctx->m_stream;
4267 
4268 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
4269 	 unsigned char *ptr;
4270 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
4271 	ptr = stream->alloc(packetSize);
4272 	int tmp = OP_glGetTexGenfvOES;memcpy(ptr, &tmp, 4); ptr += 4;
4273 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4274 
4275 		memcpy(ptr, &coord, 4); ptr += 4;
4276 		memcpy(ptr, &pname, 4); ptr += 4;
4277 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4278 	memcpy(ptr, params, __size_params);ptr += __size_params;
4279 }
4280 
glGetTexGenivOES_enc(void * self,GLenum coord,GLenum pname,GLint * params)4281 void glGetTexGenivOES_enc(void *self , GLenum coord, GLenum pname, GLint* params)
4282 {
4283 
4284 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4285 	IOStream *stream = ctx->m_stream;
4286 
4287 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
4288 	 unsigned char *ptr;
4289 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
4290 	ptr = stream->alloc(packetSize);
4291 	int tmp = OP_glGetTexGenivOES;memcpy(ptr, &tmp, 4); ptr += 4;
4292 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4293 
4294 		memcpy(ptr, &coord, 4); ptr += 4;
4295 		memcpy(ptr, &pname, 4); ptr += 4;
4296 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4297 	memcpy(ptr, params, __size_params);ptr += __size_params;
4298 }
4299 
glGetTexGenxvOES_enc(void * self,GLenum coord,GLenum pname,GLfixed * params)4300 void glGetTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, GLfixed* params)
4301 {
4302 
4303 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4304 	IOStream *stream = ctx->m_stream;
4305 
4306 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfixed));
4307 	 unsigned char *ptr;
4308 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
4309 	ptr = stream->alloc(packetSize);
4310 	int tmp = OP_glGetTexGenxvOES;memcpy(ptr, &tmp, 4); ptr += 4;
4311 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4312 
4313 		memcpy(ptr, &coord, 4); ptr += 4;
4314 		memcpy(ptr, &pname, 4); ptr += 4;
4315 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4316 	memcpy(ptr, params, __size_params);ptr += __size_params;
4317 }
4318 
glBindVertexArrayOES_enc(void * self,GLuint array)4319 void glBindVertexArrayOES_enc(void *self , GLuint array)
4320 {
4321 
4322 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4323 	IOStream *stream = ctx->m_stream;
4324 
4325 	 unsigned char *ptr;
4326 	 const size_t packetSize = 8 + 4;
4327 	ptr = stream->alloc(packetSize);
4328 	int tmp = OP_glBindVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
4329 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4330 
4331 		memcpy(ptr, &array, 4); ptr += 4;
4332 }
4333 
glDeleteVertexArraysOES_enc(void * self,GLsizei n,const GLuint * arrays)4334 void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays)
4335 {
4336 
4337 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4338 	IOStream *stream = ctx->m_stream;
4339 
4340 	const unsigned int __size_arrays =  (n * sizeof(GLuint));
4341 	 unsigned char *ptr;
4342 	 const size_t packetSize = 8 + 4 + __size_arrays + 1*4;
4343 	ptr = stream->alloc(packetSize);
4344 	int tmp = OP_glDeleteVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
4345 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4346 
4347 		memcpy(ptr, &n, 4); ptr += 4;
4348 	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
4349 	memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
4350 }
4351 
glGenVertexArraysOES_enc(void * self,GLsizei n,GLuint * arrays)4352 void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays)
4353 {
4354 
4355 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4356 	IOStream *stream = ctx->m_stream;
4357 
4358 	const unsigned int __size_arrays =  (n * sizeof(GLuint));
4359 	 unsigned char *ptr;
4360 	 const size_t packetSize = 8 + 4 + __size_arrays + 1*4;
4361 	ptr = stream->alloc(packetSize);
4362 	int tmp = OP_glGenVertexArraysOES;memcpy(ptr, &tmp, 4); ptr += 4;
4363 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4364 
4365 		memcpy(ptr, &n, 4); ptr += 4;
4366 	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
4367 	stream->readback(arrays, __size_arrays);
4368 }
4369 
glIsVertexArrayOES_enc(void * self,GLuint array)4370 GLboolean glIsVertexArrayOES_enc(void *self , GLuint array)
4371 {
4372 
4373 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4374 	IOStream *stream = ctx->m_stream;
4375 
4376 	 unsigned char *ptr;
4377 	 const size_t packetSize = 8 + 4;
4378 	ptr = stream->alloc(packetSize);
4379 	int tmp = OP_glIsVertexArrayOES;memcpy(ptr, &tmp, 4); ptr += 4;
4380 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4381 
4382 		memcpy(ptr, &array, 4); ptr += 4;
4383 
4384 	GLboolean retval;
4385 	stream->readback(&retval, 1);
4386 	return retval;
4387 }
4388 
glDiscardFramebufferEXT_enc(void * self,GLenum target,GLsizei numAttachments,const GLenum * attachments)4389 void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
4390 {
4391 
4392 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4393 	IOStream *stream = ctx->m_stream;
4394 
4395 	const unsigned int __size_attachments =  (numAttachments * sizeof(const GLenum));
4396 	 unsigned char *ptr;
4397 	 const size_t packetSize = 8 + 4 + 4 + __size_attachments + 1*4;
4398 	ptr = stream->alloc(packetSize);
4399 	int tmp = OP_glDiscardFramebufferEXT;memcpy(ptr, &tmp, 4); ptr += 4;
4400 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4401 
4402 		memcpy(ptr, &target, 4); ptr += 4;
4403 		memcpy(ptr, &numAttachments, 4); ptr += 4;
4404 	*(unsigned int *)(ptr) = __size_attachments; ptr += 4;
4405 	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
4406 }
4407 
glRenderbufferStorageMultisampleIMG_enc(void * self,GLenum target,GLsizei samples,GLenum internalformat,GLsizei width,GLsizei height)4408 void glRenderbufferStorageMultisampleIMG_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
4409 {
4410 
4411 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4412 	IOStream *stream = ctx->m_stream;
4413 
4414 	 unsigned char *ptr;
4415 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
4416 	ptr = stream->alloc(packetSize);
4417 	int tmp = OP_glRenderbufferStorageMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
4418 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4419 
4420 		memcpy(ptr, &target, 4); ptr += 4;
4421 		memcpy(ptr, &samples, 4); ptr += 4;
4422 		memcpy(ptr, &internalformat, 4); ptr += 4;
4423 		memcpy(ptr, &width, 4); ptr += 4;
4424 		memcpy(ptr, &height, 4); ptr += 4;
4425 }
4426 
glFramebufferTexture2DMultisampleIMG_enc(void * self,GLenum target,GLenum attachment,GLenum textarget,GLuint texture,GLint level,GLsizei samples)4427 void glFramebufferTexture2DMultisampleIMG_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
4428 {
4429 
4430 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4431 	IOStream *stream = ctx->m_stream;
4432 
4433 	 unsigned char *ptr;
4434 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4;
4435 	ptr = stream->alloc(packetSize);
4436 	int tmp = OP_glFramebufferTexture2DMultisampleIMG;memcpy(ptr, &tmp, 4); ptr += 4;
4437 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4438 
4439 		memcpy(ptr, &target, 4); ptr += 4;
4440 		memcpy(ptr, &attachment, 4); ptr += 4;
4441 		memcpy(ptr, &textarget, 4); ptr += 4;
4442 		memcpy(ptr, &texture, 4); ptr += 4;
4443 		memcpy(ptr, &level, 4); ptr += 4;
4444 		memcpy(ptr, &samples, 4); ptr += 4;
4445 }
4446 
glDeleteFencesNV_enc(void * self,GLsizei n,const GLuint * fences)4447 void glDeleteFencesNV_enc(void *self , GLsizei n, const GLuint* fences)
4448 {
4449 
4450 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4451 	IOStream *stream = ctx->m_stream;
4452 
4453 	const unsigned int __size_fences =  (n * sizeof(GLuint));
4454 	 unsigned char *ptr;
4455 	 const size_t packetSize = 8 + 4 + __size_fences + 1*4;
4456 	ptr = stream->alloc(packetSize);
4457 	int tmp = OP_glDeleteFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
4458 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4459 
4460 		memcpy(ptr, &n, 4); ptr += 4;
4461 	*(unsigned int *)(ptr) = __size_fences; ptr += 4;
4462 	memcpy(ptr, fences, __size_fences);ptr += __size_fences;
4463 }
4464 
glGenFencesNV_enc(void * self,GLsizei n,GLuint * fences)4465 void glGenFencesNV_enc(void *self , GLsizei n, GLuint* fences)
4466 {
4467 
4468 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4469 	IOStream *stream = ctx->m_stream;
4470 
4471 	const unsigned int __size_fences =  (n * sizeof(GLuint));
4472 	 unsigned char *ptr;
4473 	 const size_t packetSize = 8 + 4 + __size_fences + 1*4;
4474 	ptr = stream->alloc(packetSize);
4475 	int tmp = OP_glGenFencesNV;memcpy(ptr, &tmp, 4); ptr += 4;
4476 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4477 
4478 		memcpy(ptr, &n, 4); ptr += 4;
4479 	*(unsigned int *)(ptr) = __size_fences; ptr += 4;
4480 	memcpy(ptr, fences, __size_fences);ptr += __size_fences;
4481 }
4482 
glIsFenceNV_enc(void * self,GLuint fence)4483 GLboolean glIsFenceNV_enc(void *self , GLuint fence)
4484 {
4485 
4486 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4487 	IOStream *stream = ctx->m_stream;
4488 
4489 	 unsigned char *ptr;
4490 	 const size_t packetSize = 8 + 4;
4491 	ptr = stream->alloc(packetSize);
4492 	int tmp = OP_glIsFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
4493 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4494 
4495 		memcpy(ptr, &fence, 4); ptr += 4;
4496 
4497 	GLboolean retval;
4498 	stream->readback(&retval, 1);
4499 	return retval;
4500 }
4501 
glTestFenceNV_enc(void * self,GLuint fence)4502 GLboolean glTestFenceNV_enc(void *self , GLuint fence)
4503 {
4504 
4505 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4506 	IOStream *stream = ctx->m_stream;
4507 
4508 	 unsigned char *ptr;
4509 	 const size_t packetSize = 8 + 4;
4510 	ptr = stream->alloc(packetSize);
4511 	int tmp = OP_glTestFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
4512 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4513 
4514 		memcpy(ptr, &fence, 4); ptr += 4;
4515 
4516 	GLboolean retval;
4517 	stream->readback(&retval, 1);
4518 	return retval;
4519 }
4520 
glGetFenceivNV_enc(void * self,GLuint fence,GLenum pname,GLint * params)4521 void glGetFenceivNV_enc(void *self , GLuint fence, GLenum pname, GLint* params)
4522 {
4523 
4524 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4525 	IOStream *stream = ctx->m_stream;
4526 
4527 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
4528 	 unsigned char *ptr;
4529 	 const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
4530 	ptr = stream->alloc(packetSize);
4531 	int tmp = OP_glGetFenceivNV;memcpy(ptr, &tmp, 4); ptr += 4;
4532 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4533 
4534 		memcpy(ptr, &fence, 4); ptr += 4;
4535 		memcpy(ptr, &pname, 4); ptr += 4;
4536 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4537 	stream->readback(params, __size_params);
4538 }
4539 
glFinishFenceNV_enc(void * self,GLuint fence)4540 void glFinishFenceNV_enc(void *self , GLuint fence)
4541 {
4542 
4543 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4544 	IOStream *stream = ctx->m_stream;
4545 
4546 	 unsigned char *ptr;
4547 	 const size_t packetSize = 8 + 4;
4548 	ptr = stream->alloc(packetSize);
4549 	int tmp = OP_glFinishFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
4550 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4551 
4552 		memcpy(ptr, &fence, 4); ptr += 4;
4553 }
4554 
glSetFenceNV_enc(void * self,GLuint fence,GLenum condition)4555 void glSetFenceNV_enc(void *self , GLuint fence, GLenum condition)
4556 {
4557 
4558 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4559 	IOStream *stream = ctx->m_stream;
4560 
4561 	 unsigned char *ptr;
4562 	 const size_t packetSize = 8 + 4 + 4;
4563 	ptr = stream->alloc(packetSize);
4564 	int tmp = OP_glSetFenceNV;memcpy(ptr, &tmp, 4); ptr += 4;
4565 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4566 
4567 		memcpy(ptr, &fence, 4); ptr += 4;
4568 		memcpy(ptr, &condition, 4); ptr += 4;
4569 }
4570 
glGetDriverControlsQCOM_enc(void * self,GLint * num,GLsizei size,GLuint * driverControls)4571 void glGetDriverControlsQCOM_enc(void *self , GLint* num, GLsizei size, GLuint* driverControls)
4572 {
4573 
4574 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4575 	IOStream *stream = ctx->m_stream;
4576 
4577 	const unsigned int __size_num =  (1 * sizeof(GLint));
4578 	const unsigned int __size_driverControls =  (size * sizeof(GLuint));
4579 	 unsigned char *ptr;
4580 	 const size_t packetSize = 8 + __size_num + 4 + __size_driverControls + 2*4;
4581 	ptr = stream->alloc(packetSize);
4582 	int tmp = OP_glGetDriverControlsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4583 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4584 
4585 	*(unsigned int *)(ptr) = __size_num; ptr += 4;
4586 		memcpy(ptr, &size, 4); ptr += 4;
4587 	*(unsigned int *)(ptr) = __size_driverControls; ptr += 4;
4588 	stream->readback(num, __size_num);
4589 	stream->readback(driverControls, __size_driverControls);
4590 }
4591 
glGetDriverControlStringQCOM_enc(void * self,GLuint driverControl,GLsizei bufSize,GLsizei * length,GLchar * driverControlString)4592 void glGetDriverControlStringQCOM_enc(void *self , GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString)
4593 {
4594 
4595 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4596 	IOStream *stream = ctx->m_stream;
4597 
4598 	const unsigned int __size_length =  (1 * sizeof(GLsizei));
4599 	const unsigned int __size_driverControlString =  (1 * sizeof(GLchar));
4600 	 unsigned char *ptr;
4601 	 const size_t packetSize = 8 + 4 + 4 + __size_length + __size_driverControlString + 2*4;
4602 	ptr = stream->alloc(packetSize);
4603 	int tmp = OP_glGetDriverControlStringQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4604 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4605 
4606 		memcpy(ptr, &driverControl, 4); ptr += 4;
4607 		memcpy(ptr, &bufSize, 4); ptr += 4;
4608 	*(unsigned int *)(ptr) = __size_length; ptr += 4;
4609 	*(unsigned int *)(ptr) = __size_driverControlString; ptr += 4;
4610 	stream->readback(length, __size_length);
4611 	stream->readback(driverControlString, __size_driverControlString);
4612 }
4613 
glEnableDriverControlQCOM_enc(void * self,GLuint driverControl)4614 void glEnableDriverControlQCOM_enc(void *self , GLuint driverControl)
4615 {
4616 
4617 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4618 	IOStream *stream = ctx->m_stream;
4619 
4620 	 unsigned char *ptr;
4621 	 const size_t packetSize = 8 + 4;
4622 	ptr = stream->alloc(packetSize);
4623 	int tmp = OP_glEnableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4624 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4625 
4626 		memcpy(ptr, &driverControl, 4); ptr += 4;
4627 }
4628 
glDisableDriverControlQCOM_enc(void * self,GLuint driverControl)4629 void glDisableDriverControlQCOM_enc(void *self , GLuint driverControl)
4630 {
4631 
4632 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4633 	IOStream *stream = ctx->m_stream;
4634 
4635 	 unsigned char *ptr;
4636 	 const size_t packetSize = 8 + 4;
4637 	ptr = stream->alloc(packetSize);
4638 	int tmp = OP_glDisableDriverControlQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4639 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4640 
4641 		memcpy(ptr, &driverControl, 4); ptr += 4;
4642 }
4643 
glExtGetTexturesQCOM_enc(void * self,GLuint * textures,GLint maxTextures,GLint * numTextures)4644 void glExtGetTexturesQCOM_enc(void *self , GLuint* textures, GLint maxTextures, GLint* numTextures)
4645 {
4646 
4647 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4648 	IOStream *stream = ctx->m_stream;
4649 
4650 	const unsigned int __size_textures =  (maxTextures * sizeof(GLuint));
4651 	const unsigned int __size_numTextures =  (1 * sizeof(GLint));
4652 	 unsigned char *ptr;
4653 	 const size_t packetSize = 8 + __size_textures + 4 + __size_numTextures + 2*4;
4654 	ptr = stream->alloc(packetSize);
4655 	int tmp = OP_glExtGetTexturesQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4656 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4657 
4658 	*(unsigned int *)(ptr) = __size_textures; ptr += 4;
4659 		memcpy(ptr, &maxTextures, 4); ptr += 4;
4660 	*(unsigned int *)(ptr) = __size_numTextures; ptr += 4;
4661 	stream->readback(textures, __size_textures);
4662 	stream->readback(numTextures, __size_numTextures);
4663 }
4664 
glExtGetBuffersQCOM_enc(void * self,GLuint * buffers,GLint maxBuffers,GLint * numBuffers)4665 void glExtGetBuffersQCOM_enc(void *self , GLuint* buffers, GLint maxBuffers, GLint* numBuffers)
4666 {
4667 
4668 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4669 	IOStream *stream = ctx->m_stream;
4670 
4671 	const unsigned int __size_buffers =  (maxBuffers * sizeof(GLuint));
4672 	const unsigned int __size_numBuffers =  (1 * sizeof(GLint));
4673 	 unsigned char *ptr;
4674 	 const size_t packetSize = 8 + __size_buffers + 4 + __size_numBuffers + 2*4;
4675 	ptr = stream->alloc(packetSize);
4676 	int tmp = OP_glExtGetBuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4677 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4678 
4679 	*(unsigned int *)(ptr) = __size_buffers; ptr += 4;
4680 		memcpy(ptr, &maxBuffers, 4); ptr += 4;
4681 	*(unsigned int *)(ptr) = __size_numBuffers; ptr += 4;
4682 	stream->readback(buffers, __size_buffers);
4683 	stream->readback(numBuffers, __size_numBuffers);
4684 }
4685 
glExtGetRenderbuffersQCOM_enc(void * self,GLuint * renderbuffers,GLint maxRenderbuffers,GLint * numRenderbuffers)4686 void glExtGetRenderbuffersQCOM_enc(void *self , GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers)
4687 {
4688 
4689 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4690 	IOStream *stream = ctx->m_stream;
4691 
4692 	const unsigned int __size_renderbuffers =  (maxRenderbuffers * sizeof(GLuint));
4693 	const unsigned int __size_numRenderbuffers =  (1 * sizeof(GLint));
4694 	 unsigned char *ptr;
4695 	 const size_t packetSize = 8 + __size_renderbuffers + 4 + __size_numRenderbuffers + 2*4;
4696 	ptr = stream->alloc(packetSize);
4697 	int tmp = OP_glExtGetRenderbuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4698 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4699 
4700 	*(unsigned int *)(ptr) = __size_renderbuffers; ptr += 4;
4701 		memcpy(ptr, &maxRenderbuffers, 4); ptr += 4;
4702 	*(unsigned int *)(ptr) = __size_numRenderbuffers; ptr += 4;
4703 	stream->readback(renderbuffers, __size_renderbuffers);
4704 	stream->readback(numRenderbuffers, __size_numRenderbuffers);
4705 }
4706 
glExtGetFramebuffersQCOM_enc(void * self,GLuint * framebuffers,GLint maxFramebuffers,GLint * numFramebuffers)4707 void glExtGetFramebuffersQCOM_enc(void *self , GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers)
4708 {
4709 
4710 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4711 	IOStream *stream = ctx->m_stream;
4712 
4713 	const unsigned int __size_framebuffers =  (maxFramebuffers * sizeof(GLuint));
4714 	const unsigned int __size_numFramebuffers =  (1 * sizeof(GLint));
4715 	 unsigned char *ptr;
4716 	 const size_t packetSize = 8 + __size_framebuffers + 4 + __size_numFramebuffers + 2*4;
4717 	ptr = stream->alloc(packetSize);
4718 	int tmp = OP_glExtGetFramebuffersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4719 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4720 
4721 	*(unsigned int *)(ptr) = __size_framebuffers; ptr += 4;
4722 		memcpy(ptr, &maxFramebuffers, 4); ptr += 4;
4723 	*(unsigned int *)(ptr) = __size_numFramebuffers; ptr += 4;
4724 	stream->readback(framebuffers, __size_framebuffers);
4725 	stream->readback(numFramebuffers, __size_numFramebuffers);
4726 }
4727 
glExtGetTexLevelParameterivQCOM_enc(void * self,GLuint texture,GLenum face,GLint level,GLenum pname,GLint * params)4728 void glExtGetTexLevelParameterivQCOM_enc(void *self , GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params)
4729 {
4730 
4731 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4732 	IOStream *stream = ctx->m_stream;
4733 
4734 	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
4735 	 unsigned char *ptr;
4736 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + __size_params + 1*4;
4737 	ptr = stream->alloc(packetSize);
4738 	int tmp = OP_glExtGetTexLevelParameterivQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4739 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4740 
4741 		memcpy(ptr, &texture, 4); ptr += 4;
4742 		memcpy(ptr, &face, 4); ptr += 4;
4743 		memcpy(ptr, &level, 4); ptr += 4;
4744 		memcpy(ptr, &pname, 4); ptr += 4;
4745 	*(unsigned int *)(ptr) = __size_params; ptr += 4;
4746 	stream->readback(params, __size_params);
4747 }
4748 
glExtTexObjectStateOverrideiQCOM_enc(void * self,GLenum target,GLenum pname,GLint param)4749 void glExtTexObjectStateOverrideiQCOM_enc(void *self , GLenum target, GLenum pname, GLint param)
4750 {
4751 
4752 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4753 	IOStream *stream = ctx->m_stream;
4754 
4755 	 unsigned char *ptr;
4756 	 const size_t packetSize = 8 + 4 + 4 + 4;
4757 	ptr = stream->alloc(packetSize);
4758 	int tmp = OP_glExtTexObjectStateOverrideiQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4759 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4760 
4761 		memcpy(ptr, &target, 4); ptr += 4;
4762 		memcpy(ptr, &pname, 4); ptr += 4;
4763 		memcpy(ptr, &param, 4); ptr += 4;
4764 }
4765 
glExtGetTexSubImageQCOM_enc(void * self,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,GLvoid * texels)4766 void glExtGetTexSubImageQCOM_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels)
4767 {
4768 
4769 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4770 	IOStream *stream = ctx->m_stream;
4771 
4772 	const unsigned int __size_texels =  (depth * pixelDataSize(self, width, height, format, type, 0));
4773 	 unsigned char *ptr;
4774 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_texels + 1*4;
4775 	ptr = stream->alloc(packetSize);
4776 	int tmp = OP_glExtGetTexSubImageQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4777 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4778 
4779 		memcpy(ptr, &target, 4); ptr += 4;
4780 		memcpy(ptr, &level, 4); ptr += 4;
4781 		memcpy(ptr, &xoffset, 4); ptr += 4;
4782 		memcpy(ptr, &yoffset, 4); ptr += 4;
4783 		memcpy(ptr, &zoffset, 4); ptr += 4;
4784 		memcpy(ptr, &width, 4); ptr += 4;
4785 		memcpy(ptr, &height, 4); ptr += 4;
4786 		memcpy(ptr, &depth, 4); ptr += 4;
4787 		memcpy(ptr, &format, 4); ptr += 4;
4788 		memcpy(ptr, &type, 4); ptr += 4;
4789 	*(unsigned int *)(ptr) = __size_texels; ptr += 4;
4790 	stream->readback(texels, __size_texels);
4791 }
4792 
glExtGetShadersQCOM_enc(void * self,GLuint * shaders,GLint maxShaders,GLint * numShaders)4793 void glExtGetShadersQCOM_enc(void *self , GLuint* shaders, GLint maxShaders, GLint* numShaders)
4794 {
4795 
4796 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4797 	IOStream *stream = ctx->m_stream;
4798 
4799 	const unsigned int __size_shaders =  (maxShaders * sizeof(GLuint));
4800 	const unsigned int __size_numShaders =  (1 * sizeof(GLint));
4801 	 unsigned char *ptr;
4802 	 const size_t packetSize = 8 + __size_shaders + 4 + __size_numShaders + 2*4;
4803 	ptr = stream->alloc(packetSize);
4804 	int tmp = OP_glExtGetShadersQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4805 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4806 
4807 	*(unsigned int *)(ptr) = __size_shaders; ptr += 4;
4808 		memcpy(ptr, &maxShaders, 4); ptr += 4;
4809 	*(unsigned int *)(ptr) = __size_numShaders; ptr += 4;
4810 	stream->readback(shaders, __size_shaders);
4811 	stream->readback(numShaders, __size_numShaders);
4812 }
4813 
glExtGetProgramsQCOM_enc(void * self,GLuint * programs,GLint maxPrograms,GLint * numPrograms)4814 void glExtGetProgramsQCOM_enc(void *self , GLuint* programs, GLint maxPrograms, GLint* numPrograms)
4815 {
4816 
4817 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4818 	IOStream *stream = ctx->m_stream;
4819 
4820 	const unsigned int __size_programs =  (maxPrograms * sizeof(GLuint));
4821 	const unsigned int __size_numPrograms =  (1 * sizeof(GLint));
4822 	 unsigned char *ptr;
4823 	 const size_t packetSize = 8 + __size_programs + 4 + __size_numPrograms + 2*4;
4824 	ptr = stream->alloc(packetSize);
4825 	int tmp = OP_glExtGetProgramsQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4826 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4827 
4828 	*(unsigned int *)(ptr) = __size_programs; ptr += 4;
4829 		memcpy(ptr, &maxPrograms, 4); ptr += 4;
4830 	*(unsigned int *)(ptr) = __size_numPrograms; ptr += 4;
4831 	stream->readback(programs, __size_programs);
4832 	stream->readback(numPrograms, __size_numPrograms);
4833 }
4834 
glExtIsProgramBinaryQCOM_enc(void * self,GLuint program)4835 GLboolean glExtIsProgramBinaryQCOM_enc(void *self , GLuint program)
4836 {
4837 
4838 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4839 	IOStream *stream = ctx->m_stream;
4840 
4841 	 unsigned char *ptr;
4842 	 const size_t packetSize = 8 + 4;
4843 	ptr = stream->alloc(packetSize);
4844 	int tmp = OP_glExtIsProgramBinaryQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4845 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4846 
4847 		memcpy(ptr, &program, 4); ptr += 4;
4848 
4849 	GLboolean retval;
4850 	stream->readback(&retval, 1);
4851 	return retval;
4852 }
4853 
glStartTilingQCOM_enc(void * self,GLuint x,GLuint y,GLuint width,GLuint height,GLbitfield preserveMask)4854 void glStartTilingQCOM_enc(void *self , GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
4855 {
4856 
4857 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4858 	IOStream *stream = ctx->m_stream;
4859 
4860 	 unsigned char *ptr;
4861 	 const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4;
4862 	ptr = stream->alloc(packetSize);
4863 	int tmp = OP_glStartTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4864 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4865 
4866 		memcpy(ptr, &x, 4); ptr += 4;
4867 		memcpy(ptr, &y, 4); ptr += 4;
4868 		memcpy(ptr, &width, 4); ptr += 4;
4869 		memcpy(ptr, &height, 4); ptr += 4;
4870 		memcpy(ptr, &preserveMask, 4); ptr += 4;
4871 }
4872 
glEndTilingQCOM_enc(void * self,GLbitfield preserveMask)4873 void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask)
4874 {
4875 
4876 	gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
4877 	IOStream *stream = ctx->m_stream;
4878 
4879 	 unsigned char *ptr;
4880 	 const size_t packetSize = 8 + 4;
4881 	ptr = stream->alloc(packetSize);
4882 	int tmp = OP_glEndTilingQCOM;memcpy(ptr, &tmp, 4); ptr += 4;
4883 	memcpy(ptr, &packetSize, 4);  ptr += 4;
4884 
4885 		memcpy(ptr, &preserveMask, 4); ptr += 4;
4886 }
4887 
gl_encoder_context_t(IOStream * stream)4888 gl_encoder_context_t::gl_encoder_context_t(IOStream *stream)
4889 {
4890 	m_stream = stream;
4891 
4892 	set_glAlphaFunc(glAlphaFunc_enc);
4893 	set_glClearColor(glClearColor_enc);
4894 	set_glClearDepthf(glClearDepthf_enc);
4895 	set_glClipPlanef(glClipPlanef_enc);
4896 	set_glColor4f(glColor4f_enc);
4897 	set_glDepthRangef(glDepthRangef_enc);
4898 	set_glFogf(glFogf_enc);
4899 	set_glFogfv(glFogfv_enc);
4900 	set_glFrustumf(glFrustumf_enc);
4901 	set_glGetClipPlanef(glGetClipPlanef_enc);
4902 	set_glGetFloatv(glGetFloatv_enc);
4903 	set_glGetLightfv(glGetLightfv_enc);
4904 	set_glGetMaterialfv(glGetMaterialfv_enc);
4905 	set_glGetTexEnvfv(glGetTexEnvfv_enc);
4906 	set_glGetTexParameterfv(glGetTexParameterfv_enc);
4907 	set_glLightModelf(glLightModelf_enc);
4908 	set_glLightModelfv(glLightModelfv_enc);
4909 	set_glLightf(glLightf_enc);
4910 	set_glLightfv(glLightfv_enc);
4911 	set_glLineWidth(glLineWidth_enc);
4912 	set_glLoadMatrixf(glLoadMatrixf_enc);
4913 	set_glMaterialf(glMaterialf_enc);
4914 	set_glMaterialfv(glMaterialfv_enc);
4915 	set_glMultMatrixf(glMultMatrixf_enc);
4916 	set_glMultiTexCoord4f(glMultiTexCoord4f_enc);
4917 	set_glNormal3f(glNormal3f_enc);
4918 	set_glOrthof(glOrthof_enc);
4919 	set_glPointParameterf(glPointParameterf_enc);
4920 	set_glPointParameterfv(glPointParameterfv_enc);
4921 	set_glPointSize(glPointSize_enc);
4922 	set_glPolygonOffset(glPolygonOffset_enc);
4923 	set_glRotatef(glRotatef_enc);
4924 	set_glScalef(glScalef_enc);
4925 	set_glTexEnvf(glTexEnvf_enc);
4926 	set_glTexEnvfv(glTexEnvfv_enc);
4927 	set_glTexParameterf(glTexParameterf_enc);
4928 	set_glTexParameterfv(glTexParameterfv_enc);
4929 	set_glTranslatef(glTranslatef_enc);
4930 	set_glActiveTexture(glActiveTexture_enc);
4931 	set_glAlphaFuncx(glAlphaFuncx_enc);
4932 	set_glBindBuffer(glBindBuffer_enc);
4933 	set_glBindTexture(glBindTexture_enc);
4934 	set_glBlendFunc(glBlendFunc_enc);
4935 	set_glBufferData(glBufferData_enc);
4936 	set_glBufferSubData(glBufferSubData_enc);
4937 	set_glClear(glClear_enc);
4938 	set_glClearColorx(glClearColorx_enc);
4939 	set_glClearDepthx(glClearDepthx_enc);
4940 	set_glClearStencil(glClearStencil_enc);
4941 	set_glClientActiveTexture(glClientActiveTexture_enc);
4942 	set_glColor4ub(glColor4ub_enc);
4943 	set_glColor4x(glColor4x_enc);
4944 	set_glColorMask(glColorMask_enc);
4945 	set_glColorPointer((glColorPointer_client_proc_t)(enc_unsupported));
4946 	set_glCompressedTexImage2D(glCompressedTexImage2D_enc);
4947 	set_glCompressedTexSubImage2D(glCompressedTexSubImage2D_enc);
4948 	set_glCopyTexImage2D(glCopyTexImage2D_enc);
4949 	set_glCopyTexSubImage2D(glCopyTexSubImage2D_enc);
4950 	set_glCullFace(glCullFace_enc);
4951 	set_glDeleteBuffers(glDeleteBuffers_enc);
4952 	set_glDeleteTextures(glDeleteTextures_enc);
4953 	set_glDepthFunc(glDepthFunc_enc);
4954 	set_glDepthMask(glDepthMask_enc);
4955 	set_glDepthRangex(glDepthRangex_enc);
4956 	set_glDisable(glDisable_enc);
4957 	set_glDisableClientState(glDisableClientState_enc);
4958 	set_glDrawArrays(glDrawArrays_enc);
4959 	set_glDrawElements((glDrawElements_client_proc_t)(enc_unsupported));
4960 	set_glEnable(glEnable_enc);
4961 	set_glEnableClientState(glEnableClientState_enc);
4962 	set_glFinish(glFinish_enc);
4963 	set_glFlush(glFlush_enc);
4964 	set_glFogx(glFogx_enc);
4965 	set_glFogxv(glFogxv_enc);
4966 	set_glFrontFace(glFrontFace_enc);
4967 	set_glFrustumx(glFrustumx_enc);
4968 	set_glGetBooleanv(glGetBooleanv_enc);
4969 	set_glGetBufferParameteriv(glGetBufferParameteriv_enc);
4970 	set_glClipPlanex(glClipPlanex_enc);
4971 	set_glGenBuffers(glGenBuffers_enc);
4972 	set_glGenTextures(glGenTextures_enc);
4973 	set_glGetError(glGetError_enc);
4974 	set_glGetFixedv(glGetFixedv_enc);
4975 	set_glGetIntegerv(glGetIntegerv_enc);
4976 	set_glGetLightxv(glGetLightxv_enc);
4977 	set_glGetMaterialxv(glGetMaterialxv_enc);
4978 	set_glGetPointerv((glGetPointerv_client_proc_t)(enc_unsupported));
4979 	set_glGetString((glGetString_client_proc_t)(enc_unsupported));
4980 	set_glGetTexEnviv(glGetTexEnviv_enc);
4981 	set_glGetTexEnvxv(glGetTexEnvxv_enc);
4982 	set_glGetTexParameteriv(glGetTexParameteriv_enc);
4983 	set_glGetTexParameterxv(glGetTexParameterxv_enc);
4984 	set_glHint(glHint_enc);
4985 	set_glIsBuffer(glIsBuffer_enc);
4986 	set_glIsEnabled(glIsEnabled_enc);
4987 	set_glIsTexture(glIsTexture_enc);
4988 	set_glLightModelx(glLightModelx_enc);
4989 	set_glLightModelxv(glLightModelxv_enc);
4990 	set_glLightx(glLightx_enc);
4991 	set_glLightxv(glLightxv_enc);
4992 	set_glLineWidthx(glLineWidthx_enc);
4993 	set_glLoadIdentity(glLoadIdentity_enc);
4994 	set_glLoadMatrixx(glLoadMatrixx_enc);
4995 	set_glLogicOp(glLogicOp_enc);
4996 	set_glMaterialx(glMaterialx_enc);
4997 	set_glMaterialxv(glMaterialxv_enc);
4998 	set_glMatrixMode(glMatrixMode_enc);
4999 	set_glMultMatrixx(glMultMatrixx_enc);
5000 	set_glMultiTexCoord4x(glMultiTexCoord4x_enc);
5001 	set_glNormal3x(glNormal3x_enc);
5002 	set_glNormalPointer((glNormalPointer_client_proc_t)(enc_unsupported));
5003 	set_glOrthox(glOrthox_enc);
5004 	set_glPixelStorei(glPixelStorei_enc);
5005 	set_glPointParameterx(glPointParameterx_enc);
5006 	set_glPointParameterxv(glPointParameterxv_enc);
5007 	set_glPointSizex(glPointSizex_enc);
5008 	set_glPolygonOffsetx(glPolygonOffsetx_enc);
5009 	set_glPopMatrix(glPopMatrix_enc);
5010 	set_glPushMatrix(glPushMatrix_enc);
5011 	set_glReadPixels(glReadPixels_enc);
5012 	set_glRotatex(glRotatex_enc);
5013 	set_glSampleCoverage(glSampleCoverage_enc);
5014 	set_glSampleCoveragex(glSampleCoveragex_enc);
5015 	set_glScalex(glScalex_enc);
5016 	set_glScissor(glScissor_enc);
5017 	set_glShadeModel(glShadeModel_enc);
5018 	set_glStencilFunc(glStencilFunc_enc);
5019 	set_glStencilMask(glStencilMask_enc);
5020 	set_glStencilOp(glStencilOp_enc);
5021 	set_glTexCoordPointer((glTexCoordPointer_client_proc_t)(enc_unsupported));
5022 	set_glTexEnvi(glTexEnvi_enc);
5023 	set_glTexEnvx(glTexEnvx_enc);
5024 	set_glTexEnviv(glTexEnviv_enc);
5025 	set_glTexEnvxv(glTexEnvxv_enc);
5026 	set_glTexImage2D(glTexImage2D_enc);
5027 	set_glTexParameteri(glTexParameteri_enc);
5028 	set_glTexParameterx(glTexParameterx_enc);
5029 	set_glTexParameteriv(glTexParameteriv_enc);
5030 	set_glTexParameterxv(glTexParameterxv_enc);
5031 	set_glTexSubImage2D(glTexSubImage2D_enc);
5032 	set_glTranslatex(glTranslatex_enc);
5033 	set_glVertexPointer((glVertexPointer_client_proc_t)(enc_unsupported));
5034 	set_glViewport(glViewport_enc);
5035 	set_glPointSizePointerOES((glPointSizePointerOES_client_proc_t)(enc_unsupported));
5036 	set_glVertexPointerOffset(glVertexPointerOffset_enc);
5037 	set_glColorPointerOffset(glColorPointerOffset_enc);
5038 	set_glNormalPointerOffset(glNormalPointerOffset_enc);
5039 	set_glPointSizePointerOffset(glPointSizePointerOffset_enc);
5040 	set_glTexCoordPointerOffset(glTexCoordPointerOffset_enc);
5041 	set_glWeightPointerOffset(glWeightPointerOffset_enc);
5042 	set_glMatrixIndexPointerOffset(glMatrixIndexPointerOffset_enc);
5043 	set_glVertexPointerData(glVertexPointerData_enc);
5044 	set_glColorPointerData(glColorPointerData_enc);
5045 	set_glNormalPointerData(glNormalPointerData_enc);
5046 	set_glTexCoordPointerData(glTexCoordPointerData_enc);
5047 	set_glPointSizePointerData(glPointSizePointerData_enc);
5048 	set_glWeightPointerData(glWeightPointerData_enc);
5049 	set_glMatrixIndexPointerData(glMatrixIndexPointerData_enc);
5050 	set_glDrawElementsOffset(glDrawElementsOffset_enc);
5051 	set_glDrawElementsData(glDrawElementsData_enc);
5052 	set_glGetCompressedTextureFormats(glGetCompressedTextureFormats_enc);
5053 	set_glFinishRoundTrip(glFinishRoundTrip_enc);
5054 	set_glBlendEquationSeparateOES(glBlendEquationSeparateOES_enc);
5055 	set_glBlendFuncSeparateOES(glBlendFuncSeparateOES_enc);
5056 	set_glBlendEquationOES(glBlendEquationOES_enc);
5057 	set_glDrawTexsOES(glDrawTexsOES_enc);
5058 	set_glDrawTexiOES(glDrawTexiOES_enc);
5059 	set_glDrawTexxOES(glDrawTexxOES_enc);
5060 	set_glDrawTexsvOES(glDrawTexsvOES_enc);
5061 	set_glDrawTexivOES(glDrawTexivOES_enc);
5062 	set_glDrawTexxvOES(glDrawTexxvOES_enc);
5063 	set_glDrawTexfOES(glDrawTexfOES_enc);
5064 	set_glDrawTexfvOES(glDrawTexfvOES_enc);
5065 	set_glEGLImageTargetTexture2DOES(glEGLImageTargetTexture2DOES_enc);
5066 	set_glEGLImageTargetRenderbufferStorageOES(glEGLImageTargetRenderbufferStorageOES_enc);
5067 	set_glAlphaFuncxOES(glAlphaFuncxOES_enc);
5068 	set_glClearColorxOES(glClearColorxOES_enc);
5069 	set_glClearDepthxOES(glClearDepthxOES_enc);
5070 	set_glClipPlanexOES(glClipPlanexOES_enc);
5071 	set_glClipPlanexIMG(glClipPlanexIMG_enc);
5072 	set_glColor4xOES(glColor4xOES_enc);
5073 	set_glDepthRangexOES(glDepthRangexOES_enc);
5074 	set_glFogxOES(glFogxOES_enc);
5075 	set_glFogxvOES(glFogxvOES_enc);
5076 	set_glFrustumxOES(glFrustumxOES_enc);
5077 	set_glGetClipPlanexOES(glGetClipPlanexOES_enc);
5078 	set_glGetClipPlanex(glGetClipPlanex_enc);
5079 	set_glGetFixedvOES(glGetFixedvOES_enc);
5080 	set_glGetLightxvOES(glGetLightxvOES_enc);
5081 	set_glGetMaterialxvOES(glGetMaterialxvOES_enc);
5082 	set_glGetTexEnvxvOES(glGetTexEnvxvOES_enc);
5083 	set_glGetTexParameterxvOES(glGetTexParameterxvOES_enc);
5084 	set_glLightModelxOES(glLightModelxOES_enc);
5085 	set_glLightModelxvOES(glLightModelxvOES_enc);
5086 	set_glLightxOES(glLightxOES_enc);
5087 	set_glLightxvOES(glLightxvOES_enc);
5088 	set_glLineWidthxOES(glLineWidthxOES_enc);
5089 	set_glLoadMatrixxOES(glLoadMatrixxOES_enc);
5090 	set_glMaterialxOES(glMaterialxOES_enc);
5091 	set_glMaterialxvOES(glMaterialxvOES_enc);
5092 	set_glMultMatrixxOES(glMultMatrixxOES_enc);
5093 	set_glMultiTexCoord4xOES(glMultiTexCoord4xOES_enc);
5094 	set_glNormal3xOES(glNormal3xOES_enc);
5095 	set_glOrthoxOES(glOrthoxOES_enc);
5096 	set_glPointParameterxOES(glPointParameterxOES_enc);
5097 	set_glPointParameterxvOES(glPointParameterxvOES_enc);
5098 	set_glPointSizexOES(glPointSizexOES_enc);
5099 	set_glPolygonOffsetxOES(glPolygonOffsetxOES_enc);
5100 	set_glRotatexOES(glRotatexOES_enc);
5101 	set_glSampleCoveragexOES(glSampleCoveragexOES_enc);
5102 	set_glScalexOES(glScalexOES_enc);
5103 	set_glTexEnvxOES(glTexEnvxOES_enc);
5104 	set_glTexEnvxvOES(glTexEnvxvOES_enc);
5105 	set_glTexParameterxOES(glTexParameterxOES_enc);
5106 	set_glTexParameterxvOES(glTexParameterxvOES_enc);
5107 	set_glTranslatexOES(glTranslatexOES_enc);
5108 	set_glIsRenderbufferOES(glIsRenderbufferOES_enc);
5109 	set_glBindRenderbufferOES(glBindRenderbufferOES_enc);
5110 	set_glDeleteRenderbuffersOES(glDeleteRenderbuffersOES_enc);
5111 	set_glGenRenderbuffersOES(glGenRenderbuffersOES_enc);
5112 	set_glRenderbufferStorageOES(glRenderbufferStorageOES_enc);
5113 	set_glGetRenderbufferParameterivOES(glGetRenderbufferParameterivOES_enc);
5114 	set_glIsFramebufferOES(glIsFramebufferOES_enc);
5115 	set_glBindFramebufferOES(glBindFramebufferOES_enc);
5116 	set_glDeleteFramebuffersOES(glDeleteFramebuffersOES_enc);
5117 	set_glGenFramebuffersOES(glGenFramebuffersOES_enc);
5118 	set_glCheckFramebufferStatusOES(glCheckFramebufferStatusOES_enc);
5119 	set_glFramebufferRenderbufferOES(glFramebufferRenderbufferOES_enc);
5120 	set_glFramebufferTexture2DOES(glFramebufferTexture2DOES_enc);
5121 	set_glGetFramebufferAttachmentParameterivOES(glGetFramebufferAttachmentParameterivOES_enc);
5122 	set_glGenerateMipmapOES(glGenerateMipmapOES_enc);
5123 	set_glMapBufferOES((glMapBufferOES_client_proc_t)(enc_unsupported));
5124 	set_glUnmapBufferOES(glUnmapBufferOES_enc);
5125 	set_glGetBufferPointervOES((glGetBufferPointervOES_client_proc_t)(enc_unsupported));
5126 	set_glCurrentPaletteMatrixOES(glCurrentPaletteMatrixOES_enc);
5127 	set_glLoadPaletteFromModelViewMatrixOES(glLoadPaletteFromModelViewMatrixOES_enc);
5128 	set_glMatrixIndexPointerOES((glMatrixIndexPointerOES_client_proc_t)(enc_unsupported));
5129 	set_glWeightPointerOES((glWeightPointerOES_client_proc_t)(enc_unsupported));
5130 	set_glQueryMatrixxOES(glQueryMatrixxOES_enc);
5131 	set_glDepthRangefOES(glDepthRangefOES_enc);
5132 	set_glFrustumfOES(glFrustumfOES_enc);
5133 	set_glOrthofOES(glOrthofOES_enc);
5134 	set_glClipPlanefOES(glClipPlanefOES_enc);
5135 	set_glClipPlanefIMG(glClipPlanefIMG_enc);
5136 	set_glGetClipPlanefOES(glGetClipPlanefOES_enc);
5137 	set_glClearDepthfOES(glClearDepthfOES_enc);
5138 	set_glTexGenfOES(glTexGenfOES_enc);
5139 	set_glTexGenfvOES(glTexGenfvOES_enc);
5140 	set_glTexGeniOES(glTexGeniOES_enc);
5141 	set_glTexGenivOES(glTexGenivOES_enc);
5142 	set_glTexGenxOES(glTexGenxOES_enc);
5143 	set_glTexGenxvOES(glTexGenxvOES_enc);
5144 	set_glGetTexGenfvOES(glGetTexGenfvOES_enc);
5145 	set_glGetTexGenivOES(glGetTexGenivOES_enc);
5146 	set_glGetTexGenxvOES(glGetTexGenxvOES_enc);
5147 	set_glBindVertexArrayOES(glBindVertexArrayOES_enc);
5148 	set_glDeleteVertexArraysOES(glDeleteVertexArraysOES_enc);
5149 	set_glGenVertexArraysOES(glGenVertexArraysOES_enc);
5150 	set_glIsVertexArrayOES(glIsVertexArrayOES_enc);
5151 	set_glDiscardFramebufferEXT(glDiscardFramebufferEXT_enc);
5152 	set_glMultiDrawArraysEXT((glMultiDrawArraysEXT_client_proc_t)(enc_unsupported));
5153 	set_glMultiDrawElementsEXT((glMultiDrawElementsEXT_client_proc_t)(enc_unsupported));
5154 	set_glMultiDrawArraysSUN((glMultiDrawArraysSUN_client_proc_t)(enc_unsupported));
5155 	set_glMultiDrawElementsSUN((glMultiDrawElementsSUN_client_proc_t)(enc_unsupported));
5156 	set_glRenderbufferStorageMultisampleIMG(glRenderbufferStorageMultisampleIMG_enc);
5157 	set_glFramebufferTexture2DMultisampleIMG(glFramebufferTexture2DMultisampleIMG_enc);
5158 	set_glDeleteFencesNV(glDeleteFencesNV_enc);
5159 	set_glGenFencesNV(glGenFencesNV_enc);
5160 	set_glIsFenceNV(glIsFenceNV_enc);
5161 	set_glTestFenceNV(glTestFenceNV_enc);
5162 	set_glGetFenceivNV(glGetFenceivNV_enc);
5163 	set_glFinishFenceNV(glFinishFenceNV_enc);
5164 	set_glSetFenceNV(glSetFenceNV_enc);
5165 	set_glGetDriverControlsQCOM(glGetDriverControlsQCOM_enc);
5166 	set_glGetDriverControlStringQCOM(glGetDriverControlStringQCOM_enc);
5167 	set_glEnableDriverControlQCOM(glEnableDriverControlQCOM_enc);
5168 	set_glDisableDriverControlQCOM(glDisableDriverControlQCOM_enc);
5169 	set_glExtGetTexturesQCOM(glExtGetTexturesQCOM_enc);
5170 	set_glExtGetBuffersQCOM(glExtGetBuffersQCOM_enc);
5171 	set_glExtGetRenderbuffersQCOM(glExtGetRenderbuffersQCOM_enc);
5172 	set_glExtGetFramebuffersQCOM(glExtGetFramebuffersQCOM_enc);
5173 	set_glExtGetTexLevelParameterivQCOM(glExtGetTexLevelParameterivQCOM_enc);
5174 	set_glExtTexObjectStateOverrideiQCOM(glExtTexObjectStateOverrideiQCOM_enc);
5175 	set_glExtGetTexSubImageQCOM(glExtGetTexSubImageQCOM_enc);
5176 	set_glExtGetBufferPointervQCOM((glExtGetBufferPointervQCOM_client_proc_t)(enc_unsupported));
5177 	set_glExtGetShadersQCOM(glExtGetShadersQCOM_enc);
5178 	set_glExtGetProgramsQCOM(glExtGetProgramsQCOM_enc);
5179 	set_glExtIsProgramBinaryQCOM(glExtIsProgramBinaryQCOM_enc);
5180 	set_glExtGetProgramBinarySourceQCOM((glExtGetProgramBinarySourceQCOM_client_proc_t)(enc_unsupported));
5181 	set_glStartTilingQCOM(glStartTilingQCOM_enc);
5182 	set_glEndTilingQCOM(glEndTilingQCOM_enc);
5183 }
5184 
5185