Jump to content
  • Advertisement
Sign in to follow this  
CIJolly

Best way to plot lines/pixels in Direct3D 8

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

Hello all, this is my first post in the GameDev.net forums. My question is more related to DirectX programming than anything else, but I figured I was probably better off posting in the beginners forum first, due to my implicit beginner status. I'm writing a 2D based game in Direct3D using Kelly Dempski's tutorial from http://www.gamedev.net/reference/articles/article1434.asp It gives me much better "sprite" handling functionality than Direct Draw, but I don't know the best way to go about drawing the primatives that Direct Draw handles easily. First up: Pixels. Is there any way, or is it even a good idea to lock the back buffer in Direct 3D to plot pixels? Or would it be a better idea to make a quad that takes up the whole screen area and plot pixels to a texture? Secondly, lines: If it turns out to be efficient to plot pixels using the above two methods then I would just use line drawing algorithms in conjunction with them, but there were another couple of ways I could see of doing it that I would appreciate advice on. One is just to use wireframe polygons to simulate lines by having two of the vertices on the same point. The other way I could see would be to use rotated/scaled quads. This would give me lines that I can use transperancy on, but I was a bit sceptical about how slow they would be to draw. I also couldn't think of a way to draw diagonal lines of any size using this method without locking the vertex buffer (it seemed to me that manipulating them with matrices would skew the quad). Thanks for reading this, any help is much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!