-
Notifications
You must be signed in to change notification settings - Fork 140
/
main.lua
40 lines (30 loc) · 818 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
io.stdout:setvbuf('no')
push = require "push" --require the library
love.window.setTitle("Press space to switch examples")
local examples = {
"low-res",
"single-shader",
"multiple-shaders",
"mouse-input",
"canvases-shaders",
"stencil"
}
local example = 1
for i = 1, #examples do
examples[i] = require("examples." .. examples[i])
end
function love.resize(w, h)
push:resize(w, h)
end
function love.keypressed(key, scancode, isrepeat)
if key == "space" then
example = (example < #examples) and example + 1 or 1
--be sure to reset push settings
push:resetSettings()
examples[example]()
love.load()
elseif key == "f" then --activate fullscreen mode
push:switchFullscreen() --optional width and height parameters for window mode
end
end
examples[example]()