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 fc69687
Show file tree
Hide file tree
Showing 2 changed files with 14 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))))))))
2 changes: 2 additions & 0 deletions pipeline.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@
(setf (getf texspec :width) 'width))
(unless (getf texspec :height)
(setf (getf texspec :height) 'height))
(unless (getf texspec :depth)
(setf (getf texspec :depth) 'depth))
(unless (getf texspec :target)
(setf (getf texspec :target) :texture-2d))
texspec))
Expand Down

0 comments on commit fc69687

Please sign in to comment.