NimRuntime only works during idle time

This commit is contained in:
Ruslan Mustakov 2017-07-31 21:22:25 +07:00
commit 31bd5ff4c6

View file

@ -4,7 +4,13 @@ import asyncdispatch
import godot, 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():
poll(0)
GC_step(2000, false, 0)