Hi Zoltan,

I have used SDL for joytstick support in OSG for a number of years -
one can simply
set SDL to poll for the events and let the osgViewer create all
windows.  Present3D is
an example of this in action.

In your own app you could probably just do all mouse, keyboard and
joystick handling in
your own code, polling for events on each new frame.  If you want to
reuse the osgGA
event handlers/camera manipulators then you'll need to adapt the
events into osgGA
ones, the osgviewerSDL example will show you how to do this.  If you
don't need the
off the shelf event support you just just have you own event handling
and set the master
camera's view matrix on each new frame as required.

Robert.

On Tue, May 6, 2008 at 11:34 AM, Zoltán <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  I have an OSG application that uses joysticks, and I use SDL
>  for those. But I also need a mouse and keyboard and use
>  (today) OSG for that. Sometimes it's a bit messy to do
>  this, because when there is no joystick connected I fall
>  back to the mouse, and the interface is very different (one
>  is a SDL_JOYSTICk and the other an osgEventHandler). I'd
>  like to handle mouse and joystick from the same interface,
>  so either make both of them through SDL or both of them an
>  osgEventHandler.
>
>  Wouldn't it be more coherent to use SDL for all input ?
>  But then, I need to create the window with SDL, and embed
>  the osgViewer inside this window. Is this a reliable way to
>  do things ? Because if I create the window with OSG, SDL
>  doesn't "see" the mouse and keyboard.
>
>  Or, is there a way to make an osgEventHandler from a
>  SDL_JOYSTICK interface ? There is an osgviewerSDL in the
>  examples (v2.3.4) but this is for an embedded OSG viewer
>  inside an SDL window... would those work with a joystick ?
>
>  Any suggestions ?
>
>  cheers
>
>  Zoltán
>
>
>
>  PS: the application in question is a flight simulator:
>  http://sourceforge.net/projects/zsim
>
>  --
>
>  ________________________
>
>  Zoltan
>  ________________________
>
>
>  _______________________________________________
>  osg-users mailing list
>  osg-users@lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to