Properly pop active client texture in immediate mode
This commit is contained in:
parent
25de48b3f6
commit
edae8a9166
|
@ -961,6 +961,10 @@ void APIENTRY glDisableClientState(GLenum cap) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GLuint _glGetActiveClientTexture() {
|
||||||
|
return ACTIVE_CLIENT_TEXTURE;
|
||||||
|
}
|
||||||
|
|
||||||
void APIENTRY glClientActiveTextureARB(GLenum texture) {
|
void APIENTRY glClientActiveTextureARB(GLenum texture) {
|
||||||
TRACE();
|
TRACE();
|
||||||
|
|
||||||
|
|
|
@ -164,6 +164,9 @@ void APIENTRY glEnd() {
|
||||||
glColorPointer(4, GL_FLOAT, 0, COLOURS.data);
|
glColorPointer(4, GL_FLOAT, 0, COLOURS.data);
|
||||||
glNormalPointer(GL_FLOAT, 0, NORMALS.data);
|
glNormalPointer(GL_FLOAT, 0, NORMALS.data);
|
||||||
|
|
||||||
|
GLint activeTexture;
|
||||||
|
glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE, &activeTexture);
|
||||||
|
|
||||||
glClientActiveTextureARB(GL_TEXTURE0);
|
glClientActiveTextureARB(GL_TEXTURE0);
|
||||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
glTexCoordPointer(2, GL_FLOAT, 0, UV_COORDS.data);
|
glTexCoordPointer(2, GL_FLOAT, 0, UV_COORDS.data);
|
||||||
|
@ -174,6 +177,8 @@ void APIENTRY glEnd() {
|
||||||
|
|
||||||
glDrawArrays(ACTIVE_POLYGON_MODE, 0, VERTICES.size / 3);
|
glDrawArrays(ACTIVE_POLYGON_MODE, 0, VERTICES.size / 3);
|
||||||
|
|
||||||
|
glClientActiveTextureARB((GLuint) activeTexture);
|
||||||
|
|
||||||
aligned_vector_clear(&VERTICES);
|
aligned_vector_clear(&VERTICES);
|
||||||
aligned_vector_clear(&COLOURS);
|
aligned_vector_clear(&COLOURS);
|
||||||
aligned_vector_clear(&UV_COORDS);
|
aligned_vector_clear(&UV_COORDS);
|
||||||
|
|
|
@ -103,6 +103,7 @@ TextureObject* getTexture0();
|
||||||
TextureObject* getTexture1();
|
TextureObject* getTexture1();
|
||||||
TextureObject* getBoundTexture();
|
TextureObject* getBoundTexture();
|
||||||
GLubyte _glGetActiveTexture();
|
GLubyte _glGetActiveTexture();
|
||||||
|
GLuint _glGetActiveClientTexture();
|
||||||
|
|
||||||
GLboolean isBlendingEnabled();
|
GLboolean isBlendingEnabled();
|
||||||
GLboolean _glIsMipmapComplete(const TextureObject* obj);
|
GLboolean _glIsMipmapComplete(const TextureObject* obj);
|
||||||
|
|
|
@ -519,6 +519,9 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) {
|
||||||
case GL_ACTIVE_TEXTURE:
|
case GL_ACTIVE_TEXTURE:
|
||||||
*params = GL_TEXTURE0 + _glGetActiveTexture();
|
*params = GL_TEXTURE0 + _glGetActiveTexture();
|
||||||
break;
|
break;
|
||||||
|
case GL_CLIENT_ACTIVE_TEXTURE:
|
||||||
|
*params = GL_TEXTURE0 + _glGetActiveClientTexture();
|
||||||
|
break;
|
||||||
case GL_COMPRESSED_TEXTURE_FORMATS_ARB: {
|
case GL_COMPRESSED_TEXTURE_FORMATS_ARB: {
|
||||||
GLuint i = 0;
|
GLuint i = 0;
|
||||||
for(; i < NUM_COMPRESSED_FORMATS; ++i) {
|
for(; i < NUM_COMPRESSED_FORMATS; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user