Update CMakeLists.txt for SDL2
Fix compile errors
Fix runtime errors