mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
devicescale: Rename function
This commit is contained in:
parent
10b49bb0a3
commit
1807a3f530
@ -22,7 +22,7 @@ var (
|
|||||||
m sync.Mutex
|
m sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
func DeviceScale() float64 {
|
func Get() float64 {
|
||||||
m.Lock()
|
m.Lock()
|
||||||
defer m.Unlock()
|
defer m.Unlock()
|
||||||
return impl()
|
return impl()
|
||||||
|
@ -31,7 +31,7 @@ func (d *deviceScale) Update() {
|
|||||||
func (d *deviceScale) Get() float64 {
|
func (d *deviceScale) Get() float64 {
|
||||||
// As devicescale.DeviceScale accesses OS API, not call this too often.
|
// As devicescale.DeviceScale accesses OS API, not call this too often.
|
||||||
if d.val == 0 || d.frame-d.lastUpdated > 30 {
|
if d.val == 0 || d.frame-d.lastUpdated > 30 {
|
||||||
d.val = devicescale.DeviceScale()
|
d.val = devicescale.Get()
|
||||||
d.lastUpdated = d.frame
|
d.lastUpdated = d.frame
|
||||||
}
|
}
|
||||||
return d.val
|
return d.val
|
||||||
|
@ -84,7 +84,7 @@ func deviceScale() float64 {
|
|||||||
defer deviceScaleM.Unlock()
|
defer deviceScaleM.Unlock()
|
||||||
|
|
||||||
if deviceScaleVal == 0 {
|
if deviceScaleVal == 0 {
|
||||||
deviceScaleVal = devicescale.DeviceScale()
|
deviceScaleVal = devicescale.Get()
|
||||||
}
|
}
|
||||||
return deviceScaleVal
|
return deviceScaleVal
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func glfwScale() float64 {
|
func glfwScale() float64 {
|
||||||
return devicescale.DeviceScale()
|
return devicescale.Get()
|
||||||
}
|
}
|
||||||
|
|
||||||
func adjustWindowPosition(x, y int) (int, int) {
|
func adjustWindowPosition(x, y int) (int, int) {
|
||||||
|
2
run.go
2
run.go
@ -528,7 +528,7 @@ func SetWindowIcon(iconImages []image.Image) {
|
|||||||
//
|
//
|
||||||
// DeviceScaleFactor is concurrent-safe.
|
// DeviceScaleFactor is concurrent-safe.
|
||||||
func DeviceScaleFactor() float64 {
|
func DeviceScaleFactor() float64 {
|
||||||
return devicescale.DeviceScale()
|
return devicescale.Get()
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsVsyncEnabled returns a boolean value indicating whether
|
// IsVsyncEnabled returns a boolean value indicating whether
|
||||||
|
Loading…
Reference in New Issue
Block a user