mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
gpu/gl: remove OpenGL functions parameter from NewBackend
As a consequence, most API is gone from gpu/gl, and embedding Gio in foreign frameworks don't need to provide an OpenGL implementation. The next change simplifies the GLFW embedding example accordingly. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
package headless
|
||||
|
||||
import (
|
||||
"gioui.org/app/internal/glimpl"
|
||||
"gioui.org/gpu/backend"
|
||||
"gioui.org/gpu/gl"
|
||||
|
||||
@@ -24,14 +23,13 @@ __attribute__ ((visibility ("hidden"))) void gio_headless_prepareContext(CFTypeR
|
||||
import "C"
|
||||
|
||||
type nsContext struct {
|
||||
c *glimpl.Functions
|
||||
ctx C.CFTypeRef
|
||||
prepared bool
|
||||
}
|
||||
|
||||
func newGLContext() (context, error) {
|
||||
ctx := C.gio_headless_newContext()
|
||||
return &nsContext{ctx: ctx, c: new(glimpl.Functions)}, nil
|
||||
return &nsContext{ctx: ctx}, nil
|
||||
}
|
||||
|
||||
func (c *nsContext) MakeCurrent() error {
|
||||
@@ -48,11 +46,7 @@ func (c *nsContext) ReleaseCurrent() {
|
||||
}
|
||||
|
||||
func (c *nsContext) Backend() (backend.Device, error) {
|
||||
return gl.NewBackend(c.c)
|
||||
}
|
||||
|
||||
func (c *nsContext) Functions() *glimpl.Functions {
|
||||
return c.c
|
||||
return gl.NewBackend(nil)
|
||||
}
|
||||
|
||||
func (d *nsContext) Release() {
|
||||
|
||||
Reference in New Issue
Block a user