[PATCH] WineD3D: use the window size as drawable size=0A=
Stefan Doesinger
stefan at codeweavers.com
Tue Jul 29 09:53:37 CDT 2008
=0A=
---=0A=
dlls/wined3d/state.c | 4 ++++=0A=
dlls/wined3d/swapchain.c | 10 +++++-----=0A=
2 files changed, 9 insertions(+), 5 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c=0A=
index a6903c6..89bcd9e 100644=0A=
--- a/dlls/wined3d/state.c=0A=
+++ b/dlls/wined3d/state.c=0A=
@@ -4681,7 +4681,9 @@ static void viewport_miscpart(DWORD state, =
IWineD3DStateBlockImpl *stateblock, W=0A=
stateblock->viewport.Width, =
stateblock->viewport.Height);=0A=
} else {=0A=
target =3D (IWineD3DSurfaceImpl *) =
stateblock->wineD3DDevice->render_targets[0];=0A=
+ LEAVE_GL();=0A=
target->get_drawable_size(target, &width, &height);=0A=
+ ENTER_GL();=0A=
=0A=
glViewport(stateblock->viewport.X,=0A=
(height - (stateblock->viewport.Y + =
stateblock->viewport.Height)),=0A=
@@ -4823,7 +4825,9 @@ static void scissorrect(DWORD state, =
IWineD3DStateBlockImpl *stateblock, WineD3D=0A=
UINT width;=0A=
IWineD3DSurfaceImpl *target =3D (IWineD3DSurfaceImpl *) =
stateblock->wineD3DDevice->render_targets[0];=0A=
=0A=
+ LEAVE_GL();=0A=
target->get_drawable_size(target, &width, &height);=0A=
+ ENTER_GL();=0A=
/* Warning: glScissor uses window coordinates, not viewport =
coordinates, so our viewport correction does not apply=0A=
* Warning2: Even in windowed mode the coords are relative to the =
window, not the screen=0A=
*/=0A=
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c=0A=
index e564a81..bc85126 100644=0A=
--- a/dlls/wined3d/swapchain.c=0A=
+++ b/dlls/wined3d/swapchain.c=0A=
@@ -592,9 +592,9 @@ WineD3DContext =
*IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *=0A=
}=0A=
=0A=
void get_drawable_size_swapchain(IWineD3DSurfaceImpl *This, UINT =
*width, UINT *height) {=0A=
- /* The drawable size of an onscreen drawable is the surface size.=0A=
- * (Actually: The window size, but the surface is created in window =
size)=0A=
- */=0A=
- *width =3D This->currentDesc.Width;=0A=
- *height =3D This->currentDesc.Height;=0A=
+ RECT r;=0A=
+ /* The drawable size of an onscreen drawable is the window size. */=0A=
+ GetClientRect(((IWineD3DSwapChainImpl =
*)This->container)->win_handle, &r);=0A=
+ *width =3D r.right - r.left;=0A=
+ *height =3D r.bottom - r.top;=0A=
}=0A=
-- =0A=
1.5.4.5=0A=
=0A=
------=_NextPart_000_00D8_01C8F2F4.C8059450--
More information about the wine-patches
mailing list