41 lines
785 B
Go
41 lines
785 B
Go
package main
|
|
|
|
import (
|
|
sg "github.com/d2fn/sumi/internal/graphics"
|
|
"time"
|
|
)
|
|
|
|
/** Env **/
|
|
type Env struct {
|
|
Time time.Time
|
|
Frame uint
|
|
Ports map[string]float64
|
|
Layout Layout
|
|
Viewport *sg.Graphics
|
|
Window *sg.Graphics
|
|
Controls *sg.Graphics
|
|
Offscreen *sg.Graphics
|
|
Storage *Storage
|
|
}
|
|
|
|
func NewEnv() *Env {
|
|
return &Env{
|
|
Time: time.Now(),
|
|
Frame: 0,
|
|
Ports: make(map[string]float64),
|
|
}
|
|
}
|
|
|
|
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
|
|
Offscreen sg.Rect
|
|
}
|