Basic HTML version of Foils prepared July 5 98

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


//----------Set up DirectDraw---------------------
// Create the DirectDraw object
hr = DirectDrawCreate( NULL, &lpdd, NULL );
if( hr != DD_OK )
return FALSE;
// Decide the application's behaviour
hr = lpdd->SetCooperativeLevel( hwndApp, DDSCL_EXCLUSIVE |
DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX );
if( hr != DD_OK )
return FALSE;
// Set the display mode
hr = lpdd->SetDisplayMode( window_width, window_height, bits_per_pixel );
if( hr != DD_OK )
return FALSE;
ddsd.dwSize = sizeof( ddsd );
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
ddsd.dwBackBufferCount = 1; //We are using one back buffer
//Specify surface capabilities
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
hr = lpdd->CreateSurface( &ddsd, &lpFrontBuffer, NULL );
if( hr != DD_OK )
return FALSE;
// get pointer to back buffer
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
hr = lpFrontBuffer->GetAttachedSurface(&ddscaps, &lpBackBuffer );
if( hr != DD_OK )
return FALSE;
/* Initial screen layout & rendering can be done here if needed */
return TRUE;
}
Setting up
DirectDraw
640 X 480 X 8



© 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