Any reason to use glXCreateWindow?

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)?

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.

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.

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

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 :slight_smile: 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.

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.

Mmmh. You’re right, my bad. I haven’t seen about this visual.

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.