Click to See Complete Forum and Search --> : Creating DirectDraw Surface


mark yang
April 26th, 2004, 04:23 AM
How DDraw surface can be create in 32-bit ARGB format ?

All I found ddsd pixelformat must be correctly initialized..

Here is my 'out-of-work' code..This only create RGB32 mode

surface. Alpha value ignored completely..

What can I do that ?

I need some sample code...



hr = DirectDrawCreateEx(NULL,(LPVOID *)&pDD7,IID_IDirectDraw7,NULL);
hr = pDD7->SetCooperativeLevel(hwnd,DDSCL_NORMAL);
//-- Front
ZeroMemory(&ddsd,sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
hr = pDD7->CreateSurface(&ddsd,&pDDSFront,NULL);
if(FAILED(hr)){Beep(100,100);exit(1);}