[PATCH 07/10] wined3d: Don't change the draw buffer in IWineD3DDeviceImpl_SetFrontBackBuffers().

Henri Verbeet hverbeet at codeweavers.com
Tue Mar 16 13:02:19 CDT 2010


This should be handled by the context's draw buffer management.
---
 dlls/wined3d/device.c |   25 +++----------------------
 1 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4df5399..3d4a48b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5743,28 +5743,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetFrontBackBuffers(IWineD3DDevice *ifa
     if(Swapchain->backBuffer[0] != Back) {
         TRACE("Changing the back buffer from %p to %p\n", Swapchain->backBuffer, Back);
 
-        /* What to do about the context here in the case of multithreading? Not sure.
-         * This function is called by IDirect3D7::CreateDevice so in theory its initialization code
-         */
-        WARN("No active context?\n");
-
-        ENTER_GL();
-        if(!Swapchain->backBuffer[0]) {
-            /* GL was told to draw to the front buffer at creation,
-             * undo that
-             */
-            glDrawBuffer(GL_BACK);
-            checkGLcall("glDrawBuffer(GL_BACK)");
-            /* Set the backbuffer count to 1 because other code uses it to fing the back buffers */
-            Swapchain->presentParms.BackBufferCount = 1;
-        } else if (!Back) {
-            /* That makes problems - disable for now */
-            /* glDrawBuffer(GL_FRONT); */
-            checkGLcall("glDrawBuffer(GL_FRONT)");
-            /* We have lost our back buffer, set this to 0 to avoid confusing other code */
-            Swapchain->presentParms.BackBufferCount = 0;
-        }
-        LEAVE_GL();
+        /* Update the backbuffer count. */
+        if (!Swapchain->backBuffer[0]) Swapchain->presentParms.BackBufferCount = 1;
+        else if (!Back) Swapchain->presentParms.BackBufferCount = 0;
 
         if(Swapchain->backBuffer[0])
         {
-- 
1.6.4.4




More information about the wine-patches mailing list