Jump to content
  • Advertisement


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



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

Greets. I use the SetColorKey, to access and set to alpha = 0 all the transparent to be pixels. However, when it performs the check, it never seems to succeed it. It never finds any pixel that is supposed to be transparent. Here''s what happens: I use a color key 0x00FF0000 the image does containt this color (exact value). when SetColorKey function scans through it, with A1R5G5B5 format, it sees that all the pixels whose color was supposed to be red, are 0xecc9. I''ve also tried black color, and the results where alike! Any ideas? p.s. After all alpha values are set, what are the states to be set, in order for the alpha effect to take place? I''ve used the following. Let me know if something is wrong, or missing.
	g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
	g_pd3dDevice->SetRenderState( D3DRS_ALPHATESTENABLE,  TRUE );
	g_pd3dDevice->SetRenderState( D3DRS_ALPHAREF,         0x01 );
	g_pd3dDevice->SetRenderState( D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL );
... LEMMINGS ... LEMMINGS ... LEMMINGS ... LEM..... SpLaSh!... Is it what we look like on the eyes of destiny or God? Are we LeMmIngS or WhAt!?

Share this post

Link to post
Share on other sites
Im not exactly sure what the problem is, though make sure your 3D card can do colorkeying in the first place. If you need something to test the card you can download my small D3D-2D wrapper (includes the source if you need it), follow the link below and click on the ''D3DX Sprite Wrapper'' picture.

  Game Download  ZeroOne Realm

Share this post

Link to post
Share on other sites
intialize your 3D offscreen surface like so:

intialize your textures like so:
lpSurface->SetColorKey( DDCKEY_SRCBLT, &key );


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!