1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Improve robustness of GL object handling

This commit is contained in:
sfan5 2025-03-12 19:46:12 +01:00
parent 077828d0d9
commit 4b85062caf
4 changed files with 23 additions and 2 deletions

View file

@ -99,6 +99,11 @@ public:
}
GL.GenTextures(1, &TextureName);
TEST_GL_ERROR(Driver);
if (!TextureName) {
os::Printer::log("COpenGLCoreTexture: texture not created", ELL_ERROR);
return;
}
const COpenGLCoreTexture *prevTexture = Driver->getCacheHandler()->getTextureCache().get(0);
Driver->getCacheHandler()->getTextureCache().set(0, this);
@ -195,6 +200,11 @@ public:
#endif
GL.GenTextures(1, &TextureName);
TEST_GL_ERROR(Driver);
if (!TextureName) {
os::Printer::log("COpenGLCoreTexture: texture not created", ELL_ERROR);
return;
}
const COpenGLCoreTexture *prevTexture = Driver->getCacheHandler()->getTextureCache().get(0);
Driver->getCacheHandler()->getTextureCache().set(0, this);