This project contains a library with basic controls for embedding MonoGame content in WinForms. The library can be used as-is, or it can be integrated directly into your codebase for further customization.
The control code is originally derived from the MSDN tutorial WinForms Series 1: Graphics Device.
This code also supports a series of tutorials on embedding MonoGame in WinForms:
- Bringing your XNA WinForms Controls to MonoGame + OpenGL
- Embedding Your MonoGame Game in a WinForms Control
- MonoGame + WinForms: Where’s My Keyboard?
The intent is for this repository to unify the tutorials into a single solution that can be used as a template for actual projects.
- Control Example
- ExampleControl -- A sample control tracking mouse events to draw squares. Updates as needed as opposed to running an update loop.
- Game Example
- ExampleGame.Common -- A sample game engine, representing the majority of game implementation.
- ExampleGame.Embedded -- A WinForms project. Runs the shared game code from an embedded GameControl class. Also include extra WinForms interactions.
- ExampleGame -- A standard MonoGame project. Runs the shared game code from a normal Game class.
- MGWinFormsControls -- A basic library containing GraphicsDeviceControl and GameControl base controls.