SDL stuff

just throwed in the code stuff from the SDL project