Re: Cursor changes

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (aschaffe)
Fri, 10 Dec 1993 21:12:40 -0800


On Dec 9, 3:49pm, Kevin Russo wrote:
> I want my Performer1.1 app to be able to change the cursor shape
> in response to different modes in the simulation. As I understand
> it, since I'd have to use the GL cursor-routines (or X?) to do this,
> they can only be invoked in the draw proc.

That's correct, you should only make direct GL calls (like defcursor,
setcursor, etc in this case) from within the draw process.

> My question is what's the best way to handle changing the cursor
> shape? Should I make an empty node with a draw callback, where
> the node's draw traversal mask gets turned on only when I want
> to change cursors? Or is there a better way of handling this?

Instead of using an empty node and worrying about traversal masks,
ordering, etc. I would probably implement this by doing the call to
defcursor() (to construct the new GL cursor) in a pipe-initialization
callback, and then do the call to setcursor() in a channel-draw
callback.

See complex.c for an example of setting up the callbacks. Using
complex.c as a base, you would add the defcursor() stuff in the
OpenPipeline() function, and make calls to setcursor() from within
DrawChannel().

Happy hacking,

Allan

-- 
Allan Schaffer
Silicon Graphics
aschaffe++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:07 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.