Add love.graphics.copyTextureToBuffer and copyBufferToTexture.

This commit is contained in:
Alex Szpakowski
2021-12-28 12:46:56 -04:00
parent d7bfc2ebcb
commit 52101b2563
11 changed files with 344 additions and 4 deletions
+1 -1
View File
@@ -390,13 +390,13 @@ int w_Texture_newImageData(lua_State *L)
int slice = 0;
int mipmap = 0;
Rect rect = {0, 0, t->getPixelWidth(), t->getPixelHeight()};
if (t->getTextureType() != TEXTURE_2D)
slice = (int) luaL_checkinteger(L, 2) - 1;
mipmap = (int) luaL_optinteger(L, 3, 1) - 1;
Rect rect = {0, 0, t->getPixelWidth(mipmap), t->getPixelHeight(mipmap)};
if (!lua_isnoneornil(L, 4))
{
rect.x = (int) luaL_checkinteger(L, 4);