fork from ejoy2d, port to c++.