summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-10-03 21:12:22 -0500
committersanine <sanine.not@pm.me>2022-10-03 21:12:22 -0500
commitc4241b7cc97e9b0a341d54f2a4d172500c1d5399 (patch)
tree7a9d53c14d31fcc6deffd910a0604f51524faf2a /demo
parent99574e9e679208d629884b924424ed8a54423920 (diff)
add window.getKey
Diffstat (limited to 'demo')
-rw-r--r--demo/bouncing_ball/main.lua4
-rw-r--r--demo/minimal/main.lua1
2 files changed, 5 insertions, 0 deletions
diff --git a/demo/bouncing_ball/main.lua b/demo/bouncing_ball/main.lua
index ecbff7b..f98a032 100644
--- a/demo/bouncing_ball/main.lua
+++ b/demo/bouncing_ball/main.lua
@@ -98,6 +98,10 @@ local dtAverage = 0
local dtCount = 0
while not window.shouldClose(w) do
+ if window.getKey(w, window.KEY_ESCAPE) == window.PRESS then
+ break
+ end
+
local newTime = window.getTime()
local dt = newTime - time
dtAverage = dtAverage + dt
diff --git a/demo/minimal/main.lua b/demo/minimal/main.lua
new file mode 100644
index 0000000..8eaa5c1
--- /dev/null
+++ b/demo/minimal/main.lua
@@ -0,0 +1 @@
+print('hello, world!')