Sign in to follow this  

[c++ DX9] Procedurally draw filled/line shapes

Recommended Posts

I haven't been able to find any good way to render filled shapes in DirectX9... I have a 2D engine currently utilizing the ID3DXSprite interface but I now need the ability to draw procedural graphics such as rounded rectangles, lines, and circles.

I've tried ID3DXLine... but I can't fill the shapes I create

I've tried Direct2D... but that isn't supported on XP, which is my target platform.

I'd prefer hardware accelerated gfx, but I've tried messing with GDI as another option. I wasn't sure how to tie it into my current render loop since I don't use WM_PAINT. I would need to be able to layer GDI drawing calls beneath and above some ID3DXSprite begin/end calls which should be possible right?

My last option would be to render orthographic polygons to the screen to make my desired shapes. I tried messing with this briefly using DrawPrimitiveUp(), but it would always render behind my ID3DXSprites regardless of the 'Z' value I gave it. What's a better approach to this method? One that I can specify already transformed coordinates (screen/pixel coordinates)?

Thanks, for any help!

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