(t, dt float64)
| 68 | } |
| 69 | |
| 70 | func (view *GameView) Update(t, dt float64) { |
| 71 | if dt > 1 { |
| 72 | dt = 0 |
| 73 | } |
| 74 | window := view.director.window |
| 75 | console := view.console |
| 76 | if joystickReset(glfw.Joystick1) { |
| 77 | view.director.ShowMenu() |
| 78 | } |
| 79 | if joystickReset(glfw.Joystick2) { |
| 80 | view.director.ShowMenu() |
| 81 | } |
| 82 | if readKey(window, glfw.KeyEscape) { |
| 83 | view.director.ShowMenu() |
| 84 | } |
| 85 | updateControllers(window, console) |
| 86 | console.StepSeconds(dt) |
| 87 | gl.BindTexture(gl.TEXTURE_2D, view.texture) |
| 88 | setTexture(console.Buffer()) |
| 89 | drawBuffer(view.director.window) |
| 90 | gl.BindTexture(gl.TEXTURE_2D, 0) |
| 91 | if view.record { |
| 92 | view.frames = append(view.frames, copyImage(console.Buffer())) |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | func (view *GameView) onKey(window *glfw.Window, |
| 97 | key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey) { |
nothing calls this directly
no test coverage detected