-
Notifications
You must be signed in to change notification settings - Fork 5
Tutorials:Getting Started Guide Linux
This page gives an introduction for how to get started with MonoGame on Linux. The following steps are covered:
- Getting and installing the required packages
- Setting up an application with MonoGame (stable)
- Downloading an compiling the latest source files for MonoGame (develop3d)
- Setting up an application with MonoGame (develop3d)
- Updating the source files
The following packages are needed for setting up a MonoGame application with the current version of MonoGame
- monodevelop
- monogame on Arch Linux AUR (monodevelop-monogame on Mint 13)
- monodevelop-versioncontrol
In order to install the packages with the package manager
- Start your Synapctic Package Manager either from the Mint/Ubuntu menu, or by entering sudo synaptic into a terminal.
- Since the standard Ubuntu repositories do not cover the latest MonoDevelop packages, we'll need to add a custom repository that does. Head over to http://badgerports.org/ and follow the instructions for adding their repository (How do I use badgerports?).
- With the badgerports repository in place, mark the three packages listed above for installation and press Apply.
- Launch MonoDevelop either from your Mint/Ubuntu menu or by typing monodevelop into a terminal.
- Create a new project, or solution, by choosing File -> New -> Solution from the drop-down menus.
- If you have used your package manager for installation, you will find that there already is a template available for MonoGame solutions under Linux: C# -> MonoGame -> MonoGame Linux Application.
- Select a suitable name and location for your solution, press Forward, and choose OK on the following dialogue.
graphics.IsFullScreen = false
while familiarising yourself with the IDE.
To launch the application, press F5 or select Run -> Start Debugging.
We will be using the Version Control plugin of MonoDevelop as a convenient way to download the latest MonoGame sources.
- From the drop-down menu select Version Control -> Checkout.
- Enter the path to the MonoGame git repository into the Url field (git://github.com/mono/MonoGame.git) and choose a target directory for the files to be checked out into. Press OK.
- Open the MonoGame Linux solution of MonoGame by choosing File -> Open and selecting the MonoGame.Framework.Linux.sln in the target location specified by you during checkout.
- Set the Active Configuration drop-down box from Debug|x86 to Release|x86 and build the complete solution by hitting F8 or selecting Build -> Build All.
- If there are no errors, you have successfully built the MonoGame .dll files. You can now go on and include them in your project. How this step works is described in the next part.
Creating a MonoGame solution using the current develop3d version works almost the same way as creating one that is using the stable version. The only difference is that we exchange the .dll files that are used with those of the develop3d version which we have compiled in the previous step.
- Create a new solution from the MonoGame Linux Application template as shown previously.
- In order to exchange the .dll files, we need to adjust the respective references to these files. To do so, right-click on the References item in the solution tree and select Edit References, or choose Project -> Edit References from the drop-down menu.
- Delete the following items from the list
- MonoGame.Framework.Linux
- Lidgren.Network
- Tao.Sdl
- Replace them with the ones we compiled previously by choosing the .Net Assembly tab, browsing into your MonoGame.Framework/bin/Release/ folder and adding the .dll files found therein.
You can use the Version Control plugin of MonoDevelop to keep up-to-date with the latest changes in the develop3d version of MonoGame.
- Open the MonoGame.Framework.Linux.sln
- Choose Version Control -> Update Solution from the drop-down menu. Doing so will update the solution to the latest one available from the repository.
- In order for your own application to use that latest version, build the MonoGame solution once more.