[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: drawing to offscreen bitmap bombs

Thanks to Mark, Bill, and Daniel for their assistance.  Is it ok to give
WITH-PORT an uninitialized port?  If so (I tried it and it seemed to work),
then Bill's code can be simplified somewhat:

>(rlet ((port :grafport))
>  (unwind-protect
>    (without-interrupts              ; omit; subsumed by with-port
>     (with-focused-view nil          ; omit
>       (with-port (ccl::%getport)
>         (#_openPort port)
>         (#_setPortBits *bitmap-1*)
>         (#_moveTo 20 20)
>         (#_lineTo 70 30))))
>    (#_closePort port)))

(rlet ((port :grafport))
    (with-port port          ; ok?  port is not yet initialized
      (#_openPort port)
      (#_setPortBits *bitmap-1*)
      ;; various drawing commands
    (#_closePort port)))

Regarding with-focused-view, the docs say:

 If [the view is] nil, the current GrafPort is set to an invisible 

Invisible GrafPort?  Maybe then I don't have to create an additional port? 
What is the usual purpose of this invisible GrafPort?

Again, thanks all.


Tom McDougal   mcdougal@cs.uchicago.edu   +1 (312) 702-9923
     University of Chicago Artificial Intelligence