Totzkeeeeee's Blog

Just because I can...

  Home  |   Contact  |   Syndication    |   Login
  216 Posts | 4 Stories | 345 Comments | 321 Trackbacks

News


My blog is worth $14,678.04.
How much is your blog worth?

Tag Cloud


Article Categories

Archives

Post Categories

Image Galleries

Blog Roll

Cool Sites

Over on MSDN Coding4Fun there is an article on beginning DirectX development and they use the old (circa 1980) arcade game Battlezone as the basis for the game.  In its time, Battlezone pushed the limits of 3D graphical processing.  So much so that the environment was rendered in wire-frame.  It is generally considered the first true virtual reality game.  These days, you could run it on your phone.

Now, the sample tutorial suggests you use C# Express which targets the 2.0 Framework but they use the version of Managed DirectX for the 1.1 Framework.  This isn't a problem as it will all run just fine under 2.0 and MDX for 2.0 is still in Beta.  I decided to just use the 2.0 MDX and just convert the code where needed 'cause I'm cool like dat.  :)

How hard could it be?  Oh.  Did I mention I don't know the first thing about DirectX?

One of the first speed bumps you run into is the fact that when you go to reference the two dlls referred to in the tutorial, Microsoft.Directx.dll and Microsoft.Directx.Direct3D.dll, you find that only one of them has a 2.0 Version number.  A little investigation soon uncovers the fact that all of the MDX functionality has been consolidated into a single dll.  Microsoft.Directx.dll.  That's cool.

The next speed bump to appear is that while consolidating they are also cleaning up the namespace.  Doing away with overly complex overloads and renaming methods with more explicit names.  This is a Good Thing TM.  A method such as Matrix.PerspectiveFovLH becomes Matrix.PerspectiveFieldOfViewLeftHanded and Caps become Capabilities.  Much nicer and a cinch to figure out.

Others require a little more spelunking such as the change from:

int adapterOrdinal = Manager.Adapters.Default;

to:

int adapterOrdinal = AdapterCollection.Default.Adapter;

Then there's this one:

device.DrawUserPrimitives(PrimitiveType.LineStrip, 6, CreateCrossHairVertexArrayTop());

The CreateCrossHairVertexArrayTop function returns a Microsoft.DirectX.Direct3D.CustomVertex.PositionColored[] err...thing and the 2.0 DrawUserPrimitives wants a GraphicsBuffer ummm...do-dad.

I am so screwed.

The MDX documentation for 2.0 is sparse and digging into it often leads you to what is obviously 1.1 documentation.  After a little searching I found a link to Glenn Wilson over at Inner Realm who posted this little gem.  It's a base application employing the Microsoft provided framework for MDX that he's packaged up into a Visual Studio Community Content Installer File.  Uzip it, run it and then you're only a File --> New -- Project away from MDX goodness.

THANKS Glenn with two n's!!

Dave
Just because I can...(thanks to Glenn that is)

 

posted on Saturday, December 24, 2005 6:01 PM

Feedback

# re: DirectX 9 In The 2.0 Framework 8/30/2007 3:30 PM sakesh
its good

Comments have been closed on this topic.