mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
gpu: support forced OpenGL ES mode, for ANGLE on macOS
macOS is the only platform where desktop OpenGL is used. To support foreign ANGLE contexts add a setting to override Gio's selection of OpenGL implementation. The bulk of this change is making all function pointers per-context instead of global, and loading the OpenGL library dynamically. As a side effect we're closer to Gio tolerating a platform without any OpenGL implementation. For example, Apple has deprecated OpenGL and OpenGL ES on its platforms and may remove them in the future. Note that as a side-effect of this change, Gio needs Go 1.16 or newer to run on iOS. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -47,7 +47,7 @@ func newContext(w *window) (*context, error) {
|
||||
return nil, fmt.Errorf("failed to create EAGLContext")
|
||||
}
|
||||
api := contextAPI()
|
||||
f, err := gl.NewFunctions(api.Context)
|
||||
f, err := gl.NewFunctions(api.Context, api.ES)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user