Closed pmer closed 7 years ago
I wasn't sure what self.__workspace
was used for, specifically, so I just made clear()
clear the self.__texture
. Clearing either the texture or the workspace had the same effect as right now I think they refer to the same SDL2 texture object.
Just changed it to clear self.__workspace
to be consistent with FrameManager.prepare()
.
Actually this is clearing the screen too often. We need to only clear the screen when we know that AreaManager is going to redraw it again.
Well, I didn't want to have to do this, but looks like AreaManager will be the one to ask for the screen to be cleared. It's the manager that knows when a new frame is going to be drawn for any particular tick. ("par-tick-ular tick?")
This removes the FrameManager tick that I described in the PR description above.
AreaManager._tick()
is the first function called every frame in Driftwood's drawing process. If there's been a refocusing then AreaManager asks FrameManager to prepare a new frame. This new frame is black. Otherwise, the old frame is used and is not cleared, leaving garbage on-screen if the current draw does not overwrite every pixel.We need to clear the frame really early in the drawing process, basically before
AreaManager.__build_frame()
is called since that's where we startcopy()
ing stuff.This commit adds a FrameManager tick that is called before AreaManager's tick. All it does is clear the screen.
Fixes #75