Sfoglia il codice sorgente

catch dx init errors

ncannasse 8 anni fa
parent
commit
00c1b5c3db
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      h3d/impl/DirectXDriver.hx

+ 6 - 1
h3d/impl/DirectXDriver.hx

@@ -109,7 +109,12 @@ class DirectXDriver extends h3d.impl.Driver {
 		#if debug
 		options |= DebugLayer;
 		#end
-		driver = Driver.create(window, backBufferFormat, options);
+
+		try
+			driver = Driver.create(window, backBufferFormat, options)
+		catch( e : Dynamic )
+			throw "Failed to initialize DirectX driver (" + e+")";
+
 		if( driver == null ) throw "Failed to initialize DirectX driver";
 
 		var version = Driver.getSupportedVersion();