DirectDraw Transparencies

Started by
2 comments, last by GameDev.net 24 years, 6 months ago
Did you make sure to use SetColorKey() on the source surface?

------------------
Visit the homepage of my (soon to be 'net multiplayer) Tank Game at http://members.home.net/chris-man

Visit the homepage of my (soon to be 'net multiplayer) Tank Game at http://members.home.net/chris-man

Advertisement
Yes, here is the complete blt code snippet


ClearBuffer(destination);

ddck.dwColorSpaceLowValue = 0;
ddck.dwColorSpaceHighValue = 0;
hres = destination->SetColorKey(DDCKEY_SRCBLT,&ddck);
if(hres != DD_OK)
//error setting colorkey for surface

hres = destination->Blt(NULL,source, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL);
if(hres != DD_OK)
hres = destination->BltFast(0,0,source,NULL, DDBLTFAST_SRCCOLORKEY | DDBLTFAST_WAIT );
if(hres != DD_OK)
//error

Does anyone know what would cause the blt and bltfast functions to return a DDERR_INVALIDPARAMS while trying to use DDBLT_KEYSRC or DDBLTFAST_SRCCOLORKEY. I've looked at some older programs, and other samples and they have the same code. Here's the line:

lpddsback->blt(NULL,source,NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL);

Thanks in advance,
Doug

ah ok. I think everything is working now. I misread the entry. I was setting the Colorkey on the wrong surface. Thank you so very much

This topic is closed to new replies.

Advertisement