-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathmain.lua
More file actions
40 lines (34 loc) · 793 Bytes
/
main.lua
File metadata and controls
40 lines (34 loc) · 793 Bytes
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
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)
if key == "space" then
example = (example < #examples) and example + 1 or 1
examples[example]()
love.load()
elseif key == "f" then -- Activate fullscreen mode
love.window.setMode(0, 0, {fullscreen = true, fullscreentype = "desktop"})
push.resize(love.graphics.getDimensions())
elseif key == "escape" then
love.event.quit()
end
end
examples[example]()