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

potential bug in graphics:draw-image



In my understanding, the following two functions are supposed to do the
same thing. They each bitblt up a filled circle twice at offset 0,0 and
twice at offset 10,10. Since they both use :alu :flip this should cancel
out and leave a blank screen. The GOOD example directly draws circles
with graphics:draw-circle. Indeed this does the right thing. But the
BAD example first caches the circle as an image and then draws the
image at the same offsets. This leaves some ugly residue. Is there
something that I don't understand or is this a bug. I was under the
impression that graphics:draw-image simply did a bitblt. Am I wrong?
        Jeff

(defun 1BUG0 ()
 (let ((c (graphics:with-output-to-bitmap (t)
            (graphics:draw-circle 100 100 100))))
   (dw:with-own-coordinates (t :erase-window t :enable-output-recording nil)
     (graphics:draw-image c 0 0 :alu :flip)
     (graphics:draw-image c 10 10 :alu :flip)
     (graphics:draw-image c 10 10 :alu :flip)
     (graphics:draw-image c 0 0 :alu :flip)))
 (read-char)
 t)

(defun 1GOOD0 ()
 (dw:with-own-coordinates (t :erase-window t :enable-output-recording nil)
   (graphics:draw-circle 100 100 100 :alu :flip)
   (graphics:draw-circle 110 110 100 :alu :flip)
   (graphics:draw-circle 110 110 100 :alu :flip)
   (graphics:draw-circle 100 100 100 :alu :flip))
 (read-char)
 t)