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