MCPcopy
hub / github.com/EngoEngine/engo / RunIteration

Function RunIteration

engo_js.go:298–314  ·  view source on GitHub ↗

RunIteration runs one iteration per frame

()

Source from the content-addressed store, hash-verified

296
297// RunIteration runs one iteration per frame
298func RunIteration() {
299 Time.Tick()
300 Input.update()
301 jsPollKeys()
302 currentUpdater.Update(Time.Delta())
303 Input.Mouse.Action = Neutral
304 // TODO: this may not work, and sky-rocket the FPS
305 // requestAnimationFrame(func(dt float32) {
306 // currentWorld.Update(Time.Delta())
307 // keysUpdate()
308 // if !headless {
309 // // TODO: does this require !headless?
310 // Mouse.ScrollX, Mouse.ScrollY = 0, 0
311 // }
312 // Time.Tick()
313 // })
314}
315
316// jsPollKeys polls the keys collected by the javascript callback
317// this ensures the keys only get updated once per frame, since the

Callers 1

runLoopFunction · 0.70

Calls 5

jsPollKeysFunction · 0.85
TickMethod · 0.80
DeltaMethod · 0.80
UpdateMethod · 0.65
updateMethod · 0.45

Tested by

no test coverage detected