mirror of
https://github.com/love2d/love.git
synced 2026-08-15 07:41:11 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user