mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-08 02:45:38 +00:00
app/internal/gl/impl: extract platform dependent opengl bindings
We'd like to support Gio using a different renderer binding than the builtin. A first step is to define the Functions interface in package gl, and extract the concrete implementations to a separate package. Updates #26 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -11,10 +11,11 @@ import (
|
||||
"strings"
|
||||
|
||||
"gioui.org/app/internal/gl"
|
||||
"gioui.org/app/internal/gl/impl"
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
c *gl.Functions
|
||||
c gl.Functions
|
||||
disp _EGLDisplay
|
||||
eglCtx *eglContext
|
||||
eglSurf _EGLSurface
|
||||
@@ -109,12 +110,12 @@ func NewContext(disp NativeDisplayType) (*Context, error) {
|
||||
c := &Context{
|
||||
disp: eglDisp,
|
||||
eglCtx: eglCtx,
|
||||
c: new(gl.Functions),
|
||||
c: new(impl.Functions),
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *Context) Functions() *gl.Functions {
|
||||
func (c *Context) Functions() gl.Functions {
|
||||
return c.c
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user