Drawing horiz and vert lines in DirectX 9

Started by
3 comments, last by Xpyder 18 years, 4 months ago
I am trying to learn some DirectX basics in VC++ Express 2005. I have a demo program which draws a "primitive" which I guess turns out to be a triangle filled with shades of yellow. Cool, I guess. I was wondering how I could draw a grid with 7 columns and 6 rows? Thanks!
Advertisement
You could have a multi dimensional array of points set out as that grid and load it in wireframe

The only problem would be that you have the diagonal line across each square.

Maybe you should use GDI+?

As an educated guess render the PrimitiveType as a pointlist instead of a triangle strip?
JUST-CODE-IT.NETManaged DirectX & C# TutorialsForumsArticlesLinksSamples
Quote:Original post by Xpyder
You could have a multi dimensional array of points set out as that grid and load it in wireframe

The only problem would be that you have the diagonal line across each square.

Maybe you should use GDI+?

As an educated guess render the PrimitiveType as a pointlist instead of a triangle strip?



Do GDI+ and DirectX mix well together? My focus is on learning DirectX.


The Primitive in question seems to be "built-into" DirectX. I don't see anything setting up the points of the triangle. Just ONE call to draw the Triangle..that is it.
Have you tried using a "line list" in DirectX 9?

I have not used it myself so Im not sure how it works though

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_m/directx/direct3d/gettingstarted/devices/primitives/linelists.asp
Thats what i mean Tom - as me and pulpfist said there are different ways to render it - triangle list is the usual but you should consider LineLists when you call DrawPrimitives
JUST-CODE-IT.NETManaged DirectX & C# TutorialsForumsArticlesLinksSamples

This topic is closed to new replies.

Advertisement