Jump to content
  • Advertisement

Archived

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

Scooter

Sprites and partial transparency

This topic is 6032 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 have: ... D3DXCreateTextureFromFileExA(g_pd3dDevice,"sight.bmp",256,256,0,0,D3DFMT_A8R8G8B8 , D3DPOOL_DEFAULT,D3DX_DEFAULT,D3DX_DEFAULT,D3DCOLOR_ARGB(255, 255, 255, 255),NULL,NULL, &m_pSpriteTexture[1]); D3DXCreateSprite(g_pd3dDevice,&ppSprite); .... g_pd3dDevice->SetRenderState(D3DRS_ALPHAREF,0x00); g_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_NOTEQUAL); g_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE); ppSprite->Begin(); ppSprite->Draw(m_pSpriteTexture[sprite],NULL,NULL,NULL,0.0f,&pTranslation,D3DCOLOR_ARGB(255, 255, 255, 255) ); ppSprite->End(); g_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE,FALSE); ... The "sight.bmp" is a black and white .bmp, I''m trying to get the black to Draw but want the white transparent. My code makes the white transparent but makes the black the same color as the background(color when you use m_pd3dDevice->Clear( ) How do I get it black?

Share this post


Link to post
Share on other sites
Advertisement
I''m having trouble with RenderState myself..but for this code, I don''t think you need to set any renderstates at all. Try to just delete the renderstates, I made a sprite engine without renderstates and it read my colorkey fine. Well my color key was black, but when I wanted a black object, I would just make its black (1,1,1,255), that''s still black.

Share this post


Link to post
Share on other sites
that''s doesn''t work, i did see a windowed demo where it did but i think full screen maybe different

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!