mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Implement Array, Cubemap, and Volume texture types (issue #1111).
- Add love.graphics.newArrayImage, newCubeImage, and newVolumeImage.
- Add love.graphics.newCanvas(w, h, layers) and newCanvas(w, h, layers, settings). Add ‘type’ field to the settings table of newCanvas.
- Add new love.graphics.setCanvas variants: setCanvas(canvas, slice), and setCanvas(canvastable) where canvastable is in the format: {{canvas1, layer=2}, {canvas2, face=5}}
- Add Texture:getTextureType, getDepth, getLayerCount, getMipmapCount, and getFormat.
- Remove Image:getData and Image:refresh.
- Add Image:replacePixels(imagedata [, slice] [, mipmap]).
- Update Canvas:newImageData to accept a slice argument.
- Add love.image.newCubeFaces(imagedata).
--HG--
branch : minor
This commit is contained in:
@@ -122,12 +122,23 @@ int w_isCompressed(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_newCubeFaces(lua_State *L)
|
||||
{
|
||||
ImageData *id = luax_checkimagedata(L, 1);
|
||||
std::vector<StrongRef<ImageData>> faces;
|
||||
luax_catchexcept(L, [&](){ faces = instance()->newCubeFaces(id); });
|
||||
for (auto face : faces)
|
||||
luax_pushtype(L, face);
|
||||
return (int) faces.size();
|
||||
}
|
||||
|
||||
// List of functions to wrap.
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
{ "newImageData", w_newImageData },
|
||||
{ "newCompressedData", w_newCompressedData },
|
||||
{ "isCompressed", w_isCompressed },
|
||||
{ "newCubeFaces", w_newCubeFaces },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user