pixelgl has been ported to GLFW 3.5.

This commit is contained in:
nightghost 2019-12-31 01:59:20 +03:00
parent e51d4a6676
commit a3aba6004d
7 changed files with 14 additions and 14 deletions

2
go.mod
View File

@ -6,7 +6,7 @@ require (
github.com/faiface/glhf v0.0.0-20181018222622-82a6317ac380 github.com/faiface/glhf v0.0.0-20181018222622-82a6317ac380
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 // indirect github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 // indirect
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72
github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7 github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/pkg/errors v0.8.1 github.com/pkg/errors v0.8.1

4
go.sum
View File

@ -6,8 +6,8 @@ github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 h1:baVdMKlASEHr
github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3/go.mod h1:VEPNJUlxl5KdWjDvz6Q1l+rJlxF2i6xqDeGuGAxa87M= github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3/go.mod h1:VEPNJUlxl5KdWjDvz6Q1l+rJlxF2i6xqDeGuGAxa87M=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw= github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72 h1:b+9H1GAsx5RsjvDFLoS5zkNBzIQMuVKUYQDmxU3N5XE=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7 h1:THttjeRn1iiz69E875U6gAik8KTWk/JYAHoSVpUxBBI= github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7 h1:THttjeRn1iiz69E875U6gAik8KTWk/JYAHoSVpUxBBI=
github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ= github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=

View File

@ -3,7 +3,7 @@ package pixelgl
import ( import (
"github.com/faiface/mainthread" "github.com/faiface/mainthread"
"github.com/faiface/pixel" "github.com/faiface/pixel"
"github.com/go-gl/glfw/v3.2/glfw" "github.com/go-gl/glfw/v3.3/glfw"
) )
// Pressed returns whether the Button is currently pressed down. // Pressed returns whether the Button is currently pressed down.

View File

@ -1,7 +1,7 @@
package pixelgl package pixelgl
import ( import (
"github.com/go-gl/glfw/v3.2/glfw" "github.com/go-gl/glfw/v3.3/glfw"
) )
// Joystick is a joystick or controller. // Joystick is a joystick or controller.
@ -94,22 +94,22 @@ func (w *Window) JoystickAxis(js Joystick, axis int) float64 {
func (w *Window) updateJoystickInput() { func (w *Window) updateJoystickInput() {
for js := Joystick1; js <= JoystickLast; js++ { for js := Joystick1; js <= JoystickLast; js++ {
// Determine and store if the joystick was connected // Determine and store if the joystick was connected
joystickPresent := glfw.JoystickPresent(glfw.Joystick(js)) joystickPresent := glfw.Joystick(js).Present()
w.tempJoy.connected[js] = joystickPresent w.tempJoy.connected[js] = joystickPresent
if joystickPresent { if joystickPresent {
w.tempJoy.buttons[js] = glfw.GetJoystickButtons(glfw.Joystick(js)) w.tempJoy.buttons[js] = glfw.Joystick(js).GetButtons()
w.tempJoy.axis[js] = glfw.GetJoystickAxes(glfw.Joystick(js)) w.tempJoy.axis[js] = glfw.Joystick(js).GetAxes()
if !w.currJoy.connected[js] { if !w.currJoy.connected[js] {
// The joystick was recently connected, we get the name // The joystick was recently connected, we get the name
w.tempJoy.name[js] = glfw.GetJoystickName(glfw.Joystick(js)) w.tempJoy.name[js] = glfw.Joystick(js).GetName()
} else { } else {
// Use the name from the previous one // Use the name from the previous one
w.tempJoy.name[js] = w.currJoy.name[js] w.tempJoy.name[js] = w.currJoy.name[js]
} }
} else { } else {
w.tempJoy.buttons[js] = []byte{} w.tempJoy.buttons[js] = []glfw.Action{}
w.tempJoy.axis[js] = []float32{} w.tempJoy.axis[js] = []float32{}
w.tempJoy.name[js] = "" w.tempJoy.name[js] = ""
} }
@ -122,7 +122,7 @@ func (w *Window) updateJoystickInput() {
type joystickState struct { type joystickState struct {
connected [JoystickLast + 1]bool connected [JoystickLast + 1]bool
name [JoystickLast + 1]string name [JoystickLast + 1]string
buttons [JoystickLast + 1][]byte buttons [JoystickLast + 1][]glfw.Action
axis [JoystickLast + 1][]float32 axis [JoystickLast + 1][]float32
} }

View File

@ -2,7 +2,7 @@ package pixelgl
import ( import (
"github.com/faiface/mainthread" "github.com/faiface/mainthread"
"github.com/go-gl/glfw/v3.2/glfw" "github.com/go-gl/glfw/v3.3/glfw"
) )
// Monitor represents a physical display attached to your computer. // Monitor represents a physical display attached to your computer.

View File

@ -2,7 +2,7 @@ package pixelgl
import ( import (
"github.com/faiface/mainthread" "github.com/faiface/mainthread"
"github.com/go-gl/glfw/v3.2/glfw" "github.com/go-gl/glfw/v3.3/glfw"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -8,7 +8,7 @@ import (
"github.com/faiface/glhf" "github.com/faiface/glhf"
"github.com/faiface/mainthread" "github.com/faiface/mainthread"
"github.com/faiface/pixel" "github.com/faiface/pixel"
"github.com/go-gl/glfw/v3.2/glfw" "github.com/go-gl/glfw/v3.3/glfw"
"github.com/pkg/errors" "github.com/pkg/errors"
) )