1. Configure the OpenGL environment to download glut (OpenGL utility Toolkit) https://www.opengl.org/resources/libraries/glut/to Local. After decompression there are two Lib files, two DLL files and one. h file.
2. Glut.lib and Glut32.lib are copied to X:\Program Files (x86) \microsoft Visual Studio 12.0\vc\lib.
3. Glut.dll and Glut32.dll copied to the C:\Windows\system32 folder (32-bit system) or? C:\WINDOWS\SYSWOW64 (64-bit system) (two directories are copied)
4.. h files are copied to X:\Program files (x86) \microsoft Visual Studio 12.0\VC\INCLUDE\GL If you do not have a GL folder under the Incluce directory, you will need to manually create
This will set the OpenGL environment in place.
1. Create a new Win32 project, preferably not empty.
2. Follow the tutorial code, the address is: http://www.yakergong.net/nehe/content no longer repeat.
3. In vs2013, the string type cannot be converted error, that is, the encoding format error problem, string constants directly _t () macro can be resolved, if it is a variable, you need to do a conversion in the following way.
char* title = "AAAA";
WCHAR wsztitlename[256];
memset (wsztitlename, 0, sizeof (wsztitlename));
int L = MultiByteToWideChar (CP_ACP, 0, title, Lstrlena (title), Wsztitlename, sizeof (wsztitlename)/sizeof (wsztitlename[ 0]));
Then you can use Wsztitlename.
The above method is derived from http://blog.csdn.net/rodgeliao/article/details/7091926
After the above steps, the Nehe code can be run on the vs2013
Works for: http://download.csdn.net/detail/mizoushenjing/8723589
Nehe OpenGL Tutorial OpenGL window ported to vs2013 Win7 environment