Jump to content
  • Advertisement
Sign in to follow this  
Sol Blue

[Solved] Color parameter in ID3DXSprite::Draw() isn't applied in object space

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

Hi all, I'm using ID3DXSprite in object space. The last parameter of its Draw() method is a D3DCOLOR, which is supposed to tint the drawn sprite. Back when I was using ID3DXSprite with pre-transformed coordinates, that worked fine, but now it is entirely ignoring that parameter. Even though I'm passing different colors in, it always draws as if it had gotten D3DCOLOR_XRGB(255, 255, 255). Now that I'm using ID3DXSprite with the D3DXSPRITE_OBJECTSPACE | D3DXSPRITE_DONOTMODIFY_RENDERSTATE flags, are there some render states or something that I need to manually set for it to pay attention to the color parameter again? Thanks for any help! If it would be helpful to know what render states I already have set, I can post those. [Edited by - Sol Blue on May 13, 2008 2:24:00 PM]

Share this post


Link to post
Share on other sites
Advertisement
It's not the D3DXSPRITE_OBJECTSPACE parameter, it's the D3DXSPRITE_DONOTMODIFY_RENDERSTATE. ID3DXSprite normally sets texture stage stages that allow it to modulate the texture color by that color you supply.

You can see what render states, texture stage states, and sampler states ID3DXSprite normally sets right here.

Share this post


Link to post
Share on other sites
Thanks MJP, that helped!

For others who might come along: the solution was to change the first line to the second --


gDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
gDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!