From a9bf08d7c8d54204b76f91dab95052b737595bea Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 26 Jan 2021 01:19:33 +0200 Subject: [PATCH] Use glCreateTextures also for async loading Otherwise the texture won't be fully created when glTextureStorage2D is called. --- source/texture2d.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/texture2d.cpp b/source/texture2d.cpp index dac671fd..08383526 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -270,7 +270,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); } -- 2.45.2