[m] Modified code to use sdl2 (and made 20 times faster)