public PicoGame() { Instance = this; PicoPlatform.Initialize(); _gfx = new PicoGfx(); _input = new PicoInput(); PicoPlatform.TerminateRequested += (sender, args) => this.Quit(); PicoPlatform.DisplayResized += OnDisplayResize; PicoPlatform.GamePadAdded += (sender, gamepadDesc) => _input.AddGamePad(gamepadDesc); PicoPlatform.GamePadRemoved += (sender, slot) => _input.RemoveGamePad(slot); }
/// <summary> /// Creates the platform for the specified project using the specified /// platform name. /// </summary> /// <param name="project">The project to create a platform for.</param> /// <param name="platformName">The name of the platform to create.</param> /// <returns></returns> public Platform CreatePlatform(Project project, string platformName) { Platform pl; switch (platformName.ToLower()) { case "picocomputer": pl = new PicoPlatform(project, Program.MainForm); break; default: throw new ArgumentException("Platform \"" + platformName + "\" is not supported.", "platformName"); } pl.Initialize(); return(pl); }