Loadbmp fps drop

Previous topic - Next topic

Crivens

Ah yes rings a bell. Hmm, gives me an idea for something else too... Thanks Ampos that could really help!

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

loadbmp is done once at the start of a program. The showscreen will use the loaded image later for updating the back buffer.
Internally it just does a DRAWSPRITE after the showscreen. The image format makes no difference. It's all converted to a BGRA 8888 texture internally.

ampos

So LOADBMP "back.png" is the same as

Code (glbasic) Select
loadsprite "back.png",0
MAINLOOP
   drawsprite 0,0,0
   your_code_here
   showscreen()
ENDLOOP
   


Interesting.
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Crivens

I assumed it was. Although over the weekend doing the exact same code as you just posted gained on average about 1fps over the loadbmp command. Strange.

I still don't get how my recovered FPS went away again with almost identical code. Thought I had the answer with "the more complicated the picture the slower the update will be", but has gone back to 46FPS. Hmmm. Perhaps a temp glitch that gave me 60fps on retina... Although that doesn't explain why my game runs at 60fps on retina with a full whack 3D object covering the whole screen. But it does have lots of black in it...

Possibly I can use clearscreen -1 and then only paste the part of the image that was drawn over. It's *always* the center section, and a quick test yesterday showed it gain FPS the more of the wallpaper sprite I kept off the screen (5FPS gain when the full image was half off the screen for example or when I used a 3D object and it was small on the screen and therefore was only showing "half" of it's full self). Interestingly 3D gave me a couple of FPS points so I might revert to that too.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

add a clearscreen -1 after the loadsprite, then it's the same.


Crivens

Hmm. So how come my DRAWSPRITE example was 1FPS faster than the LOADBMP one? And that was without the clearscreen -1 code.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Qube

Quote
add a clearscreen -1 after the loadsprite, then it's the same.
Really? - I only ask as when doing 2D games I found that method really dragged down the FPS but just using the command "LOADBMP" brought FPS up to 60 again. Huh! must of been doing something silly if that's the case.

Crivens

Nice one Ampos. Use clearscreen -1 has put it between 70 and 80FPS now. Much better :) Because I always draw the full background every showscreen (like LOADBMP does) then I have nothing to worry about :) Out of interest I wonder why LOADBMP doesn't do the same if it literally uses clearscreen -1 like Gernot said?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.