public void PreRenderMeshes() { TexturesManager.Instance.clearAll(); OldRenderTarget = Device.GetRenderTarget(0); OldDepthStencil = Device.DepthStencilSurface; Surf = RenderTarget2D.GetSurfaceLevel(0); Device.SetRenderTarget(0, Surf); Device.DepthStencilSurface = DepthStencil; Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1f, 0); Device.BeginScene(); }