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
+16 -10
View File
@@ -25,9 +25,9 @@
// LOVE
#include "graphics/Color.h"
#include "graphics/Image.h"
#include "graphics/Texture.h"
// STL
// C++
#include <vector>
// The last argument to AttribPointer takes a buffer offset casted to a pointer.
@@ -93,6 +93,12 @@ public:
**/
void deInitContext();
/**
* Set up necessary state (LOVE-provided shader uniforms, etc.) for drawing.
* This *MUST* be called directly before OpenGL drawing functions.
**/
void prepareDraw();
/**
* Sets the current constant color.
**/
@@ -163,25 +169,25 @@ public:
void deleteTexture(GLuint texture);
/**
* Sets the image filter mode for the currently bound texture.
* Sets the texture filter mode for the currently bound texture.
* Returns the actual amount of anisotropic filtering set.
**/
float setTextureFilter(const graphics::Image::Filter &f);
float setTextureFilter(graphics::Texture::Filter &f);
/**
* Returns the image filter mode for the currently bound texture.
* Returns the texture filter mode for the currently bound texture.
**/
graphics::Image::Filter getTextureFilter();
graphics::Texture::Filter getTextureFilter();
/**
* Sets the image wrap mode for the currently bound texture.
* Sets the texture wrap mode for the currently bound texture.
**/
void setTextureWrap(const graphics::Image::Wrap &w);
void setTextureWrap(const graphics::Texture::Wrap &w);
/**
* Returns the image wrap mode for the currently bound texture.
* Returns the texture wrap mode for the currently bound texture.
**/
graphics::Image::Wrap getTextureWrap();
graphics::Texture::Wrap getTextureWrap();
/**
* Returns the maximum supported width or height of a texture.