OpenGL with Visual C++ 2008 Express Edition
OpenGL is a popular cross-platform library for 2-D and 3-D graphics programming. OpenGL comes with implementations on most operating systems and many compilers, including Visual C++ 2008 Express Edition, a modern, free IDE and compiler from Microsoft. Once VC++ 2008 is installed you simply need to create a new project and link to the correct libraries and headers to start using OpenGL.
Run Visual C++ and create a new project:
- Under the File menu select New → Project (Ctrl+Shift+N).
- Select Win32 Project, enter a Name, and click OK.
- In the Wizard click Next, then check the box next to Empty Project, and click Finish.
Add a new source file for the project:
- Under the Project menu select Add New Item (Ctrl+Shift+A).
- Select C++ File (.cpp), enter a Name, and click OK.
- Under the Project menu select Project Properties (Alt+F7) at the bottom.
- Select Configuration Properties → Linker → Input from the navigation panel on the left.
- Select All Configurations from the Configuration drop-down box at the top of the dialog. This ensures you are changing the settings for both the Debug and Release configurations.
- Type “opengl32.lib glu32.lib” in Additional Dependencies and click OK.
Now that your project is set up to use OpenGL you can start coding. Download opengl.cpp to begin with a basic Win32/OpenGL demonstration that compiles on VC++ 2008.
If everything is correct you should see a red square when running the code. Credit for this code goes mostly to examples from MSDN and NeHe.
To learn more about OpenGL programming there are several great online resources including NeHe Productions, OpenGL API Documentation, and GameDev.net.
Posted in Tutorials
June 16th, 2008 at 5:05 am
Dude, I love you!
I thought I never get this visual studio to work but with your tutorial I made it work. Thanks man.
August 30th, 2008 at 8:49 pm
This is great. I really appreciate it. All smiles here.
September 13th, 2008 at 12:12 am
Thanks, it works for both professional and express editions!
November 7th, 2008 at 6:51 pm
If only I’d found your page this morning I wouldn’t have been pulling my hair out all day!
I have never been so happy to see a red square.
Thanks!
February 4th, 2009 at 9:25 am
Simply smoothhhhhhhhhhhh.
works accurately.
February 21st, 2009 at 7:50 am
Thanks ! Finally I ran my code successfully !
April 5th, 2009 at 8:08 pm
Thank you, you explained in a very clear way. Thanks again and good luck
April 15th, 2009 at 12:40 pm
I have been trying to figure out how to do this for last 2 days by myself. And now with 15 mins of search i found this page and it did solve my problem. Thank you so much.
June 16th, 2009 at 2:24 am
Wow! finally something that works!!! This is awesome. I’ve spent hours trying to get visual C++ to work and no tutorials so far have got anything other than compile errors