Index: code/graphics/gropenglstate.cpp
===================================================================
--- code/graphics/gropenglstate.cpp	(revision 11208)
+++ code/graphics/gropenglstate.cpp	(working copy)
@@ -179,10 +179,14 @@
 void opengl_texture_state::SetTarget(GLenum tex_target)
 {
 	if (units[active_texture_unit].texture_target != tex_target) {
+		GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - before Disable()");
 		Disable();
+		GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - after Disable()");
 
 		if (units[active_texture_unit].texture_id) {
+			GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - before glBindTexture()");
 			glBindTexture(units[active_texture_unit].texture_target, 0);
+			GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - after glBindTexture()");
 			units[active_texture_unit].texture_id = 0;
 		}
 
@@ -213,12 +217,16 @@
 	}
 
 	if ( !shader_mode && (active_texture_unit < (uint)GL_supported_texture_units) ) {
+		GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - before glEnable()");
 		glEnable( units[active_texture_unit].texture_target );
+		GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - after glEnable()");
 		units[active_texture_unit].enabled = GL_TRUE;
 	}
 
 	if (units[active_texture_unit].texture_id != tex_id) {
+		GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - before glBindTexture()");
 		glBindTexture(units[active_texture_unit].texture_target, tex_id);
+		GL_CHECK_FOR_ERRORS("opengl_texture_state::Enable() - after glBindTexture()");
 		units[active_texture_unit].texture_id = tex_id;
 	}
 
Index: code/graphics/gropengltexture.cpp
===================================================================
--- code/graphics/gropengltexture.cpp	(revision 11208)
+++ code/graphics/gropengltexture.cpp	(working copy)
@@ -1060,8 +1060,11 @@
 		*u_scale = t->u_scale;
 		*v_scale = t->v_scale;
 
+		GL_CHECK_FOR_ERRORS("tcache_set_internal() - before SetTarget()");
 		GL_state.Texture.SetTarget(t->texture_target);
+		GL_CHECK_FOR_ERRORS("tcache_set_internal() - between SetTarget() and Enable()");
 		GL_state.Texture.Enable(t->texture_id);
+		GL_CHECK_FOR_ERRORS("tcache_set_internal() - after Enable()");
 
 		if ( (t->wrap_mode != GL_texture_addressing) && (bitmap_type != TCACHE_TYPE_AABITMAP)
 			&& (bitmap_type != TCACHE_TYPE_INTERFACE) && (bitmap_type != TCACHE_TYPE_CUBEMAP) )
