From 316720baf4ecf600382cd9dff2b9c76fb2c68d21 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 22 Jun 2011 01:57:37 +0000 Subject: [PATCH] boot up without crashing on systems without HWTransformAndLight --- BizHawk.MultiClient/RenderPanel.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BizHawk.MultiClient/RenderPanel.cs b/BizHawk.MultiClient/RenderPanel.cs index f7acf36a5c..578fb7690f 100644 --- a/BizHawk.MultiClient/RenderPanel.cs +++ b/BizHawk.MultiClient/RenderPanel.cs @@ -206,7 +206,13 @@ namespace BizHawk.MultiClient DeviceWindowHandle = backingControl.Handle, PresentationInterval = Global.Config.DisplayVSync ? PresentInterval.One : PresentInterval.Immediate }; - Device = new Device(d3d, 0, DeviceType.Hardware, backingControl.Handle, CreateFlags.HardwareVertexProcessing, pp); + + var flags = CreateFlags.SoftwareVertexProcessing; + if ((d3d.GetDeviceCaps(0, DeviceType.Hardware).DeviceCaps & DeviceCaps.HWTransformAndLight) != 0) + { + flags = CreateFlags.HardwareVertexProcessing; + } + Device = new Device(d3d, 0, DeviceType.Hardware, backingControl.Handle, flags, pp); Sprite = new Sprite(Device); Texture = new ImageTexture(Device); MessageFont = new Font(Device, 16, 0, FontWeight.Bold, 1, false, CharacterSet.Default, Precision.Default, FontQuality.Default, PitchAndFamily.Default | PitchAndFamily.DontCare, "Courier");