mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
parent
ba674a686c
commit
fea802b39d
@ -24,6 +24,7 @@ import (
|
||||
"os"
|
||||
"runtime"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/devicescale"
|
||||
@ -43,7 +44,7 @@ type UserInterface struct {
|
||||
windowWidth int
|
||||
windowHeight int
|
||||
|
||||
running bool
|
||||
running uint32
|
||||
toChangeSize bool
|
||||
origPosX int
|
||||
origPosY int
|
||||
@ -198,16 +199,15 @@ func getCachedMonitor(wx, wy int) *cachedMonitor {
|
||||
}
|
||||
|
||||
func (u *UserInterface) isRunning() bool {
|
||||
u.m.RLock()
|
||||
v := u.running
|
||||
u.m.RUnlock()
|
||||
return v
|
||||
return atomic.LoadUint32(&u.running) != 0
|
||||
}
|
||||
|
||||
func (u *UserInterface) setRunning(running bool) {
|
||||
u.m.Lock()
|
||||
u.running = running
|
||||
u.m.Unlock()
|
||||
if running {
|
||||
atomic.StoreUint32(&u.running, 1)
|
||||
} else {
|
||||
atomic.StoreUint32(&u.running, 0)
|
||||
}
|
||||
}
|
||||
|
||||
func (u *UserInterface) getInitTitle() string {
|
||||
|
Loading…
Reference in New Issue
Block a user