Skip to content

Commit 03dc634

Browse files
authored
1 parent 6a80f54 commit 03dc634

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

application.go

+9
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func NewApplication(opt ...Option) *Application {
7070
func createResourceWindow(window *glfw.Window) (*glfw.Window, error) {
7171
glfw.WindowHint(glfw.Decorated, glfw.False)
7272
glfw.WindowHint(glfw.Visible, glfw.False)
73+
if runtime.GOOS == "linux" {
74+
// Skia expects an EGL context on linux (libglvnd)
75+
glfw.WindowHint(glfw.ContextCreationAPI, glfw.EGLContextAPI)
76+
}
7377
resourceWindow, err := glfw.CreateWindow(1, 1, "", nil, window)
7478
if err != nil {
7579
return nil, errors.Wrap(err, "error creating the resource window")
@@ -119,6 +123,11 @@ func (a *Application) Run() error {
119123
glfw.WindowHint(glfw.Floating, glfw.True)
120124
}
121125

126+
if runtime.GOOS == "linux" {
127+
// Skia expects an EGL context on linux (libglvnd)
128+
glfw.WindowHint(glfw.ContextCreationAPI, glfw.EGLContextAPI)
129+
}
130+
122131
a.window, err = glfw.CreateWindow(a.config.windowInitialDimensions.width, a.config.windowInitialDimensions.height, "Loading..", monitor, nil)
123132
if err != nil {
124133
return errors.Wrap(err, "creating glfw window")

0 commit comments

Comments
 (0)