Compare commits
3 Commits
66c423447e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 30052c88be | |||
| f2eaec2dcc | |||
|
|
f09889919c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.strm
|
||||
vendor/
|
||||
result
|
||||
snapshots/
|
||||
|
||||
29
main.go
29
main.go
@@ -14,12 +14,18 @@ import (
|
||||
|
||||
gui "github.com/gen2brain/raylib-go/raygui"
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
"github.com/ojrac/opensimplex-go"
|
||||
// "github.com/ojrac/opensimplex-go"
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
@@ -106,9 +115,9 @@ func main() {
|
||||
colorCycle := sg.NewFixedColorCycle(sg.FlourescentColors).Shuffle(0)
|
||||
|
||||
rng := rand.New(rand.NewSource(env.Time.Unix()))
|
||||
imageField := NewImageField("/home/d/Dropbox/art/data/david.png")
|
||||
noiseField := &SimplexNoiseField{Noise: opensimplex.NewNormalized32(env.Time.Unix())}
|
||||
//imageField := NewImageField("/home/d/Dropbox/art/data/ramstatue.png")
|
||||
// imageField := NewImageField("/home/d/Dropbox/art/data/david.png")
|
||||
// noiseField := &SimplexNoiseField{Noise: opensimplex.NewNormalized32(env.Time.Unix())}
|
||||
imageField := NewImageField("/home/d/Dropbox/art/data/ramstatue.png")
|
||||
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/Photo Dec 24 2025, 5 58 23 PM.jpg")
|
||||
//imageField := NewImageField("/home/d/Dropbox/art/data/bassrockastro/andromeda.jpg")
|
||||
//imageField := NewImageField("/home/d/Dropbox/art/data/moses_statue.jpg")
|
||||
@@ -121,8 +130,8 @@ func main() {
|
||||
field:
|
||||
&AdderField{
|
||||
fields: []Field{
|
||||
&ScaleField{scale: 3, field: imageField},
|
||||
&ScaleField{scale: 500, field: noiseField},
|
||||
&ScaleField{scale: 4, field: imageField},
|
||||
//&ScaleField{scale: 100, field: noiseField},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -136,14 +145,14 @@ func main() {
|
||||
|
||||
sketch.AddColorLayer("background-blue", rl.Blue)
|
||||
sketch.AddColorLayer("background-black", rl.Black)
|
||||
sketch.AddLayer("blinds", NewBlindsLayer(field))
|
||||
//sketch.AddLayer("blinds", NewBlindsLayer(field))
|
||||
//sketch.AddLayer("moses", imageLayer)
|
||||
sketch.AddLayer("field", &FieldLayer{field: field, loColor: rl.NewColor(0, 0, 0, 0), hiColor: fieldColor, dirty: true})
|
||||
|
||||
actorColor := color.RGBA { R: 10, G: 58, B: 59, A: 25 }
|
||||
fmt.Printf("actor color = %v\n", actorColor)
|
||||
|
||||
contourLayer := NewContourLayer(rng, field, actorColor, -math.Pi/3.0, 5.0 * math.Pi)
|
||||
contourLayer := NewContourLayer(rng, field, actorColor, -math.Pi/3.0, 12.0 * math.Pi)
|
||||
sketch.AddLayer("contours", contourLayer)
|
||||
//sketch.AddLayer("sierpinski-arrowhead", sierpinskiLayer)
|
||||
// aurora := NewImageLayer("/home/d/Dropbox/photos/Events/2025/Aurora/Photo Nov 11 2025, 9 52 03 PM.jpg")
|
||||
|
||||
Reference in New Issue
Block a user