emulator opengl: system GLESv1 first commit.

This is the first commit for the GLESv1 implementation.
It also includes needed fixes in emugen to support const types.
Also, changed glFinish definition in gl.in to match the
definition as in gl.h.

Change-Id: I90262a1db6035a90af8db17984acecef6499847a
This commit is contained in:
Stas Gurtovoy
2011-05-05 11:07:34 +03:00
committed by Guy Zadikario
parent b7caa30ba2
commit d32c2d9633
19 changed files with 145 additions and 64 deletions

View File

@@ -40,7 +40,7 @@ void GL2Encoder::s_glFlush(void *self)
ctx->m_stream->flush();
}
GLubyte *GL2Encoder::s_glGetString(void *self, GLenum name)
const GLubyte *GL2Encoder::s_glGetString(void *self, GLenum name)
{
GLubyte *retval = (GLubyte *) "";
switch(name) {
@@ -78,7 +78,7 @@ void GL2Encoder::s_glBindBuffer(void *self, GLenum target, GLuint id)
ctx->m_glBindBuffer_enc(self, target, id);
}
void GL2Encoder::s_glVertexAtrribPointer(void *self, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid * ptr)
void GL2Encoder::s_glVertexAtrribPointer(void *self, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * ptr)
{
GL2Encoder *ctx = (GL2Encoder *)self;
assert(ctx->m_state != NULL);
@@ -232,7 +232,7 @@ void GL2Encoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei co
}
void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, void *indices)
void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
{
GL2Encoder *ctx = (GL2Encoder *)self;
@@ -266,7 +266,7 @@ void GL2Encoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum
LOGE("glDrawElements: indirect index arrays, with immidate-mode data array is not supported\n");
}
} else {
void *adjustedIndices = indices;
void *adjustedIndices = (void*)indices;
int minIndex = 0, maxIndex = 0;
switch(type) {
@@ -324,12 +324,12 @@ GLint * GL2Encoder::getCompressedTextureFormats()
return m_compressedTextureFormats;
}
void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, GLstr *string, GLint *length)
void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLstr *string, const GLint *length)
{
int len = glUtilsCalcShaderSourceLen(string, length, count);
int len = glUtilsCalcShaderSourceLen((char**)string, (GLint*)length, count);
char *str = new char[len + 1];
glUtilsPackStrings(str, string, length, count);
glUtilsPackStrings(str, (char**)string, (GLint*)length, count);
GL2Encoder *ctx = (GL2Encoder *)self;
ctx->glShaderString(ctx, shader, str, len + 1);