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

Strange graphics behavior



I am having trouble understanding some strange graphics behavior. Consider the code:

(defvar *disp*)
(defvar *vp*)
(proclaim '(special *disp* *vp*))

(setq *disp* (tv:make-window 'tv:window :x 100 :y 100 :size '(500 500)
			       :deexposed-typeout-action :expose))
(send *disp* :set-cursor-visibility nil)
(graphics:graphics-translate 250 250 :stream *disp*)
(graphics:graphics-scale 100 -100 :stream *disp*)


(defun draw-edge (v1 v2 &optional (m *vp*) (s *disp*))
  (let ((from (project-vector v1 m))
	(to (project-vector v2 m)))
    (graphics:draw-line (aref from 0) (aref from 1)(aref to 0)(aref to 1)
			 :stream s)))

If I call (draw-edge (vector -1 1 0) (vector 1 1 0)) I get nothing. If I then
put a break right before the call to graphics:draw-line, I can look at from and
to. Their values are (vector -.2 .2 0) (vector .2 .2 0), which is correct.
If I execute the (graphics:draw-line ... from the debugger, the line drawn is
exactly what I expect. But if I continue, I get nothing. 

What am I missing? Seems to simple not to be obvious.
Thanks
Strip