Add GLESv2 functionality to GLESv1/GLESv2 shared code

Extends GLClientState to support additional state data
that is required by GLESv2. this includes:
* normalized flag in vertex attribute arrays
* getter for vertex attribute arrays state
* glParamSize now knows about the result size of GL2 parameters
* utility functions required for a GLESv2 encoder

Change-Id: I7e57d978bed5b8b929b918aee66c7f71dc5df3b1
This commit is contained in:
Jacky Romano
2011-04-11 18:21:28 +03:00
parent 3c2aa9b931
commit 254492ffd6
5 changed files with 122 additions and 13 deletions

View File

@@ -147,28 +147,28 @@ void GLEncoder::s_glVertexPointer(void *self, int size, GLenum type, GLsizei str
{
GLEncoder *ctx = (GLEncoder *)self;
assert(ctx->m_state != NULL);
ctx->m_state->setState(GLClientState::VERTEX_LOCATION, size, type, stride, data);
ctx->m_state->setState(GLClientState::VERTEX_LOCATION, size, type, false, stride, data);
}
void GLEncoder::s_glNormalPointer(void *self, GLenum type, GLsizei stride, void *data)
{
GLEncoder *ctx = (GLEncoder *)self;
assert(ctx->m_state != NULL);
ctx->m_state->setState(GLClientState::NORMAL_LOCATION, 3, type, stride, data);
ctx->m_state->setState(GLClientState::NORMAL_LOCATION, 3, type, false, stride, data);
}
void GLEncoder::s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, void *data)
{
GLEncoder *ctx = (GLEncoder *)self;
assert(ctx->m_state != NULL);
ctx->m_state->setState(GLClientState::COLOR_LOCATION, size, type, stride, data);
ctx->m_state->setState(GLClientState::COLOR_LOCATION, size, type, false, stride, data);
}
void GLEncoder::s_glPointsizePointer(void *self, GLenum type, GLsizei stride, void *data)
{
GLEncoder *ctx = (GLEncoder *)self;
assert(ctx->m_state != NULL);
ctx->m_state->setState(GLClientState::POINTSIZE_LOCATION, 1, type, stride, data);
ctx->m_state->setState(GLClientState::POINTSIZE_LOCATION, 1, type, false, stride, data);
}
void GLEncoder::s_glClientActiveTexture(void *self, GLenum texture)
@@ -183,7 +183,7 @@ void GLEncoder::s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei s
GLEncoder *ctx = (GLEncoder *)self;
assert(ctx->m_state != NULL);
int loc = ctx->m_state->getLocation(GL_TEXTURE_COORD_ARRAY);
ctx->m_state->setState(loc, size, type, stride, data);
ctx->m_state->setState(loc, size, type, false, stride, data);
}
void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, void * data)
@@ -191,7 +191,7 @@ void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLs
GLEncoder *ctx = (GLEncoder *)self;
assert(ctx->m_state != NULL);
int loc = ctx->m_state->getLocation(GL_MATRIX_INDEX_ARRAY_OES);
ctx->m_state->setState(loc, size, type, stride, data);
ctx->m_state->setState(loc, size, type, false, stride, data);
}
void GLEncoder::s_glWeightPointerOES(void * self, int size, GLenum type, GLsizei stride, void * data)
@@ -199,7 +199,7 @@ void GLEncoder::s_glWeightPointerOES(void * self, int size, GLenum type, GLsizei
GLEncoder *ctx = (GLEncoder *)self;
assert(ctx->m_state != NULL);
int loc = ctx->m_state->getLocation(GL_WEIGHT_ARRAY_OES);
ctx->m_state->setState(loc, size, type, stride, data);
ctx->m_state->setState(loc, size, type, false, stride, data);
}
void GLEncoder::s_glEnableClientState(void *self, GLenum state)