mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
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:
@@ -526,12 +526,11 @@ void Image::uploadDefaultTexture()
|
||||
|
||||
void Image::drawv(const Matrix &t, const Vertex *v)
|
||||
{
|
||||
OpenGL::TempTransform transform(gl);
|
||||
transform.get() *= t;
|
||||
|
||||
predraw();
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
glMultMatrixf((const GLfloat *)t.getElements());
|
||||
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
@@ -544,8 +543,6 @@ void Image::drawv(const Matrix &t, const Vertex *v)
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
postdraw();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user