Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Setting Up Visual Studio Express 2005 For OpenGL + Direct X
Index -> Programming, C++ -> C++ Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Geostigma




PostPosted: Sun Jun 03, 2007 12:00 am   Post subject: Setting Up Visual Studio Express 2005 For OpenGL + Direct X

Setting Up Visual Studio Express C++ 2005 for OpenGL and Direct X programming

This is a tutorial to help people properly set up VS 2005 to create Win 32 programs and will explain what you need and how to set everything up

1. Required Files.

1. Download Microsoft Visual Studio Express c++ 2005
http://msdn.microsoft.com/vstudio/express/downloads/default.aspx

2. Download the Microsoft Platform SDK R2
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/

Optional

Download the Direct X SDK 2007
http://www.microsoft.com/downloads/details.aspx?FamilyID=86cf7fa2-e953-475c-abde-f016e4f7b61a&DisplayLang=en


If you want to compile with OpenGL then you just need theMicrosoft Platform SDK to create the win 32 programs. All the OpenGL libraries are included with this sdk (Including GLaux.h) includes ect to create OpenGL powered programs. The Direct X SDK must be downloaded because it has all the library files etc to compile the Direct X code.

Note: you need both SDK's to compile Direct X

To compile any of the code you need Microsoft Net Framework V 2.0 or higher to run VS of any version. .Net should automatically download when you run the VS 2005 installer if you don't have it.

2. Setting up VS studio

1.Install VS 2005, Microsoft Platform SDK and Direct X SDK

2. Open up Visual Studio and go into Tools\Options\Projects and solutions\VC++ Directories

Directx is optional (optional) if you just want OpenGL

Add to the Executable directories

Microsoft Platform SDK bin folder to the Executable files directories
<Path>\Microsoft Platform SDK for Windows Server 2003 R2\Bin


Add to the Library directories

-Microsoft Platform SDK lib folder
<Path>\Microsoft Platform SDK for Windows Server 2003 R2\Lib

-Direct X SDK lib folder x86(optional)
<Path>\Microsoft DirectX SDK (April 2007)\Lib\x86


Add to the Include directories

-Microsoft Platform SDK
<Path>Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include
-Direct X SDK(optional)
<Path>Program Files\Microsoft DirectX SDK (April 2007)\Include


Add to the Source Directories

-Microsoft Platform SDK
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\src

-Direct X SDK(optional)
C:\Program Files\Microsoft DirectX SDK (April 2007)\Utilities\Source


3. Exit VS 2005 and go into the installation folder where your VS 2005 is kept. you need to edit the “corewin_express.vsprops” file (found in <Path>\Microsoft Visual Studio 8\VC\VCProjectDefaults and change the string that reads:
code:

AdditionalDependencies="kernel32.lib"

to
code:
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"



Using notepad, you need to edit the file “AppSettings.htm” located in the folder
<Path>\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\Application\html\1033\.
Comment out lines 441 - 444 by putting a “//” in front of them as shown here:

code:
// WIN_APP.disabled = true;
// WIN_APP_LABEL.disabled = true;
// DLL_APP.disabled = true;
// DLL_APP_LABEL.disabled = true



Save and close the file and open Visual C++ Express.


3. Testing your set up.

(OpenGL)
Go to http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=03 and download the VS project and extract all files and open it in VS 2005. Compile and run the program. You should have initialization dialog and when you start it see a cube and a triangle.

If there is an Error compiling the program, then there is something wrong with the set up. Check that you edited and saved the "corewin_express.vsprops" not the corewin.vsprops. The corewin_express.vsprops shouldn't even let you save any changes made. Make sure that you commented the proper lines out in your AppSettings.htm folder.

(DirectX)
Open and compile any of the projects in the <Path>Program Files\Microsoft DirectX SDK (April 2007)\Samples\C++\Direct3D\Tutorials directory

If there is an Error compiling the program, then there is something wrong with the set up. Check that you edited and saved the "corewin_express.vsprops" not the corewin.vsprops. The corewin_express.vsprops shouldn't even let you save anychanges made. Make sure that you commented the proper lines out in your AppSettings.htm folder.
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Sun Jun 03, 2007 8:38 am   Post subject: RE:Setting Up Visual Studio Express 2005 For OpenGL + Direct X

Nice job. This one will be popular I'm sure.
Mazer




PostPosted: Sun Jun 03, 2007 8:46 am   Post subject: RE:Setting Up Visual Studio Express 2005 For OpenGL + Direct X

I can see why you wanted to make this tutorial, and I appreciate that, but some of it needs clearing up. The very first impression I had was that you wanted the tutorial to teach people to write programs that used both OpenGL and DirectX together.

Also, in a few places I think you referred to "VS Studio". The "S" stands for Studio. (this is no big deal, of course, just wanted to clear it up).

Lastly, it's pretty well accepted that glaux sucks. You can make OpenGL applications just fine without it, and if you want to load an image to use as a texture, there are plenty of image loading libraries out there.
Geostigma




PostPosted: Sun Jun 03, 2007 8:12 pm   Post subject: RE:Setting Up Visual Studio Express 2005 For OpenGL + Direct X

Suggestions to make it better?
Quakerstate98




PostPosted: Sun Mar 30, 2008 12:20 am   Post subject: (No subject)

hey, i'm getting a error when i try to install the direct x, says its not a valid win32 application. Any suggestions to fix this?
Display posts from previous:   
   Index -> Programming, C++ -> C++ Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: