Fix issues with gamma adjustment when changing window position
Initial port of mouse handling to SDL2