backported changes from museum project
[ld37_one_room] / src / texture.cc
index ff4d1b5..18dd28f 100644 (file)
@@ -38,6 +38,7 @@ void bind_texture(Texture *tex, int tunit)
        } else {
                glActiveTexture(GL_TEXTURE0 + tunit);
                glBindTexture(cur_target[tunit], 0);
+               glDisable(cur_target[tunit]);
                assert(glGetError() == GL_NO_ERROR);
                glActiveTexture(GL_TEXTURE0);
        }
@@ -139,6 +140,7 @@ TextureType Texture::get_type() const
 void Texture::bind(int tex_unit) const
 {
        glActiveTexture(GL_TEXTURE0 + tex_unit);
+       glEnable(target);
        glBindTexture(target, id);
        assert(glGetError() == GL_NO_ERROR);
        glActiveTexture(GL_TEXTURE0);