Martin - yes go for that if all else fails. Create a WinForms user control
and embed it in WPF using the WindowsFormsHost class (from memory)

Besides you're creating OSG in WPF so whats the problem about one WinForms
class in WPF? Winforms (.NET2) is a subset of .NET3/3.5 so there will be no
extra dependency. Besides I'm sure if you have good separation of view and
logic (model view presenter style) your winforms user control can be very
thin. On mine I just expose the osg::Viewer and that's it.

BTW

You may have a problem with opengl and WPF. Something about Z-order when
rendering. I remember reading articles a while back that DirectX didn't
integrate with WPF very well as the DX surface appeared at the highest in
the Z-order, meaning things like context menus and text written by WPF
wouldn't appear over the rendered area. Not sure if OpenGL will have the
same problem or not.

Anyway good luck, I'll be interested to see if this works. Please post your
results!

Andrew

On Wed, Jul 29, 2009 at 2:43 PM, Martin Fleck <[email protected]>wrote:

> Hello everyone, thank you for your replies :)
>
> @Sergey: Thank you but I've tried exactly that, but the problem is that I
> want to integrate the window in the WPF-application and not open another
> window :(
>
> @Andrew: If I'm not wrong WPF uses only one HWND for the whole application.
> I guess that is where the problem lies, maybe I mix up my handlers. Anyway
> thank you for the code, maybe another way is to create a winforms-control
> and embed it into WPF (though it seems very strange OSG->Winforms->WPF).
>
> @Can: OK, I've never worked with ActiveX before so I'm not sure what you're
> talking about, but I'll research it, thanks.
>
> Again, thank you all, it's great that there are people here willing to help
> (and so fast :D)
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=15602#15602
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to