Original Post
Okay, I wrote a function that loads a bitmap onto an offscreen surface. I know that it is loading the bitmap (I tested the actual bitmap loading on the backbuffer, and it worked), however when I blit the offscreen surface to the backbuffer, nothing is displayed. Here is the code that is creating the offscreen surface (the surface image is a ref parameter for lpddstest):
and then in the main game loop, I try to blit that surface to the backbuffer and then flip the backbuffer with the primary surface like so:
The screen just remains blank. If anyone knows what the problem is, please help me out.
-Yoshi
XGXCX ''''99
DDSURFACEDESC2 ddsd; // ddraw surface description
// clear the ddsd struct of garbage
memset(&ddsd, 0, sizeof(ddsd));
// fill in the description structure
ddsd.dwSize = sizeof(ddsd); // size of the struct
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; // flags
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; // surface is off screen
ddsd.dwWidth = width; // width of surface
ddsd.dwHeight = height; // height of surface
// create the surface
if(lpdd->CreateSurface(&ddsd, ℑ, NULL)!=DD_OK)
return(0);
|
// blit the test surface to the backbuffer
if(lpddsback->Blt(&dest_rect, lpddstest, NULL,
DDBLT_WAIT, NULL) != DD_OK)
return(0);
// flip the pages
while(lpddsprimary->Flip(NULL, DDFLIP_WAIT)!=DD_OK);
|