Code updates into trying to make Sdl sample work