using OpenGL to implement a window manager

Jon Smirl jonsmirl at yahoo.com
Sat Apr 24 09:40:32 EST 2004


Keith and I are discussing window composition on the xserver list. How do you
implement window management with OpenGL?

Suppose xserver is applying a trapezoidal transform to an application window
before displaying it.  Now I want to set this trapezoidal transform in OpenGL
before letting the app draw the window. The app should be totally unaware I set
this transform and instead think it is drawing into a flat rectangular buffer. 

The point in doing this is so that things will get scaled and aliased right.
Drawing the app into a straight pbuffer and then transforming it is going to
mess the text up. Text in the first case would be generated with knowledge of
the transform when computing the glyph bitmap.

Another example of this. Suppose I had a bitmap that was too big. When I draw it
into a straight pbuffer I need to down sample by a half. But now xserver is
displaying this window at a 2x magnification. The bitmap is going to look ugly.
If instead I knew the xserver transform the bitmap resolution didn't have to be
lost. 

Same logic could be applied to clipping. The xserver could be displaying a
partial zoom of an app's window. If the app is painting to straight pbuffer it
will paint the whole scene and then get it clipped by the server transform.

Can this be done without messing with the OpenGL implementation?

=====
Jon Smirl
jonsmirl at yahoo.com


	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash



More information about the xserver mailing list