use new flag implementation same as rust-sdl2