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:
parent
077828d0d9
commit
4b85062caf
4 changed files with 23 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue