From d6d57fdadf5a55a0757c41f12eadef6acf6af65a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 28 Mar 2019 03:36:31 +0900 Subject: [PATCH] ui: Refactoring --- internal/ui/ui_glfw.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index b9cccc012..c870e723c 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -99,9 +99,6 @@ func initialize() error { if err := glfw.Init(); err != nil { return err } - if !driver.Graphics().IsGL() { - glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI) - } glfw.WindowHint(glfw.Visible, glfw.False) // Create a window to set the initial monitor. @@ -581,8 +578,12 @@ func DeviceScaleFactor() float64 { func Run(width, height int, scale float64, title string, g GraphicsContext, mainloop bool) error { u := currentUI _ = mainthread.Run(func() error { - glfw.WindowHint(glfw.ContextVersionMajor, 2) - glfw.WindowHint(glfw.ContextVersionMinor, 1) + if driver.Graphics().IsGL() { + glfw.WindowHint(glfw.ContextVersionMajor, 2) + glfw.WindowHint(glfw.ContextVersionMinor, 1) + } else { + glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI) + } // 'decorated' must be solved before creating a window (#556). decorated := glfw.False