简体   繁体   English

OpenTK C#Windows Phone(8)

[英]OpenTK C# Windows Phone (8)

I am trying to port a desktop C# project to Windows Phone (8) but my problem is that it uses OpenTK in some parts to show some 3d models. 我正在尝试将桌面C#项目移植到Windows Phone(8),但是我的问题是它在某些部分使用OpenTK来显示某些3d模型。 After some research I have determined that OpenTK is a .NET or mono binding to OpenGL. 经过一些研究,我确定OpenTK是.NET或与OpenGL的单绑定。 I do know though that Windows Phone does not support OpenGL, only XNA and Direct3D. 我确实知道Windows Phone不支持OpenGL,仅支持XNA和Direct3D。

My question now is, what can I do to make this code work. 现在我的问题是,如何使此代码起作用。 Is there already a port of some sort of OpenTK to Windows Phone; Windows Phone已经有某种OpenTK的端口了吗? some port of OpenTK to direct3d that can that I can then port to WP, but I am not sure if I will be able access Direct3D from C# though; 我可以将OpenTK的某些端口移植到direct3d,然后再移植到WP,但是我不确定是否可以从C#访问Direct3D。 will I have to somehow figure out how to transalte the OpenTK code to XNA code (is that even (practically) possible); 我是否必须以某种方式弄清楚如何将OpenTK代码转换为XNA代码(甚至(实际上)可行); or is there some other hopefully simpler way of doing. 还是有其他希望更简单的方法。

I'm afraid that there is no simple way of automatically translating your OpenTK code to DirectX. 恐怕没有简单的方法可以将您的OpenTK代码自动转换为DirectX。

I would port the code to http://www.monogame.net/ which uses OpenTK under the hood for Windows,Android,iOS and Linux and SharpDX for Windows Phone8 and Windows 8 Store/Metro. 我会将代码移植到http://www.monogame.net/上 ,它在Windows,Android,iOS和Linux的引擎盖下使用OpenTK,在Windows Phone8和Windows 8的Store / Metro中使用SharpDX。

That way your code becomes independent from the target platform, but there is some work involved in getting your OpenTK to move to monogame. 这样,您的代码就变得与目标平台无关,但是要使您的OpenTK迁移到单机游戏中需要做一些工作。 So that's probably not what you wanted to hear, sorry. 抱歉,这可能不是您想要听到的。

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

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