• Advertisement

Archived

This topic is now archived and is closed to further replies.

2D Lines and filled rects in Direct3D

This topic is 5968 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 am using D3DXSprite to blit 2D sprites, though I need to be able to blit single pixel lines and rects as like in DirectDraw using the rectangle() and lintto(). Is this possible? Or would I need to blit the lines with textures? Pls supply the code if possible. Thankx in advance.

  Downloads:  ZeroOne Realm

Share this post


Link to post
Share on other sites
Advertisement
Thanks ill look into it, in the mean time are there any tutorials covering this topic?

Edited by - SikCiv on October 18, 2001 12:30:20 AM

Share this post


Link to post
Share on other sites
For filled rectangles you can always "cheat" and use the IDirect3DDevice8::Clear function and pass in the RECT you want to draw.

This method isn''t the geatest since it doesn''t support the alpha colour and your out of luck if you want to do any transformations on it.



-------
Andrew

Share this post


Link to post
Share on other sites
There are some tutorials on FlipCode, but basically create a bunch of vertices, draw them as a line strip and voila, connected lines. Works exactly the same as triangles.

The only problem is that DX does not have the notion of line width (OpenGL rules, man!) so you have to get clever if you want thick lines. I do it by jittering the line and redrawing it several times, others draw very thin rectangles.

Share this post


Link to post
Share on other sites

  • Advertisement