PDA

View Full Version : Root window



jlebrech
07-03-2006, 02:54 AM
Hi guys, i would like to know how to display a cube in the root window in OpenGL.

Basically its to get me started on experimenting with picking matrices, as i wanna know how someone could replace 2d icons with 3d objects on the desktop.

i have done nehe tutorials and the like but none show how to display in the root window, hopefully i can get a nice desktop app running.

cheers.

Zengar
07-03-2006, 05:18 AM
As far as I know, you can't do it directly, as you can't perform OpenGL rendering to the desktop. One solution would be creating transparent windows on it's top, but I am not shure if OpenGL rendering is supported to such windows. Never did it myself, hovewer, so treat this post rather as guess then a real recommendation.

Overmind
07-03-2006, 06:03 PM
What OS are you on?

If it's Linux, I'm pretty sure it's possible. I don't know how, but I know that xscreensaver can be put into the root window (I think with the "-root" option passed to the screensaver).

You can look at the source code of the GL screensavers to find out how they do it.

Brian Paul
07-04-2006, 10:12 AM
Presuming you're using X... you can use OpenGL to render to the root window. When you create your rendering context you have to use the same GLX visual as the root window.

The big potential problem is the root window's visual may not support Z/stencil/double-buffering, etc. You could work-around that by rendering to a framebuffer object and copying the image to the root window.

jlebrech
07-04-2006, 12:29 PM
Maybe i should have a go at, borderless windows.

My main plan anyway is to create a "launchcube" it looks like a rubix cube, and theres tiles that rotate you view round the view to that you see another facet on the cube and also the tiles that launch apps.

basically its a way to ditch w95 style start menus.

Guardian
07-27-2006, 10:58 AM
sorry to bump this post, but what's so special with the root window ???

why would it not support Z/stencil/double-buffering ???

08-05-2006, 07:02 PM
Originally posted by Guardian:
sorry to bump this post, but what's so special with the root window ???This question has come up many times before.

Under the current Windows OS, you cannot set the pixel format of the desktop window, and you cannot in general set the pixel format of any window more than once. The reason for this restriction is to avoid undue implementation complexity and certain types of race conditions.