示例#1
0
文件: callback.go 项目: kebo/gorgasm
func mouseButtonCallback(
	window *glfw.Window,
	button glfw.MouseButton,
	action glfw.Action,
	mod glfw.ModifierKey) {

	if button == glfw.MouseButton1 {
		down := action == glfw.Press
		x, y := window.GetCursorPosition()
		event <- ActionUpDownEvent{
			Down: down,
			X:    float32(x),
			Y:    float32(y),
		}
	}
}