Jump to content
  • Advertisement
Sign in to follow this  
golgo

drawing primitives/ID3DXLine in front of everything (2D game)

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

hey guys, this is my first real DX experience so forgive me if i sound like a tool. Using DirectX 9, I was wondering how i could make it so that I can draw primitives in front of anything on the screen, specifically using ID3DXLine->Draw(). Currently when I use them, they appear behind any sprites or surfaces. What would be the simplest approach for this in a 2D sort of game? if you have any experience with this and could provide an example/tutorial/answer geared towards an idiot it would be greatly appreciated. thanks.

Share this post


Link to post
Share on other sites
Advertisement
Just render your lines last with z-buffering disabled (IDirect3DDevice9::SetRenderState(D3DRS_ZENABLE, FALSE)), and the lines will be on top. If you're using ID3DXSprite, make sure you render the lines after you call ID3DXSprite::End() because that's when the sprite interface actually renders everything.

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!