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");
}
}