Skip to content

Commit

Permalink
Ignore invalidError at Init (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi authored Jul 14, 2021
1 parent ef648d7 commit 550f947
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions v3.3/glfw/glfw.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ const (
func Init() error {
C.glfwInit()
// invalidValue can happen when specific joysticks are used. This issue
// will be fixed in GLFW 3.3.5. As a temporary fix, accept this error.
// 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.
return acceptError(APIUnavailable, invalidValue)
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
Expand Down

0 comments on commit 550f947

Please sign in to comment.