app/internal/wm: [iOS] use proper constructor for gl.Functions

We're about to load OpenGL function pointers into gl.Function structs.
Make sure iOS internally uses the NewFunctions constructor, not just
new(Functions).

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-05-17 20:08:55 +02:00
parent 3a0583564b
commit 06477be50f
+11 -2
View File
@@ -46,19 +46,28 @@ func newContext(w *window) (*context, error) {
if ctx == 0 {
return nil, fmt.Errorf("failed to create EAGLContext")
}
api := contextAPI()
f, err := gl.NewFunctions(api.Context)
if err != nil {
return nil, err
}
c := &context{
ctx: ctx,
owner: w,
layer: C.CFTypeRef(w.contextLayer()),
c: new(gl.Functions),
c: f,
}
return c, nil
}
func (c *context) API() gpu.API {
func contextAPI() gpu.OpenGL {
return gpu.OpenGL{}
}
func (c *context) API() gpu.API {
return contextAPI()
}
func (c *context) Release() {
if c.ctx == 0 {
return