mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
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:
@@ -46,19 +46,28 @@ func newContext(w *window) (*context, error) {
|
|||||||
if ctx == 0 {
|
if ctx == 0 {
|
||||||
return nil, fmt.Errorf("failed to create EAGLContext")
|
return nil, fmt.Errorf("failed to create EAGLContext")
|
||||||
}
|
}
|
||||||
|
api := contextAPI()
|
||||||
|
f, err := gl.NewFunctions(api.Context)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
c := &context{
|
c := &context{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
owner: w,
|
owner: w,
|
||||||
layer: C.CFTypeRef(w.contextLayer()),
|
layer: C.CFTypeRef(w.contextLayer()),
|
||||||
c: new(gl.Functions),
|
c: f,
|
||||||
}
|
}
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *context) API() gpu.API {
|
func contextAPI() gpu.OpenGL {
|
||||||
return gpu.OpenGL{}
|
return gpu.OpenGL{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *context) API() gpu.API {
|
||||||
|
return contextAPI()
|
||||||
|
}
|
||||||
|
|
||||||
func (c *context) Release() {
|
func (c *context) Release() {
|
||||||
if c.ctx == 0 {
|
if c.ctx == 0 {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user