From 0719fdeaaf73cb0b1c9f2a8456e74613ae617ffe Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 16 Jan 2023 09:48:06 -0800 Subject: [PATCH 1/3] hoist out some common settings --- main.lua | 5 +++++ run.lua | 5 ----- source.lua | 5 ----- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/main.lua b/main.lua index 8e61b5f..31b7f5b 100644 --- a/main.lua +++ b/main.lua @@ -87,6 +87,11 @@ function App.initialize_globals() end function App.initialize(arg) + love.keyboard.setTextInput(true) -- bring up keyboard on touch screen + love.keyboard.setKeyRepeat(true) + + love.graphics.setBackgroundColor(1,1,1) + if Current_app == 'run' then run.initialize(arg) elseif Current_app == 'source' then diff --git a/run.lua b/run.lua index 45df7c9..ec6a509 100644 --- a/run.lua +++ b/run.lua @@ -16,11 +16,6 @@ end -- called only for real run function run.initialize(arg) log_new('run') - love.keyboard.setTextInput(true) -- bring up keyboard on touch screen - love.keyboard.setKeyRepeat(true) - - love.graphics.setBackgroundColor(1,1,1) - if Settings then run.load_settings() else diff --git a/source.lua b/source.lua index 44cf440..b3357ba 100644 --- a/source.lua +++ b/source.lua @@ -61,11 +61,6 @@ end -- called only for real run function source.initialize() log_new('source') - love.keyboard.setTextInput(true) -- bring up keyboard on touch screen - love.keyboard.setKeyRepeat(true) - - love.graphics.setBackgroundColor(1,1,1) - if Settings and Settings.source then source.load_settings() else From e7b37e39dee84da1ef2e6fc008e0f7ea32fa3b57 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 16 Jan 2023 09:50:32 -0800 Subject: [PATCH 2/3] disable vsync Thanks Nils Berg for the suggestion! --- main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/main.lua b/main.lua index 31b7f5b..9ad2f01 100644 --- a/main.lua +++ b/main.lua @@ -87,6 +87,7 @@ function App.initialize_globals() end function App.initialize(arg) + love.window.setVSync(0) -- remove some delays in exchange for risk of screen tears; we're not a game love.keyboard.setTextInput(true) -- bring up keyboard on touch screen love.keyboard.setKeyRepeat(true) From 15f56341dfed1d5829e8e742600cb5b559be22ac Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 16 Jan 2023 10:20:46 -0800 Subject: [PATCH 3/3] correct comment; vsync is hard to reason about --- main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 9ad2f01..260f1b0 100644 --- a/main.lua +++ b/main.lua @@ -87,7 +87,7 @@ function App.initialize_globals() end function App.initialize(arg) - love.window.setVSync(0) -- remove some delays in exchange for risk of screen tears; we're not a game + love.window.setVSync(0) -- simplify profiling; we're not a game love.keyboard.setTextInput(true) -- bring up keyboard on touch screen love.keyboard.setKeyRepeat(true)