Skip to content

Instantly share code, notes, and snippets.

@lemon32767
lemon32767 / sdlthread.zig
Created November 23, 2019 14:08
thin wrapper around SDL_Thread's in zig
////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2019 lemon sherbet
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from
// the use of this software.
//
// Permission is granted to anyone to use this software
// for any purpose, including commercial applications, and to alter it
#!/bin/env bash
if [[ -f ~/unjscal ]]; then
echo "dont calibrate"
rm ~/unjscal
exit
fi
#---joydev cal---
jscal -s 8,1,0,135,135,11184469,20648251,1,0,116,116,13094012,14509581,1,0,126,126,5711218,5899500,1,0,28,28,107370905,2618802,1,0,30,30,178951509,2606089,1,0,127,127,5835375,5592234,1,0,0,0,536854528,536854528,1,0,0,0,536854528,536854528 /dev/input/js0
local points = {}
local trails = {}
local N = 100
local w,h = love.graphics.getDimensions()
print(w,h)
local function color(x,y)
local th = (x+y)/20
return {(math.cos(th)+1)/2, (math.sin(th)+1)/2, (math.cos(th+math.pi/2+1))/2}