Version: 4.0.2
8 A More Complicated Example
The use of multiple viewports, viewport descriptors, drawing operations for multiple viewports is as easy as the use of a single viewport:
(let* (; w1 and w2 are viewports for different windows |
[w1 (open-viewport "viewport 1" 300 300)] |
[w2 (open-viewport "viewport 2" 200 500)] |
; d1 and d2 draw lines in different viewports |
[d1 (draw-line w1)] |
[d2 (draw-line w2)]) |
; draws a line in viewport labeled “viewport 1” |
; draws a line in viewport labeled “viewport 2” |
|
; we no longer have access to viewports 1 and 2, |
; since their descriptors did not escape the let |
; removes the viewports |