examples/windowsize: add a new flag -runnableonunfocused

This commit is contained in:
Hajime Hoshi 2023-04-01 03:13:47 +09:00
parent db7c99fde8
commit 3564a44638

View File

@ -49,6 +49,7 @@ var (
flagMinWindowSize = flag.String("minwindowsize", "", "minimum window size (e.g., 100x200)")
flagMaxWindowSize = flag.String("maxwindowsize", "", "maximium window size (e.g., 1920x1080)")
flagGraphicsLibrary = flag.String("graphicslibrary", "", "graphics library (e.g. opengl)")
flagRunnableOnUnfocused = flag.Bool("runnableonunfocused", true, "whether the app is runnable even on unfocused")
)
func init() {
@ -429,9 +430,8 @@ func main() {
if *flagAutoAdjusting {
ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled)
}
if !*flagInitFocused {
ebiten.SetRunnableOnUnfocused(true)
if !*flagRunnableOnUnfocused {
ebiten.SetRunnableOnUnfocused(false)
}
minw, minh, maxw, maxh := -1, -1, -1, -1