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 / Yield to Windows O/S, X button not working

Author
Message
old man
20
Years of Service
User Offline
Joined: 25th Feb 2004
Location:
Posted: 29th Dec 2008 17:27
Hi
I am on Vista using DGK with vc++

I have a small problem that I think must be simple but I can't see the solution.

I have a small game that runs fine and has its own exit method that works fine if I use dbSetWindowLayout(0,0,0), but if I run it in a normal window and click on the exit X it has strange effects but does not close the application. It is as if my application is not yielding to the Windows system, is there a command that stops the DGK/vc++ and allows windows to do its thing?

uff
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 29th Dec 2008 17:30
Perhaps you're not calling LoopGDK in the main loop?

old man
20
Years of Service
User Offline
Joined: 25th Feb 2004
Location:
Posted: 29th Dec 2008 18:07
Thanks Benjamin

Yes I have
void DarkGDK (void)
while (LoopDGK){
game bit
}
return;
}

uff
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 29th Dec 2008 20:45
That code isn't actually calling LoopGDK(), it's merely checking the value of the function address. You need to add brackets.

SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 30th Dec 2008 03:43 Edited at: 30th Dec 2008 03:44
Right, because he wants the return value. I suspect it's just a copy error as it wouldn't compile without 'LoopDGK' being defined, but it should be GDK not DGK.


My site, for various stuff that I make.
old man
20
Years of Service
User Offline
Joined: 25th Feb 2004
Location:
Posted: 30th Dec 2008 11:17 Edited at: 30th Dec 2008 11:20
Thanks for that.

I now understand that I have no clear understanding of LoopGDK()

If I change the code from:

void DarkGDK (void){
while (LoopGDK()){
game looping bit{
}
}
return;
}

TO
void DarkGDK (void){
game looping bit{
if (LoopGDK()!=1){ goto endit;}
}
endit:
return;
}

Then it works fine. Soo it looks like if you have a loop within the while (LoopGDK()) bit then windows does not get a look in, so build in your own interupt checks within loops that are likely to go on for a while??

uff
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 7th Jan 2009 01:16 Edited at: 7th Jan 2009 01:16

Login to post a reply

Server time is: 2024-09-30 15:28:43
Your offset time is: 2024-09-30 15:28:43