Updated for OS X without SDL frameworks