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 / DGDK seems slow

Author
Message
The Viking
16
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 1st Feb 2011 02:58
Hmmm, ok... I'll admit that I'm new to GDK, and haven't too much experience with C++, but I have played with DBP for a number of years. I have been attempting to redo a game I was working on in DBP, which involved using 360 Controllers (2 of them for co-op play to be more precise) and i was getting frames of about 50 or so with both running simultaneously. Now, with GDK, and only running a simple program which has nothing more than some text i'm getting frames of about 30... I haven't even gotten a chance to code any of the controller stuff. Why does it seem slow (or more precise, what am I doing that's MAKING it run slow)

here is the full program:



Are there things I should avoid using. I know someone has mentioned the switch method is not good... but I didn't understand the other method he/she described. Other than that... any thing that I could/should be doing differently?

Thanks to anyone who has taken the time to respond... P.S. I am not sure if it's the controller dll which is making it so slow, but without it... it still runs slow, and in DBP the controller addition runs fast!

www.myspace.com/norseblod
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 1st Feb 2011 07:21
My guess is that it's the dbText() calls. They are dog slow. Check out this alternative by Hassan.

JTK
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 1st Feb 2011 08:51
dbSetTextFont ( "Papyrus" );
dbSetTextSize ( 96 );
dbInk(dbRGB(235,90,40),dbRGB(0,0,0));

do not use them in loops, they are slow!!

WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 1st Feb 2011 10:03
Unless you have the new update to GDK, the old one defaults anyway to Vsync at 60 fps. It shouldn't make that much difference setting fonts but not within loops though as Hassan has said. I've never used the 360 controls but even so they are polled input using interrupts so they should just return values instead of waiting. Looking at the code you've put up, I wouldn't expect you to get 30 fps unless you have something else running that has attached itself to a D3D device as well. I've found that out many a time in the past, especially having a modelling program running at the same time as a GDK program runs.

Warning! May contain Nuts!
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 1st Feb 2011 23:40 Edited at: 1st Feb 2011 23:55
try removing that dbCLS();

and adding

dbBackdropOn();
dbColorBackdrop(0x000000);

after
dbSetDisplayMode ( 1024 , 768 , 32 );
dbSyncOn();
dbSyncRate(0);
dbMaximiseWindow();

hi
The Viking
16
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 2nd Feb 2011 03:39 Edited at: 2nd Feb 2011 05:13
Thanks all for the replies:

1) having the:
dbSetTextFont ( "Papyrus" );
dbSetTextSize ( 96 );
dbInk(dbRGB(235,90,40),dbRGB(0,0,0));
did slow it down quite a bit. Though, removing them and putting them outside the loop didn't allow the text size or font to show properly instead it went to default font and 12 pt.

I'll definitely take a look at your alternative text hassan, as with DBP I use to use Cloggy's D3D plugin, which I couldn't get to work in DGDK (which it says it can, oh well).

2) After I got the text things out... the program did seem to run at a solid 60 fps. How or where would I change the default sync rate for the program? For the version of GDK I am using... it's only the free version I received about a month ago now. So, I think it's the up to date version, unless they only free released the older versions?

3) I didn't know you could clear text without the cls command. Thanks.

I"m gonna try the alternative text thing now to see if it helps. Thanks all so far!

EDIT: Ok, I finally got Cloggy's D3D plugin working, and it's fixed the problem... However!! It's still running at 60 fps... which indicates that it is defaulted to 60, so... where would I change this setting? Thanks again ALL!

www.myspace.com/norseblod
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 2nd Feb 2011 22:31
There are two commands to release the 60 fps limit, by switching off the vertical sync: dbSetDisplayModeVSync and dbSetDisplayModeAntialias. These work since Dark GDK version 7.3.
The Viking
16
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 5th Feb 2011 03:29
Thanks... although, those commands are not recognized... does this mean i have the older version then?

www.myspace.com/norseblod

Login to post a reply

Server time is: 2024-11-19 14:51:10
Your offset time is: 2024-11-19 14:51:10