From 4ada8a5e26723e25c646b3590f23381ff1ffa0e3 Mon Sep 17 00:00:00 2001 From: Karsten Elfenbein Date: Thu, 19 Oct 2006 19:13:14 +0200 Subject: [PATCH] wined3d: Fix the FrontBuffer content capturing. --- dlls/wined3d/swapchain.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index b0bc657030b..287153d7172 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -428,34 +428,20 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO static HRESULT WINAPI IWineD3DSwapChainImpl_GetFrontBufferData(IWineD3DSwapChain *iface, IWineD3DSurface *pDestSurface) { IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; - WINED3DFORMAT d3dformat; - UINT width; - UINT height; - WINED3DSURFACE_DESC desc; - glDescriptor *glDescription; + POINT start; TRACE("(%p) : iface(%p) pDestSurface(%p)\n", This, iface, pDestSurface); - ENTER_GL(); - memset(&desc, 0, sizeof(desc)); - desc.Width = &width; - desc.Height = &height; - desc.Format = &d3dformat; + + start.x = 0; + start.y = 0; + + if (This->presentParms.Windowed) { + MapWindowPoints(This->win_handle, NULL, &start, 1); + } #if 0 /* TODO: make sure that this swapchains context is active */ IWineD3DDevice_ActivateSwapChainContext(This->wineD3DDevice, iface); #endif - IWineD3DSurface_GetDesc(pDestSurface, &desc); - /* make sure that the front buffer is the active read buffer */ - glReadBuffer(GL_FRONT); - /* Read the pixels from the buffer into the surfaces memory */ - IWineD3DSurface_GetGlDesc(pDestSurface, &glDescription); - glReadPixels(glDescription->target, - glDescription->level, - width, - height, - glDescription->glFormat, - glDescription->glType, - (void *)IWineD3DSurface_GetData(pDestSurface)); - LEAVE_GL(); + IWineD3DSurface_BltFast(pDestSurface, start.x, start.y, This->frontBuffer, NULL, 0); return WINED3D_OK; } -- 2.11.4.GIT