Commit def7df30 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: ScissorRect correction.

parent 2a14dc95
...@@ -4650,11 +4650,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface, ...@@ -4650,11 +4650,19 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface,
static HRESULT WINAPI IWineD3DDeviceImpl_SetScissorRect(IWineD3DDevice *iface, CONST RECT* pRect) { static HRESULT WINAPI IWineD3DDeviceImpl_SetScissorRect(IWineD3DDevice *iface, CONST RECT* pRect) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
ENTER_GL(); RECT windowRect;
UINT winHeight;
/** FIXME: Windows uses a top,left origin openGL uses a bottom Right? **/ GetClientRect(((IWineD3DSwapChainImpl *)This->swapchains[0])->win_handle, &windowRect);
TRACE("(%p)Setting new Scissor Rect to %d:%d-%d:%d\n", This, pRect->left, pRect->top, pRect->right, pRect->bottom); /* Warning: glScissor uses window coordinates, not viewport coordinates, so our viewport correction does not apply
glScissor(pRect->left, pRect->top, pRect->right - pRect->left, pRect->bottom - pRect->top); * Warning2: Even in windowed mode the coords are relative to the window, not the screen
*/
winHeight = windowRect.bottom - windowRect.top;
TRACE("(%p)Setting new Scissor Rect to %d:%d-%d:%d\n", This, pRect->left, pRect->bottom - winHeight,
pRect->right - pRect->left, pRect->bottom - pRect->top);
ENTER_GL();
glScissor(pRect->left, winHeight - pRect->bottom, pRect->right - pRect->left, pRect->bottom - pRect->top);
checkGLcall("glScissor");
LEAVE_GL(); LEAVE_GL();
return WINED3D_OK; return WINED3D_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment