func mousePositionCallback(window *glfw.Window, x, y float64) { var windHeight int if paunchWindow.nativeMousePos { x *= float64(paunchWindow.nativeWidth) / float64(paunchWindow.width) y *= float64(paunchWindow.nativeHeight) / float64(paunchWindow.height) windHeight = paunchWindow.nativeHeight } else { _, windHeight = window.GetSize() } for _, eventManager := range paunchWindow.eventManagers { eventManager.RunMousePositionEvent(x, float64(windHeight)-y) } }
func mouseEnterWindowCallback(window *glfw.Window, entered bool) { x, y := window.GetCursorPosition() var windHeight int if paunchWindow.nativeMousePos { x *= float64(paunchWindow.nativeWidth) / float64(paunchWindow.width) y *= float64(paunchWindow.nativeHeight) / float64(paunchWindow.height) windHeight = paunchWindow.nativeHeight } else { _, windHeight = window.GetSize() } for _, eventManager := range paunchWindow.eventManagers { eventManager.RunMouseEnterWindowEvent(x, float64(windHeight)-y, entered) } }
func mouseButtonCallback(window *glfw.Window, button glfw.MouseButton, action glfw.Action, mod glfw.ModifierKey) { x, y := window.GetCursorPosition() var windHeight int if paunchWindow.nativeMousePos { x *= float64(paunchWindow.nativeWidth) / float64(paunchWindow.width) y *= float64(paunchWindow.nativeHeight) / float64(paunchWindow.height) windHeight = paunchWindow.nativeHeight } else { _, windHeight = window.GetSize() } for _, eventManager := range paunchWindow.eventManagers { eventManager.RunMouseButtonEvent(MouseButton(button), Action(action), x, float64(windHeight)-y) } }