[Development] More flexible window orientation API

Alan Alpert alan.alpert at nokia.com
Wed Jan 25 11:35:29 CET 2012


On Tue, 17 Jan 2012 21:58:29 ext Samuel Rødal wrote:
> Hi,
> 
> we're working toward having a flexible yet simple API for window
> orientations. It's important that the QWindow orientation API is
> flexible enough to handle all use cases, whereas the APIs on top (in Qt
> components for instance) can offer some more convenience for application
> developers.
> 
> We've found that the current QWindow::setOrientation() API isn't
> sufficient to express all the different ways of doing orientation.
> Namely, it currently only allows you to tell the windowing system /
> compositor about how the contents of the window are rendered, and not
> how the window buffer itself should be interpreted. It's not always
> desirable to explicitly rotate the contents of the window, sometimes
> it's practical to be able to use a different buffer layout instead. As
> an example, a game being ported to a portrait device might still want to
> use a landscape buffer layout, if the game engine design makes it hard
> to rotate the rendered output to fit a portrait buffer layout. For a
> raster based game there are performance costs due to having to do a
> 90-degree rotation.
> 
> So we should support both approaches, having a way to hint to the
> compositor both the window orientation and the content orientation.

What happens if you set both? Or set one but query the other?

Examples: That landscape 2D game sets the window orientation, what if you 
query content orientation?

What if that game then gains it's own rotation, but bases it off landscape for 
portability? So it sets window orientation to landscape and content 
orientation to portrait?

And for completeness, a contrived application sets content orientation but is 
in a contrived window manager that only works off window orientation.

--
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks



More information about the Development mailing list