just set viewport when necessary
fix alpha issue and more general states handling