Compare commits

...

1 Commits

Author SHA1 Message Date
30052c88be fix hidpi issues 2026-05-05 23:19:45 -05:00
8 changed files with 12 additions and 12 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.strm
vendor/
result
snapshots/

View File

@@ -1,8 +0,0 @@
[remotes]
[remotes.local]
enabled = true
repo = 'sumi'
[remotes.origin]
enabled = true
repo = 'sumi'

View File

@@ -1 +0,0 @@
0723fe496ed6c679262e6965dadf4839011f2eb749a529010366a9629f2568d9

View File

@@ -1 +0,0 @@
0723fe496ed6c679262e6965dadf4839011f2eb749a529010366a9629f2568d9

View File

Binary file not shown.

Binary file not shown.

13
main.go
View File

@@ -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)