2 * Test display list corner cases.
13 static GLfloat Xrot
= 0, Yrot
= 0, Zrot
= 0;
14 static GLboolean Anim
= GL_FALSE
;
15 static GLuint List1
= 0, List2
= 0;
31 glClear(GL_COLOR_BUFFER_BIT
| GL_DEPTH_BUFFER_BIT
);
34 glRotatef(Xrot
, 1, 0, 0);
35 glRotatef(Yrot
, 0, 1, 0);
36 glRotatef(Zrot
, 0, 0, 1);
48 Reshape(int width
, int height
)
50 glViewport(0, 0, width
, height
);
51 glMatrixMode(GL_PROJECTION
);
53 glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
54 glMatrixMode(GL_MODELVIEW
);
56 glTranslatef(0.0, 0.0, -15.0);
61 Key(unsigned char key
, int x
, int y
)
63 const GLfloat step
= 3.0;
81 glutDestroyWindow(Win
);
90 SpecialKey(int key
, int x
, int y
)
92 const GLfloat step
= 3.0;
116 /* List1: start of primitive */
117 List1
= glGenLists(1);
118 glNewList(List1
, GL_COMPILE
);
124 /* List2: end of primitive */
125 List2
= glGenLists(1);
126 glNewList(List2
, GL_COMPILE
);
132 glEnable(GL_DEPTH_TEST
);
137 main(int argc
, char *argv
[])
139 glutInit(&argc
, argv
);
140 glutInitWindowPosition(0, 0);
141 glutInitWindowSize(400, 400);
142 glutInitDisplayMode(GLUT_RGB
| GLUT_DOUBLE
| GLUT_DEPTH
);
143 Win
= glutCreateWindow(argv
[0]);
144 glutReshapeFunc(Reshape
);
145 glutKeyboardFunc(Key
);
146 glutSpecialFunc(SpecialKey
);
147 glutDisplayFunc(Draw
);