mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-19 03:05:29 +02:00
Improve robustness of GL object handling
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user