BACKENDS: OPENGL: Allow callers to check for texture setSize result

This commit is contained in:
Le Philousophe 2022-10-09 17:20:33 +02:00
parent a205c79a98
commit 3a7f2aa1ee
4 changed files with 16 additions and 7 deletions

View file

@ -225,8 +225,10 @@ void TextureTarget::create() {
_needUpdate = true;
}
void TextureTarget::setSize(uint width, uint height) {
_texture->setSize(width, height);
bool TextureTarget::setSize(uint width, uint height) {
if (!_texture->setSize(width, height)) {
return false;
}
const uint texWidth = _texture->getWidth();
const uint texHeight = _texture->getHeight();
@ -263,6 +265,7 @@ void TextureTarget::setSize(uint width, uint height) {
applyViewport();
applyProjectionMatrix();
}
return true;
}
#endif // !USE_FORCED_GLES