|
Creating VS C++ Project with OpenGL |
|
I'm assuming you have downloaded glut and put the files in the path of visual studio. If you didn't just copy them with the projects files and include glut.h from there. Ok. Create a new Project from Visual Studio: File/New/Project and choose Win32 Console Application, under Visual C++/Win32. You get a 2 step wizard but we don't care about any of those settings so just press finish. You end up with a project with 3 files: A cpp with the same name as your project, stdafx.cpp and stdafx.h. The last one is a precompiled header file you will need to include in any .cpp file you add to the project. It's got nothing to do with opengl...you do this for every windows application. Now you can include under it glut.h. One peace of advice....stdlib.h doesn't like glut very much as it redefines some of it's symbols so if you need stdlib.h (for malloc for instance) make sure you include it before glut.h or you'll get some compiling errors. Man I had some headaches over this. Now you are ready to add some code to the project. Check the next tutorial for an example.
|