38 lines
720 B
Go
38 lines
720 B
Go
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
|
|
}
|
|
|
|
|