mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Added love.graphics.getMaxImageSize
This commit is contained in:
@@ -394,6 +394,11 @@ unsigned char Graphics::getAlphaTestRef()
|
||||
return ref * 255;
|
||||
}
|
||||
|
||||
int Graphics::getMaxImageSize() const
|
||||
{
|
||||
return gl.getMaxTextureSize();
|
||||
}
|
||||
|
||||
Image *Graphics::newImage(love::image::ImageData *data)
|
||||
{
|
||||
// Create the image.
|
||||
|
||||
@@ -216,6 +216,12 @@ public:
|
||||
*/
|
||||
unsigned char getAlphaTestRef();
|
||||
|
||||
/**
|
||||
* Gets the maximum supported width or height of Images and Canvases on this
|
||||
* system.
|
||||
**/
|
||||
int getMaxImageSize() const;
|
||||
|
||||
/**
|
||||
* Creates an Image object with padding and/or optimization.
|
||||
**/
|
||||
|
||||
@@ -175,6 +175,12 @@ int w_getAlphaTest(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_getMaxImageSize(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, instance->getMaxImageSize());
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_newImage(lua_State *L)
|
||||
{
|
||||
love::image::ImageData *data = 0;
|
||||
@@ -1544,6 +1550,7 @@ static const luaL_Reg functions[] =
|
||||
{ "getPointSize", w_getPointSize },
|
||||
{ "getPointStyle", w_getPointStyle },
|
||||
{ "getMaxPointSize", w_getMaxPointSize },
|
||||
{ "getMaxImageSize", w_getMaxImageSize },
|
||||
{ "newScreenshot", w_newScreenshot },
|
||||
{ "setCanvas", w_setCanvas },
|
||||
{ "setCanvases", w_setCanvases },
|
||||
|
||||
@@ -50,6 +50,7 @@ int w_getScissor(lua_State *L);
|
||||
int w_setStencil(lua_State *L);
|
||||
int w_setAlphaTest(lua_State *L);
|
||||
int w_getAlphaTest(lua_State *L);
|
||||
int w_getMaxImageSize(lua_State *L);
|
||||
int w_newImage(lua_State *L);
|
||||
int w_newGeometry(lua_State *L);
|
||||
int w_newQuad(lua_State *L);
|
||||
|
||||
Reference in New Issue
Block a user