This may be the simplest configuration of OpenGL related library method, this semester needs to learn graphics, so the Internet to find a variety of configuration OpenGL method, found that many people are copied to copy, many methods are wrong. Otherwise, the PC environment is different and various.lib file lookup errors appear in the configuration. Also many methods need to configure the external environment, is also troublesome. Today I will introduce my own method, do not need to consider the computer environment, convenient and simple.
1. Upgrade to VS2015
I am using VS2015. I do not know about the previous version, nor do I know whether it can be used, so I suggest you to upgrade to 2015. After all, do you use the new version or not?
2. Open VS2015 and create a new Win32 project (won’t create the wall to go).
Name it whatever you want, place it whatever you want.
3. Use NUTGET
This step is the most important and the only step in the configuration process.
vs2015 toolbars -> NuGet Package Manager-> Manage Nuget Packages for solution
The diagram below
1. Upgrade to VS2015
I am using VS2015. I do not know about the previous version, nor do I know whether it can be used, so I suggest you to upgrade to 2015. After all, do you use the new version or not?
2. Open VS2015 and create a new Win32 project (won’t create the wall to go).
Name it whatever you want, place it whatever you want.
3. Use NUTGET
This step is the most important and the only step in the configuration process.
vs2015 toolbars -> NuGet Package Manager-> Manage Nuget Packages for solution
The diagram below
And then you see something like this
Search the Browse window for any library you want. For example, here I want to configure glew and freeGLUT, I’ll search glew and then click Install at the top.
When configuring FreeGLUT, remember to select the second one. In fact, you can look at the installation amount, and select the one with the highest installation amount as the safest install.
4. Test
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glut.h>
void init()
{
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
}
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition(100, 100);
glutInitWindowSize(800, 480);
glutInitDisplayMode(GLUT_RGBA);
glutCreateWindow("opengl");
glewInit();
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
Run this code, if run successfully indicates that the configuration is successful, do not need any reference code what, super convenient!!
if you’re running failure is your problem, it’s ok with me (low ˇ ∀ ˇ “)
Read More:
- The simplest way to configure OpenGL development environment with vs2015
- Configuring OpenGL in VS
- Configuring OpenGL development environment in win10 + vs2015 (including the method of installing 32-bit and 64 bit libraries)
- The solution of configuring OpenGL in vs2017
- Configuring OpenGL in Chinese version of VS2010 and problem solving
- A series of problems in configuring OpenGL development environment in vs2015
- Write about the problems and solutions when configuring OpenGL in vs2015
- Vs2019 nuget configuring OpenGL
- Vs2015 configuring OpenGL (glfw Library)
- Problems encountered in configuring OpenGL development environment in vs2015
- Vs2015 configuring OpenGL (glfw, glew)
- Configuring OpenGL with vs2019
- Configuring OpenGL in Visual Studio 2015
- Vs2015 configuring OpenGL development environment: configuration of glfw library and glad Library
- Configuring OpenGL in Code:: blocks
- Configuring OpenGL environment with code blocks16.0 in Windows 10
- Configuring OpenGL in Visual Studio
- Problems in configuring OpenGL
- Vc2010 configuring OpenGL environment
- OpenGL environment configuration under VS2010 / vs2012 / vs2015