NimRuntime only works during idle time
This commit is contained in:
parent
be02bdfd9c
commit
31bd5ff4c6
1 changed files with 7 additions and 1 deletions
|
|
@ -4,7 +4,13 @@ import asyncdispatch
|
||||||
import godot, node
|
import godot, node
|
||||||
|
|
||||||
gdobj NimRuntime of Node:
|
gdobj NimRuntime of Node:
|
||||||
method process*(delta: float64) =
|
method enterTree*() =
|
||||||
|
discard getTree().connect("idle_frame", self, "idle", newArray())
|
||||||
|
|
||||||
|
method exitTree*() =
|
||||||
|
getTree().disconnect("idle_frame", self, "idle")
|
||||||
|
|
||||||
|
proc idle*() {.gdExport.} =
|
||||||
if asyncdispatch.hasPendingOperations():
|
if asyncdispatch.hasPendingOperations():
|
||||||
poll(0)
|
poll(0)
|
||||||
GC_step(2000, false, 0)
|
GC_step(2000, false, 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue