/********* GLUT callbacks ***********/
void display()
{
/* Draw a grid on the screen */
int x, y, w, h;
w = glutGet(GLUT_WINDOW_WIDTH);
h = glutGet(GLUT_WINDOW_HEIGHT);
/* Clear the screen */
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
// glClear(GL_COLOR_BUFFER_BIT);
/* Set color to light grey */
glColor3f(0, 1.0, 0);
glBegin(GL_LINES);
glVertex3f(-2.0f, 2.0f, 0.0f);
glVertex3f(2.0f, -2.0f, 0.0f);
glEnd();
/* Force the commands to complete */
glFlush();
}
void idle()
{
/* Update the GUI */
if(!tickGUI())
{
/* The GUI window has been closed */
exit(EXIT_SUCCESS);
}
}
void reshape(int width, int height)
{
/* Setup the viewport and transformations that must be used for
the project */
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, width, height, 0);
//gluPerspective(44.0f, width/height, 0.2f, 255.0f);
// gluOrth
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -128.0f);
}