开发者

Does XNA support OpenGL

Eventually, when I've 开发者_StackOverflowfinished the game I'm writing, I'd like to port it to XNA. I'm using C++ and OpenGL at the moment. My question is simply this: does XNA support OpenGL (I can switch from C++ to XNA language if need be)?


No, not directly. XNA is built upon DirectX.

You can spin off a separate window, using a wrapper around OpenGL if you want however. You'll need to use a unofficial binding though, in order to do this. Then use XNA constructs within this. I've worked on a project like this and wouldn't reccommend it. There are two ways to use XNA. The by the book approach, which is too limited for most, or the other way. The 'other' way being not making use of the base game classes and handling your own game logic. With the second approach using another rendering method is too much work for no real pay off.

I'd recommend that for your current game the logic and graphics are separate. If you do decide to port at a later date, the transfer should be easier to convert from C++ to C#.

Also, XNA is not a language. It's a framework built using C#.


The XnaTouch implementation runs on iPhone and so uses OpenGL ES under the hood. It uses C# via the Mono project (specifically MonoTouch for the iPhone). This could conceivably be used as a base to port XNA to other platforms that don't support DirectX (eg: Mac, Linux).

(Note: in my experience the XnaTouch implementation is not very good.)

Obviously the Xbox 360 doesn't use OpenGL at all - it uses DirectX - you don't get an option about this.

And I don't even understand why you'd want to use XNA, but with OpenGL under the covers, on Windows when the existing XNA implementation works just fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜