C sharp:Drawing A Triangle
From GPWiki
The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server. However, the GPWiki forums are still active! Come say hello. [edit] DirectX deviceHello, I am DarkShadow. This is a tutorial on setting up a DirectX and drawing... A TRIANGLE! "A stupid triangle?", you may say. Well, you can't start out making Halo, so suck it up and start drawing this triangle. ;-)
Anyway, start up a new empty project in whatever compiler you use (if you use notepad and command prompt, I pity you, you poor fool). Empty, becuase we need to learn everything from scratch. This could work with a windows forms project, but don't try it. Add a new code file, name it whatever you want. I chose "Triangle"; simple and sweet. Now, add these two using clauses at the top of your file. using System; using System.Windows.Forms; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; Great! What the heck does that mean? The System namespace is what you need to run any program, but you should know that. System.Windows.Forms means you have the ability to create sweet graphics with a windows program! DirectX is to use DirectX |


