فهرست منبع

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;
 	}