copied all of the helper functions from sdlfun to here, changed to not depend on sdlfun code. removed all events (except quit)