refactoring progress

This commit is contained in:
2026-01-08 11:54:35 -06:00
parent bbad63c60a
commit b3d9d0340a
7 changed files with 312 additions and 155 deletions

37
env.go Normal file
View File

@@ -0,0 +1,37 @@
package main
import (
sg "github.com/d2fn/sumi/internal/graphics"
)
/** Env **/
type Env struct {
Layout Layout
Time float64
Ports map[string]float64
Graphics sg.Graphics
}
type Layout struct {
// total monitor bounds
Monitor sg.Rect
// bounds of the application window
Window sg.Rect
// bounds of the ui controls area
Controls sg.Rect
// bounds of the region of the app window reserved for rendering the graphics buffer
Viewport sg.Rect
// bounds of the off screen graphics buffer where rendering happens
Graphics sg.Rect
}
func (ctx *Env) GetGraphicsWidth() float32 {
return ctx.Graphics.Bounds.Width
}
func (ctx *Env) GetGraphicsHeight() float32 {
return ctx.Graphics.Bounds.Height
}