소스 검색

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