Mouse location input.

Andrew Myers andru at rhialto.SGI.COM
Sat Apr 15 06:08:56 AEST 1989


In article <8904141229.AA24616 at explorer.dgp.toronto.edu>, juancho at dgp.toronto.edu (John Buchanan) writes:
>    Is there any way to determine the location of a mouse relative to
> a window rather than in absolute screen coordinates?  The code that I have
> now looks like this.
  [ a valid solution to the problem ]
> I cannot even imagine the thinking which led to the line drawing occuring
> in window coordinates but the mouse tracking only in screen coordinates.

    Actually, line drawing doesn't occur in window coordinates; it occurs
    in world coordinates. In a pixel-oriented paradigm, the two are the
    same; however, SGI uses a 3D paradigm, and they are quite different.

    As far as getting window-relative mouse coordinates, it seems like a
    decision fraught with trade-offs. The only real issue is programmer
    ease/confusion; as you've demonstrated, it's easy enough to translate
    screen coordinates to window coordinates.

    Personally, I prefer to get the coordinates in an absolute system,
    because it reduces confusion for me, especially when writing multi-
    window programs. De gustibus non est disputandum.

> 
> 	
> John W. Buchanan                  Dynamic Graphics Project
>                			  Computer Systems Research Institute
> 				  University of Toronto
> (416) 978-6619			  Toronto, Ontario M5S 1A4
> 

Andrew Myers



More information about the Comp.sys.sgi mailing list