• Advertisement

Archived

This topic is now archived and is closed to further replies.

game flow in window programming

This topic is 6213 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I had once develop game in DOS environment. when I switch to window environment, I get trouble. I wonder where should I put my game flow in my program? in Winmain?? or somewhere else?? please help!!! Jimmy

Share this post


Link to post
Share on other sites
Advertisement
Well.. you _slightly_ missed the right forum. This forum is about Artificial Intelligence.
Anyway, I''m in a good mood, so: Usually, in window environments, the main (or WinMain in Windows) function looks like:


int main(int argc, char **argv)
{
Initalization stuff here...

while(!done)
{
while(PeekMessage(...)) {
Handle message...
}

Do game logic...
Render scene...
}

Cleanup code...
}


The inner while-loop handles window system messages.. everything else is just like you''re used to from DOS games.

cu,
Prefect

---
Sanity is the trademark of a weak mind.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
sorry to go into the wrong room^^;

so messages like keypress, buttondown are done in windows function ?

so is the code look like that?

void winmain (){

//game main loop

}

winproc(){

WM_XXX:

WM_XXX:

}

Share this post


Link to post
Share on other sites

  • Advertisement