Advertisement Jump to content
Sign in to follow this  
longlong9

how to set the line width

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

in d3d9's surface i draw lines use DrawPrimitive and D3DPT_LINELIST?because it is fact than gdi and ID3DXLine,but how to set the line width?

is anyone know? thanks.

Share this post


Link to post
Share on other sites
Advertisement

You can't. You will have to expand your lines into polygons to give them thickness, which is what ID3DXLine exactly does (and bit more).

Edited by Guns

Share this post


Link to post
Share on other sites

thanks for reply,

 

another question ,how to enhance the ID3DXLine's efficiency?

 

The best way will be to make your own system for line rendering. The D3DX helper interfaces D3DXLine, D3DXSprite, D3DXFont etc are great start, you even can use them for a long time (well, not so much D3DXFont, that tends to be very slow), but sooner or later you'll find out that by making it yourself you will be able to make it much better. And especially if you can make it not fully general, but directly for a particular application.

(For example if hypothetically you were always drawing exactly 100 lines, you don't need a dynamic system which can render any number of lines and you maybe will be able to make one constant vertex buffer for all of them and you'll drive them all using a single draw command...)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!