Original Post
Hi,
i have problems initializing my Directdraw object. I want to have an object which has only one primary surface and no backbuffers.
Here''s my code:
// Create the primary surface with 1 back buffer
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize=sizeof(ddsd);
ddsd.dwFlags=DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
ddsd.ddsCaps.dwCaps=DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
ddsd.dwBackBufferCount=1;
hRet=g_pDD->CreateSurface(&ddsd, &g_pDDSPrimary, NULL);
if (hRet!=DD_OK) {
TRACE("Could not create primary surface - error code %d\n", hRet);
return false;
}
I have tried to set dwBackBufferCount to 0 but this didn''t work.
When i try to lock the primary surface, i get an DERR_INVALIDPARAMS, and i guess it''s due to this initialization.
Can anyone help me please?
Thanks,
Chris