color keys in DX7
I am trying to use color keys for off-screen surfaces in DX7. Could someone give me help on how to use the IDIRECTDRAWSURFACE7::SetColorKey function, or how to set the high and low colorspace values in the DDSURFACEDESC before creating the surface? If you''ve made a game that does this and I can download the source code that would help also.
-Amish
int Set_ColorKey(LPDIRECTDRAWSURFACE7 surface, COLORREF color){ DDCOLORKEY DDCK; DDCK.dwColorSpaceLowValue = color; DDCK.dwColorSpaceHighValue = DDCK.dwColorSpaceLowValue; surface->SetColorKey(DDCKEY_SRCBLT, &DDCK); return 1;}
use the RGB macro to make a COLORREF like this: RGB(24, 255, 65);
You must include windows.h (but of course you should already have that included since your using DirectX).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement