mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Canvases can now be used in SpriteBatches, ParticleSystems, and Meshes (resolves issue #782).
Canvases and Images are now subclasses of the new Texture class. Added setTexture and getTexture methods for Meshes, ParticleSystems, and SpriteBatches (the old set/getImage methods are deprecated but not removed.) Canvas texture coordinates are no longer flipped.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#include "common/math.h"
|
||||
#include "common/StringMap.h"
|
||||
#include "graphics/Drawable.h"
|
||||
#include "Image.h"
|
||||
#include "Texture.h"
|
||||
#include "VertexBuffer.h"
|
||||
|
||||
// C++
|
||||
@@ -110,20 +110,20 @@ public:
|
||||
size_t getVertexMapCount() const;
|
||||
|
||||
/**
|
||||
* Sets the Image used when drawing the Mesh.
|
||||
* Sets the texture used when drawing the Mesh.
|
||||
**/
|
||||
void setImage(Image *img);
|
||||
void setTexture(Texture *texture);
|
||||
|
||||
/**
|
||||
* Disables any Image from being used when drawing the Mesh.
|
||||
* Disables any texture from being used when drawing the Mesh.
|
||||
**/
|
||||
void setImage();
|
||||
void setTexture();
|
||||
|
||||
/**
|
||||
* Gets the Image used when drawing the Mesh. May return null if no Image is
|
||||
* set.
|
||||
* Gets the texture used when drawing the Mesh. May return null if no
|
||||
* texture is set.
|
||||
**/
|
||||
Image *getImage() const;
|
||||
Texture *getTexture() const;
|
||||
|
||||
/**
|
||||
* Sets the draw mode used when drawing the Mesh.
|
||||
@@ -167,7 +167,7 @@ private:
|
||||
|
||||
DrawMode draw_mode;
|
||||
|
||||
Image *image;
|
||||
Texture *texture;
|
||||
|
||||
// Whether the per-vertex colors are used when drawing.
|
||||
bool colors_enabled;
|
||||
|
||||
Reference in New Issue
Block a user