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 / dbsyncrate ( 0 ) gives refresh rate of monitor

Author
Message
Coding Fodder
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 6th Dec 2007 04:16
I want the main program loop to run as fast as it can, but it seems to cap out at whatever I have my monitor set to. So a program that runs at 750 fps in dbPro runs at 75 fps in GDK. ????

Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever"
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 6th Dec 2007 05:25
Is that the max that your monitor can handle? I doubt you can set the refresh higher than it's cap. Other than that, all I can think of is make sure you declare "dbSyncOn( )" before declaring refresh rate.

Cheers,
Bishop


Tux is my guildmaster.
Coding Fodder
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: Somewhere in my cerebralcortex
Posted: 6th Dec 2007 06:26
Yes that is the max my monitor can display but that should not cap the number of program cycles. dbsync must be waiting for monitor refresh before continuing. dbPro never did that. It is wasted CPU time.

Something really catchy that makes people stop and think about the meaning of life and say to themselves "My but thats clever"
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 6th Dec 2007 07:14 Edited at: 6th Dec 2007 07:18
Of course it doesn't cap the number of program cycles. Think about it; the average game runs at roughly 30 frames per second. You think the program is running at 30 cycles per second? Of course not! Your average CPU, about maybe 3 gigahertz, cycles 3 billion times a second. The program will cycle as fast as the CPU will allow, dbSync will simply refresh the monitor if is available to be done.

Secondly, you don't really *need* more than 60 FPS. The human eye sees at about 24 frames per second, meaning that your retinal nerve pulses every 1/24th of a second. Any more than that merely makes it look smoother. Really, you don't need 750 FPS, I doubt theres a monitor out there that even has a refresh rate that high.

There's no way that dbSync makes the CPU pause. If your program ran at 30 cycles per second, I doubt you'd even see it running =P


Tux is my guildmaster.
FERSIS
18
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 6th Dec 2007 12:07
i think that GDK refreshes as a maximum value the same refresh rate that your monitor.
Example if your monitor is 60HZ then your max FPS would be 60-62
cheers
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 6th Dec 2007 12:48 Edited at: 6th Dec 2007 12:50
@Bishop
TGC seem to have a monitor capable of extremely high refresh rates, just look at the following comparison chart

http://gdk.thegamecreators.com/?f=darksdkvsdbpro



No matter how good your code is, someone will improve on it
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 6th Dec 2007 12:54 Edited at: 6th Dec 2007 12:55
Quote: "It is wasted CPU time."

Why is it? If you want your loop to process more than a certain amount of times per second, don't call sync so often. The fact that it waits before refreshing doesn't mean any CPU time is wasted, because the amount of time it waits depends on the amount of CPU time you've used.

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Dec 2007 20:08
Wow - This is an intesting volley.

Wasted CPU? YEP - CAP CPU cycles? Nope.

Makes your program wait when you call Sync? Yup.

Can you make it go faster?

Yup, but it can cause what is often to referred to as "Tearing" - where - say you had a big white CUBE in front of a black background - and were moving it around - You might see occasional "white/black" diagonal "flaws" in the image because the graphic data was commited to the gfx card WHILE the graphic card was currently drawing to the video output. Not a big deal.


How do I make it go faster? Well - many newer video cards have a "Settings" area that can OVERRIDE your DBPRO code dbSyncOn, and manually refreshing the screen with SYNC (Where your code seems to hang) - So, if dbSyncOn doesn't do the trick - open up the "Control panel" for your graphics card and turn off VSYNC or set it so that its "Software" controlled. Each card is different so experiment with a simple program that just writes the FPS to the Screen - with dbSyncOn called at the top of your code - and a dbSync command in your little loop.

Login to post a reply

Server time is: 2024-11-19 18:31:51
Your offset time is: 2024-11-19 18:31:51