Statement macro
Associates a sheet with a medium.
with-sheet-medium ({medium = sheet}) {body} end
duim-sheets
duim-sheets
Associates a sheet with a medium.
Within body, the variable medium is bound to the medium allocated to sheet. The sheet specified should be an instance of type <sheet>. If sheet does not have a medium permanently allocated, one is allocated and associated with sheet for the duration of body, and then unassociated from sheet and deallocated when body has been exited. The values of the last form of body are returned as the values of with-sheet-medium.
The medium argument is not evaluated, and must be a symbol that is bound to a medium. The body may have zero or more declarations as its first forms.
This macro is a useful way of speeding up drawing operations, since drawing on a sheet requires finding the medium for that sheet. You can use with-sheet-medium to associate a known sheet with a medium, and then draw directly onto that medium, as shown in the example.
with-sheet-medium (medium = sheet)
with-drawing-options (medium, brush: color)
for (x :: <integer> from 0 to 199)
for (y :: <integer> from 0 to 199)
draw-point(medium, x, y)
end
end
end
end