-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.lua
29 lines (25 loc) · 893 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
local shader
local canvas
local time = 0
function love.load(arg)
-- Load the shader from the file we generated
shader = love.graphics.newShader('MetaHexaBalls.glsl')
-- Create a new Canvas to draw to
canvas = love.graphics.newCanvas(800, 600)
end
function love.update(dt)
-- increment our pseudo time variable
time = dt + time;
-- When converting, the following variables were requested from the shader...
shader:send('iResolution', { love.window.getWidth(), love.window.getHeight(), 1 })
shader:send('iGlobalTime', time)
shader:send('iMouse', { love.mouse.getX(), love.mouse.getY(), love.mouse.getX(), love.mouse.getY() })
end
function love.draw()
love.graphics.setCanvas(canvas)
love.graphics.setShader(shader)
love.graphics.draw(canvas)
love.graphics.setShader()
love.graphics.setCanvas()
love.graphics.draw(canvas,0,0,0,1,1,0,0)
end