I have never done DirextX programming before, as I mentioned my graphics experience is in 2D software drawing APIs (ie, line/pixel/arc drawing) and OpenGL. Tonight I got some paying work done and needed to dabble in something so I got the latest and greatest Managed DirectX download from MSDN, dated April 2005. I have mostly been messing around with the sample programs tonight, and just started combining some of the samples to do something more than hello, world. "Hello World" in graphics land is drawing a shaded triangle, by the way.
A few observations from an hour of messing around:
Things have come a long way since I last did anything with graphics. Creating a drawing device can be done in as little as 2-4 lines of code. Its fairly easy to get to the point where you can start messing around and see something on the screen. Microsoft has also included some Intellisense documentation, which was missing when I played with DirectShow a while back.
PresentParameters presentParams = new PresentParameters(); presentParams.Windowed=true; presentParams.SwapEffect = SwapEffect.Discard; _device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
... then draw away.
Performance from Managed code does not look like its going to be pretty. I'm thinking it should be able to draw the simple scene shown above more than 42 times per second. Also, many of the examples included in this release of the SDK do not compile or work. The most annoying thing I encountered is the code included for drawing text to the Direct3D device did not compile. It looks like MSFT has been tweaking the managed API and has not updated all the samples. For what its worth, I got the "GraphicsFont" to work with minor code changes, and I'm including the file here for download on the off chance anyone else is having issues.
GraphicsFont.cs.rename (22.61 KB)
More observations as I get time to make them.