VS2015 + openGL configuration
Steps for installing GLUT in Windows:
1, In C:\Program Files (x86)\ WindowKits \10\Include\10.0.10586.0\um\ GL or C:\Program Files (x86)\ WindowKits \8.1\Include\um\ GL there are GL.H and GLU.H;
![](https://programmerah.com/wp-content/uploads/2021/02/ca5ce16d54b67b7efdd17889155257d4.png)
The freeglut. J h, freeglut_ext. J h, freeglut_std. J h, glew. J h, glfw3. J h, glfw3native. J h, glut. J h, glxew. J h, wglew. J h, GLU. H and gl. H in C: \ Program Files \ Windows (x86) Kits 10 \ \ Include \ 10.0.10586.0 \ um \ gl or C: \ Program Files (x86) Kits \ Windows \ \ Include \ 8.1 um \ gl.
2, carry freeglut decompressed. Lib, glew32. Lib, glfw3dll. Lib, glu32. Lib, in the folder (C: \ Program Files \ Windows (x86) Kits 10 \ lib \ \ 10.0.10586.0 and, um, x86″
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\ UM \x64).
There were glu32.lib and opengl32.lib
![](https://programmerah.com/wp-content/uploads/2021/02/8b8166573763ae4f2cc0db63d80e6da7.png)
3, carry freeglut decompressed. DLL, glew32. DLL, glfw3. The DLL into the operating system directory under the system32 folder. (Location: C:\Windows\System32)
If it is a 64-bit operating System, copy it to C:\Windows\System
![](https://programmerah.com/wp-content/uploads/2021/02/e43b042cf1872449bc9c93dfe81e1c59.png)
Two VC engineering configuration:
1) Create a Win32 Console Application.
![](https://programmerah.com/wp-content/uploads/2021/02/31eedba5e664866e610f3a6cca7cea53.png)
![](https://programmerah.com/wp-content/uploads/2021/02/67867aef295f1bc0aef440144950d158.png)
2) Link to OpenGL libraries. Right click on Project — property,
The Settings are as follows:
![](https://programmerah.com/wp-content/uploads/2021/02/2b905f844218de15ae897e2c2c1453c4.png)
![](https://programmerah.com/wp-content/uploads/2021/02/92955f2c8d661c57f897f9675d9c488f.png)
![](https://programmerah.com/wp-content/uploads/2021/02/8d82c6f493dde77f36c55cc541c1c164.png)
I’m going to put FreeGlut.Lib first; glew32.lib; glfw3dll.lib;
Add semicolons between libraries; Or the enter key
3) Modify the code as follows:
#include “stdafx.h”
// opg1.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
# include “stdafx. H”
# include & lt; GL/glew.h>
# include & lt; GL/glut.h>
# include & lt; math.h>
void display(void)
{
GlClear (GL_COLOR_BUFFER_BIT); /* Clear all pixels */
GlColor3f (1.0, 1.0, 1.0);
GlBegin (GL_POLYGON);// the draw white polygon
GlVertex3f (0.25, 0.25, 0.0);
GlVertex3f (0.75, 0.25, 0.0);
GlVertex3f (0.75, 0.75, 0.0);
GlVertex3f (0.25, 0.75, 0.0);
GlEnd ();
GlFlush (); /* Start processing buffered OpenGL routines */
}
void init (void)
{
GlclearColor (0.0, 0.0, 0.0, 0.0, 0.0); /* select clearing color */
GlMatrixMode (GL_PROJECTION);
GlLoadIdentity ();
GlOrtho (0.0, 1.0, 0.0, 1.0, -1.0, 1.0); /* Initialize viewing values */
}
int main(int argc, char** argv)
{
GlutInit (& amp; argc, argv);
GlutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
GlutInitWindowSize (250, 250); /*Declare initial window size.*/
GlutInitWindowPosition (100, 100); /*Declare initial window position.*/
GlutCreateWindow (” hello “); /*Open window with “hello”in its title bar.*/
The init (); /*Call initialization routines.*/
GlutDisplayFunc (display); /*Register callback function to display graphics.*/
GlutMainLoop (); /*Enter main loop and process events.*/
Return 0; /* ANSI C requires main to return int. */
}
The compile run displays a white rectangle
![](https://programmerah.com/wp-content/uploads/2021/02/835ae14f1799fe516cd25d1956d4d698.png)
Steps for installing GLUT in Windows:
1, In C:\Program Files (x86)\ WindowKits \10\Include\10.0.10586.0\um\ GL or C:\Program Files (x86)\ WindowKits \8.1\Include\um\ GL there are GL.H and GLU.H;
![](https://programmerah.com/wp-content/uploads/2021/02/ca5ce16d54b67b7efdd17889155257d4.png)
The freeglut. J h, freeglut_ext. J h, freeglut_std. J h, glew. J h, glfw3. J h, glfw3native. J h, glut. J h, glxew. J h, wglew. J h, GLU. H and gl. H in C: \ Program Files \ Windows (x86) Kits 10 \ \ Include \ 10.0.10586.0 \ um \ gl or C: \ Program Files (x86) Kits \ Windows \ \ Include \ 8.1 um \ gl.
![](https://programmerah.com/wp-content/uploads/2021/02/f2bb153dce8d78613519f80cf58e3360.png)
2, carry freeglut decompressed. Lib, glew32. Lib, glfw3dll. Lib, glu32. Lib, in the folder (C: \ Program Files \ Windows (x86) Kits 10 \ lib \ \ 10.0.10586.0 and, um, x86″
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\ UM \x64).
There were glu32.lib and opengl32.lib
![](https://programmerah.com/wp-content/uploads/2021/02/8b8166573763ae4f2cc0db63d80e6da7.png)
3, carry freeglut decompressed. DLL, glew32. DLL, glfw3. The DLL into the operating system directory under the system32 folder. (Location: C:\Windows\System32)
If it is a 64-bit operating System, copy it to C:\Windows\System
![](https://programmerah.com/wp-content/uploads/2021/02/e43b042cf1872449bc9c93dfe81e1c59.png)
Two VC engineering configuration:
1) Create a Win32 Console Application.
![](https://programmerah.com/wp-content/uploads/2021/02/31eedba5e664866e610f3a6cca7cea53.png)
![](https://programmerah.com/wp-content/uploads/2021/02/67867aef295f1bc0aef440144950d158.png)
2) Link to OpenGL libraries. Right click on Project — property,
The Settings are as follows:
![](https://programmerah.com/wp-content/uploads/2021/02/2b905f844218de15ae897e2c2c1453c4.png)
![](https://programmerah.com/wp-content/uploads/2021/02/92955f2c8d661c57f897f9675d9c488f.png)
![](https://programmerah.com/wp-content/uploads/2021/02/8d82c6f493dde77f36c55cc541c1c164.png)
I’m going to put FreeGlut.Lib first; glew32.lib; glfw3dll.lib;
Add semicolons between libraries; Or the enter key
3) Modify the code as follows:
#include “stdafx.h”
// opg1.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
# include “stdafx. H”
# include & lt; GL/glew.h>
# include & lt; GL/glut.h>
# include & lt; math.h>
void display(void)
{
GlClear (GL_COLOR_BUFFER_BIT); /* Clear all pixels */
GlColor3f (1.0, 1.0, 1.0);
GlBegin (GL_POLYGON);// the draw white polygon
GlVertex3f (0.25, 0.25, 0.0);
GlVertex3f (0.75, 0.25, 0.0);
GlVertex3f (0.75, 0.75, 0.0);
GlVertex3f (0.25, 0.75, 0.0);
GlEnd ();
GlFlush (); /* Start processing buffered OpenGL routines */
}
void init (void)
{
GlclearColor (0.0, 0.0, 0.0, 0.0, 0.0); /* select clearing color */
GlMatrixMode (GL_PROJECTION);
GlLoadIdentity ();
GlOrtho (0.0, 1.0, 0.0, 1.0, -1.0, 1.0); /* Initialize viewing values */
}
int main(int argc, char** argv)
{
GlutInit (& amp; argc, argv);
GlutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
GlutInitWindowSize (250, 250); /*Declare initial window size.*/
GlutInitWindowPosition (100, 100); /*Declare initial window position.*/
GlutCreateWindow (” hello “); /*Open window with “hello”in its title bar.*/
The init (); /*Call initialization routines.*/
GlutDisplayFunc (display); /*Register callback function to display graphics.*/
GlutMainLoop (); /*Enter main loop and process events.*/
Return 0; /* ANSI C requires main to return int. */
}
The compile run displays a white rectangle
![](https://programmerah.com/wp-content/uploads/2021/02/835ae14f1799fe516cd25d1956d4d698.png)