The Future of Linux Graphics COVER STORY

OpenGL and the Linux desktop LIFE IN 3D New technologies will change the way you view the objects on your Linux desktop. BY JOE CASAD

he X graphics system has been at antiquated design of the X system is not, specification originally created by Silicon the heart of the Unix GUI desktop on its own, flexible enough to support Graphics. The OpenGL specification pro- Tsince 1984. Of course, its hori- this kind of performance. vides a standard for vendors to create zons expanded slowly. In the early years, In the Linux world, wherever you find graphics programming interfaces. The no one knew they even needed a graph- a very big and intriguing question, you purpose of OpenGL is to provide a single ics subsystem, and if anyone did venture can bet that someone out there is work- interface that gives graphics programs a out to try X with one of the few applica- ing on the answer. A solution to the wor- standard way of talking to graphics hard- tions that supported it, they needed to ries of the restless graphics developers is ware. One of the reasons why OpenGL be ready for late nights of tinkering. converging now around the emergence is necessary is that graphics hardware But the X system kept getting better, of two very important developments: vendors are busy with their own experi- and the X protocol, with its surrounding • Extensions to X that offer increased ments to deliver richer graphics and bet- technologies, served a key role in the flexibility and shortcuts around some ter performance to their customers. One evolution of Linux. When graphic desk- of the more sluggish parts of the X of the techniques used by graphics hard- top systems came into vogue with the system ware vendors is known as 3D accelera- appearance of MacOS and a Mac clone • The growth and widespread accep- tion. 3D acceleration lets the graphics known as Windows, Linux could build tance of the OpenGL graphics pro- hardware assume a larger share of the its own equivalent graphic desktop upon gramming interface responsibility for the details of generat- the foundation of X. Today’s Linux OpenGL desktop integration is already ing 3D images. OpenGL lets program- graphic desktops are every bit as power- underway in the Windows and Mac mers write code that anticipates and ful and far more flexible than the Apple worlds, and two systems known as capitalizes on the benefits of 3D acceler- and Windows equivalents, but the sim- and AIGLX now offer alternative visions ation. ple fact is, developers and hardware ven- for how to merge OpenGL with the dors – for all platforms – have gotten a Linux desktop. OpenGL with X bit restless with the ordinary, garden One free (but unofficial) implementation variety X. OpenGL of OpenGL for X-based platforms is One of the reasons for this restlessness OpenGL is a popular- [3]. In theory, Mesa and other is that X is primarily designed for 2D graphics library graphics, and the real world is 3D. Of course, when X first appeared, 2D graphics techniques were very amazing and wonderful compared to the punch card or the command prompt, but users today want more, and the hardware of today is fully capable of giving them more. Because of the em- phasis on fast action and realism, ven- dors want to squeeze the best possible performance from the hardware, and the

COVER STORY

Xgl and ...... 24

AIGLX ...... 28

X11R7 ...... 32

WWW.LINUX - MAGAZINE.COM ISSUE 68 JULY 2006 21 COVER STORY The Future of Linux Graphics

didn’t participate in creating. But they also expressed con- cerns about parts of Xgl, and they argued that their approach would have some technical benefits. Since then, the community has vigorously debated the technical benefits of these two solutions, and they have also debated which was truer to the open source spirit. As of now, both Xgl and AIGLX are avail- able to developers. The two projects actually share some of their code and are proceeding in parallel with much interest from the community. In the next few years, Xgl and AIGLX may redefine the Figure 1: Projecting a movie on the edge of a cube may not be practical, but it displays some of the way we think about the Linux power that OpenGL brings to the Linux desktop. desktop. Features like wobbly windows and the famous desk- alternative OpenGL APIs let Linux pro- manager. The call for integrat- top cube may seems like gimmicks at a grams access OpenGL functions. How- ing OpenGL with the desktop began to glance, but they have a subtle effect on ever, the X system was not designed for crystallize around the task of creating a the way the user perceives the user futuristic techniques like OpenGL. In the compositing window manager, or a com- space, making the objects on the virtual early attempts to integrate OpenGL, 3D- posite manager, a window manager that desktop seem more like objects on a real based data simply had to be translated makes use of the X extension. desktop. Developers have only begun to into ordinary calls to the X server, which Xgl and AIGLX bring the glories of explore the benefits of features such as required additional translation steps that OpenGL to the Linux desktop by sup- translucent windows and the many other took the edge off performance. Since porting the integration of a composite effects that are only now making their those early attempts, programmers have manager. As you’ll learn in this issue, way into the public eye. been looking for ways to work with X Compiz is a composite manager de- For an inside look at these desktop but circumvent some of its limitations. signed for Xgl. AIGLX developers have technologies of tomorrow, we invited One popular technique for integrating experimented with the Luminocity com- Novell’s Mathias Hopf and Red Hat’s accelerated 3D graphics with X makes posite manager, and Red Hat is currently Kevin E. Martin to talk about Xgl and use of the X Composite extension. The working on implementing compositing AIGLX. Read on for more on these inno- Composite extension essentially draws features into their window vative technologies. And to round out windows into memory, rather than di- manager. this month’s cover story on the Future of rectly onto the screen. This reduces Linux Graphics, we bring you a report some translation and allows for fuller Strategies on the latest release of X11, the domi- and more efficient expression of the po- The appearance of Xgl and AIGLX have nant version of the X system, which of- tential of OpenGL. It also provides for followed a familiar pattern for open fers a new modular design and many more efficient use of special effects, such source software: controversy, followed other important improvements. We hope as magnification, translucence, and by standoff, followed by a remarkable you enjoy this month’s cover story. ■ other nifty manipulations. level of coorperation. Novell announced they were working on a technology INFO Now the Desktop called Xgl that would deliver impressive [1] X.org Foundation: http:// www. x. org/ Game programmers and other graphics OpenGL tricks to a working X server, but specialists have pioneered several im- the whole project went silent for several [2] An introduction to the : http:// en. wikipedia. org/ wiki/ pressive techniques for extending and months while Novell worked behind the X_Window expanding X to accommodate OpenGL, scenes. This level of secrecy was upset- and eventually, developers began to ask ting to some in the community. Red Hat [3] Mesa project: http:// www. mesa3d. org/ whether the desktop itself could take on then stepped up to say they were devel- [4] “Accelerated X Flame Wars!…Maybe OpenGL capabilities. oping their own OpenGL desktop tech- Not,” by Edward Macnaghten, Free In Linux and other X-based systems, nology, which they called AIGLX. Red Software Magazine, 2/ 27/ 06: http:// www. freesoftwaremagazine. the task of generating and organizing the Hat undoubtedly had their own worries com/ articles/ accelerated_x window environment is performed by a about accepting a specification they

22 ISSUE 68 JULY 2006 WWW.LINUX - MAGAZINE.COM