mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +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:
@@ -10,10 +10,10 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"gioui.org/app/internal/glimpl"
|
||||
"gioui.org/app/internal/srgb"
|
||||
"gioui.org/gpu/backend"
|
||||
"gioui.org/gpu/gl"
|
||||
"gioui.org/internal/glimpl"
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
@@ -106,20 +106,20 @@ func NewContext(disp NativeDisplayType) (*Context, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
f, err := glimpl.NewFunctions(nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c := &Context{
|
||||
disp: eglDisp,
|
||||
eglCtx: eglCtx,
|
||||
c: new(glimpl.Functions),
|
||||
c: f,
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *Context) Functions() *glimpl.Functions {
|
||||
return c.c
|
||||
}
|
||||
|
||||
func (c *Context) Backend() (backend.Device, error) {
|
||||
return gl.NewBackend(c.c)
|
||||
return gl.NewBackend(nil)
|
||||
}
|
||||
|
||||
func (c *Context) ReleaseSurface() {
|
||||
@@ -164,7 +164,7 @@ func (c *Context) MakeCurrent() error {
|
||||
}
|
||||
if c.srgbFBO == nil {
|
||||
var err error
|
||||
c.srgbFBO, err = srgb.New(c.c)
|
||||
c.srgbFBO, err = srgb.New(nil)
|
||||
if err != nil {
|
||||
c.ReleaseCurrent()
|
||||
return err
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
syscall "golang.org/x/sys/windows"
|
||||
|
||||
"gioui.org/app/internal/glimpl"
|
||||
"gioui.org/internal/glimpl"
|
||||
gunsafe "gioui.org/internal/unsafe"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user