Original Post
//mainDD is the DirectDraw4 object
// surface is a LPDIRECTDRAWSURFACE4 surface
// w and h are variable width and height
DDSURFACEDESC2 ddsd;
ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwWidth = w;
ddsd.dwHeight = h;
if (mainDD->CreateSurface(&ddsd, &surface, NULL) != DD_OK)
return false;
return true;
|