1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| GameInit(); // Perform all game console specific initialization
while(1) // Enter main event loop
{if (PeekMessage(&WindowsMessage,NULL,0,0,PM_REMOVE))
{if (WindowsMessage.message == WM_QUIT) // Test if this is a quit
break;
TranslateMessage(&WindowsMessage); // Translate any accelerator keys
DispatchMessage(&WindowsMessage); // Send the message to the window proc
}
GameMain(); // main game processing goes here
}
GameShutDown(); // Shutdown game and release all resources
return(WindowsMessage.wParam); // Return to Windows like this
} // End WinMain
// WinX Game Programming Console Functions ---------------------------------------------------
int GameInit(void *Params)
{
// This function is where you do all the initialization for your game.
//
// Your code goes here
//
return(1); // Return success
} // end GameInit
//--------------------------------------------------------------------------------------------
int GameShutDown(void *Params)
{
// This function is where you shutdown your game and release all resources that you allocated.
//
// Your code goes here
//
return(1); // Return success
//
} // End GameShutdown
//--------------------------------------------------------------------------------------------
int GameMain(void *Params)
{
// This is the workhorse of your game it will be called continuously in real-time,
// this is like main() in C, all the calls for you game go here!
//
// Your code goes here
//
return(1); // Return success
//
} // End GameMain |
Partager