added vsync option; these are now set in the strife configs too; vsync off by default

This commit is contained in:
Felix Angell 2018-05-18 18:17:01 +01:00
parent edbe684306
commit 420937a402
6 changed files with 18 additions and 2 deletions

View File

@ -75,6 +75,7 @@ type RenderConfig struct {
Accelerated bool
Throttle_Cpu_Usage bool
Always_Render bool
Vertical_Sync bool
Syntax_Highlighting bool
}

View File

@ -17,6 +17,7 @@ show_line_numbers = true
aliased = true
accelerated = true
throttle_cpu_usage = true
vertical_sync = false
always_render = true
syntax_highlighting = true

View File

@ -17,6 +17,7 @@ show_line_numbers = true
aliased = true
accelerated = true
throttle_cpu_usage = true
vertical_sync = false
always_render = true
syntax_highlighting = true

View File

@ -16,6 +16,7 @@ show_line_numbers = true
[render]
aliased = true
accelerated = true
vertical_sync = false
throttle_cpu_usage = true
always_render = true
syntax_highlighting = true

View File

@ -261,7 +261,7 @@ func (n *View) OnUpdate() bool {
r := rune(strife.PopKey())
if r == sdl.K_F12 {
if r == 'l' {
DEBUG_MODE = !DEBUG_MODE
}
@ -313,6 +313,12 @@ func (n *View) OnRender(ctx *strife.Renderer) {
}
n.commandPalette.OnRender(ctx)
if DEBUG_MODE {
ctx.SetColor(strife.HexRGB(0xff00ff))
mPos := strife.MouseState()
ctx.Rect(mPos[0], mPos[1], 16, 24, strife.Line)
}
}
func (n *View) OnDispose() {}

View File

@ -72,7 +72,13 @@ func main() {
config := cfg.Setup()
ww, wh := 1280, 720
window := strife.SetupRenderWindow(ww, wh, strife.DefaultConfig())
windowConfig := strife.DefaultConfig()
windowConfig.Accelerated = config.Render.Accelerated
windowConfig.Alias = config.Render.Aliased
windowConfig.VerticalSync = config.Render.Vertical_Sync
window := strife.SetupRenderWindow(ww, wh, windowConfig)
window.SetTitle("Hello world!")
window.SetResizable(true)