Add love.graphics.isSupported

Replaces love.graphics.hasPixelEffects and also does framebuffer support.

Also fixed 4 compiler warnings.
This commit is contained in:
Bart van Strien
2011-07-24 15:21:52 +02:00
parent 7b6836466e
commit bd2b190a19
7 changed files with 79 additions and 8 deletions
+18
View File
@@ -88,6 +88,16 @@ namespace graphics
return pointStyles.find(in, out);
}
bool Graphics::getConstant(const char * in, Support & out)
{
return support.find(in, out);
}
bool Graphics::getConstant(Support in, const char *& out)
{
return support.find(in, out);
}
StringMap<Graphics::DrawMode, Graphics::DRAW_MAX_ENUM>::Entry Graphics::drawModeEntries[] =
{
{ "line", Graphics::DRAW_LINE },
@@ -139,5 +149,13 @@ namespace graphics
StringMap<Graphics::PointStyle, Graphics::POINT_MAX_ENUM> Graphics::pointStyles(Graphics::pointStyleEntries, sizeof(Graphics::pointStyleEntries));
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM>::Entry Graphics::supportEntries[] =
{
{ "framebuffers", Graphics::SUPPORT_FRAMEBUFFERS },
{ "pixeleffects", Graphics::SUPPORT_PIXELEFFECTS }
};
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM> Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries));
} // graphics
} // love