From f43b24da6b3ec83578ce3e94bd850880f1a85aeb Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 11 Dec 2004 03:44:40 +0000 Subject: [PATCH] added code to make sure we've got the right texture unit selected. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@627 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_backend.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/gl/gl_backend.c b/engine/gl/gl_backend.c index 5bd347128..9676d8ca8 100644 --- a/engine/gl/gl_backend.c +++ b/engine/gl/gl_backend.c @@ -30,6 +30,15 @@ void GL_SelectTexture (GLenum target) qglSelectTextureSGIS(target); } +void GL_CheckTMUIs0(void) +{ + if (gl_state.currenttmu != 0) + { + Con_Printf("TMU is not 0\n"); + GL_SelectTexture(mtexid0); + } +} + void GL_MBind( GLenum target, int texnum ) { GL_SelectTexture( target ); @@ -45,6 +54,7 @@ void GL_Bind (int texnum) { if (gl_state.currenttextures[gl_state.currenttmu] == texnum) return; + gl_state.currenttextures[gl_state.currenttmu] = texnum; bindTexFunc (GL_TEXTURE_2D, texnum);