Browse Source

allow to capture log

Nicolas Cannasse 11 năm trước cách đây
mục cha
commit
e7069635a7
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      h3d/impl/LogDriver.hx

+ 5 - 1
h3d/impl/LogDriver.hx

@@ -6,6 +6,7 @@ class LogDriver extends Driver {
 	var d : Driver;
 	var d : Driver;
 	var loggedShaders = new Map<Int,Bool>();
 	var loggedShaders = new Map<Int,Bool>();
 	var currentShader : hxsl.RuntimeShader;
 	var currentShader : hxsl.RuntimeShader;
+	public var logLines : Array<String> = null;
 
 
 	public function new( driver : Driver ) {
 	public function new( driver : Driver ) {
 		this.d = driver;
 		this.d = driver;
@@ -14,7 +15,10 @@ class LogDriver extends Driver {
 	}
 	}
 
 
 	override function logImpl( str : String ) {
 	override function logImpl( str : String ) {
-		d.logImpl(str);
+		if( logLines == null )
+			d.logImpl(str);
+		else
+			logLines.push(str);
 	}
 	}
 
 
 	override function hasFeature( f : Feature ) {
 	override function hasFeature( f : Feature ) {