3 (defmacro with-new-list
(list mode
&body forms
)
4 "New/End-List wrapper."
6 (gl:new-list
,list
,mode
)
7 (unwind-protect (progn ,@forms
)
10 (defmacro with-push-name
(name &body forms
)
11 "Select name push/pop wrapper"
14 (unwind-protect (progn ,@forms
)
17 (defmacro with-begin
(mode &body forms
)
18 "Immediate mode block wrapper."
21 (unwind-protect (progn ,@forms
)
24 (defmacro with-push-attrib
((&rest attrib-bits
) &body forms
)
25 "Pushes the bitwise or of attrib-bits, executing forms and clean up with pop-attrib."
27 (gl:push-attrib
(logior ,@attrib-bits
))
28 (unwind-protect (progn ,@forms
)
31 (defmacro with-push-matrix
(&body forms
)
32 "Pushes the current matrix onto the stack, executes forms and clean up with pop-matrix."
35 (unwind-protect (progn ,@forms
)
38 (defmacro with-setup-projection
(&body forms
)
39 "Switch to projection mode, load identity, execute forms and return to modelview matrix mode."
41 (gl:matrix-mode gl
:+projection
+)
43 (unwind-protect (progn ,@forms
)
44 (gl:matrix-mode gl
:+modelview
+))))
48 (defmacro with-push-client-attrib
((&rest attrib-bits
) &body forms
)
49 "Pushes the bitwise or of the client attrib-bits, executing forms and clean up with pop-client-attrib."
51 (gl:push-client-attrib
(logior ,@attrib-bits
))
52 (unwind-protect (progn ,@forms
)
53 (gl:pop-client-attrib
))))
56 (defmacro with-begin-query
((target id
) &body forms
)
58 (gl:begin-query
,target
,id
)
59 (unwind-protect (progn ,@forms
)
62 (export '(with-new-list with-push-name with-begin with-push-attrib with-push-matrix with-setup-projection with-push-client-attrib with-begin
))