Browse Source

added reportError

ncannasse 7 năm trước cách đây
mục cha
commit
788c985c40
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  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;
 	}