Hey Paul,

Just a bit more on Xamarin and mono.
Mono is free and lets you run .NET framework apps, such as C# and VB.NET, on Mac and Linux. Xamarin has a product called MonoTouch which compiles your C# code down to native code that runs on IOS devices. They also have a product called MonoDroid that compiles your code for android.

I think the 2 products cost $400 each, but then you have a permanent license for yourself or your company to use them.

As others have said you can still run into places where you need platform specific code, but this also depends on what you are doing. For instance, a couple years ago my brother wrote a game for Windows phone using the XNA framework, which Microsoft now seems to be dropping.
There is a framework called MonoGame that is a drop in replacement for XNA.
So he used this framework along with MonoTouch and MonoDroid to be able to run his game on IOS and Android devices. Then there's another framework that lets you run XNA games in Silverlight, so he was also able to post the game online and let people play in their web browser.

So he did successfully get it working on Windows, Mac, Windows phone, IOS, and Android. Since it's a game he didn't have to worry about IOS or android themed buttons and textboxes as games usually use their own theme for those things. Though with that said, I understand that MonoTouch actually comes with themes to make your silverlight buttons and other controls look like the IOS ones, not sure if those are kept up to date as I expect the IOS themes change with each major version of IOS, though I can't see well enough to tell myself.

I'll agree with everyone that cross platform is not easy and you do usually run into issues, but I think frameworks and products like these go a long way to lessening the effort required.

I'll also mention that Xamarin provides something called Xamarin Studio for compiling your code, this tool is completely inaccessible on windows.
Perhaps it's better on Mac, but I doubt it.
So a blind person will have to figure out how to use their command line tools to compile things for mobile devices. You can actually just use the .NET dlls you compiled on windows if you are running it in mono on Mac or linux, but you have to re-compile for mobile devices.

As a few other notes, I considered making my C# games cross platform and here are some of the things I have to contend with before I even attempt it, which will probably present me with new issues. I use a javascript library called noesis.javascript.net that was written in C++ CLI, which is not supported by Mono.
So I had to find a new javascript library that could be cross platform.
I found one called V8.NET, but I still had to write a lot of extra code to wrap its API as it had a lower level API than the noesis.javascript.net API I was already using. So that's good, but V8.NET still relies on some native C++ which means I'll have to get setup on a mac and compile those libraries for Mac. That should be ok since they are supposed to be cross platform, but there's still a learning curve there.

Then I used to use DirectSound and DirectShow to play sounds in 3D and 2D respectively. Neither of those are cross platform, so I made the switch to libsndfile, OpenAL and more specifically OpenALSoft. Again I'll have to compile those for Mac, but hopefully that won't be much trouble as they are also supposed to be cross platform libraries. That switch was also a ton of work as DirectShow gave me sound file streaming for free, but I had to implement it myself in libsndfile and OpenAL, not to mention that swapping one library for another is a ton of work anyway. A side effect of all this is that I could play mp3s on windows but would have to use platform specific APIs to play them on other platforms. So instead I switched to ogg vorbis as I can use libsndfile to parse that on any platform. Oh, and I'll also have to use platform specific APIs to support self voicing as it's SAPI for windows, voice over for Mac, and speech-dispatcher for linux.

All this took me multiple months to figure out and switch, and this is just preparatory work. I haven't even attempted to compile and run my games on Mac yet, which I expect will present some new issues.

And on a non game, but cross platform related thought:
I recently moved my websites running C# ASP.NET MVC 3 and MSSQL from an expensive windows server to a much less expensive linux server. Now they run in mono against MySQL, the biggest headache there was switching from MSSQL queries to MySQL queries and finding the MysqlClient replacement for SqlClient. But I'm very happy with the results, and that was actually a much much easier switch than the effort required to make my games cross platform.

Phew, sorry for the long winded response, just wanted to share a lot of details and personal experience about these things.

~ Ian Reed


---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to