public void FixtureSetUp() { try { // Support ES tests Egl.IsRequired = IsEsTest; // Create window Form = DeviceContext.CreateHiddenWindow(); // Create device context _DeviceContext = DeviceContext.Create(Form.Display, Form.Handle); List <DevicePixelFormat> pixelFormats = _DeviceContext.PixelsFormats.Choose(new DevicePixelFormat(24)); if (pixelFormats.Count == 0) { throw new NotSupportedException("unable to find suitable pixel format"); } } catch { // Release resources manually FixtureTearDown(); throw; } }