Create with-graphics-context macro
This commit is contained in:
parent
4fc83b269a
commit
be7fa37495
@ -92,6 +92,12 @@
|
|||||||
(sdl2:destroy-window window)
|
(sdl2:destroy-window window)
|
||||||
(sdl2:quit)))
|
(sdl2:quit)))
|
||||||
|
|
||||||
|
(defmacro with-graphics-context ((var &rest args) &body body)
|
||||||
|
`(let ((,var (make-instance 'graphics-context ,@args)))
|
||||||
|
(unwind-protect
|
||||||
|
(progn ,@body)
|
||||||
|
(cleanup ,var))))
|
||||||
|
|
||||||
(define-transform project-to-screen (screen-height)
|
(define-transform project-to-screen (screen-height)
|
||||||
:x-transform (round x)
|
:x-transform (round x)
|
||||||
:y-transform (round (- screen-height y)))
|
:y-transform (round (- screen-height y)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user