#include <stdlib.h>
#include "GLEncoder.h"
+namespace glesv1_enc {
+
size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
{
GLEncoder *ctx = (GLEncoder *)self;
return ctx->pixelDataSize(width, height, format, type, pack);
}
+
+} // namespace glesv1_enc
#ifndef GL_ENCODER_UTILS_H
#define GL_ENCLODER_UTILS_H
-extern "C" {
+namespace glesv1_enc {
size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
};
+
#endif
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glLoadIdentity;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glPopMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glPushMatrix;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = pixelDataSize(self, width, height, format, type, 1);
+ const unsigned int __size_pixels = glesv1_enc::pixelDataSize(self, width, height, format, type, 1);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(packetSize);
gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = ((pixels != NULL) ? pixelDataSize(self, width, height, format, type, 0) : 0);
+ const unsigned int __size_pixels = ((pixels != NULL) ? glesv1_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = pixelDataSize(self, width, height, format, type, 0);
+ const unsigned int __size_pixels = glesv1_enc::pixelDataSize(self, width, height, format, type, 0);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glLoadPaletteFromModelViewMatrixOES;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
gl_encoder_context_t *ctx = (gl_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_texels = (depth * pixelDataSize(self, width, height, format, type, 0));
+ const unsigned int __size_texels = (depth * glesv1_enc::pixelDataSize(self, width, height, format, type, 0));
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_texels + 1*4;
ptr = stream->alloc(packetSize);
GLboolean glIsVertexArrayOES(GLuint array);
void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments);
void glMultiDrawArraysEXT(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount);
- void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid*const* indices, GLsizei primcount);
+ void glMultiDrawElementsEXT(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const* indices, GLsizei primcount);
void glMultiDrawArraysSUN(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
void glMultiDrawElementsSUN(GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
#include "GL2Encoder.h"
#include <assert.h>
+namespace glesv2_enc {
+
size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
{
GL2Encoder *ctx = (GL2Encoder *)self;
assert (ctx->shared() != NULL);
return ctx->shared()->getProgramUniformType(program, location);
}
+
+} // namespace glesv2_enc
#ifndef GL2_ENCODER_UTILS_H
#define GL2_ENCLODER_UTILS_H
-extern "C" {
- size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
- size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack);
- GLenum uniformType(void * self, GLuint program, GLint location);
-};
+namespace glesv2_enc {
+
+size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
+size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack);
+GLenum uniformType(void * self, GLuint program, GLint location);
+
+} // namespace glesv2_enc
+
#endif
typedef void (gl2_APIENTRY *glSampleCoverage_client_proc_t) (void * ctx, GLclampf, GLboolean);
typedef void (gl2_APIENTRY *glScissor_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
typedef void (gl2_APIENTRY *glShaderBinary_client_proc_t) (void * ctx, GLsizei, const GLuint*, GLenum, const GLvoid*, GLsizei);
-typedef void (gl2_APIENTRY *glShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar*const*, const GLint*);
+typedef void (gl2_APIENTRY *glShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar* const*, const GLint*);
typedef void (gl2_APIENTRY *glStencilFunc_client_proc_t) (void * ctx, GLenum, GLint, GLuint);
typedef void (gl2_APIENTRY *glStencilFuncSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLint, GLuint);
typedef void (gl2_APIENTRY *glStencilMask_client_proc_t) (void * ctx, GLuint);
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glCreateProgram;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glFinish;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glFlush;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glGetError;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_params = glSizeof(uniformType(self, program, location));
+ const unsigned int __size_params = glSizeof(glesv2_enc::uniformType(self, program, location));
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
ptr = stream->alloc(packetSize);
gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_params = glSizeof(uniformType(self, program, location));
+ const unsigned int __size_params = glSizeof(glesv2_enc::uniformType(self, program, location));
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + __size_params + 1*4;
ptr = stream->alloc(packetSize);
gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = pixelDataSize(self, width, height, format, type, 1);
+ const unsigned int __size_pixels = glesv2_enc::pixelDataSize(self, width, height, format, type, 1);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(packetSize);
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glReleaseShaderCompiler;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = ((pixels != NULL) ? pixelDataSize(self, width, height, format, type, 0) : 0);
+ const unsigned int __size_pixels = ((pixels != NULL) ? glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = ((pixels != NULL) ? pixelDataSize(self, width, height, format, type, 0) : 0);
+ const unsigned int __size_pixels = ((pixels != NULL) ? glesv2_enc::pixelDataSize(self, width, height, format, type, 0) : 0);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = ((pixels != NULL) ? pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
+ const unsigned int __size_pixels = ((pixels != NULL) ? glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
IOStream *stream = ctx->m_stream;
- const unsigned int __size_pixels = pixelDataSize3D(self, width, height, depth, format, type, 0);
+ const unsigned int __size_pixels = glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0);
unsigned char *ptr;
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
IOStream *stream = ctx->m_stream;
unsigned char *ptr;
- const size_t packetSize = 8 + 0;
+ const size_t packetSize = 8;
ptr = stream->alloc(packetSize);
int tmp = OP_glFinishRoundTrip;memcpy(ptr, &tmp, 4); ptr += 4;
memcpy(ptr, &packetSize, 4); ptr += 4;
void glSampleCoverage(GLclampf value, GLboolean invert);
void glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
void glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
- void glShaderSource(GLuint shader, GLsizei count, const GLchar*const* string, const GLint* length);
+ void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
void glStencilFunc(GLenum func, GLint ref, GLuint mask);
void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
void glStencilMask(GLuint mask);
ctx->glShaderBinary(ctx, n, shaders, binaryformat, binary, length);
}
-void glShaderSource(GLuint shader, GLsizei count, const GLchar*const* string, const GLint* length)
+void glShaderSource(GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length)
{
GET_CONTEXT;
ctx->glShaderSource(ctx, shader, count, string, length);