fix hidpi issues
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
.strm
|
||||||
vendor/
|
vendor/
|
||||||
result
|
result
|
||||||
snapshots/
|
snapshots/
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
[remotes]
|
|
||||||
[remotes.local]
|
|
||||||
enabled = true
|
|
||||||
repo = 'sumi'
|
|
||||||
|
|
||||||
[remotes.origin]
|
|
||||||
enabled = true
|
|
||||||
repo = 'sumi'
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0723fe496ed6c679262e6965dadf4839011f2eb749a529010366a9629f2568d9
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0723fe496ed6c679262e6965dadf4839011f2eb749a529010366a9629f2568d9
|
|
||||||
Binary file not shown.
Binary file not shown.
13
main.go
13
main.go
@@ -19,7 +19,13 @@ import (
|
|||||||
|
|
||||||
func Bootstrap() *Env {
|
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()
|
monitor := rl.GetCurrentMonitor()
|
||||||
fmt.Printf("Using monitor %d\n", monitor)
|
fmt.Printf("Using monitor %d\n", monitor)
|
||||||
@@ -59,7 +65,11 @@ func Bootstrap() *Env {
|
|||||||
controlsWidth := int(float64(windowWidth) * controlsRelWidth)
|
controlsWidth := int(float64(windowWidth) * controlsRelWidth)
|
||||||
viewportWidth := windowWidth - controlsWidth
|
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.CloseWindow()
|
||||||
|
rl.SetConfigFlags(rl.FlagWindowHighdpi)
|
||||||
|
|
||||||
log.Printf("Storing snapshots at '%s'\n", snapshotsPath)
|
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)},
|
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.InitWindow(int32(layout.Window.Width), int32(layout.Window.Height), "sumi sierpinski arrow")
|
||||||
rl.SetTargetFPS(30)
|
rl.SetTargetFPS(30)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user