fix hidpi issues
This commit is contained in:
13
main.go
13
main.go
@@ -19,7 +19,13 @@ import (
|
||||
|
||||
func Bootstrap() *Env {
|
||||
|
||||
rl.InitWindow(800, 600, "bootstrap")
|
||||
// HiDPI: report logical sizes to layout code while drawing into the full
|
||||
// framebuffer. Required for correct scaling on Wayland/XWayland mixed-DPI
|
||||
// setups. Leaving the window non-resizable so tiling WMs (Hyprland) treat
|
||||
// it as a floating window via fixed min/max size hints.
|
||||
rl.SetConfigFlags(rl.FlagWindowHighdpi)
|
||||
|
||||
rl.InitWindow(800, 600, "sumi sierpinski arrow")
|
||||
|
||||
monitor := rl.GetCurrentMonitor()
|
||||
fmt.Printf("Using monitor %d\n", monitor)
|
||||
@@ -59,7 +65,11 @@ func Bootstrap() *Env {
|
||||
controlsWidth := int(float64(windowWidth) * controlsRelWidth)
|
||||
viewportWidth := windowWidth - controlsWidth
|
||||
|
||||
// Reopen at the real size so the window's fixed-size hints land on
|
||||
// Hyprland the first time — avoids a tiling layout being applied and
|
||||
// the resize flicker from SetWindowSize.
|
||||
rl.CloseWindow()
|
||||
rl.SetConfigFlags(rl.FlagWindowHighdpi)
|
||||
|
||||
log.Printf("Storing snapshots at '%s'\n", snapshotsPath)
|
||||
|
||||
@@ -79,7 +89,6 @@ func Bootstrap() *Env {
|
||||
Offscreen: sg.Rect{X: 0, Y: 0, Width: float32(graphicsWidth), Height: float32(graphicsHeight)},
|
||||
}
|
||||
|
||||
//rl.SetConfigFlags(rl.FlagMsaa4xHint)
|
||||
rl.InitWindow(int32(layout.Window.Width), int32(layout.Window.Height), "sumi sierpinski arrow")
|
||||
rl.SetTargetFPS(30)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user