Hi Robert,

Although somewhat different, they also suffer from the problem that events must be reimplemented. I'd like to create an embedded window that uses the code GraphicsWindowWin32 uses for event handling.

One option that would *almost* work is to create the window separately and pass it in using the inheritedWindowData variable of the Traits class. However, since Win32WindowingSystem is a class whose definition is not inside a .h file, it can't be used to lookup the associated GraphicsContextWin32 of an HWND, thus not allowing one to use GraphicsWindowWin32::handleNativeWindowingEvent to handle events.

The more ideal technique imo would be to have an option within the Traits class, similar to 'inheritedWindowData', for supplying a parent window. Then each subclass of GraphicsWindow can use this as it sees fit when creating its window. I'm currently modifying my local osg project to implement this for win32.

- Eron


Robert Osfield wrote:
Hi Eron,

Have a look at the osgviewerGLUT, FLTK, SDL and QT examples as they
illustrate a viewer entirely embedded within an exisiting window.
These examples are setup slightly differntly than examples like
osgviewerMFC, and use GraphicsWindowEmbedded to adapt the Viewer to
work in this role.

Robert.

On 7/12/07, Eron Steger <[EMAIL PROTECTED]> wrote:
Hello,

I know the issue of embedding an osg viewer in a window as a component
has been addressed to some level, with examples like osgviewerMFC, but I
believe there are some major issues with this.

In particular, the GraphicsWindowWin32 does a fair amount of work in
order to convert Win32 events into OSG events.  However, if we want to
embed it, we are forced to rewrite this code.

Ideally, we should be able to create a viewer as a child window of some
already created parent window.  It should only require minor changes to
how events are handled for this to work.

My main goal in all this is to embed an osg viewer inside an SWT
window.  My understanding is it's not hard to get the HWND for the SWT
window, and thus use that as the parent window for the viewer.

-Eron

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to