Sign in to follow this  
CIJolly

Best way to plot lines/pixels in Direct3D 8

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

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