Remove MouseButtonMax

This commit is contained in:
Hajime Hoshi 2015-01-07 03:08:33 +09:00
parent bc26690b14
commit 7677d885a2
3 changed files with 1 additions and 3 deletions

View File

@ -37,7 +37,7 @@ func (i *input) update(window *glfw.Window, scale int) {
for g, e := range glfwKeyCodeToKey {
i.keyPressed[e] = window.GetKey(g) == glfw.Press
}
for b := MouseButtonLeft; b < MouseButtonMax; b++ {
for b := 0; b < len(i.mouseButtonPressed); b++ {
i.mouseButtonPressed[b] = window.GetMouseButton(glfw.MouseButton(b)) == glfw.Press
}
x, y := window.GetCursorPosition()

View File

@ -20,5 +20,4 @@ const (
MouseButtonLeft MouseButton = iota
MouseButtonRight
MouseButtonMiddle
MouseButtonMax
)

View File

@ -26,5 +26,4 @@ const (
MouseButtonLeft = MouseButton(ui.MouseButtonLeft)
MouseButtonRight = MouseButton(ui.MouseButtonRight)
MouseButtonMiddle = MouseButton(ui.MouseButtonMiddle)
MouseButtonMax = MouseButton(ui.MouseButtonMax)
)