Sign in to follow this  
XSlinger

Primitives drawing under textures

Recommended Posts

Hello, I am using Direct3D 9. No matter what order I call the drawing of objects in, primitives (points, squares) are always drawing underneath the textures I render using an ID3DXSprite. The primitives are drawn using DrawPrimitiveUP. I have disabled the z-buffer and I am still getting the same problem. Please help.

Share this post


Link to post
Share on other sites
Ahh thankyou that fixed my problem, but now that leads to another question.

Rather than call ID3DXSprite::Begin() once at the beginning and ID3DXSprite::End() once at the end, I put the begin and end call in my draw image function, so for each texture it draws those functions are called.

When I ran my program I found that the primitives were not drawing anymore, so I placed the Begin() and End() calls in those functions too, but I don't see why they need a sprite anyway.

It does work properly now, drawing in the correct order, but doesn't it seem inefficient to call Begin and End after every draw? The thing is, it is an engine, not a game, so I don't know in what order things will be drawn. But, is there any way I can get around this to make it more efficient?

Thanks

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