diff --git a/lisp/opengl/src/glview.l b/lisp/opengl/src/glview.l index bcf3da6dd..e70c8aef3 100644 --- a/lisp/opengl/src/glview.l +++ b/lisp/opengl/src/glview.l @@ -290,15 +290,23 @@ (glEnable GL_LIGHTING) (glMatrixMode GL_MODELVIEW) (glLoadIdentity)) - (:2d-mode () + (:2d-mode (&key ((:push apush) nil)) (glViewport 0 0 x::width x::height) (glMatrixMode GL_PROJECTION) + (if apush (glPushMatrix)) (glLoadIdentity) (glorthofv (float-vector 0 x::width 0 x::height -1.0 1.0)) (glDisable GL_DEPTH_TEST) (glDisable GL_LIGHTING) (glMatrixMode GL_MODELVIEW) + (if apush (glPushMatrix)) (glLoadIdentity)) + (:pop-mode () + (glMatrixMode GL_PROJECTION) + (glPopMatrix) + (glMatrixMode GL_MODELVIEW) + (glPopMatrix)) + ; (:clear (mask &key (color)) ; (if color ; (glClearColorfv color)) @@ -331,18 +339,18 @@ (defmethod glviewsurface (:point (x y) - (send self :2d-mode) + (send self :2d-mode :push t) (glBegin GL_POINTS) (glVertex2fv (float-vector x (- x::height y))) (glEnd) - (send self :3d-mode)) + (send self :pop-mode)) (:line (x1 y1 x2 y2) - (send self :2d-mode) + (send self :2d-mode :push t) (glBegin GL_LINES) (glvertex2fv (float-vector x1 (- x::height y1))) (glVertex2fv (float-vector x2 (- x::height y2))) (glEnd) - (send self :3d-mode)) + (send self :pop-mode)) (:3d-point (pos) (glDisable GL_DEPTH_TEST) (glDisable GL_LIGHTING) @@ -365,14 +373,14 @@ (draw-face f nil nil)) faces)) (:rectangle (x y w h) - (send self :2d-mode) + (send self :2d-mode :push t) (glBegin GL_POLYGON) (glVertex2fv (float-vector x y)) (glVertex2fv (float-vector x (+ y h))) (glVertex2fv (float-vector (+ x w) (+ y h))) (glVertex2fv (float-vector (+ x w) y)) (glEnd) - (send self :3d-mode)) + (send self :pop-mode)) ) (defun geo::default-viewsurface (&rest args)