work everywhere?

i have an engine in XNA 4 but after Microsoft cut the support of XNA i thought it is better to move it to something similar and Mono was the only best choice, any how, when ever i google monogames i get links like “write once run everywhere” from the java catchy phrase, but does mono really do this?

i mean i tried to make my engine just how it has per-processor (or just-in-time) conditions for XBOX and Windows i tried to do that for mono games for all platform … i tried first to make it run on windows and windows 8 applications (store with SharpDX) and god … how long did it take me to feel like an ultimate loser … i failed in all ways to upload the library Windows.windmd manually or using the manger, because the content template is not designed seems for that, not only that, i even failed to make the visual studio detect the program.cs as a starter program … i am not good enough to take a look on monogames source code and see how it works so i came here to ask you guys (monogames developers)

does mono games really support the feature “write it once run it everywhere” by having a universal template which i believe is the content one … or you are heading there slowly and it is not ready yet? thanks for all your efforts btw, you are doing wonderful job with this project.

well i’m not related with the monogame team, but from what i understand each platform has its own template.

IOS and android is achieved through the Xamarin framework, and the rest is with only Mono.

There is allot information on how to port from xna, you should search and read about that, it will help allot, since you acquire knowledge on how monogame was implemented and the differences with xna.

find more info here:

and this an example of porting, (lots of those arround)

thanks for reply, the thing is i wonder if there is a way to make one project, one source code and make it run on all platforms, i am not interested in the idea of having 6 or more projects for the same engine, and it seems every game will have its own changes of the engine, so if i have 4 different engines (i know you might say that’s absurd but be patient with me) for different several games in the future will i have a 6 copies of each for each platform? i am just trying to avoid problems from the start, i am trying to make the project accept addition but not change as much as possible so i won’t have to make different versions of it for different games, cause fixing that won’t be easy, and will make things up to date will be harder.

so for example i tried to make the windows8 app support normal windows\xbox games but i couldn’t get the references in either direction. so is it advisable to make a project for each platform?

I think so, yes, but maybe someone more knowledgeable should answer this.

Changes in monogame to develop your project are probably not required, however you might find some not implemented functionality and in that case, if you desire, you should implement it and request a pull request.

So changes in the code necessary for multiple platforms should be minimum, something like 2% of a project code base (completely random number, should be read as “low amount of code”), and from what i understand the changes are usually related with input mechanisms. I have read though, that the mobile platforms have some more stuff required for the project to run decently (performance related).

What i would do, would be isolating my non changeable code inside a dll (or something like it).

You’re over thinking this.

Of course you wouldn’t have multiple copies of your game code. In general you end up with a few small differences per-platform and one project file for each.

thanks for the reply tom, i needed to make sure if what i am trying to do is possible or not, i am glad that my classes are totally separated from the main class project (game), so i need to created several projects for each platform i want my games run after all, after all it seems each platform deals with screen paint differently. i thought i could go around that by having just-in-time if statements, but ohh well. so no more time wasting or worrying that i am doing the wrong thing by doing making different projects.

thanks again and keep the good work!
best regards

As far as your game is concerned… all the rendering code is the same.

If you are trying to mix some native platform UI elements in with your game rendering then that would be where you have to maintain differences between platforms.