use new flag implementation same as rust-sdl2

rust-sdl2 has updated to use new style flag implementation.

* add flag mod/macro
* update demo code