nitrofurano's picture

Kenta Cho’s C# games (like Mazer Mayhem), how easy is to convert them to OpenTK?

i guess probably most of you heard about these games:
- http://www.asahi-net.or.jp/~cs8k-cyu/xna/mm/index_e.html
- http://www.asahi-net.or.jp/~cs8k-cyu/xna/gtg/index_e.html
how easy is to convert them to OpenTK, since they are C#, considering OpenTK can use OpenGL?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
winterhell's picture

Not very easy, especially since you don't have a working knowledge of XNA, OpenTK/GL or both(otherwise you wouldn't be asking the question).

The game's logic would remain untouched. Input, Math and Vector/Matrix operations would only need touching here and there, primarily the view and projection.
After that you need to rewrite the code loading the textures(if any), and the audio(of course also audio playback code/interface). For the HUD, replacing the SpriteBatch with your own texture blitter.
I see there is 3D rendering as well. In the case they are using shaders, you'd need to port them from HLSL to GLSL and then pass the shader parameters in a GL way.

While it can be done, don't expect it to be over the weekend.

the Fiddler's picture

It's doable, but the real question is *why* do you want to port to OpenTK/OpenGL. If this is to gain portability to e.g. MacOS or Linux, then there is a better approach: use MonoGame, the open-source, cross-platform implementation of XNA.

MonoGame uses OpenTK under the hood, but offers an XNA-compatible interface. You might have to change a few lines of code here and there, but most of the code should compile as-is (including shaders!) and run on almost every operating system. The only significant change is that MonoGame uses a different content pipeline, so you'll have to recompile your content using that.

sagorahmead's picture

sagor