Ejemplo n.º 1
0
        protected internal void NotifyOnDeviceLost( D3D9Device device )
        {
            LogManager.Instance.Write( "D3D9 Device 0x[{0}] entered lost state", device.D3DDevice );

            // you need to stop the physics or game engines after this event
            FireEvent( "DeviceLost" );
        }
Ejemplo n.º 2
0
        public void NotifyOnDeviceReset( D3D9Device device )
        {
            // Reset state attributes.	
		    vertexProgramBound = false;
		    fragmentProgramBound = false;
		    _lastVertexSourceCount = 0;

		
		    // Force all compositors to reconstruct their internal resources
		    // render textures will have been changed without their knowledge
		    CompositorManager.Instance.ReconstructAllCompositorResources();
		
		    // Restore previous active device.

		    // Invalidate active view port.
		    activeViewport = null;


		    // Reset the texture stages, they will need to be rebound
		    for (var i = 0; i < Config.MaxTextureLayers; ++i)
			    SetTexture(i, false, (Texture)null);

		    LogManager.Instance.Write("!!! Direct3D Device successfully restored.");
            LogManager.Instance.Write("D3D9 device: 0x[{0}] was reset", device.D3DDevice);

		    FireEvent("DeviceRestored");
        }
Ejemplo n.º 3
0
		public override void Destroy()
		{
			if ( this._device != null )
			{
				this._device.DetachRenderWindow( this );
				this._device = null;
			}

			if ( this._windowHandle != null && !this._isExternal )
			{
				WindowEventMonitor.Instance.UnregisterWindow( this );
				this._windowHandle.SafeDispose();
			}

			this._windowHandle = null;
			active = false;
			this._isClosed = true;
		}