Content Archived

This content is no longer current.

Beginning Game Development: Part II - Introduction to DirectX

Sign in to queue

The Discussion

  • User profile image

    This articel is great. You understand how to take this subject and make me wanna learn everything about it. Your humor mixed in along is great!

    Thumbs up for you.

  • User profile image

    In the code housekeeping section you said you wrapped up creation of the GameEngine class into a using statement.

    How and where did you do that?


  • User profile image

    Your articles are great. Thanks!

  • User profile image

    @ Martin, Anthony:  using statements cause the dispose method to be called when a block is exited.  Very useful for closing connections and resource clean up.

  • User profile image

    the crash pleeeeeeease ... what are we doing wrong ?????????

  • User profile image

    After comparing files I found that

    device.VertexFormat = CustomVertex.PositionColored.Format;

    hast to before

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

    Thats all with my crashes now it works fine

  • User profile image

    It looks like a lot of people are having the same problem that I am, namely that the Device constructor is throwing an InvalidCallException when running in non-Windowed mode.  As far as I can tell from documentation the back buffer format needs to be set to something other than unknown if you want to run non-windowed.  I've looked through the available formats and tried a few, but I still get the exception.  Anyone know if this is why the exception is occurring?  It's difficult to debug as you can't step into the Device constructor code.

  • User profile image

    I'm using Visual Studio C# '05 Express Edition and have commenced developing an Xbox 360 game. I'm wondering if coding is any different because I have 12 errors and have done exactly as this tutorial has shown. PLEASE HELP

  • User profile image

    @Jesse, use XNA Game Studio instead if you want to develop in managed code for the 360.

  • User profile image

    Hi I am getting the following errors and cannot seem to able to get rid of them on the follow ing lines of code

    // Tell DirectX we are about to draw something


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

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

    errors i get:

    The name 'CreateCrossHairVertexArrayTop' does not exist in the current context

    The name 'CreateCrossHairVertexArrayBottom' does not exist in the current context


  • User profile image

    It is not looking for namespace Device it is looking for device.  (notice the case)

    The name given to the variable Device is device.  It needs to be visible in other methods, so it needs to be declared at the beginning of the class.

    Put in this line of code

    Device = device.

  • User profile image

    I was wondering how do you properly wrap the 'GameEngine' class to dispose things in a correct manner. I set up the framework for the dispose following the links you provided.

    But how do we exactly 'dispose' and what.

  • User profile image
    Tim Martin

    In the #if state with the debug, DEBUG has to be in all caps in order for it to work.

  • User profile image

    For people having problems with 64 bit OS

      1. G in to the menu option Tools>Options and the in the dialog box tick the box in the bottom right corner to "Show all settings"

      2. Once the settings expand go to "Projects and Settings" expand it and click on "General"

      3. Check the option which is called "Show advanced build configurations", then close the dialog box

      4. Now if you right click on the solution explorer, chose properties

      5. Goto "Configuration Properties", now you should be able to see the platform drop down. This will probably have only "Any CPU" selected; if so click on "Configuration Manager"

      6. Chose the option "New" under the "Active Solution Platform" drop down box

      7. Chose the new platform of x86 and copy your settings from "Any CPU"

      8. Then just make sure that your projects in your solution refer to x86 as the platform rather that "Any CPU"


  • User profile image

    @ge-force I didn't see where that was in this project. however will show how to do that in c#

  • User profile image

    I can't find QueryPerformanceCounter on my computer!

  • User profile image

    Very Nice Articles. Thank you very MUCH !

Add Your 2 Cents