Issues

Issue #124 resolved

Add a function to love.graphics that only clears all transformations of rendering.

Kosie van der Merwe
created an issue

Currently, love.graphics.clear() calls glClear(GL_COLOR_BUFFER_BIT) and glLoadIdentity().

This means users can't reset transformations(translate, scale and rotation) without also clearing the screen.

Suggested name: love.graphics.clearTransformations()

Though it could be shorter. Suggestions?

Comments (7)

  1. Boolsheet

    We should have a look at this again if thelinx gets love.event.clear. ;)

    Push/popping the state or reversing every transformation through the whole draw function just to retain the identity matrix seems not lövley at all to me.

    Let's take the glLoadIdentity out of l.g.clear and put it in a new separate thing like:
    love.graphics.resetCoordinates
    love.graphics.home
    love.graphics.startPosition

    Hm, if it changes l.g.clear it's probably something for 0.8.0.

  2. Robin Wellner

    I agree with Bart on this one. Pushing and popping seems to be the proper way to do that. Let's not introduce a function which does nothing new, especially not one with a confusing name.

    Linus' suggestion for love.event.clear() is different, because the workaround was kludgy.

  3. Jez Kabanov

    there are situations where you might wish to Push -> LoadIdentity -> do something and then Pop, without reversing every transform there is no way to reliably return to the initial state without LoadIdentity

  4. Log in to comment