D3DXSprite

Started by
13 comments, last by beginner_directx 22 years, 3 months ago
This is a sure way to achieve what you want. When loading in the texture, use the D3DX Utitlity function D3DXCreateTextureFromFileEx() and set the eleventh parameter to the colour you don''t want to be visible. It''s all in the documentation anyhows.
Advertisement
Also add the following:

device->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
device->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
device->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );



I assume it is not possible to load an "*.dds" file as a texture with the alpha blended transparency already removed?
thanx guys
http://uae-arts.host.sk
If you''re truely using D3DXSprite look for the post I made a week ago (it''s on the 4th page of this forum right now - D3DXSprite Problems). I put in some good information about setting render/texture states that isn''t in the DX docs. If you don''t know where to set the states every sprite will automatically get filtered linearly, which can lead to halos around your sprites (because it combines the transparent and visible pixels around the edges of the visible part of the texture). Hope this helps.

Bill6
thanx bill , I''ve just finished my exams 2 days ago ,that''s why I did not read your post about D3DXS problems .
http://uae-arts.host.sk

This topic is closed to new replies.

Advertisement