make example3 compatible with surfaces of different pixel-format