This article is republished from Baidu Lesson: Configuring OpenGL in Visual Studio 2015
Program test:
#include "stdafx.h"
#include <GL/glut.h>
void init(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0, 200.0, 0.0, 150.0);
}
void lineSegment(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.4, 0.2);
glBegin(GL_LINES);
glVertex2i(180, 15);
glVertex2i(10, 145);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition(50, 100);
glutInitWindowSize(400, 300);
glutCreateWindow("An Example OpenGL Program");
init();
glutDisplayFunc(lineSegment);
glutMainLoop();
return 0;
}
Program running results:
Read More:
- Configuring OpenGL in Visual Studio
- Configuring OpenGL + glew in windows10 + Visual Studio 2017
- Detailed steps for installing Visual Studio 2010 + Intel parallel studio Xe 2013 and configuring mpich2
- Configuring OpenGL in VS
- The simplest course of configuring OpenGL in vs2015
- Visual studio 2019 + OpenGL environment configuration
- Visual studio 2017, OpenGL program running prompt glut32.dll missing solution
- Vc2010 configuring OpenGL environment
- Configure OpenGL development environment (glfw3 + glad) once and for all with visual studio
- Configuring OpenGL in Chinese version of VS2010 and problem solving
- Configuring OpenGL in Code:: blocks
- The solution of configuring OpenGL in vs2017
- A series of problems in configuring OpenGL development environment in vs2015
- Problems in configuring OpenGL
- Configuring OpenGL environment with code blocks16.0 in Windows 10
- Write about the problems and solutions when configuring OpenGL in vs2015
- Problems encountered in configuring OpenGL development environment in vs2015
- Configuring OpenGL development environment in win10 + vs2015 (including the method of installing 32-bit and 64 bit libraries)
- Solve the problem of flash back in Visual Studio 2010
- Three methods of referencing DLL in Visual Studio 2015