2008/8/31 Alexander Dorofeyev alexd4@inbox.lv:
Handled in ActivateContext, must be remains of pre-context management code.
dlls/wined3d/surface.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-)
If you're going to remove those glDrawBuffer calls, you should remove the buffer variable completely.
Henri Verbeet wrote:
2008/8/31 Alexander Dorofeyev alexd4@inbox.lv:
Handled in ActivateContext, must be remains of pre-context management code.
dlls/wined3d/surface.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-)
If you're going to remove those glDrawBuffer calls, you should remove the buffer variable completely.
I don't think this is possible yet, the variable is also used for some window/screen and upside-down coordinate magic. I do suspect that the code doing so may need to be fixed or removed, because it looks inconsistent with code in e.g. ClearSurface (device.c) and doesn't seem to work correctly with windowed ddraw. But it probably must be done in another patch. Setting buffer for offscreen surface case could be removed though, as it doesn't do anything after removal of glDrawBuffer.
2008/9/2 Alexander Dorofeyev alexd4@inbox.lv:
I don't think this is possible yet, the variable is also used for some window/screen and upside-down coordinate magic. I do suspect that the code doing so may need to be fixed or removed, because it looks inconsistent with code in e.g. ClearSurface (device.c) and doesn't seem to work correctly with windowed ddraw. But it probably must be done in another patch. Setting buffer for offscreen surface case could be removed though, as it doesn't do anything after removal of glDrawBuffer.
After this patch it would only be used to check if the surface is the frontbuffer by comparing it to GL_FRONT. That doesn't make sense of course.
if(buffer == GL_FRONT) { should be replaced with if ((IWineD3DSurface *)This == dstSwapchain->frontBuffer) {
Henri Verbeet wrote:
2008/9/2 Alexander Dorofeyev alexd4@inbox.lv:
I don't think this is possible yet, the variable is also used for some window/screen and upside-down coordinate magic. I do suspect that the code doing so may need to be fixed or removed, because it looks inconsistent with code in e.g. ClearSurface (device.c) and doesn't seem to work correctly with windowed ddraw. But it probably must be done in another patch. Setting buffer for offscreen surface case could be removed though, as it doesn't do anything after removal of glDrawBuffer.
After this patch it would only be used to check if the surface is the frontbuffer by comparing it to GL_FRONT. That doesn't make sense of course.
if(buffer == GL_FRONT) { should be replaced with if ((IWineD3DSurface *)This == dstSwapchain->frontBuffer) {
The question is whether it truly has to be 'This == swapchain->frontBuffer' or maybe simply 'if (swapchain)' or maybe something like '!device->render_offscreen'. Not sure myself because it seems to be different in BltOverride and other places. Some of this may be effectively equal, but for the sake of less confusion IMO it's best to come up with a single working way and use it, maybe even abstract in some ddraw-to-opengl-drawable coordinate function. The problem I ran into is that I can't really get either ClearSurface and BltOveride to work properly in a windowed ddraw testcase, so it's difficult to say which way is the right one - possibly neither. That's why I would rather not touch the code yet and fix it later in a different patch.