- /* Sadly, this causes a stall of the graphics pipeline (as would the
- equivalent calls to glGet*.) But there's no way around this, short
- of having each caller set up the specific display matrix we need
- here, which would kind of defeat the purpose of centralizing this
- code in one file.
- */
- glPushAttrib(GL_TRANSFORM_BIT | /* for matrix contents */
- GL_ENABLE_BIT | /* for various glDisable calls */
- GL_CURRENT_BIT | /* for glColor3f() */
- GL_LIST_BIT); /* for glListBase() */
- {
- check_gl_error ("glPushAttrib");
-
- /* disable lighting and texturing when drawing stars!
- (glPopAttrib() restores these.)
- */
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_LIGHTING);
- glDisable(GL_DEPTH_TEST);
-
- /* glPopAttrib() does not restore matrix changes, so we must
- push/pop the matrix stacks to be non-intrusive there.
- */
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- {
- check_gl_error ("glPushMatrix");
- glLoadIdentity();
-
- /* Each matrix mode has its own stack, so we need to push/pop
- them separately. */
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- {
- check_gl_error ("glPushMatrix");
- glLoadIdentity();