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:
#include "DarkGDK.h"
void DarkGDK(void) {
dbSetDisplayMode(1024,768,32);
dbSetWindowOff();
dbSyncOn();
dbSyncRate(70);
dbLoadImage("gfx/blackdot.png",1);
dbPasteSprite(1,0,0);
while(LoopGDK()) {
dbText(0,0,"Use the up and down arrow keys to move the camera");
dbSync();
}
return;
}
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.