From 1de26ea1fac4399908c96f6f54d9ed5bdd04986e Mon Sep 17 00:00:00 2001 From: Alexander Szpakowski Date: Wed, 2 Jan 2013 05:55:50 -0400 Subject: [PATCH] Added "mipmap" love.graphics.isSupported string --- src/modules/graphics/Graphics.cpp | 1 + src/modules/graphics/Graphics.h | 1 + src/modules/graphics/opengl/wrap_Graphics.cpp | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/Graphics.cpp b/src/modules/graphics/Graphics.cpp index cd8403f0e..58019c017 100644 --- a/src/modules/graphics/Graphics.cpp +++ b/src/modules/graphics/Graphics.cpp @@ -160,6 +160,7 @@ StringMap::Entry Graphics::suppor { "pixeleffect", Graphics::SUPPORT_PIXELEFFECT }, { "npot", Graphics::SUPPORT_NPOT }, { "subtractive", Graphics::SUPPORT_SUBTRACTIVE }, + { "mipmap", Graphics::SUPPORT_MIPMAP }, }; StringMap Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries)); diff --git a/src/modules/graphics/Graphics.h b/src/modules/graphics/Graphics.h index ed0da81a2..4926aa90a 100644 --- a/src/modules/graphics/Graphics.h +++ b/src/modules/graphics/Graphics.h @@ -89,6 +89,7 @@ public: SUPPORT_PIXELEFFECT, SUPPORT_NPOT, SUPPORT_SUBTRACTIVE, + SUPPORT_MIPMAP, SUPPORT_MAX_ENUM }; diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index cce9a0be5..0fe1a9140 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -853,7 +853,12 @@ int w_isSupported(lua_State *L) supported = false; break; case Graphics::SUPPORT_SUBTRACTIVE: - supported = (GLEE_VERSION_1_4 || GLEE_ARB_imaging) || (GLEE_EXT_blend_minmax && GLEE_EXT_blend_subtract); + if (!((GLEE_VERSION_1_4 || GLEE_ARB_imaging) || (GLEE_EXT_blend_minmax && GLEE_EXT_blend_subtract))) + supported = false; + break; + case Graphics::SUPPORT_MIPMAP: + if (!Image::hasMipmapSupport()) + supported = false; break; default: supported = false;