local time = 0
local function col(r,g,b) return bit.lshift(math.floor(r),16)+bit.lshift(math.floor(g),8)+math.floor(b) end
app:AddHook("RENDER", "wat", function(app, delta)
local surface = sdl.SDL_GetWindowSurface(app.window)
local pixels = ffi.cast("uint32_t*", surface.pixels)
local width, height = surface.w, surface.h
for yc = 0, height-1 do
for xc = 0, width-1 do
pixels[xc+yc*height] = col(time%1*255, 0, 0)
end
end
end)
while app:Update() do
time = tonumber(sdl.SDL_GetTicks())/1000
print(time)
app:Render()
end