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:
@@ -16,8 +16,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"gioui.org/app/internal/gl"
|
||||
"gioui.org/app/internal/gl/impl"
|
||||
"gioui.org/gpu/gl"
|
||||
"gioui.org/app/internal/glimpl"
|
||||
)
|
||||
|
||||
type context struct {
|
||||
@@ -45,7 +45,7 @@ func newContext(w *window) (*context, error) {
|
||||
ctx: ctx,
|
||||
owner: w,
|
||||
layer: C.CFTypeRef(w.contextLayer()),
|
||||
c: new(impl.Functions),
|
||||
c: new(glimpl.Functions),
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
@@ -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 context struct {
|
||||
@@ -33,7 +33,7 @@ func newContext(w *window) (*context, error) {
|
||||
if ctx.IsNull() {
|
||||
return nil, errors.New("app: webgl is not supported")
|
||||
}
|
||||
f := &impl.Functions{Ctx: ctx}
|
||||
f := &glimpl.Functions{Ctx: ctx}
|
||||
if err := f.Init(version); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
package window
|
||||
|
||||
import (
|
||||
"gioui.org/app/internal/gl"
|
||||
"gioui.org/app/internal/gl/impl"
|
||||
"gioui.org/gpu/gl"
|
||||
"gioui.org/app/internal/glimpl"
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -35,7 +35,7 @@ func newContext(w *window) (*context, error) {
|
||||
ctx := C.gio_contextForView(view)
|
||||
c := &context{
|
||||
ctx: ctx,
|
||||
c: new(impl.Functions),
|
||||
c: new(glimpl.Functions),
|
||||
view: view,
|
||||
}
|
||||
return c, nil
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"gioui.org/app/internal/gl"
|
||||
"gioui.org/gpu/gl"
|
||||
"gioui.org/io/event"
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/unit"
|
||||
|
||||
Reference in New Issue
Block a user