3D in WinForms?

前端 未结 4 1934
别那么骄傲
别那么骄傲 2021-01-02 22:05

How can i use 3D view inside WinForms?

Should i use XNA ?

I found this tutorial: http://create.msdn.com/en-US/education/catalog/sample/winforms_series_1

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 23:00

    There are a few libraries you can use. IDWMaster mentioned OpenTK, which is one option (OpenGL, so your mileage may vary; I'm not a huge fan).

    If you'd like to use DirectX, as you tagged the question, there are a few more options. Microsoft used to offer Managed DirectX, which has been deprecated in favor of XNA. SlimDX is a more modern wrapper for the DirectX libraries, exposing most of their functionality (but does have some performance cost). SharpDX is also available, which I belive is supposed to be somewhat faster than SlimDX, but I've not used.

    You may also be able to use some of the DirectX APIs directly, using COM interop. C# and .Net support rather good interop with COM components, including native ones. You will have to handle a significant amount of IntPtrs and may have to do some manual marshaling, but IDirect3DDevice doesn't have too many methods that would cause trouble (IIRC).

提交回复
热议问题