Added love.graphics.getRendererInfo(infotype). Useful for creating more informative error reports and advanced debugging.

Returned string can be highly system-dependent, so don't rely on its output!

infotype can be "name", "version", "vendor", or "device"
This commit is contained in:
Alex Szpakowski
2013-05-05 16:47:42 -03:00
parent 08d6e658c1
commit 63404f7097
11 changed files with 112 additions and 32 deletions
+20
View File
@@ -109,6 +109,16 @@ bool Graphics::getConstant(Support in, const char *&out)
return support.find(in, out);
}
bool Graphics::getConstant(const char *in, RendererInfo &out)
{
return rendererInfo.find(in, out);
}
bool Graphics::getConstant(RendererInfo in, const char *&out)
{
return rendererInfo.find(in, out);
}
StringMap<Graphics::DrawMode, Graphics::DRAW_MAX_ENUM>::Entry Graphics::drawModeEntries[] =
{
{ "line", Graphics::DRAW_LINE },
@@ -192,5 +202,15 @@ StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM>::Entry Graphics::suppor
StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM> Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries));
StringMap<Graphics::RendererInfo, Graphics::RENDERER_INFO_MAX_ENUM>::Entry Graphics::rendererInfoEntries[] =
{
{ "name", Graphics::RENDERER_INFO_NAME },
{ "version", Graphics::RENDERER_INFO_VERSION },
{ "vendor", Graphics::RENDERER_INFO_VENDOR },
{ "device", Graphics::RENDERER_INFO_DEVICE },
};
StringMap<Graphics::RendererInfo, Graphics::RENDERER_INFO_MAX_ENUM> Graphics::rendererInfo(Graphics::rendererInfoEntries, sizeof(Graphics::rendererInfoEntries));
} // graphics
} // love