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:
Alex Szpakowski
2017-02-20 14:58:13 -04:00
parent d70fe5cb89
commit 73fd45558b
91 changed files with 3160 additions and 2003 deletions
+8 -10
View File
@@ -23,7 +23,7 @@
// LOVE
#include "common/math.h"
#include "Drawable.h"
#include "Texture.h"
#include "Image.h"
#include "vertex.h"
#include "video/VideoStream.h"
#include "audio/Source.h"
@@ -33,13 +33,15 @@ namespace love
namespace graphics
{
class Graphics;
class Video : public Drawable
{
public:
static love::Type type;
Video(love::video::VideoStream *stream, float pixeldensity = 1.0f);
Video(Graphics *gfx, love::video::VideoStream *stream, float pixeldensity = 1.0f);
virtual ~Video();
// Drawable
@@ -56,12 +58,12 @@ public:
int getPixelWidth() const;
int getPixelHeight() const;
virtual void setFilter(const Texture::Filter &f) = 0;
void setFilter(const Texture::Filter &f);
const Texture::Filter &getFilter() const;
protected:
private:
virtual void uploadFrame(const love::video::VideoStream::Frame *frame) = 0;
void update();
StrongRef<love::video::VideoStream> stream;
@@ -72,11 +74,7 @@ protected:
Vertex vertices[4];
ptrdiff_t textureHandles[3];
private:
void update();
StrongRef<Image> images[3];
StrongRef<love::audio::Source> source;
}; // Video