Skip to content

Commit d40f2d0

Browse files
committed
Fix Haxe5 EventLoop compilation
1 parent 811136e commit d40f2d0

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

h3d/impl/Benchmark.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class Benchmark extends h2d.Graphics {
347347
var totalName = measureCpu ? "cpu" : "gpu";
348348
#if target.threaded
349349
if (measureCpuThread != null) {
350-
var n = measureCpuThread.getName();
350+
var n = #if (haxe_ver >= 5) measureCpuThread.name #else measureCpuThread.getName() #end;
351351
if (n != null)
352352
totalName = n;
353353
}

h3d/impl/DX12Driver.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ class DX12Driver extends h3d.impl.Driver {
19111911
srvRingBuf = hl.CArray.alloc(SrvArgs, 256);
19121912
#if !console
19131913
var thread = sys.thread.Thread.create(runThread);
1914-
thread.setName("DX12");
1914+
#if (haxe_ver >= 5) thread.name = "DX12"; #else thread.setName("DX12"); #end
19151915
#end
19161916
}
19171917

hxd/System.hl.hx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ class System {
155155
try {
156156
hl.Api.setErrorHandler(reportError); // set exception trap
157157
#end
158-
#if ( target.threaded && (haxe_ver >= 4.2) )
158+
#if ( haxe_ver >= 5 )
159+
mainThread.events.loopOnce();
160+
#elseif ( target.threaded && (haxe_ver >= 4.2) )
159161
// Due to how 4.2+ timers work, instead of MainLoop, thread events have to be updated.
160162
// Unsafe events rely on internal implementation of EventLoop, but utilize the recycling feature
161163
// which in turn provides better optimization.

0 commit comments

Comments
 (0)