mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +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 {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user