Пример #1
0
 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);
 }
		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;
		}
Пример #4
0
 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);
		}
Пример #6
0
        /// <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);
        }
Пример #7
0
        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;
        }
		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;
		}