#include #include /* compile command: gcc gltest.c -g -o gltest -lGL -lglut * * must be run using xinit and DRI3 to see the issue. * * Program will hang in draw function. * * Comment out any one of * glutInitWindowPosition * glutFullScreen * glDrawBuffer(GL_FRONT) * * and it will execute properly. * * It will also work if DRI2 is used. * LIBGL_DRI3_DISABLE=1 ./gltest * */ static void idle(void) { glutPostRedisplay(); } static void reshape(int width, int height) { glViewport(0, 0, (GLint) width, (GLint) height); } static void draw(void) { printf("Draw!\n"); glBegin(GL_QUADS); glVertex2f(-1.3333, 1.0); glVertex2f(1.3333, 1.0); glVertex2f(1.3333, -1.0); glVertex2f(-1.3333, -1.0); glEnd(); glutSwapBuffers(); } int main(int argc, char *argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); glutInitWindowPosition(0, 0); glutInitWindowSize(1024, 768); glutCreateWindow("Screen"); glClearColor(0.0, 0.0, 0.0, 1.0); glutDisplayFunc(draw); glutReshapeFunc(reshape); glutIdleFunc(idle); glutFullScreen(); glDrawBuffer(GL_FRONT); glutMainLoop(); return 0; }