diff options
| author | ewy <ewy0@protonmail.com> | 2026-08-13 15:13:39 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-08-13 15:13:39 +0200 |
| commit | 60f58e548ef745ec072482954ac37c35d88280d4 (patch) | |
| tree | b1d89c0c1e47a427334e7fe708367b1263aaef40 /objs/root.go | |
| parent | d0fe29558b040a11c5c8a744c37fbd2e3826f6c4 (diff) | |
switch to single render loop
Diffstat (limited to 'objs/root.go')
| -rw-r--r-- | objs/root.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/objs/root.go b/objs/root.go index 649200d..44309ac 100644 --- a/objs/root.go +++ b/objs/root.go @@ -7,6 +7,7 @@ import ( type Root struct { *ecs.GameObject + Height, Width int32 } func (root *Root) Render(r *sdl.Renderer) { @@ -14,12 +15,15 @@ func (root *Root) Render(r *sdl.Renderer) { r.Clear() } -func NewRoot(children ...ecs.IsGameObject) ecs.IsGameObject { +func NewRoot(window *sdl.Window, children ...ecs.IsGameObject) ecs.IsGameObject { + x, y, _ := window.Size() r := &Root{ GameObject: &ecs.GameObject{ Position: sdl.FPoint{}, Children: children, }, + Width: x, + Height: y, } return r } |
