There's one big issue regarding windowed opengl rendering and pbuffers. A while ago Huw added some code for bitmap rendering using GLX Pixmaps. In the end our wglMakeCurrent checks whether the DC is used for offscreen rendering or not. If offscreen rendering is used (there's no distinction between a pixmap or a pbuffer!) it an indirect GLX Context as that's needed for pixmaps (mesa+dri doesn't accelerate it).
This code is also entered for games like World of Warcraft which use pbuffers. The main issue is that some glDrawBuffer line is called (single buffer emulation). In case of non-Nvidia users the indirect rendering context which shouldn't be needed for pbuffers is very bad, as most drivers don't accelerate indirect rendering yet. The glxpixmap code should be rewritten using pbuffers or perhaps there's a different way.
On irc someone suggested to create a new window for opengl rendering and put it on top of the place that needs rendering. He claimed that something similar is done on Windows.
This would solve the issues. I was also thinking about layering WineD3D on top of WGL also for the sake of portability and it will allow us to use WineD3D on Windows for testing purposes. It would be usefull if our opengl can atleast handle windowed rendering. I don't know the code that well to change it.
Roderick
For me your patch seems correct
Anyway the problem is you can add regression in cases:
- application want a very specific needs that isn't compatible with
current selected visual (use of SetPixelFormat before first CreateContext, now you don't care about user wanted PixelFormat)
- application wants to create many context with not compatible pixel
format (supported on windows)
So you may restore many of the original problems but fixed the more problematic problem of BadMatch :)
What it'll be interesting to do next is to move all low-level GLW/GLX utilities calls to x11drv to permit better access to x11drv internals (and to permit better portability on non GLX os, and better share with wined3d). This will help a lot for the famous bug of openGL chils windows.
And after that, when user use the SetPixelFormat API, find a way to change the default created wine visual (use of SetPixelFormat is only permited once on windows). The problem is that visual is created by default before the application specify it's needs (ie. when the windows is created). We have the same problem for WineD3D, many games create a window and after want to choose a specific frame buffer (and if not compatible with current visual -> problem)
I wanted to delay this visual creation (or better dynamically change this on X, if permited) but no chance (same problem for glwShareLists) :(
Keep your good job :)
Best Regards, Raphael