Enabled VSync & added setting.
This commit is contained in:
parent
a07d3c1c82
commit
3a8ad733a4
@ -47,7 +47,14 @@ func run() error {
|
|||||||
if ctx.Settings.Window.Size == nil {
|
if ctx.Settings.Window.Size == nil {
|
||||||
ctx.Settings.Window.Size = tins2020.PtPtr(800, 600)
|
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")
|
sdl.SetHint(sdl.HINT_RENDER_SCALE_QUALITY, "1")
|
||||||
window, err := sdl.CreateWindow("TINS 2020",
|
window, err := sdl.CreateWindow("TINS 2020",
|
||||||
ctx.Settings.Window.Location.X, ctx.Settings.Window.Location.Y,
|
ctx.Settings.Window.Location.X, ctx.Settings.Window.Location.Y,
|
||||||
|
@ -32,4 +32,5 @@ func (s *Settings) Store() error {
|
|||||||
type WindowSettings struct {
|
type WindowSettings struct {
|
||||||
Location *Point
|
Location *Point
|
||||||
Size *Point
|
Size *Point
|
||||||
|
VSync *bool
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user