]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texunit.cpp
Bind textures in the modern way when shaders are used
[libs/gl.git] / source / texunit.cpp
index 31c90777aad10eccd5a4e9d110de2a0846809f26..9277c27704ebd8347c3c6a782fc1b6ff05fc8658 100644 (file)
@@ -16,13 +16,16 @@ TexUnit *TexUnit::cur_unit = 0;
 
 TexUnit::TexUnit():
        legacy(false),
-       texture(0)
+       texture(0),
+       tex_legacy(false)
 { }
 
-bool TexUnit::set_texture(const Texture *tex)
+bool TexUnit::set_texture(const Texture *tex, bool lgc)
 {
-       bool result = (tex!=texture);
+       lgc = (lgc && legacy && tex);
+       bool result = (tex!=texture || lgc!=tex_legacy);
        texture = tex;
+       tex_legacy = lgc;
        return result;
 }