Basic HTML version of Foils prepared July 5 98

Foil 157 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


//Check if any messages were received from the other player
hr = lpDirectPlay1->Receive(lpmsgFrom, lpmsgTo, DPRECEIVE_ALL, pMessage, &msgSize);
if(SUCCEEDED(hr)) //If yes, ...
{
// Update his coordinates
x1 = pMessage->x;
y1 = pMessage->y;
}
//Erase the back buffer to remove 'Hello World!' from previous position
DDBLTFX ddbltfx;
ddbltfx.dwSize = sizeof( ddbltfx );
ddbltfx.dwFillColor = PALETTEINDEX(0);
hr = lpBackBuffer->Blt( NULL,
NULL,
NULL,
DDBLT_COLORFILL | DDBLT_WAIT,
&ddbltfx);
if(lpBackBuffer->GetDC(&hdc) == DD_OK)
{
GetTextExtentPoint32(hdc, msg, strlen(msg), &size );
//Update my coordinates
if(strcmp(direction,"UP")==0) //If UP arrow was pressed
if(yɬ) y-=ychange;
if(strcmp(direction,"DOWN")==0) //If DOWN arrow was pressed
if((y+size.cy) < window_height) y+=ychange;
if(strcmp(direction,"LEFT")==0) //If LEFT arrow was pressed
if(xɬ) x-=xchange;
if(strcmp(direction,"RIGHT")==0) //If RIGHT arrow was pressed
if((x+size.cx) < window_width) x+=xchange;
Continued...
Fills the back buffer
with the color specified
in ddbltfx.dwFillColor



© 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