Renan,

if you are working under windows, you can do in the main loop

DispatchLoop ()


with: (the difference to the examples is: use PeekMessage instead of
GetMessage)

int

DispatchLoopNT ()

{

int num; /* number of button pressed */

MSG msg; /* incoming message to be evaluated */

BOOL handled; /* is message handled yet */

SiSpwEvent Event; /* SpaceWare Event */

SiGetEventData EData; /* SpaceWare Event Data */

handled = SPW_FALSE; /* init handled */

/* start message loop */


{

if (PeekMessage (&msg, NULL, 0,0,PM_REMOVE))

{

....


Dieter



Unclassified Mail
 -----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Renan Mendes
Sent: Tuesday, 22 April, 2008 14:36
To: OSG Mailing List
Subject: [osg-users] Adding input device Part 2


  Hi,

       As some of you may remember, i was trying to add a new input device
to my OSG application. This device was the SpaceNavigator. I had access to
the code that gets the 3D coordinates from it any time it is activated. But,
when it is idle, that code makes my application stop and wait for any signal
from SN. I was inserting that loop in the event type FRAME. But, as you may
imagine, when I stopped moving with SN, my application entered that waiting
stage, and the regular cycles of traversal, culling and drawing were
blocked.
       Someone else suggested that I added this device in a new Event
Handler class. Is that right? How do I do that, exactly? Any examples?

                            Thanks,

                                   Renan M Z Mendes
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to