当我在visual studio 2013中运行我的项目时,我收到此错误。 “glut_demo.exe中0x10005655(glut32.dll)的未处理异常:0xC0000005:访问冲突读取位置0x00000020。”
代码就在这里:
#include<GL\glut.h>
const GLsizei windowWidth = 500;
const GLsizei windowHeight = 500;
GLvoid drawScene(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glFlush();
//this line is modified in diff window interfaces.
glutSwapBuffers();
}
GLvoid timerLoop(int value)
{
glutPostOverlayRedisplay();
glutTimerFunc(1, timerLoop, 0);
}
int main(int argc, char *argv[])
{
// initialize glut
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE);
int windowID = glutCreateWindow("OpenGL CUBE demo");
glutReshapeWindow(windowWidth, windowHeight);
glutDisplayFunc(drawScene);
glutTimerFunc(1, timerLoop, 0);
glutMainLoop();
//it never reacheas here.
return 0;
}