简体   繁体   English

如何在WPF C#应用程序中使用SlimDX

[英]How to use SlimDX inside a WPF C# application

i'm totally new to SlimDX and WPF, but i need to create a multiple images in my application and one of them need to be a 3d visualizator of a point render, something like this: http://img600.imageshack.us/img600/5879/6a00d83452464869e2017ee.gif 我是SlimDX和WPF的新手,但我需要在我的应用程序中创建多个图像,其中一个需要成为点渲染的三维可视化器,如下所示: http//img600.imageshack.us/ img600 / 5879 / 6a00d83452464869e2017ee.gif

I found i can use SlimDX to use DirectX by C# instruction in my application, writing the result in a D3DImage component. 我发现我可以使用SlimDX在我的应用程序中使用DirectX by C#指令,将结果写入D3DImage组件。 After some tries i made visual studio 2012 to recoignize that D3DImage (for some reason i needed to restart windows to made it work) but i don't know a few things: 经过一些尝试后,我让visual studio 2012重新标注了D3DImage(出于某种原因我需要重新启动窗口以使其工作)但我不知道一些事情:

  • How i can initialize a DirectX window inside that D3DImage? 我如何在D3DImage中初始化DirectX窗口? I really can't find any example or source code. 我真的找不到任何示例或源代码。 All the examples i can find (like the 3 litte examples on SlimDX) are out of the WPF context 我能找到的所有例子(如SlimDX上的3个例子)都不属于WPF环境
  • Where i can find some good documentation about SlimDX? 哪里可以找到一些关于SlimDX的好文档? The GameDev community seems some kinda bugged and i can't post anything (maybe because i'm not paying) and i can't find anything anywhere! GameDev社区似乎有些故障,我不能发布任何东西(也许是因为我不付钱),我什么都找不到! How i'm supposed to learn that? 我应该怎么学习呢?
  • Not a single one of the SlimDX examples from the SVN can compile. SVN中没有一个SlimDX示例可以编译。 I always got some reference error with the SlimDX library (empty path) and even re-importing from the correct path doesn't solve it 我总是在SlimDX库(空路径)中遇到一些引用错误,甚至从正确的路径重新导入也无法解决它

This is driving my crazy D: 这让我疯狂D:

I feel your pain. 我感觉到你的痛苦。 I haven't be working to much with the D3D stuff in SlimDX for lack of a reason to do so, But I have been playing around with DirectSound and DirectInput, So i'll tell you what i've figured out. 由于缺乏理由,我没有在SlimDX中使用D3D的东西,但我一直在玩DirectSound和DirectInput,所以我会告诉你我已经想到了什么。

First Bullet: I'm not sure initializing a D3D Window inside of an image is going to work. First Bullet:我不确定在图像中初始化D3D窗口是否可行。 If you're using Windows Forms as your base, SlimDX includes a RenderForm or some such thing that subclasses Windows.Forms, and provides a decent amount of functionality. 如果您使用Windows窗体作为基础,SlimDX包含一个RenderForm或类似于Windows.Forms的东西,并提供了相当多的功能。 I still haven't figured it out for WPF, even though there's supposed to be a sample for that. 我仍然没有想到它为WPF,即使应该有一个样本。

Second Bullet: Documentation is difficult to come by. 第二个子弹:很难获得文档。 There's some stuff on the site, and some stuff here, but what's really been helpful is the MSDN Reference for DirectX. 网站上有一些东西,有些东西在这里,但真正有用的是DirectX的MSDN参考。 SlimDX Mirrors the structures pretty well, and you can find out a lot by reading it. SlimDX很好地镜像结构,你可以通过阅读它找到很多。 It DOES take a bit of conversion, because the DirectX reference is C++. 它需要一些转换,因为DirectX引用是C ++。

Third Bullet: Same problem. 第三个子弹:同样的问题。 Never was able to figure out why. 从来没有弄清楚为什么。

Hope that helps a bit. 希望有点帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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