Ok, this is what I am trying to do, I am trying to make it so that every time you press the left mouse button of your mouse, the litttle space ship will fire something.........This is somewhat what I have.........
This is how the message loop is organized......
So obviously we will be going through the message pump every time until the window's killed.......I have this on winproc.Code://message pump for(;;) { //look for a message if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { //there is a message //check that we arent quitting if(msg.message==WM_QUIT) break; //translate message TranslateMessage(&msg); //dispatch message DispatchMessage(&msg); } //run main game loop Prog_Loop(); } //clean up program data Prog_Done(); //return the wparam from the WM_QUIT message return(msg.wParam);
case WM_LBUTTONDOWN:
{
Fire();
return (0);
}break;
This would call Fire which is a function outside of the Program loop and everthing. Well my problem is that when I press the mouse it goes to fire and then it stays there, it doesn't go back to the Prog_Loop or so it seems nothing it's updated......How can I make it so that I can press the mouse and then keep on going with the message loop any idea?
I know I am doing something seriously wrong, thanks in advance.