Original Post
When I create a DD7 Surface using the below code, and blit to/from it, my app crashes, therefore im unable to diagnose the problem by the error return code.
// ----------- MY CODE:
ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
if(bSysMem) ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
else ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN |DDSCAPS_VIDEOMEMORY;
ddsd.dwWidth = bm.bmWidth;
ddsd.dwHeight = bm.bmHeight;
if (pdd->CreateSurface(&ddsd, &pdds, NULL) != DD_OK)
return NULL;
//-------------------------
My objective is to create a surface, then blit from another larger surface to fill the bitmap.
What am i doing wrong? Do i have to pre-fill the surface with something, or fill it with black??? or do i HAVE TO load a bitmap to it?