From 28ce1fc3fb17a60ef1dedad0ac6393cf5542b617 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 19 Sep 2020 01:32:33 +0900 Subject: [PATCH] uidriver/glfw: Bug fix: Compile failure --- internal/uidriver/glfw/ui_darwin.go | 4 ++++ internal/uidriver/glfw/ui_windows.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/internal/uidriver/glfw/ui_darwin.go b/internal/uidriver/glfw/ui_darwin.go index 33ebd0943..6e90ffa6e 100644 --- a/internal/uidriver/glfw/ui_darwin.go +++ b/internal/uidriver/glfw/ui_darwin.go @@ -57,6 +57,10 @@ func (u *UserInterface) toGLFWPixel(x float64) float64 { return x } +func (u *UserInterface) toFramebufferPixel(x float64) float64 { + return x +} + func (u *UserInterface) adjustWindowPosition(x, y int) (int, int) { return x, y } diff --git a/internal/uidriver/glfw/ui_windows.go b/internal/uidriver/glfw/ui_windows.go index ad1e2a35e..5369e27a9 100644 --- a/internal/uidriver/glfw/ui_windows.go +++ b/internal/uidriver/glfw/ui_windows.go @@ -114,6 +114,11 @@ func (u *UserInterface) toGLFWPixel(x float64) float64 { return x * u.deviceScaleFactor() } +// toFramebufferPixel must be called from the main thread. +func (u *UserInterface) toFramebufferPixel(x float64) float64 { + return x +} + func (u *UserInterface) adjustWindowPosition(x, y int) (int, int) { mx, my := currentMonitor(u.window).GetPos() // As the video width/height might be wrong,