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 / My game uses 50 % of processor after I minimize it

Author
Message
velimatti
15
Years of Service
User Offline
Joined: 8th Jan 2009
Location:
Posted: 8th Jan 2009 19:49
If I use the function dbSetWindowOff(), the game begins to use 50 % of my processor (which is full load because I have a dual-core), when I minimize it by using Alt+Tab or the Windows key. However, after I maximize it again, it no longer uses processor that much (1% at maximum).
I have just started to make my game, and this code does that:

I think it can be circumvented by checking if Alt+Tab has been pressed and then using dbSetWindowOn. And when the game is opened it maximizes the window again.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 8th Jan 2009 22:06
Yes, DarkGDK is known to do this. However, it's quite slow to change from fullscreen to windowed.
velimatti
15
Years of Service
User Offline
Joined: 8th Jan 2009
Location:
Posted: 8th Jan 2009 22:19
But why does it do that? It doesn't make any sense. And now it not only uses processor when minimized but also maximized.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Jan 2009 00:29
I believe it uses up more CPU while minimized because while minimized it is not slowed by the sync rate and so loops as fast as it can.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Jan 2009 00:43
You can add a Windows Sleep command in your loop to free up processor time. This is an easy fix!

Almost as easy as implementing MikeNet! (Good Job on that Micheal... was scoping out your net lib )

--Jason

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 9th Jan 2009 00:48
Quote: "Almost as easy as implementing MikeNet! (Good Job on that Micheal... was scoping out your net lib )"

Cheers
velimatti
15
Years of Service
User Offline
Joined: 8th Jan 2009
Location:
Posted: 10th Jan 2009 12:31 Edited at: 11th Jan 2009 12:02
I fixed the problem by installing Dark GDK again and not installing the November 2008 update, which i had previously installed.
EDIT: It didn't fix the problem (I had forgot to remove sleep function). But i used dbSetWindowLayout(0,0,0) and dbMaximizeWindow instead of dbSetWindowOff and now it works.

Login to post a reply

Server time is: 2024-11-25 11:27:11
Your offset time is: 2024-11-25 11:27:11