Chad Vernon
  • Home
  • Reel/Resume
  • Work
  • Resources
  • About
  • Contact
sideBar

Search

Categories

  • CG
  • cvxporter
  • Maya
    • API
    • Plug-ins
  • Personal

Archives

  • September 2011
  • June 2011
  • March 2011
  • December 2010
  • November 2010
  • September 2010
  • August 2010
  • July 2010
  • May 2010
  • April 2010
  • March 2010
  • December 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007

Rss

  • Main Entries RSS
  • Comments RSS
Home » Resources » DirectX 9 » Setting Up Visual Studio .NET 2003

Setting Up Visual Studio .NET 2003

Before you can start programming with DirectX, you need to setup your IDE so it can find all the DirectX files.

Step 1

First, create a new Win32 project.

Step 2

Just click Finish here.

Step 3

Go up to the menu bar and hit Tools > Options.

Step 4

In the Options dialog, click on the Project folder in the menu tree on the left. Then click VC++ Directories. This is where we can tell Visual Studio where to find the DirectX libraries and header files. In the top right corner of the Options dialog is the “Show directories for:” drop down menu. First select “Include files” so we can set the directory of the DirectX header files. Installing the DirectX SDK should have put in the directory automatically, but if it didn’t, you’ll need to add the Include directory yourself. Make sure the directory ends up at the top of the list as shown in the picture. This is to ensure that Visual Studio uses the latest SDK instead of the SDK that is installed with Visual Studio.

Step 5

Next, set the DirectX library directory. This is the same process as setting the Include directory except you select “Library files” from the drop down menu. Don’t forget to move it to the top of the list. After this, click OK.

Step 6

Go up to the menu bar again and click Project > “Your project name here” Properties.

Step 7

The IDE knows where to find the DirectX files, but you need to tell Visual Studio that the current project is going to use the DirectX libraries. In the Project Properties dialog, select Linker > Input from the tree on the left. In “Additional Dependencies” you need to add all the library files that the project will be using. To get started, add “dxerr9.lib dxguid.lib d3dx9d.lib d3d9.lib dinput8.lib winmm.lib comctl32.lib“.

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

// Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN

#define SAFE_RELEASE(x) if( x ) { (x)->Release(); (x) = NULL; }
#define SAFE_DELETE(x) if( x ) { delete(x); (x) = NULL; }
#define SAFE_DELETE_ARRAY(x) if( x ) { delete [] (x); (x) = NULL; }

// Windows Header Files:
#include <windows.h>

// C RunTime Header Files
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>

// DirectX Header Files
#include <d3d9.h>
#include <d3dx9.h>

And finally, you need to include the DirectX headers (d3d9.h and d3dx9.h) in the source code. By default, Visual Studio uses precompiled headers. Therefore, add the includes into the stdafx.h file. This is also a nice place to define macros that you might want to use throughout your program. With precompiled headers, you need to include stdafx.h in every file.

After these steps, Visual Studio should all be ready to use DirectX.

No Responses to “Setting Up Visual Studio .NET 2003”

Subscribes to this topic Comment RSS or TrackBack URL

Leave A Reply

Allowed tag : <blockquote>, <p>, <code>, <em>, <small>, <ul>, <li>, <ol>, <a href=>..

 Username

 Email Address

 Website

Sticky: Always double check your comment before posting Please Note: Comment Moderation Maybe Active So There Is No Need To Resubmit Your Comments
Home » Resources » DirectX 9 » Setting Up Visual Studio .NET 2003

© 2011 Chad Vernon