aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/go-gl/glfw/v3.3/glfw/glfw.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-gl/glfw/v3.3/glfw/glfw.go')
-rw-r--r--vendor/github.com/go-gl/glfw/v3.3/glfw/glfw.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/github.com/go-gl/glfw/v3.3/glfw/glfw.go b/vendor/github.com/go-gl/glfw/v3.3/glfw/glfw.go
index 3492997..9a135da 100644
--- a/vendor/github.com/go-gl/glfw/v3.3/glfw/glfw.go
+++ b/vendor/github.com/go-gl/glfw/v3.3/glfw/glfw.go
@@ -34,7 +34,14 @@ const (
// This function may only be called from the main thread.
func Init() error {
C.glfwInit()
- return acceptError(APIUnavailable)
+ // invalidValue can happen when specific joysticks are used. This issue
+ // will be fixed in GLFW 3.3.5. As a temporary fix, ignore this error.
+ // See go-gl/glfw#292, go-gl/glfw#324, and glfw/glfw#1763.
+ err := acceptError(APIUnavailable, invalidValue)
+ if e, ok := err.(*Error); ok && e.Code == invalidValue {
+ return nil
+ }
+ return err
}
// Terminate destroys all remaining windows, frees any allocated resources and
@@ -100,6 +107,7 @@ func GetVersionString() string {
func GetClipboardString() string {
cs := C.glfwGetClipboardString(nil)
if cs == nil {
+ acceptError(FormatUnavailable)
return ""
}
return C.GoString(cs)