MCPcopy
hub / github.com/fogleman/nes / Update

Method Update

ui/gameview.go:70–94  ·  view source on GitHub ↗
(t, dt float64)

Source from the content-addressed store, hash-verified

68}
69
70func (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
96func (view *GameView) onKey(window *glfw.Window,
97 key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey) {

Callers

nothing calls this directly

Calls 9

joystickResetFunction · 0.85
readKeyFunction · 0.85
updateControllersFunction · 0.85
setTextureFunction · 0.85
drawBufferFunction · 0.85
copyImageFunction · 0.85
ShowMenuMethod · 0.80
StepSecondsMethod · 0.80
BufferMethod · 0.80

Tested by

no test coverage detected