Added love.graphics.getMaxImageSize

This commit is contained in:
Alex Szpakowski
2013-07-17 00:35:25 -03:00
parent 5a3055dd3b
commit 57aa632841
4 changed files with 19 additions and 0 deletions
+5
View File
@@ -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.
+6
View File
@@ -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);