Archived

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

z_yang

a nasty colorKey bug

Recommended Posts

z_yang    122
before i say anything, here''s the code im using to support color keying, DWORD color; DDPIXELFORMAT ddpf; ddpf.dwSize = sizeof(ddpf); lpddsPrimary->GetPixelFormat(&ddpf); color = ddpf.dwBBitMask;//or dwGBitMask for green... DDCOLORKEY key; key.dwColorSpaceHighValue=color; key.dwColorSpaceLowValue=color; lpddsHouse->SetColorKey(DDCKEY_SRCBLT, &key); the problem is, i got this to work once, only with blue and black, and yesterday, i updated my OS(im not sure if that''s the problem), but now it''s totally dead. im sure it''s something i missed, because the demo works with any color. i''ve compared my code with the demo several times, but i still don''t see what the problem is,

Share this post


Link to post
Share on other sites
b2funny    122
Hi,

I suppose you use Dx7. So, i dont known if that''s possible but use Dx8 with ID3DXSprite interface. This way, i''m sure that you can use ID3DXSprite interface to load from a large group of supported image format.

One interesting format, is the ".png". It''s support 32-bit color values with an alpha channel. So, when you draw your sprite use the alpha channel. This way, you can add transparency and/or translucidity(wrong spelling).

If it''s work right, but damn slow on my, P200/Voodoo card. And work pretty fast on any PII/GeForce/Radeon system, well over 100fps in screen resolution of 1280x1024 and up, with all alpha-blending enable. I think it''s the way to go.

I just test my tech-demo on my friend''s computer, i get very happy to get 100fps, since i got 2.7fps under Dx8 with a blank screen. It''s now the time for my to implement my AI-code. Hope it will work well.

If you have others question, ask

B2Funny

Share this post


Link to post
Share on other sites