Hi Robert,
I think the thing that still puzzles me though is this:
Why can't an event be processed on receipt of the event instead of putting
it in a queue for processing at the next event traversal?
It seems that in order to make it work the way I want, I have to intercept
user events outside OSG and to call frame/eventTraversal to get it to
process the event that OSG just received and queued.
Thanks for the tip on breaking up frame() method.
Chris.
----- Original Message -----
From: "Robert Osfield" <[email protected]>
To: "Chris Denham" <[email protected]>; "OpenSceneGraph Users"
<[email protected]>
Sent: Tuesday, June 02, 2009 2:46 PM
Subject: Re: [osg-users] Processing input events without calling
Viewer::frame?
Hi Chris,
The osgViewer in it's default configuration is built for realtime apps
so is focused on doing a continuous frame loop. You aren't tied to
this, and can call viewer->frame() when you app wants, and you can
even break the viewer::frame() method out into it constituent parts
for advance(), eventTraversal(), updateTraversal() and
renderingTraversals().
Lots has been written about this in the past so please check the archives.
Robert.
On Tue, Jun 2, 2009 at 2:31 PM, Chris Denham <[email protected]> wrote:
Background:
In a particular durr-brain day yesterday, I was struggling to get a small
windowed OSG app working properly.
The problem with it was that OSG was not processing the keyboard and mouse
events for the window hosting the OSG viewer.
As it turns out, this was simply the result of me ONLY calling
viewer->frame
from within the paint function of the window.
Eventually, in a flash of common sense, I decided to also call
viewer->frame from within a timer function running at 60Hz, and now it is
working nicely.
The Question:
It occured to me to wonder.. "Why do I need to call 'frame' in order to
process user events?"
If I happen to know that my view only needs updating as a RESULT of a user
event, how do I process the event without updating the view?
Do I have to hammer the CPU&GPU with calls to frame while waiting for user
input?
In a nutshell, is it possible to get OSG to process events without calling
frame? Or is it something I shouldn't want to do?
Chris.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org