mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/graphicsdriver/opengl/gl: add more error messages to load libraries
This commit is contained in:
parent
1843f6acc1
commit
3106f98b52
@ -45,6 +45,9 @@ func (c *defaultContext) init() error {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Use multiple %w-s as of Go 1.20.
|
||||
var errors []string
|
||||
|
||||
// Try OpenGL first. OpenGL is preferable as this doesn't cause context losses.
|
||||
if !preferES {
|
||||
// Usually libGL.so or libGL.so.1 is used. libGL.so.2 might exist only on NetBSD.
|
||||
@ -57,6 +60,7 @@ func (c *defaultContext) init() error {
|
||||
libGL = lib
|
||||
return nil
|
||||
}
|
||||
errors = append(errors, fmt.Sprintf("%s: %v", name, err))
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,9 +72,10 @@ func (c *defaultContext) init() error {
|
||||
c.isES = true
|
||||
return nil
|
||||
}
|
||||
errors = append(errors, fmt.Sprintf("%s: %v", name, err))
|
||||
}
|
||||
|
||||
return fmt.Errorf("gl: failed to load libGL.so and libGLESv2.so")
|
||||
return fmt.Errorf("gl: failed to load libGL.so and libGLESv2.so: %s", strings.Join(errors, ", "))
|
||||
}
|
||||
|
||||
func (c *defaultContext) getProcAddress(name string) (uintptr, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user