Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

amish1234

color keys in DX7

This topic is 6251 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!