[BUG] Graphics don't update properly

A project to port LÖVE to Android handhelds
Locked
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

[BUG] Graphics don't update properly

Post 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?
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: [BUG] Graphics don't update properly

Post 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
love-android - gamejams
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: [BUG] Graphics don't update properly

Post 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.
User avatar
ghoulsblade
Party member
Posts: 111
Joined: Sun Oct 31, 2010 6:11 pm

Re: [BUG] Graphics don't update properly

Post 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.
love-android - gamejams
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: [BUG] Graphics don't update properly

Post 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!
Locked

Who is online

Users browsing this forum: No registered users and 48 guests