Пример #1
0
// MouseButtonCallback :: input.InputEmitter
func (self *OpenGLWindow) MouseButtonCallback(callback func(input.MouseButtonCode, input.KeyState)) {
	self.window.SetMouseButtonCallback(func(w *glfw.Window, button glfw.MouseButton, state glfw.Action, mod glfw.ModifierKey) {
		callback(input.MouseButtonCode(button), input.KeyState(state))
	})
}
Пример #2
0
// KeyCallback :: input.InputEmitter
func (self *OpenGLWindow) KeyCallback(callback func(input.KeyCode, input.KeyState)) {
	self.window.SetKeyCallback(func(w *glfw.Window, key glfw.Key, scancode int, state glfw.Action, mods glfw.ModifierKey) {
		callback(input.KeyCode(key), input.KeyState(state))
	})
}