Added stack type enums to love.graphics.push (resolves issue #906.) Current enums are "transform" and "all". "transform" is the default (for compatibility.) When love.graphics.push("all") is used, love.graphics.pop() will restore all love.graphics module state to what it was when push was called.

Updated the graphics code to use a custom matrix stack rather than OpenGL1's APIs.
This commit is contained in:
Alex Szpakowski
2014-08-06 22:25:29 -03:00
parent 028108ea64
commit afc505e183
18 changed files with 726 additions and 415 deletions
+3 -6
View File
@@ -271,11 +271,10 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float
return;
static Matrix t;
glPushMatrix();
t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
glMultMatrixf((const GLfloat *)t.getElements());
OpenGL::TempTransform transform(gl);
transform.get() *= t;
texture->predraw();
@@ -314,8 +313,6 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float
}
texture->postdraw();
glPopMatrix();
}
void SpriteBatch::addv(const Vertex *v, int index)