Add MainLoop support.
Pros: It's a standard Haxe feature that other Haxelibs may rely on. Plus it offers built-in thread safety, unlike `onUpdate`. Cons: It incurs two `mutex.acquire()` calls per frame.
This commit is contained in:
@@ -600,6 +600,16 @@ class NativeApplication
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#if target.threaded
|
||||
sys.thread.Thread.current().events.progress();
|
||||
#elseif cpp
|
||||
cpp.vm.Thread.current().events.progress();
|
||||
#elseif neko
|
||||
neko.vm.Thread.current().events.progress();
|
||||
#else
|
||||
@:privateAccess haxe.EntryPoint.processEvents();
|
||||
#end
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user