Improved error messages when canvas/image creation fails because the size is too big for the system

This commit is contained in:
Alex Szpakowski
2013-06-09 18:24:19 -03:00
parent 0a36c41ba0
commit d286f78ec7
5 changed files with 50 additions and 8 deletions
+4
View File
@@ -704,6 +704,10 @@ Image::Wrap Canvas::getWrap() const
bool Canvas::loadVolatile()
{
// glTexImage2D is guaranteed to error in this case.
if (width > gl.getMaxTextureSize() || height > gl.getMaxTextureSize())
return false;
status = strategy->createFBO(fbo, img, width, height, texture_type);
if (status != GL_FRAMEBUFFER_COMPLETE)
return false;