This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local num_verts = 100000 | |
local vertices = {} | |
for i=1,num_verts do | |
vertices[i] = {0, 0, 0, 0, 255, 255, 255, 255} | |
end | |
local ffi = require('ffi') | |
ffi.cdef[[ | |
typedef struct { | |
float x, y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PALETTE_SIZE 4 | |
uniform float time = 0; | |
// Good old wave effect | |
uniform vec2 amplitude = vec2(0 / 128., 8/128.); | |
uniform vec2 speed = vec2(1., 2.); | |
uniform vec2 frequency = vec2(1, 3); | |
uniform float sampling_factor = 0.5; | |
uniform vec3 palette[PALETTE_SIZE+1]; | |
uniform bool inverse = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Sparse = {} | |
local function new(dimension) | |
local sparse = {} | |
sparse._dimension = dimension | |
return setmetatable(sparse, Sparse) | |
end | |
function Sparse.__index(sparse, key) | |
if sparse._dimension == 1 then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Simple currying module | |
-- | |
-- With a bit of extra complexity, so that | |
-- currying several times gives only one | |
-- level of function indirection for up to | |
-- five parameters. | |
-- weak table to store a reference to the curried | |
-- function, with the parameters and original function | |
local _curried = setmetatable({}, { __mode = 'k' }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function love.conf(t) | |
t.window.width, t.window.height = 200, 60 | |
t.window.x, t.window.y = 10, 10 | |
t.window.borderless = true | |
t.window.title = "Pomodoro!" | |
end |
OlderNewer