diff --git a/cmd/tins2020/tins2020.go b/cmd/tins2020/tins2020.go index 602d830..71de9b8 100644 --- a/cmd/tins2020/tins2020.go +++ b/cmd/tins2020/tins2020.go @@ -47,7 +47,14 @@ func run() error { if ctx.Settings.Window.Size == nil { ctx.Settings.Window.Size = tins2020.PtPtr(800, 600) } + if ctx.Settings.Window.VSync == nil { + vsync := true + ctx.Settings.Window.VSync = &vsync + } + if *ctx.Settings.Window.VSync { + sdl.SetHint(sdl.HINT_RENDER_VSYNC, "1") + } sdl.SetHint(sdl.HINT_RENDER_SCALE_QUALITY, "1") window, err := sdl.CreateWindow("TINS 2020", ctx.Settings.Window.Location.X, ctx.Settings.Window.Location.Y, diff --git a/settings.go b/settings.go index 2b58fff..5223811 100644 --- a/settings.go +++ b/settings.go @@ -32,4 +32,5 @@ func (s *Settings) Store() error { type WindowSettings struct { Location *Point Size *Point + VSync *bool }