Jump to content
  • Advertisement
Sign in to follow this  
WWakerFAN

Draw Inverted line with XNA?

This topic is 3588 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 an xna GraphicsDevice embedded so it displays on a UserControl and I want to draw a line that uses inverted colors, I already understand how to draw a normal colored line, by i'm unsure as to how I would go about doing this.

Share this post


Link to post
Share on other sites
Advertisement
If you're drawing a line primitive, you'll want to set up the blending to "invert". In C++, that's done as so:

pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR);


I think, it's untested. It'll be similar in XNA I suspect.

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.

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!