I tried to draw a simple line in OpenGL, the code below
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
gluLookAt(0.0, 50.0f , 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0);
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(50.0f, 50.0f, 50.0f);
glEnd();
//glutWireSphere(20.0f, 20.0f, 20.0f);
glutSwapBuffers();
glFlush();
}
However, when I run the program, the performance drop significantly then after a few seconds, it stops responding (I have to run task manager and force quit the program). However, when I disable the line and draw …