瀏覽代碼

added -D hl-profile to mark end-of-frame while profiling samples (requires hl 1.11)

Nicolas Cannasse 5 年之前
父節點
當前提交
a5e2d26455
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      hxd/System.hl.hx

+ 10 - 1
hxd/System.hl.hx

@@ -71,7 +71,16 @@ class System {
 
 		// present
 		var cur = h3d.Engine.getCurrent();
-		if( cur != null && cur.ready ) cur.driver.present();
+		if( cur != null && cur.ready ) {
+			#if hl_profile
+			hl.Profile.event(-1); // pause
+			#end
+			cur.driver.present();
+			#if hl_profile
+			hl.Profile.event(0); // next frame
+			hl.Profile.event(-2); // resume
+			#end
+		}
 		return true;
 	}