opengl emulator - handle shader string decoding

Shader strings are sent over the wire protocal as one concatenated
string. a special api call - glShaderString is used to handle the
encoding and decoding of this string.

Change-Id: Id682763f35e9fcc6215559931db2112a4fa981a9
This commit is contained in:
Jacky Romano
2011-04-23 20:16:00 +03:00
committed by David 'Digit' Turner
parent 5b840fb32b
commit 68e7ee63f5
4 changed files with 13 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ int GL2Decoder::initGL(get_proc_func_t getProcFunc, void *getProcFuncData)
set_glDrawElementsOffset(s_glDrawElementsOffset);
set_glDrawElementsData(s_glDrawElementsData);
set_glShaderString(s_glShaderString);
return 0;
}
@@ -108,3 +108,8 @@ void GL2Decoder::s_glDrawElementsOffset(void *self, GLenum mode, GLsizei count,
ctx->glDrawElements(mode, count, type, (void *)offset);
}
void GL2Decoder::s_glShaderString(void *self, GLuint shader, GLstr string, GLsizei len)
{
GL2Decoder *ctx = (GL2Decoder *)self;
ctx->glShaderSource(shader, 1, &string, NULL);
}

View File

@@ -30,8 +30,6 @@ private:
static void s_glDrawElementsOffset(void *self, GLenum mode, GLsizei count, GLenum type, GLuint offset);
static void s_glDrawElementsData(void *self, GLenum mode, GLsizei count, GLenum type, void * data, GLuint datalen);
static void s_glShaderString(void *self, GLuint shader, GLstr string, GLsizei len);
};
#endif

View File

@@ -538,3 +538,8 @@ glGetCompressedTextureFormats
dir formats out
len formats (count * sizeof(GLint))
flag custom_decoder
#GL_ENTRY(void, glShaderString, GLuint shader, GLchar *string, GLsizei len)
glShaderString
len string len
flag custom_decoder

View File

@@ -211,5 +211,6 @@ GL_ENTRY(void, glVertexAttribPointerOffset, GLuint indx, GLint size, GLenum type
GL_ENTRY(void, glDrawElementsOffset, GLenum mode, GLsizei count, GLenum type, GLuint offset)
GL_ENTRY(void, glDrawElementsData, GLenum mode, GLsizei count, GLenum type, void *data, GLuint datalen)
GL_ENTRY(void, glGetCompressedTextureFormats, int count, GLint *formats)
GL_ENTRY(void, glShaderString, GLuint shader, GLstr string, GLsizei len)