Fix a number of bugs with texture bindings
This commit is contained in:
parent
3a1f7d24d8
commit
824b7a64ab
3
gl-api.h
3
gl-api.h
|
@ -209,7 +209,8 @@ GLuint _glKosVertexColor();
|
|||
GLubyte _glKosMaxTextureUnits();
|
||||
GLubyte _glKosEnabledTextureMatrix();
|
||||
|
||||
GL_TEXTURE_OBJECT *_glKosBoundMultiTexID();
|
||||
GL_TEXTURE_OBJECT *_glKosBoundMultiTexObject();
|
||||
GLuint _glKosActiveTextureBoundTexID();
|
||||
|
||||
inline void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex,
|
||||
pvr_vertex_t *src,
|
||||
|
|
|
@ -834,7 +834,7 @@ static GLuint _glKosArraysApplyClipping(GLfloat *uvsrc, GLuint uvstride, GLenum
|
|||
|
||||
static inline void _glKosArraysApplyMultiTexture(GLenum mode, GLuint count) {
|
||||
if(GL_KOS_VERTEX_PTR_MODE & GL_KOS_USE_TEXTURE1) {
|
||||
GL_TEXTURE_OBJECT* tex = _glKosBoundMultiTexID();
|
||||
GL_TEXTURE_OBJECT* tex = _glKosBoundMultiTexObject();
|
||||
if(tex) {
|
||||
_glKosPushMultiTexObject(tex,
|
||||
(pvr_vertex_t *)_glKosVertexBufPointer(),
|
||||
|
|
2
gl-cap.c
2
gl-cap.c
|
@ -200,7 +200,7 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) {
|
|||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_2D:
|
||||
*params = _glKosBoundTexID();
|
||||
*params = _glKosActiveTextureBoundTexID();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
15
gl-texture.c
15
gl-texture.c
|
@ -98,13 +98,22 @@ void _glKosCompileHdrTx() {
|
|||
_glKosCompileHdrT(GL_KOS_TEXTURE_UNIT[GL_TEXTURE0_ARB & 0xF]) : _glKosCompileHdr();
|
||||
}
|
||||
|
||||
GL_TEXTURE_OBJECT *_glKosBoundMultiTexID() {
|
||||
GL_TEXTURE_OBJECT *_glKosBoundMultiTexObject() {
|
||||
return GL_KOS_TEXTURE_UNIT[GL_TEXTURE1_ARB & 0xF];
|
||||
}
|
||||
|
||||
GLuint _glKosBoundMultiTexID() {
|
||||
return GL_KOS_TEXTURE_UNIT[GL_TEXTURE1_ARB & 0xF] ?
|
||||
GL_KOS_TEXTURE_UNIT[GL_TEXTURE1_ARB & 0xF]->index : 0;
|
||||
}
|
||||
|
||||
GLuint _glKosBoundTexID() {
|
||||
return GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE] ?
|
||||
GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->index : 0;
|
||||
return GL_KOS_TEXTURE_UNIT[GL_TEXTURE0_ARB & 0xF] ?
|
||||
GL_KOS_TEXTURE_UNIT[GL_TEXTURE0_ARB & 0xF]->index : 0;
|
||||
}
|
||||
|
||||
GLuint _glKosActiveTextureBoundTexID() {
|
||||
return (GL_KOS_ACTIVE_TEXTURE) ? _glKosBoundMultiTexID() : _glKosBoundTexID();
|
||||
}
|
||||
|
||||
GLubyte _glKosMaxTextureUnits() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user