Karsten Elfenbein : wined3d: Fix the FrontBuffer content capturing.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Oct 20 04:45:43 CDT 2006
Module: wine
Branch: master
Commit: 4ada8a5e26723e25c646b3590f23381ff1ffa0e3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4ada8a5e26723e25c646b3590f23381ff1ffa0e3
Author: Karsten Elfenbein <kelfe at gmx.de>
Date: Thu Oct 19 19:13:14 2006 +0200
wined3d: Fix the FrontBuffer content capturing.
---
dlls/wined3d/swapchain.c | 32 +++++++++-----------------------
1 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index b0bc657..287153d 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -428,34 +428,20 @@ #endif
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;
}
More information about the wine-cvs
mailing list