Ver código fonte

catch dx init errors

ncannasse 8 anos atrás
pai
commit
00c1b5c3db
1 arquivos alterados com 6 adições e 1 exclusões
  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();