   transparency, 2D
  Alright, here is a topic that has me banging my head against the wall. I have seen many snippets of code that uses primary and secondary buffers in conjunction with color keys to acheive transparency. I, however, am already rendering all of my sprites by using the pD3Ddevice->stretchRect(); In which I pass the source and destination RECT and the surface containing the image to be drawn. I have tried many different areas to find a place to set color keys or rendering states that would allow for sprite transparency. I am using directX 9.0 SDK and have a completely up to date system. Any ideas?   
  StretchRect will only copy the source color (including alpha if present), it isn't supposed to blend the colors.To draw "sprites", it is advisable to either: 1. use the ID3DXSprite interface or 2. Draw them manually by using two triangles to form rectangular areas, while the texture with the alpha channel is in use.Color keys aren't supported in most hardware nowadays, nor can you set one during rendering. The D3DX image loaders handle color keys by turning the desired color to transparent black; it is your responsibility to use the correct alpha-related renderstates when rendering the images (textures).   ;  Can you tell me where to learn more about the sprite interface, or what renderstates to use to make this work?   ;Quote:Original post by gurumareCan you tell me where to learn more about the sprite interface, or what renderstates to use to make this work?All of the sprite stuff that Nik02 mentioned is covered in the SDK documentation [smile]ID3DXSprite InterfaceThere isn't a specific sprite-only sample, but they do make an appearance across a large number of the Direct3D Samples, so you might want to look through them.NeXe has an entry on the topic as well. Searching the forums also yields a large number of useful discussions.If you have any specific questions about how to use them, feel free to post back and ask [smile]hthJack   