mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
app/internal/glimpl: derive version parameter in Functions.Init
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -26,17 +26,15 @@ func newContext(w *window) (*context, error) {
|
||||
"desynchronized": true,
|
||||
"preserveDrawingBuffer": true,
|
||||
}
|
||||
version := 2
|
||||
ctx := w.cnv.Call("getContext", "webgl2", args)
|
||||
if ctx.IsNull() {
|
||||
version = 1
|
||||
ctx = w.cnv.Call("getContext", "webgl", args)
|
||||
}
|
||||
if ctx.IsNull() {
|
||||
return nil, errors.New("app: webgl is not supported")
|
||||
}
|
||||
f := &glimpl.Functions{Ctx: ctx}
|
||||
if err := f.Init(version); err != nil {
|
||||
if err := f.Init(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
c := &context{
|
||||
|
||||
Reference in New Issue
Block a user