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; }