Hi,

I should have said that I was drawing the viewer in a pixel buffer in
my other question [1], that now leads to this one...
I'm streaming the pixel buffer data and displaying/manipulating the
scene in/from a webpage.
The offscreen viewer obviously hasn't any window, nor associated event queue.
I would like to forward the keyboard/mouse inputs emitted by the
JavaScript code in my webpage, so that I can leverage upon the OSG
manipulators (namely, trackball).

At the moment, I'm doing the following:

        viewer.getEventQueue()->setGraphicsContext(pbuffer);
        viewer.getEventQueue()->syncWindowRectangleWithGraphcisContext();

These operations are normally performed when initializing a
GraphicsWindow, e.g. in GraphicsWindowWin32::init() and are thus
missing when initializing a pbuffer, in e.g. PixelBufferWin32::init().

The syncWindowRectangleWithGraphcisContext (ever noticed the
misspelling?) was the missing thing for me in [1]. Thus, the
GUIEventAdapter created when processing an event in the EventQueue had
its _Xmin, _Xmax, _Ymin, _Ymax, _windowWidth and _windowHeight had
their default values.

So, am I adding correctly an event queue to an offscreen viewer/view this way?

     Émeric

[1] 
http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2015-February/269273.html
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to