PDA

View Full Version : Any reason to use glXCreateWindow?



l_belev
07-04-2011, 08:18 AM
instead of just working with plain X windows?

I find this this very strange - the new version of the API presents a new way to do basically the same as the old way, except that the new way is quite more complicated..
Why on earth would anyone use it?
Nowhere in the documentation is given any reason.
Anyone knows why is this?
Maybe some performance reasons (e.g. the opengl driver can use this GLXWindow object to cache some internal stuff)?

Dark Photon
07-04-2011, 10:47 AM
No clue. Never used it nor seen it used. Gives you a GLXWindow, which I've also never used before, which is an XID. Looking through the headers I don't see anything useful you can do with this GLXWindow except destroy it.

No help here.

mbentrup
07-05-2011, 02:14 AM
A GLXWindow is also a GLXDrawable, so you can use it in a few functions.

The new API was introduced to allow PBuffers, but since we have proper cross-platform FBOs, PBuffers are pretty much dead.

l_belev
07-06-2011, 05:48 AM
The new API was introduced to allow PBuffers, but since we have proper cross-platform FBOs, PBuffers are pretty much dead.


glXCreateWindow is about windows, it has nothing to do with pbuffers or pixmaps.

In the documentation it reads that GLXDrawable is the union of { GLXPBuffer, GLXPixmap, GLXWindow, Window }. Now why is this GLXWindow thing necessary at all when the plain Window is GLXDrawable as well..

I guess this is one of the not-so-well thought out parts of the api

_arts_
07-06-2011, 06:35 AM
glXCreateWindow allows you to create an OpenGL renderable window over an existing X Window which can have no OpenGL abilities.

If it's there I'm pretty sure there's need for it :) One can imagine to make a splash window with only X11 stuffs, and then move to an OpenGL renderable without destroying the window.

Also, it might be useful for GUI toolkits like GTK or Qt. We could then create a window then make it OpenGL renderable while keeping the widget.

l_belev
07-07-2011, 07:11 AM
glXCreateWindow allows you to create an OpenGL renderable window over an existing X Window which can have no OpenGL abilities.


That would be very nice but i don't see how it can be possible.
Correct me if i miss something but, according to the documentation, glXCreateWindow will fail unless the X window you give was created with the visual corresponding to the GLXConfig you give to glXCreateWindow. So the X window should already have the OpenGL abilities.

_arts_
07-08-2011, 02:17 AM
Mmmh. You're right, my bad. I haven't seen about this visual.

matrem
09-11-2011, 01:52 PM
Interesting point.

I also would like to know what drawbacks ( I guess there are some ) appear when the X Window is used directly instead of an intermediate GLXWindow.