Reputation: 19
Can Viewport3D control in WPF work with OpenGL?
Upvotes: 0
Views: 3040
Reputation: 17272
The WPF's something Viewport3D can't do (there are lots of thing it can't do), whole WPF is DirectX based. This also means DirectX is generally much better supported in WPF.
However you can use OpenTK's WinForms viewport and use WinFormsHost to put it in your application. OpenTK is a very nice .Net wrapper for OpenGL.
However you will not be able to use XAML, bindings and other WPF-specific stuff. You will have to do the OpenGL calls manually from code. All the interop does is that is places the viewport in your application and lets you do .Net calls on it.
You may also want to have a look at this project.
Upvotes: 1
Reputation: 2640
It cannot, in the sense that you can merge 3D content from OpenGL to Viewport3D seemlessly (with correct Z testing and all).
Upvotes: 0