From fca3d4a8418d3208d9b51bca9b44290260467d56 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Tue, 11 Apr 2017 19:06:51 -0300 Subject: [PATCH] Improved the error message when a Canvas with the readable field explicitly set is not supported. --HG-- branch : minor --- src/modules/graphics/opengl/Canvas.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/opengl/Canvas.cpp b/src/modules/graphics/opengl/Canvas.cpp index 1af0fa968..48d9f6894 100644 --- a/src/modules/graphics/opengl/Canvas.cpp +++ b/src/modules/graphics/opengl/Canvas.cpp @@ -194,8 +194,11 @@ bool Canvas::loadVolatile() if (!Canvas::isFormatSupported(format, readable)) { const char *fstr = "rgba8"; + const char *readablestr = ""; + if (readable != !isPixelFormatDepthStencil(format)) + readablestr = readable ? " readable" : " non-readable"; love::getConstant(Canvas::getSizedFormat(format), fstr); - throw love::Exception("The %s canvas format is not supported by your OpenGL drivers.", fstr); + throw love::Exception("The %s%s canvas format is not supported by your OpenGL drivers.", fstr, readablestr); } if (requestedSamples > 1 && texType != TEXTURE_2D)