简体   繁体   中英

OpenGL with Viewport3D control in WPF

WPF中的Viewport3D控件可以与OpenGL一起使用吗?

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 .

从某种意义上讲,您可以将OpenGL中的3D内容无缝合并到Viewport3D中(正确的Z测试和所有操作)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM