mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Add love.graphics.getPixelDensity, gets the pixel density scale of the screen (matches other APIs).
--HG-- branch : minor
This commit is contained in:
@@ -195,6 +195,12 @@ int w_getPixelDimensions(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_getPixelDensity(lua_State *L)
|
||||
{
|
||||
lua_pushnumber(L, instance()->getScreenPixelDensity());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_setCanvas(lua_State *L)
|
||||
{
|
||||
// Disable stencil writes.
|
||||
@@ -2163,6 +2169,7 @@ static const luaL_Reg functions[] =
|
||||
{ "getPixelWidth", w_getPixelWidth },
|
||||
{ "getPixelHeight", w_getPixelHeight },
|
||||
{ "getPixelDimensions", w_getPixelDimensions },
|
||||
{ "getPixelDensity", w_getPixelDimensions },
|
||||
|
||||
{ "setScissor", w_setScissor },
|
||||
{ "intersectScissor", w_intersectScissor },
|
||||
|
||||
Reference in New Issue
Block a user