X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=47e0c7434d0ef56c7fbf892b0ee45a31f4552710;hb=344dd6a52b55d847f3346e94ec266a8864764b9d;hp=dac671fdfa52fcae265d088b2cb9d14f918a9a56;hpb=ffe1debbd757d20f7250fd8572c2c46cd901f559;p=libs%2Fgl.git diff --git a/source/texture2d.cpp b/source/texture2d.cpp index dac671fd..47e0c743 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -188,6 +188,7 @@ void Texture2D::unload() { glDeleteTextures(1, &id); id = 0; + allocated = 0; // TODO check which params actually need refreshing dirty_params = -1; } @@ -270,7 +271,12 @@ bool Texture2D::AsyncLoader::process() } if(!texture.id) - glGenTextures(1, &texture.id); + { + if(ARB_direct_state_access) + glCreateTextures(texture.target, 1, &texture.id); + else + glGenTextures(1, &texture.id); + } texture.image(image, srgb_conversion, true); }