Sign in to follow this  
golgo

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

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this