TothBenoit 1 rok pred
rodič
commit
26f011c701
1 zmenil súbory, kde vykonal 13 pridanie a 7 odobranie
  1. 13 7
      h2d/LoadingScene.hx

+ 13 - 7
h2d/LoadingScene.hx

@@ -8,14 +8,20 @@ class LoadingScene extends h2d.Scene {
 		this.presentCooldown = presentCooldown;
 	}
 
-	override function render( engine : h3d.Engine ) {
-		hxd.Timer.update();
-		var dt = hxd.Timer.dt;
-		ctx.elapsedTime += dt;
-		if ( ctx.elapsedTime < presentCooldown )
+	var lastPresentTime : Float = 0.0;
+	public override function render( engine : h3d.Engine ) {
+		var time = haxe.Timer.stamp();
+		if ( time - lastPresentTime < presentCooldown)
 			return;
-		ctx.elapsedTime = 0.0;
-		hxd.System.timeoutTick();
+		lastPresentTime = time;
+
+	#if usesys
+		haxe.System.emitEvents(@:privateAccess hxd.Window.inst.event);
+	#elseif hldx
+		dx.Loop.processEvents(@:privateAccess hxd.Window.inst.onEvent);
+	#elseif hlsdl
+		sdl.Sdl.processEvents(@:privateAccess hxd.Window.inst.onEvent);
+	#end
 		super.render(engine);
 		engine.driver.present();
 	}