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) {
|
||||
TRACE();
|
||||
|
||||
|
|
|
@ -164,6 +164,9 @@ void APIENTRY glEnd() {
|
|||
glColorPointer(4, GL_FLOAT, 0, COLOURS.data);
|
||||
glNormalPointer(GL_FLOAT, 0, NORMALS.data);
|
||||
|
||||
GLint activeTexture;
|
||||
glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE, &activeTexture);
|
||||
|
||||
glClientActiveTextureARB(GL_TEXTURE0);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, UV_COORDS.data);
|
||||
|
@ -174,6 +177,8 @@ void APIENTRY glEnd() {
|
|||
|
||||
glDrawArrays(ACTIVE_POLYGON_MODE, 0, VERTICES.size / 3);
|
||||
|
||||
glClientActiveTextureARB((GLuint) activeTexture);
|
||||
|
||||
aligned_vector_clear(&VERTICES);
|
||||
aligned_vector_clear(&COLOURS);
|
||||
aligned_vector_clear(&UV_COORDS);
|
||||
|
|
|
@ -103,6 +103,7 @@ TextureObject* getTexture0();
|
|||
TextureObject* getTexture1();
|
||||
TextureObject* getBoundTexture();
|
||||
GLubyte _glGetActiveTexture();
|
||||
GLuint _glGetActiveClientTexture();
|
||||
|
||||
GLboolean isBlendingEnabled();
|
||||
GLboolean _glIsMipmapComplete(const TextureObject* obj);
|
||||
|
|
|
@ -519,6 +519,9 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) {
|
|||
case GL_ACTIVE_TEXTURE:
|
||||
*params = GL_TEXTURE0 + _glGetActiveTexture();
|
||||
break;
|
||||
case GL_CLIENT_ACTIVE_TEXTURE:
|
||||
*params = GL_TEXTURE0 + _glGetActiveClientTexture();
|
||||
break;
|
||||
case GL_COMPRESSED_TEXTURE_FORMATS_ARB: {
|
||||
GLuint i = 0;
|
||||
for(; i < NUM_COMPRESSED_FORMATS; ++i) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user