Jump to content
  • Advertisement


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


SetColorKey and 16bit graphics

This topic is 6670 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

Hi all I''m rather new in the DirectX field at large. Thus, I''m delving into using 16 bit graphics and finally abandoning the annoying 8-bit arena. So I''ve set up my primary surface as 640x480x16 Also, I''ve set up an offscreen_plain surface loaded with a bitmap (24 bit, automatically converted, right?) Now I want to set the colorkey in the offscreen_plain surface, but how is the 16 bit surface set up? Does it use 5-bit per color channel, and how are they arranged? RRRRR GGGGG BBBBB X ? In my frustration I didn''t really care, so I figured I just wanted to see if the SetColorKey worked at all in 16 bit. Thus, I set up the DDCOLORKEY structure as follows: colorKey.dwColorSpaceLowValue := $FFFE; colorKey.dwColorSpaceHighValue := $FFFF; Yep, that''s right: Delphi ... but I''m sure you get the picture. I figured that whatever I set up the colorkey space to be, as long as I kept it rather small, I was sure that something from my bitmap would be displayed when blitted. I made the call as: FBitmap.SetColorKey(DDCKEY_COLORSPACE or DDCKEY_SRCBLT, @colorKey); and the actual blit with DDBLTFAST_SRCCOLORKEY or DDBLTFAST_WAIT. However, nothing is displayed. Absolutely nothing! Removing all references to colorkeying and making the blit with DDBLTFAST_NOCOLORKEY copied the bitmap as it should, but ofcourse also *with* the supposedly transparent color. What am I doing wrong? (besides using Delphi, I know, I know) Regards Toft

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!