Ilija Zdravkov
Ilija Zdravkov

Reputation: 19

OpenGL with Viewport3D control in WPF

Can Viewport3D control in WPF work with OpenGL?

Upvotes: 0

Views: 3040

Answers (2)

Matěj Zábský
Matěj Zábský

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

Alex Shtoff
Alex Shtoff

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

Related Questions