Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Jan 3, 2025
1 parent be57bc9 commit 90b6397
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions gl-features.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,16 @@
;; KLUDGE: this sucks.
(defvar *depth-mask* T)
(defmacro with-depth-mask (mode &body body)
(let ((old-mode (gensym "OLD-MODE")))
(let ((old-mode (gensym "OLD-MODE"))
(new-mode (gensym "NEW-MODE"))
(thunk (gensym "THUNK")))
`(let ((,old-mode *depth-mask*)
(*depth-mask* ,mode))
(gl:depth-mask *depth-mask*)
(multiple-value-prog1 (progn ,@body)
(gl:depth-mask ,old-mode)))))
(,new-mode ,mode))
(flet ((,thunk ()
,@body))
(if (eq ,new-mode ,old-mode)
(,thunk)
(let ((*depth-mask* ,new-mode))
(gl:depth-mask ,new-mode)
(multiple-value-prog1 (,thunk)
(gl:depth-mask ,old-mode))))))))

0 comments on commit 90b6397

Please sign in to comment.