Enhance the gl-assert macro to include an implicit progn
This commit is contained in:
parent
8b96f8166f
commit
a26b19be1b
1 changed files with 9 additions and 6 deletions
|
|
@ -37,12 +37,15 @@ Store values like the drivers version."
|
|||
(and (<= maj *major-version*)
|
||||
(<= min *minor-version*))))
|
||||
|
||||
(defmacro gl-assert (form)
|
||||
`(prog1
|
||||
(defmacro gl-assert (&body body)
|
||||
`(progn
|
||||
,@(loop for form in body
|
||||
collect `(prog1
|
||||
,form
|
||||
(let ((err-sym (%gl:get-error)))
|
||||
(unless (eq err-sym :zero)
|
||||
(error "The OpenGL command `~a'~%~2iresulted in an error: ~s~%" ',form err-sym)))))
|
||||
(error "The OpenGL command `~a'~%~2iresulted in an error: ~s~%"
|
||||
',form err-sym)))))))
|
||||
|
||||
(defmacro gl-restart (form)
|
||||
`(restart-case
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue