X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=aec1bc92da90b9b84f8882991f9b6bf4a24d84c2;hb=47abe7c9e1633ca65f910a4db340724117a6f6e5;hp=a23e57c72615ed632e67c863e9ed37539842dcd2;hpb=9d696772b2194b67d8e3e4da11169900eab58c0d;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index a23e57c7..aec1bc92 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -178,13 +178,13 @@ void Texture::set_compare_func(Predicate f) void Texture::bind_to(unsigned i) const { - if(!id) - manager->load_resource(*this); - TexUnit &unit = TexUnit::get_unit(i); const Texture *cur = unit.get_texture(); if(unit.set_texture(this)) { + if(manager) + manager->resource_used(*this); + unit.bind(); if(cur && cur->target!=target) glDisable(cur->target);