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 drop with own class, using dbText

Author
Message
miko
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: Germany
Posted: 8th Oct 2005 22:30
Hi All,

I\'m currently writing my first game with the DarkSDK. To make life a bit easier, I made a class called \"CSimpleWindow\" (which does show a window with text - see code attached).
Once the dbText and dbCenterText routines of this class are in the loop (read: the window is active), my FPS drops from 60 to about 30 (see pic). Should this be considered normal behavior, or did I do something wrong?

Thanks,
miko

OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Oct 2005 22:42
Sounds like the text is being constantly being re-written, which would slow things down (along with setting the current bitmap etc etc).

Come to the third DarkBasic Pro Sci Fi Con - Be there and be square
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
miko
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: Germany
Posted: 8th Oct 2005 23:28
Ups, I get a
Quote: "Error obtaining Source Code, invalid ID. Sorry but I've given up."
. Attaching it didn't work, obviously. Sorry.
Well, here is it with <code> tags:

The header file


The cpp file
miko
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: Germany
Posted: 9th Oct 2005 18:12
Yep. The text is constantly rewritten (the box is, too; but this isn't really noticeable).
Seems that I found the root cause. When changing the text size every render call, this causes massively impact on fps.

So, this one is rather fast:


This one is not:


So, I'll stick for a constant text size (and remove all those calls to dbSetTextXXXX where possible)
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 9th Oct 2005 21:16
dbText is notoriously slow anyway, especially when using several different fonts and sizes.

I ported the fast anti-aliased text from dbp dll to darksdk code and its on the forum here somewhere, i suggest you grab it and try using it instead

Login to post a reply

Server time is: 2024-03-28 15:38:16
Your offset time is: 2024-03-28 15:38:16