ebiten: Refactoring

This commit is contained in:
Hajime Hoshi 2021-08-05 01:48:56 +09:00
parent 0bc5166a36
commit fb04b0d004
2 changed files with 3 additions and 10 deletions

View File

@ -110,15 +110,6 @@ func (c *uiContext) setScreenClearedEveryFrame(cleared bool) {
} }
} }
func (c *uiContext) setWindowResizable(resizable bool) {
c.m.Lock()
defer c.m.Unlock()
if w := uiDriver().Window(); w != nil {
w.SetResizable(resizable)
}
}
func (c *uiContext) screenScale(deviceScaleFactor float64) float64 { func (c *uiContext) screenScale(deviceScaleFactor float64) float64 {
if c.offscreen == nil { if c.offscreen == nil {
return 0 return 0

View File

@ -75,7 +75,9 @@ func IsWindowResizable() bool {
// //
// SetWindowResizable is concurrent-safe. // SetWindowResizable is concurrent-safe.
func SetWindowResizable(resizable bool) { func SetWindowResizable(resizable bool) {
theUIContext.setWindowResizable(resizable) if w := uiDriver().Window(); w != nil {
w.SetResizable(resizable)
}
} }
// SetWindowTitle sets the title of the window. // SetWindowTitle sets the title of the window.