瀏覽代碼

added reportError

ncannasse 7 年之前
父節點
當前提交
788c985c40
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      libs/mesa/haxe/System.hx

+ 8 - 2
libs/mesa/haxe/System.hx

@@ -36,10 +36,16 @@ class System {
 			throw "Failed to init GL API";
 		return true;
 	}
-	
+
+	public dynamic function reportError(e:Dynamic) {
+		var stack = haxe.CallStack.toString(haxe.CallStack.exceptionStack());
+		var err = try Std.string(e) catch( _ : Dynamic ) "????";
+		Sys.println(err + stack);
+	}
+
 	@:extern public static inline function beginFrame() {
 	}
-	
+
 	public static function emitEvents(_) {
 		return true;
 	}