Started porting to SDL2.
Fix building on windows using MSVC.