simplify Geometry sample’s draw loop with scoped state objects