Improved API for multiple viewports