mirror of
https://github.com/felixangell/phi.git
synced 2024-10-26 09:08:24 +03:00
added vsync option; these are now set in the strife configs too; vsync off by default
This commit is contained in:
parent
edbe684306
commit
420937a402
@ -75,6 +75,7 @@ type RenderConfig struct {
|
||||
Accelerated bool
|
||||
Throttle_Cpu_Usage bool
|
||||
Always_Render bool
|
||||
Vertical_Sync bool
|
||||
Syntax_Highlighting bool
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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() {}
|
||||
|
8
main.go
8
main.go
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user