From f56c3bd096a16e1c24a537e67de68b02f0968d2e Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 25 Feb 2019 02:16:25 +0900 Subject: [PATCH] ui: Unexport SetWindowResizable (#320) --- examples/windowsize/main.go | 2 -- internal/ui/ui_glfw.go | 2 ++ run.go | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/windowsize/main.go b/examples/windowsize/main.go index ea83ad070..ba11e0182 100644 --- a/examples/windowsize/main.go +++ b/examples/windowsize/main.go @@ -37,7 +37,6 @@ import ( var ( windowDecorated = flag.Bool("windowdecorated", true, "whether the window is decorated") - windowResizable = flag.Bool("windowresizable", false, "whether the window is resizable") ) func init() { @@ -222,7 +221,6 @@ func main() { ebiten.SetWindowIcon([]image.Image{createRandomIconImage()}) ebiten.SetWindowDecorated(*windowDecorated) - ebiten.SetWindowResizable(*windowResizable) if err := ebiten.Run(update, initScreenWidth, initScreenHeight, initScreenScale, "Window Size (Ebiten Demo)"); err != nil && err != terminated { log.Fatal(err) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 8c9fa725b..7d95582c6 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -286,6 +286,7 @@ func SetScreenSize(width, height int) { panic("ui: Run is not called yet") } _ = mainthread.Run(func() error { + // TODO: What if the window is maximized? (#320) u.setScreenSize(width, height, u.scale, u.isFullscreen(), u.vsync) return nil }) @@ -298,6 +299,7 @@ func SetScreenScale(scale float64) bool { } r := false _ = mainthread.Run(func() error { + // TODO: What if the window is maximized? (#320) r = u.setScreenSize(u.width, u.height, scale, u.isFullscreen(), u.vsync) return nil }) diff --git a/run.go b/run.go index 617ab9feb..eb7dee811 100644 --- a/run.go +++ b/run.go @@ -342,19 +342,21 @@ func IsWindowDecorated() bool { return ui.IsWindowDecorated() } -// SetWindowResizable sets the state if the window is resizable. +// setWindowResizable is unexported until specification is determined (#320) +// +// setWindowResizable sets the state if the window is resizable. // // The window is not resizable by default. // // When the window is resizable, the image size given via the update function can be changed by resizing. // -// SetWindowResizable works only on desktops. -// SetWindowResizable does nothing on other platforms. +// setWindowResizable works only on desktops. +// setWindowResizable does nothing on other platforms. // -// SetWindowResizable panics if SetWindowResizable is called after Run. +// setWindowResizable panics if setWindowResizable is called after Run. // -// SetWindowResizable is concurrent-safe. -func SetWindowResizable(resizable bool) { +// setWindowResizable is concurrent-safe. +func setWindowResizable(resizable bool) { ui.SetWindowResizable(resizable) }