Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / FPS Slowdown

Author
Message
Bipo
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 13th Jun 2009 05:03
Hi everyone,

I have a question about the 2d game I'm developing. Before my main menu (and while graphics are loading) I came up with an image that I wanted to display for my 'game company' logo.

I decided to fade it in/out using dbSetSpriteAlpha() in a loop with dbSleep(). I switched off dbSync just before my Fade procedure, then switched it back on after and set the frame rate to 60 again just in case.

For some reason, this is really goofing up my fps speed after I get to the game. It's really slow. It seems like there's some kind of heavy processing strain going on but I can't imagine why. I even deleted the loaded images used in the intro.

Any ideas?

(I could probably paste a code snipit if it would help.)
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 13th Jun 2009 08:59
You need to call "dbSync();" every frame or else the screen won't get updated and it will seem as if your program is "Stalling" until it gets called again, thats why its good to place it always at the end of your gdk loop. (that may be your issue)

Also, try setting the frame rate to one value at the beginning of your program and leave it be for the duration (just my opinion on things)

If you say you switch off sync before your fade procedure and switch it back on after, everything that happens during the fade procedure wont get displayed on the screen, rather what ever was on the screen before you switched off the sync would stay there until the sync got switched back on.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 13th Jun 2009 10:55
Yes, it would help to see your code, without that we can only guess. Otherwise, I wouldn't use dbSleep for animation. A timer would be better. Well, post the code please.

Login to post a reply

Server time is: 2024-11-25 08:33:42
Your offset time is: 2024-11-25 08:33:42