I am trying to draw a string using GLUT with C ++ - IDE - VS 2008 - but an error occurred:
Windows called a breakpoint in Graphics.exe.
This may be due to a bunch of corruption, which indicates an error in Graphics.exe or any of the DLLs loaded.
It may also be due to the user pressing F12, while Graphics.exe has focus.
There may be more diagnostic information in the output window.
Of course I don't have a breakpoint in my code, this is my code:
#include <glut.h>
void init (void)
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,200.0,0.0,15.0);
}
void lineSegment(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glBegin(GL_LINES);
glVertex2i(180,15);
glVertex2i(10,145);
glEnd();
glFlush();
}
void main(int argc, char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowPosition(50,100);
glutInitWindowSize(400,300);
glutCreateWindow("N.S");
init();
glutDisplayFunc(lineSegment);
glutMainLoop();
}
Does anyone know a problem?
source
share