Page 1 of 1

[BUG] Graphics don't update properly

Posted: Mon Dec 05, 2011 10:05 am
by T-Bone
While this is probably a known bug, I've seen some games work so I guess it works in some situations but not in others, so I thought it might be a good idea to make a thread about it.

I run this very simple code (which will eventually be a totally awesome game).
http://dl.dropbox.com/u/7572962/MILF.love

Basically what it does is that is has a state system, and one state draws something (green background with a picture that can be clicked to go to the next state) and the other state draws two pictures and a blue background.

What happens is that when you go to the next state, the green background is kept and the pictures don't show correctly.
Image

However, if you somehow update the graphics, by for example changing the orientation of the phone to portrait and back to landscape, it looks fine. Any workaround? Or is this something that is worked on?

I'm running today's love-android on CM7.1 on a HTC Desire.

Also, by the way, any way to force landscape yet?

Re: [BUG] Graphics don't update properly

Posted: Tue Dec 06, 2011 7:13 am
by ghoulsblade
landscape : calling love.phone.setRequestedOrientation("landscape") once during love.load should do the trick

images might need to be "power of two" (16,32,64,128,256,512...) resolution to display correctly, not sure what's wrong with the background

Re: [BUG] Graphics don't update properly

Posted: Tue Dec 06, 2011 1:14 pm
by T-Bone
ghoulsblade wrote:landscape : calling love.phone.setRequestedOrientation("landscape") once during love.load should do the trick

images might need to be "power of two" (16,32,64,128,256,512...) resolution to display correctly, not sure what's wrong with the background
The images are PO2 and they work once the image has been updated, as I previously stated.

Re: [BUG] Graphics don't update properly

Posted: Tue Dec 06, 2011 5:50 pm
by ghoulsblade
hmm, so far i've only tried loaded images during love.load(),
now your mousepressed on the button triggers a gamestate.load() which loads gfx.
that might be the problem due to android having a render-thread separate from the main-thread,
and graphics/texture loading might need to be called from there.

as workaround please load graphics in love.load(), until we can fix it in the love-android binary.

Re: [BUG] Graphics don't update properly

Posted: Tue Dec 06, 2011 8:30 pm
by T-Bone
ghoulsblade wrote:hmm, so far i've only tried loaded images during love.load(),
now your mousepressed on the button triggers a gamestate.load() which loads gfx.
that might be the problem due to android having a render-thread separate from the main-thread,
and graphics/texture loading might need to be called from there.

as workaround please load graphics in love.load(), until we can fix it in the love-android binary.
Oh I see, thanks!