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
@@ -843,11 +843,11 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
Color curcolor = gl.getColor();
glPushMatrix();
static Matrix t;
t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
glMultMatrixf((const GLfloat *)t.getElements());
OpenGL::TempTransform transform(gl);
transform.get() *= t;
const Vertex *textureVerts = texture->getVertices();
Vertex *pVerts = particleVerts;
@@ -901,8 +901,6 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
texture->postdraw();
glPopMatrix();
gl.setColor(curcolor);
}