Basic HTML version of Foils prepared July 5 98

Foil 151 PPT Slide

From FMS: Forces Modeling and Simulation Handout JSU HPC Summer Institute for Undergraduates, Jackson MS -- June 15 1998. by Wojtek Furmanski, Subhash Nair, Tom Pulikal


//Entry point for the windows program
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
joinSession = FALSE; //By default create new session
if(strcmp(lpCmdLine,"join")==0)
joinSession=TRUE;
if( !WinInit( hInstance, nCmdShow ) ) // Initialize & set up Windows
return FALSE;
if( !DXInit() ) // Initialize & set up DirectX
return FALSE;
ShowCursor(FALSE); //Hide the mouse pointer
// Start windows loop
while( 1 )
{
if( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
if( !GetMessage( &msg, NULL, 0, 0 ) )
return msg.wParam;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
UpdateFrame("NONE"); //Update the screen
}
}
}
The main Function - WinMain()
A command line argument
`join' must be supplied
to join an already existing
session
We update the screen even when
no keys are pressed because the
other player might have changed
position.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998