Settings are stored.

Window location is passed to new renderer.
This commit is contained in:
Sander Schobers 2020-05-17 21:06:42 +02:00
parent 89c8a5225e
commit 498021456d

View File

@ -135,6 +135,7 @@ func run() error {
if err != nil { if err != nil {
return err return err
} }
defer settings.Store()
if settings.Window.Location == nil { if settings.Window.Location == nil {
settings.Window.Location = ptPtr(sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED) settings.Window.Location = ptPtr(sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED)
@ -147,6 +148,7 @@ func run() error {
settings.Window.VSync = &vsync settings.Window.VSync = &vsync
} }
renderer, err := ui.NewRenderer("Botanim - TINS 2020", settings.Window.Size.X, settings.Window.Size.Y, ui.NewRendererOptions{ renderer, err := ui.NewRenderer("Botanim - TINS 2020", settings.Window.Size.X, settings.Window.Size.Y, ui.NewRendererOptions{
Location: &geom.PointF32{X: float32(settings.Window.Location.X), Y: float32(settings.Window.Location.Y)},
Resizable: true, Resizable: true,
VSync: *settings.Window.VSync, VSync: *settings.Window.VSync,
}) })