Divinity Banner
Previous Thread
Next Thread
Print Thread
Sleep( 0x80 ) more. #566518
25/05/15 03:07 AM
25/05/15 03:07 AM
Joined: May 2015
Posts: 2
V
VillageIdiot Offline OP
stranger
VillageIdiot  Offline OP
stranger
V

Joined: May 2015
Posts: 2
Hey, I missed something. Like the general suggestions forum. Could we move this thread there please (unless there's a D:OS suggestions forum)? crazy

Code:
while( bInRenderLoop )
{
     ...

     if( GetForegroundWindow() != hMainWindow &&
          bSinglePlayer )
     {
          Sleep( 0x80 );
     }
     else
     {
          SceneGraph->Draw();
          SceneGraph->Tick( delta );
     }
     ...
}


10% CPU on a i5-3570 (@3.0ghz, "turbo" disabled) tabbed out. frown

Though I very well could be missing something here.

Last edited by VillageIdiot; 25/05/15 08:40 PM. Reason: I AM THE VILLAGE IDIOT! :D
Re: Sleep( 0x80 ) more. [Re: VillageIdiot] #566520
25/05/15 03:22 AM
25/05/15 03:22 AM
Joined: Mar 2003
Posts: 26,336
Canada
Raze Offline

veteran
Raze  Offline

veteran

Joined: Mar 2003
Posts: 26,336
Canada

UBBCode is disabled on new accounts, to discourage spam (no clickable links). It'll work now, though.

Running the game in Win 9x compatibility mode will restrict it to a single core. I don't know if that will help with the CPU usage when minimized.

Re: Sleep( 0x80 ) more. [Re: Raze] #566521
25/05/15 03:53 AM
25/05/15 03:53 AM
Joined: May 2015
Posts: 2
V
VillageIdiot Offline OP
stranger
VillageIdiot  Offline OP
stranger
V

Joined: May 2015
Posts: 2
Originally Posted By: Raze

UBBCode is disabled on new accounts, to discourage spam (no clickable links). It'll work now, though.


Thanks. smile

Originally Posted By: Raze
Running the game in Win 9x compatibility mode will restrict it to a single core. I don't know if that will help with the CPU usage when minimized.


One of the threads seem to hover around 7% or 8%. I think most of the time is used in a main thread.

I know the input is handled in the render loop - tried the game on my onboard while zip-tie'ing a new fan to my graphics card. It lagged so hard (~3 seconds/frame) I had to hold down clicks until the frame advanced just to have it register mouse up and down. X-)


Moderated by  Dom_Larian, Larian_QA, Lynn, Macbeth 

Powered by UBB.threads™ PHP Forum Software 7.6.2