Commits

Alex Szpakowski  committed 7cc3202

Added love.graphics.getMaxImageSize

  • Participants
  • Parent commits af7e4b0

Comments (0)

Files changed (4)

File src/modules/graphics/opengl/Graphics.cpp

 	return ref * 255;
 }
 
+int Graphics::getMaxImageSize() const
+{
+	return gl.getMaxTextureSize();
+}
+
 Image *Graphics::newImage(love::image::ImageData *data)
 {
 	// Create the image.

File src/modules/graphics/opengl/Graphics.h

 	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.
 	 **/
 	Image *newImage(love::image::ImageData *data);

File src/modules/graphics/opengl/wrap_Graphics.cpp

 	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;
 	{ "getPointSize", w_getPointSize },
 	{ "getPointStyle", w_getPointStyle },
 	{ "getMaxPointSize", w_getMaxPointSize },
+	{ "getMaxImageSize", w_getMaxImageSize },
 	{ "newScreenshot", w_newScreenshot },
 	{ "setCanvas", w_setCanvas },
 	{ "setCanvases", w_setCanvases },

File src/modules/graphics/opengl/wrap_Graphics.h

 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);