mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
Move some Canvas code to Texture, devirtualize Texture::draw.
This commit is contained in:
@@ -126,6 +126,7 @@ class Texture : public Drawable, public Resource
|
||||
public:
|
||||
|
||||
static love::Type type;
|
||||
static int textureCount;
|
||||
|
||||
enum MipmapsType
|
||||
{
|
||||
@@ -175,16 +176,20 @@ public:
|
||||
/**
|
||||
* Draws the texture using the specified transformation with a Quad applied.
|
||||
**/
|
||||
virtual void draw(Graphics *gfx, Quad *quad, const Matrix4 &m);
|
||||
void draw(Graphics *gfx, Quad *quad, const Matrix4 &m);
|
||||
|
||||
void drawLayer(Graphics *gfx, int layer, const Matrix4 &m);
|
||||
virtual void drawLayer(Graphics *gfx, int layer, Quad *quad, const Matrix4 &m);
|
||||
void drawLayer(Graphics *gfx, int layer, Quad *quad, const Matrix4 &m);
|
||||
|
||||
TextureType getTextureType() const;
|
||||
PixelFormat getPixelFormat() const;
|
||||
|
||||
bool isRenderTarget() const;
|
||||
bool isReadable() const;
|
||||
|
||||
bool isCompressed() const;
|
||||
bool isFormatLinear() const;
|
||||
|
||||
bool isValidSlice(int slice) const;
|
||||
|
||||
int getWidth(int mip = 0) const;
|
||||
@@ -201,6 +206,8 @@ public:
|
||||
virtual void setSamplerState(const SamplerState &s);
|
||||
const SamplerState &getSamplerState() const;
|
||||
|
||||
virtual void generateMipmaps() = 0;
|
||||
|
||||
Quad *getQuad() const;
|
||||
|
||||
static int getTotalMipmapCount(int w, int h);
|
||||
@@ -220,8 +227,11 @@ protected:
|
||||
TextureType texType;
|
||||
|
||||
PixelFormat format;
|
||||
bool renderTarget;
|
||||
bool readable;
|
||||
|
||||
bool sRGB;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user