mono/MonoGame — pull request #3012 by hach-que (2014-09-23 08:45:29+00:00)
Title: Update MonoGame to support service dependencies

This updates MonoGame to support services dependencies in Protobuild. This was originally developed to address https://github.com/hach-que/Protobuild/issues/33, although I didn't have time then to update MonoGame or cocas2d-xna to support the new functionality.

Primarily this functionality separates the idea of a platform (which encapsulates platform-specific code and platform-specific project structures) and the idea of different APIs (or backends) as services.

For example, on Windows, you have the option of using 3 different graphics implementations:

* DirectX
* OpenGL
* Angle

These are currently exposed as Windows, WindowsGL and Angle respectively. However, this setup does not work for consumers of MonoGame (who consume it as a Protobuild library). The most direct example is that if someone wanted to include platform-specific code in their game, but use the Angle backend in MonoGame, they currently have no way of doing so when using MonoGame as a submodule.

Longer term, this also allows MonoGame to have multiple graphics APIs on mobile platforms; currently if you were to create an `iOSMetal` platform, it wouldn't be treated as iOS in terms of the project format generated. Service dependencies keep these two concerns separate, so that a (potential) Metal-based graphics API could be enabled with `--enable MetalGraphics` when generating the projects.

To this end, the graphics and audio APIs have been exposed as services, such as `OpenGLGraphics`. `WindowsGL` and `Angle` platforms have appropriate settings such that they work as they do currently. Now when consuming MonoGame as a Protobuild submodule, and wanting to use an alternate graphics API, users can add the following to their game project:

```

Windows

```

And the OpenGL API will be used by MonoGame when the user generates their projects for `Windows` (without using the `WindowsGL` platform).