Programming question.

Def

Spaceman
Hey guys, I finally figured out my AI turning issue! I'm not even 100% sure why it works, but it does so I'm not complaining. Gotta love stumbling blindly into answers.

Any way I'm noticing my game pauses after a couple itterations. If I move the mouse or hit a kay the game starts going frame by frame. Like if I move my mouse one pixel, or hit a key once, the game cycles through only one frame. Is this like some sort of debug thing I can turn off?
 
It's the default windows program thing that screwed me up. What was happening was the way that the programming was getting messages from the main callback function. The GetMessage function was pausing my game after a few itterations.


In other words:

// Main message loop:

//while (GetMessage(&msg, NULL, 0, 0))
while(1)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)){
if(!GetMessage(&msg, NULL, 0,0)) return msg.wParam;
TranslateMessage(&msg);
DispatchMessage(&msg);
}


Woo, sure is cool to get that hornet flying around on it's own now. :)
 
Back
Top