mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
gpu: expose the rendering implementation
The rendering implementation is needed for using Gio UI with external window libraries such as GLFW. Expose it in the new package gpu. Updates #26 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
"image"
|
||||
"runtime"
|
||||
|
||||
"gioui.org/app/internal/gl"
|
||||
"gioui.org/app/internal/gpu"
|
||||
"gioui.org/gpu"
|
||||
"gioui.org/gpu/gl"
|
||||
"gioui.org/op"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
package headless
|
||||
|
||||
import "gioui.org/app/internal/gl"
|
||||
import "gioui.org/app/internal/gl/impl"
|
||||
import (
|
||||
"gioui.org/app/internal/glimpl"
|
||||
"gioui.org/gpu/gl"
|
||||
)
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -DGL_SILENCE_DEPRECATION -Werror -Wno-deprecated-declarations -fmodules -fobjc-arc -x objective-c
|
||||
@@ -21,7 +23,7 @@ type nsContext struct {
|
||||
|
||||
func newContext() (context, error) {
|
||||
ctx := C.gio_headless_newContext()
|
||||
return &nsContext{ctx: ctx, c: new(impl.Functions)}, nil
|
||||
return &nsContext{ctx: ctx, c: new(glimpl.Functions)}, nil
|
||||
}
|
||||
|
||||
func (c *nsContext) MakeCurrent() error {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"errors"
|
||||
"syscall/js"
|
||||
|
||||
"gioui.org/app/internal/gl"
|
||||
"gioui.org/app/internal/gl/impl"
|
||||
"gioui.org/gpu/gl"
|
||||
"gioui.org/app/internal/glimpl"
|
||||
)
|
||||
|
||||
type jsContext struct {
|
||||
@@ -27,7 +27,7 @@ func newContext() (*jsContext, error) {
|
||||
if ctx.IsNull() {
|
||||
return nil, errors.New("headless: webgl is not supported")
|
||||
}
|
||||
f := &impl.Functions{Ctx: ctx}
|
||||
f := &glimpl.Functions{Ctx: ctx}
|
||||
if err := f.Init(version); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user