internal void SetApplication(Application app, XNAWinFormsHostAppWrapper formsWrapper, WinFormsHostGraphicsDeviceService device) { this.device = device; this.application = app; this.winFormWrapper = formsWrapper; this.winFormWrapper.Exiting += new EventHandler(winFormWrapper_Exiting); }
void winFormWrapper_Exiting(object sender, EventArgs e) { if (this.winFormWrapper != null) this.winFormWrapper.Exiting -= new EventHandler(winFormWrapper_Exiting); this.device = null; this.application = null; this.winFormWrapper = null; }
void winFormWrapper_Exiting(object sender, EventArgs e) { if (this.winFormWrapper != null) { this.winFormWrapper.Exiting -= new EventHandler(winFormWrapper_Exiting); } this.device = null; this.application = null; this.winFormWrapper = null; }
/// <summary> /// Disposes the control. /// </summary> protected override void Dispose(bool disposing) { if (application != null) application.Shutdown(); application = null; device = null; winFormWrapper = null; base.Dispose(disposing); }
/// <summary> /// Disposes the control. /// </summary> protected override void Dispose(bool disposing) { if (application != null) { application.Shutdown(); } application = null; device = null; winFormWrapper = null; base.Dispose(disposing); }
public WinFormsHostGraphicsDeviceService(XNAWinFormsHostAppWrapper winForms, int width, int height) { this.winFormsHost = winForms; parameters = new PresentationParameters(); parameters.BackBufferWidth = Math.Max(width, 1); parameters.BackBufferHeight = Math.Max(height, 1); parameters.BackBufferFormat = SurfaceFormat.Color; parameters.EnableAutoDepthStencil = true; parameters.AutoDepthStencilFormat = DepthFormat.Depth24Stencil8; }