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)
Read More:
- The simplest way to configure OpenGL development environment with vs2015
- Vs2013 + glfw + glew configure OpenGL development environment
- Configure OpenGL development environment (vs2015)
- OpenGL result white screen solution
- Solution to the problem that OpenGL can’t find glew32.dll in vs2019
- OpenGL environment configuration under VS2010 / vs2012 / vs2015
- VC + + OpenGL is used as the development platform to design the program, which can generate any pixel on the screen, and use the pixel to draw the basic graphics
- Vs2017 installing OpenGL
- [181124] VC + + use OpenGL to draw 3D graphics example source code
- The simplest course of configuring OpenGL in vs2015
- Configuring OpenGL in VS
- Vs compiling OpenGL project, the solution of unable to open the source file “GL / glaux. H” appears
- Configure OpenGL in CodeBlocks
- Vs2015 + OpenGL environment configuration
- Configure glut in Ubuntu and implement basic OpenGL experiment on CodeBlocks platform
- Vs2015 OpenGL environment configuration
- Vs configure tensorrt environment to use
- (64 bit) OpenGL configuration + vs2017 + glew + glfw
- Configuring OpenGL development environment in win10 + vs2015 (including the method of installing 32-bit and 64 bit libraries)
- Configure OpenGL development environment (glfw3 + glad) once and for all with visual studio