Made it work on linux with glfw. But I didn't tested it thoroughly. I tried to keep the changes to a minimum. You might check with a diff viewer. (Also just tell me if you want me to remove it)
edit: fixed some warnings
edit: it can work on any platform supported by glfw