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:
- Configuring OpenGL in Visual Studio 2015
- Vc2010 configuring OpenGL environment
- The simplest course of configuring OpenGL in vs2015
- 1 vs20152017 + OpenGL to configure and draw a white rectangle
- The first day of OpenGL [vs2017 + OpenGL environment configuration]
- Configuring OpenGL in VS
- A strange problem in compiling OpenGL program
- Problems encountered in vs2015 configuration using OpenGL environment
- OpenGL programming error analysis
- How to use high version OpenGL under Windows
- Configuration of OpenGL under CodeBlocks and solutions to problems encountered
- On the configuration of OpenGL Red Book eighth edition environment in vs2013
- To solve the problem of flashback of calling class function of glutsolidcube() in Win32 program
- Vs2015 + OpenGL environment configuration
- How to use higher version of OpenGL SDK in windows?
- Summary of problems encountered in compiling opengl code
- Error in header file when calling OpenGL to open obj file in vs2013: unable to open include file: “GL / glut. H”: no such file or directories
- Some configuration problems of OpenGL in VS2008
- (64 bit) OpenGL configuration + vs2017 + glew + glfw
- OpenGL class library and environment configuration under win10 and vs2015