So, first off, I'm a total newb to GDK. I've been using DBP for about 4 years now, and I decided it was time to make the switch.
Here is my insane problem.
Take a look at my code first:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetDisplayMode (1024,768,32);
dbSetWindowOff ();
while ( LoopGDK ( ) )
{
dbCLS ();
dbText (20,20,"Hello World!");
dbText (20,40,dbStr(dbScreenFPS()));
dbSync ( );
}
return;
}
I understand that GDK has a Vsync framerate barrier of 60fps.
But the
insane part is- I get a solid 30fps when running that code!
So I tried to re simulate this is exact code, but instead in DarkBasic Pro.
Here is my DBP code...
Sync On
Sync Rate 0
Set Window Off
Set Display Mode 1024,768,32,1
Do
cls
Text 20,20,"Hello World!"
Text 20,40,str$(Screen FPS())
Sync
Loop
And wa-la! I was successful. I get the exact same, steady 30fps framerate as I did when running the similar code in DarkGDK.
I realized that the problem lied completely in the 'VSync' parameter in 'Set Display Mode'.
As you can see, in my DBP code I set the 'VSync' to 1 because that's how it is set by default in DarkGDK. That's the reason I got the same result.
So get this: I change that 1 to a 0, turning VSync off when setting the display mode in DBP, and my framerate skyrocketed to it's max, as it should with the sync rate set to 0. It went up above 100 and skedaddled around there. I could even change the Sync Rate to 60 and it would stay capped there.
I thought I figured out how to fix that cap in DarkGDK too. I just had to turn VSync off when setting the display mode.
And it turns out, with the latest version of DarkGDK and everything,
the command dbSetDisplayMode doesn't have a 4th arguement for setting VSync!
So now I'm at a complete loss for what I can do about this.
I played around with it some more in DarkGDK, and these are the results I got.
DarkGDK Framerate Results (VSync on by Default)
- Display Mode 1024,768,32 + Fullscreen Mode = 30 FPS capped
- Display Mode 800,600,32 + Fullscreen Mode = 60 FPS capped
- Display Mode 1024,768,32 + Default Windowed Mode = 60 FPS capped
- Display Mode 800,600,32 + Default Windowed Mode = 60 FPS capped
The same results go for re-simulation of the code in DarkBasic Pro with VSync on (set to 1).
So, the dilemma is, I want to be able to uncap the framerate. I also want it to be in FullScreen Mode, and I need the resolution to be at least 1024,768,32... the problem is, these are the only settings that are causing that 30FPS cap for me, and the command that allows you to turn VSync off does not have that VSync parameter with DarkGDK.
Solution that I am not sure about using:
I can go into my NVidia control panel and set the VSync to 'Force Off'. Then, when I set the sync rate to 0 in DarkGDK and lower the display mode resolution, there is no 60FPS cap in DarkGDK. The thing is, I don't want this 'Force Off' to be for all the games I play as well. So I put it back to the setting with 'Let the 3D application decide' so I can find a fix for this through DarkGDK, not so it's fixed OFF for all games I play or make.
Thanks all for any help you offer.