X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture2d.cpp;h=6e7d97202f341cc12e2a76d9e94b92f840c3ff94;hb=412996297a287c9e97a7207458877c0ab07cc8b6;hp=d2addda70fc4d6e35de11e2df472bf98b89d9940;hpb=efb45a6851563cdb8077b6aad3ab92d4006d8790;p=libs%2Fgl.git diff --git a/source/core/texture2d.cpp b/source/core/texture2d.cpp index d2addda7..6e7d9720 100644 --- a/source/core/texture2d.cpp +++ b/source/core/texture2d.cpp @@ -230,6 +230,12 @@ void Texture2D::Loader::init() void Texture2D::Loader::raw_data(const string &data) { + if(obj.manager) + { + obj.set_manager(0); + if(!obj.id) + obj.generate_id(); + } obj.image(0, data.data()); } @@ -290,12 +296,7 @@ bool Texture2D::AsyncLoader::process() } if(!texture.id) - { - if(ARB_direct_state_access) - glCreateTextures(texture.target, 1, &texture.id); - else - glGenTextures(1, &texture.id); - } + texture.generate_id(); texture.image(image, 0, true); }