refactoring progress
This commit is contained in:
37
env.go
Normal file
37
env.go
Normal 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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user