From fc6a9df304ec059e62adb0d8817a3ec31ad6a8f7 Mon Sep 17 00:00:00 2001 From: Bill Meltsner Date: Sat, 3 Mar 2012 20:33:55 -0500 Subject: [PATCH] =?UTF-8?q?Report=20lack=20of=20support=20for=20the=20subt?= =?UTF-8?q?ract=20blendmode=20through=20the=20Blue=20Screen=20of=20LO?= =?UTF-8?q?=CC=88VE=20instead=20of=20stderr=20spam.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/graphics/opengl/Graphics.cpp | 2 +- src/modules/graphics/opengl/wrap_Graphics.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 98629899e..1530a77a2 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -525,7 +525,7 @@ namespace opengl } } else { if (mode == BLEND_SUBTRACTIVE) { - std::cerr << "This graphics card does not support the subtract blend mode!" << std::endl; + throw Exception("This graphics card does not support the subtract blend mode!"); } // GL_FUNC_ADD is the default even without access to glBlendEquation, so that'll still work. } diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 8ece980f8..04b7076b5 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -532,7 +532,14 @@ namespace opengl if (!Graphics::getConstant(str, mode)) return luaL_error(L, "Invalid blend mode: %s", str); - instance->setBlendMode(mode); + try + { + instance->setBlendMode(mode); + } + catch (love::Exception &e) + { + return luaL_error(L, e.what()); + } return 0; }