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

Function RunIteration

engo_glfw.go:265–285  ·  view source on GitHub ↗

RunIteration runs one iteration per frame

()

Source from the content-addressed store, hash-verified

263
264// RunIteration runs one iteration per frame
265func RunIteration() {
266 Time.Tick()
267
268 // First check for new keypresses
269 if !opts.HeadlessMode {
270 Input.update()
271 glfw.PollEvents()
272 }
273
274 // Then update the world and all Systems
275 currentUpdater.Update(Time.Delta())
276
277 // Lastly, forget keypresses and swap buffers
278 if !opts.HeadlessMode {
279 // reset values to avoid catching the same "signal" twice
280 Input.Mouse.ScrollX, Input.Mouse.ScrollY = 0, 0
281 Input.Mouse.Action = Neutral
282
283 Window.SwapBuffers()
284 }
285}
286
287// RunPreparation is called automatically when calling Open. It should only be called once.
288func RunPreparation(defaultScene Scene) {

Callers 1

runLoopFunction · 0.70

Calls 4

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

Tested by

no test coverage detected