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:
Alex Szpakowski
2014-01-03 17:07:12 -04:00
parent 1d3f6e967d
commit aa69a695d3
43 changed files with 1011 additions and 852 deletions
+5 -5
View File
@@ -42,7 +42,7 @@ namespace opengl
{
// Forward declarations.
class Image;
class Texture;
class VertexBuffer;
class VertexIndex;
@@ -58,7 +58,7 @@ public:
USAGE_MAX_ENUM
};
SpriteBatch(Image *image, int size, int usage);
SpriteBatch(Texture *texture, int size, int usage);
virtual ~SpriteBatch();
int add(float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky, int index = -1);
@@ -68,8 +68,8 @@ public:
void *lock();
void unlock();
void setImage(Image *newimage);
Image *getImage();
void setTexture(Texture *newtexture);
Texture *getTexture();
/**
* Set the current color for this SpriteBatch. The sprites added
@@ -127,7 +127,7 @@ private:
*/
void setColorv(Vertex *v, const Color &color);
Image *image;
Texture *texture;
// Max number of sprites in the batch.
int size;