The project name – & gt; Manage NUGET packages ->; Browse – & gt; Search Nupengl, download and install it. Reference blog:
https://blog.csdn.net/HY_JT/article/details/79482556 can also refer to the blog: https://blog.csdn.net/yinglang19941010/article/details/50166343
#include <cstdio>
#include <GL/glew.h>
#include <GL/freeglut.h>
#pragma comment(lib, "glew32.lib")
void displayFunction()
{
glClear(GL_COLOR_BUFFER_BIT);
glRectf(-0.5, -0.5, 0.5, 0.5);
glColor3f(0.0, 1.0, 0.0);
glFlush();
};
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutInitWindowSize(600, 600);
glutCreateWindow("The first OpenGL Application");
glewExperimental = true;
glewInit();
printf("OpenGL version: (%s) \n", glGetString(GL_VERSION));
glutDisplayFunc(&displayFunction);
glutMainLoop();
return 0;
}
Read More:
- The experience of installing OpenGL in vs2017 under win7 system
- Configuring OpenGL development environment in win10 + vs2015 (including the method of installing 32-bit and 64 bit libraries)
- [graphics] exceptions in downloading and installing OpenGL in vs2017
- OpenGL environment configuration under VS2010 / vs2012 / vs2015
- Configuring OpenGL in VS
- The simplest course of configuring OpenGL in vs2015
- 1 vs20152017 + OpenGL to configure and draw a white rectangle
- Vs2015 + OpenGL environment configuration
- Problems encountered in vs2015 configuration using OpenGL environment
- On the configuration of OpenGL Red Book eighth edition environment in vs2013
- Solution to the problem that OpenGL can’t find glew32.dll in vs2019
- Some configuration problems of OpenGL in VS2008
- The solution of configuring OpenGL in vs2017
- Configure OpenGL development environment (vs2015)
- Vs2015 configuring OpenGL (glfw, glew)
- (64 bit) OpenGL configuration + vs2017 + glew + glfw
- Configuring OpenGL with vs2019
- Vs2015 OpenGL environment configuration
- OpenGL class library and environment configuration under win10 and vs2015
- Vs2013 + glfw + glew configure OpenGL development environment