GLUT/OpenGL, Windows 7 64 bit and VS2010 Express
Download GLUT for Win32 dll, lib and header file from:
http://press.liacs.nl/researchdownloads/glut.win32/glut-3.7.6-bin.zip
Extract to files to each folder :
glut.h: ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\GL\’
glut32.lib: ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\’
glut32.dll: ‘C:\Windows\System32\’
glut32.dll: ‘C:\Windows\SysWOW64\’ //For 64-bit machines
Place the sample code below in a file called mytest.cpp:
----------------------------------------------
#include <GL/glut.h>
void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,0.0,0.0);
glVertex3f(0.0,0.5,0.0);
glEnd();
glFlush();
}
void main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("GLUT Tutorial");
glutDisplayFunc(renderScene);
glutMainLoop();
}
----------------------------------------------
Now to setup a new project in MS VS 2010 Express:
(1) start MS VS2010
(2) Select File | New | Project
(3) Select Win32 | Win32 Console Application and enter a name for the project and click OK
(4) Left-click "Next" and then Select "Empty project" in the Win32 App Wizard
(5) Left-click "Finish" button
On the left column you should see "Solution Explorer" and a folder called "Source Files"
(6) Right-click on "Source Files" | Add | Existing Item
(7) Select your mytest.cpp file and click Add
At this point the VS2010 will say it is Parsing and scanning a lot of files. When it finishes, mytest.cpp should be located under "Source Files"
(8) Build Solution to create the executable
(9) Tools | Start debugging to run it.
|