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