mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 20:43:40 +00:00
d3d: Move clippers from DDraw to wined3d.
This commit is contained in:
parent
04fada9035
commit
d93e161b1f
|
@ -106,8 +106,9 @@ static ULONG WINAPI IDirectDrawClipperImpl_Release(IDirectDrawClipper *iface) {
|
|||
|
||||
if (ref == 0)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
return 0;
|
||||
IWineD3DClipper_Release(This->wineD3DClipper);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
return 0;
|
||||
}
|
||||
else return ref;
|
||||
}
|
||||
|
@ -131,15 +132,17 @@ static HRESULT WINAPI IDirectDrawClipperImpl_SetHwnd(
|
|||
LPDIRECTDRAWCLIPPER iface, DWORD dwFlags, HWND hWnd
|
||||
) {
|
||||
IDirectDrawClipperImpl *This = (IDirectDrawClipperImpl *)iface;
|
||||
HRESULT hr;
|
||||
TRACE("(%p)->(%08x,%p)\n", This, dwFlags, hWnd);
|
||||
|
||||
TRACE("(%p)->(0x%08x,0x%08x)\n", This, dwFlags, (DWORD)hWnd);
|
||||
if( dwFlags ) {
|
||||
FIXME("dwFlags = 0x%08x, not supported.\n",dwFlags);
|
||||
return DDERR_INVALIDPARAMS;
|
||||
hr = IWineD3DClipper_SetHWnd(This->wineD3DClipper,
|
||||
dwFlags,
|
||||
hWnd);
|
||||
switch(hr)
|
||||
{
|
||||
case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS;
|
||||
default: return hr;
|
||||
}
|
||||
|
||||
This->hWnd = hWnd;
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -165,46 +168,12 @@ static HRESULT WINAPI IDirectDrawClipperImpl_GetClipList(
|
|||
LPDWORD lpdwSize)
|
||||
{
|
||||
IDirectDrawClipperImpl *This = (IDirectDrawClipperImpl *)iface;
|
||||
|
||||
TRACE("(%p,%p,%p,%p)\n", This, lpRect, lpClipList, lpdwSize);
|
||||
|
||||
if (This->hWnd)
|
||||
{
|
||||
HDC hDC = GetDCEx(This->hWnd, NULL, DCX_WINDOW);
|
||||
if (hDC)
|
||||
{
|
||||
HRGN hRgn = CreateRectRgn(0,0,0,0);
|
||||
if (GetRandomRgn(hDC, hRgn, SYSRGN))
|
||||
{
|
||||
if (GetVersion() & 0x80000000)
|
||||
{
|
||||
/* map region to screen coordinates */
|
||||
POINT org;
|
||||
GetDCOrgEx( hDC, &org );
|
||||
OffsetRgn( hRgn, org.x, org.y );
|
||||
}
|
||||
if (lpRect)
|
||||
{
|
||||
HRGN hRgnClip = CreateRectRgn(lpRect->left, lpRect->top,
|
||||
lpRect->right, lpRect->bottom);
|
||||
CombineRgn(hRgn, hRgn, hRgnClip, RGN_AND);
|
||||
DeleteObject(hRgnClip);
|
||||
}
|
||||
*lpdwSize = GetRegionData(hRgn, *lpdwSize, lpClipList);
|
||||
}
|
||||
DeleteObject(hRgn);
|
||||
ReleaseDC(This->hWnd, hDC);
|
||||
}
|
||||
return DD_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
static int warned = 0;
|
||||
if (warned++ < 10)
|
||||
FIXME("(%p,%p,%p,%p),stub!\n",This,lpRect,lpClipList,lpdwSize);
|
||||
if (lpdwSize) *lpdwSize=0;
|
||||
return DDERR_NOCLIPLIST;
|
||||
}
|
||||
return IWineD3DClipper_GetClipList(This->wineD3DClipper,
|
||||
lpRect,
|
||||
lpClipList,
|
||||
lpdwSize);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -225,10 +194,10 @@ static HRESULT WINAPI IDirectDrawClipperImpl_SetClipList(
|
|||
LPDIRECTDRAWCLIPPER iface,LPRGNDATA lprgn,DWORD dwFlag
|
||||
) {
|
||||
IDirectDrawClipperImpl *This = (IDirectDrawClipperImpl *)iface;
|
||||
static int warned = 0;
|
||||
if (warned++ < 10 || lprgn == NULL)
|
||||
FIXME("(%p,%p,%d),stub!\n",This,lprgn,dwFlag);
|
||||
return DD_OK;
|
||||
|
||||
return IWineD3DClipper_SetClipList(This->wineD3DClipper,
|
||||
lprgn,
|
||||
dwFlag);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -248,9 +217,8 @@ static HRESULT WINAPI IDirectDrawClipperImpl_GetHWnd(
|
|||
IDirectDrawClipperImpl *This = (IDirectDrawClipperImpl *)iface;
|
||||
TRACE("(%p)->(%p)\n", This, hWndPtr);
|
||||
|
||||
*hWndPtr = This->hWnd;
|
||||
|
||||
return DD_OK;
|
||||
return IWineD3DClipper_GetHWnd(This->wineD3DClipper,
|
||||
hWndPtr);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -3037,8 +3037,12 @@ DirectDrawCreateClipper(DWORD Flags,
|
|||
|
||||
ICOM_INIT_INTERFACE(object, IDirectDrawClipper, IDirectDrawClipper_Vtbl);
|
||||
object->ref = 1;
|
||||
object->hWnd = 0;
|
||||
object->ddraw_owner = NULL;
|
||||
object->wineD3DClipper = pWineDirect3DCreateClipper((IUnknown *) object);
|
||||
if(!object->wineD3DClipper)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
*Clipper = (IDirectDrawClipper *) object;
|
||||
return DD_OK;
|
||||
|
|
|
@ -398,16 +398,15 @@ struct IDirectDrawClipperImpl
|
|||
ICOM_VFIELD_MULTI(IDirectDrawClipper);
|
||||
LONG ref;
|
||||
|
||||
/* IDirectDrawClipper fields */
|
||||
HWND hWnd;
|
||||
|
||||
IDirectDrawImpl* ddraw_owner;
|
||||
struct IDirectDrawClipperImpl* prev_ddraw;
|
||||
struct IDirectDrawClipperImpl* next_ddraw;
|
||||
IWineD3DClipper *wineD3DClipper;
|
||||
IDirectDrawImpl *ddraw_owner;
|
||||
};
|
||||
|
||||
const IDirectDrawClipperVtbl IDirectDrawClipper_Vtbl;
|
||||
|
||||
typedef IWineD3DClipper* (WINAPI *fnWineDirect3DCreateClipper)(IUnknown *);
|
||||
fnWineDirect3DCreateClipper pWineDirect3DCreateClipper;
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawPalette implementation structure
|
||||
*****************************************************************************/
|
||||
|
|
|
@ -172,7 +172,10 @@ DDRAW_Create(const GUID *guid,
|
|||
{
|
||||
hWineD3D = LoadLibraryA("wined3d");
|
||||
if (hWineD3D)
|
||||
{
|
||||
pWineDirect3DCreate = (fnWineDirect3DCreate) GetProcAddress(hWineD3D, "WineDirect3DCreate");
|
||||
pWineDirect3DCreateClipper = (fnWineDirect3DCreateClipper) GetProcAddress(hWineD3D, "WineDirect3DCreateClipper");
|
||||
}
|
||||
}
|
||||
|
||||
if (!hWineD3D)
|
||||
|
|
|
@ -12,6 +12,7 @@ C_SRCS = \
|
|||
arb_program_shader.c \
|
||||
baseshader.c \
|
||||
basetexture.c \
|
||||
clipper.c \
|
||||
context.c \
|
||||
cubetexture.c \
|
||||
device.c \
|
||||
|
|
203
dlls/wined3d/clipper.c
Normal file
203
dlls/wined3d/clipper.c
Normal file
|
@ -0,0 +1,203 @@
|
|||
/* IWineD3DClipper implementation
|
||||
*
|
||||
* Copyright 2000 (c) Marcus Meissner
|
||||
* Copyright 2000 (c) TransGaming Technologies Inc.
|
||||
* Copyright 2006 (c) Stefan Dösinger
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_FLOAT_H
|
||||
# include <float.h>
|
||||
#endif
|
||||
#include "wined3d_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||
|
||||
static HRESULT WINAPI IWineD3DClipperImpl_QueryInterface(IWineD3DClipper *iface, REFIID riid, void **Obj)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
|
||||
TRACE("(%p)->(%p,%p)\n", This, riid, Obj);
|
||||
if (IsEqualGUID(&IID_IUnknown, riid)
|
||||
|| IsEqualGUID(&IID_IWineD3DClipper, riid))
|
||||
{
|
||||
*Obj = iface;
|
||||
IWineD3DClipper_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
|
||||
static ULONG WINAPI IWineD3DClipperImpl_AddRef(IWineD3DClipper *iface )
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p)->() incrementing from %u.\n", This, ref - 1);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IWineD3DClipperImpl_Release(IWineD3DClipper *iface)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p)->() decrementing from %u.\n", This, ref + 1);
|
||||
|
||||
if (ref == 0)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
return 0;
|
||||
}
|
||||
else return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DClipperImpl_GetParent(IWineD3DClipper *iface, IUnknown **Parent)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
TRACE("(%p)->(%p)\n", This, Parent);
|
||||
|
||||
*Parent = This->Parent;
|
||||
IUnknown_AddRef(*Parent);
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DClipperImpl_SetHwnd(IWineD3DClipper *iface, DWORD Flags, HWND hWnd)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
|
||||
TRACE("(%p)->(0x%08x,%p)\n", This, Flags, hWnd);
|
||||
if( Flags )
|
||||
{
|
||||
FIXME("Flags = 0x%08x, not supported.\n",Flags);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
This->hWnd = hWnd;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DClipperImpl_GetClipList(IWineD3DClipper *iface, RECT *Rect, RGNDATA *ClipList, DWORD *Size)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
TRACE("(%p,%p,%p,%p)\n", This, Rect, ClipList, Size);
|
||||
|
||||
if (This->hWnd)
|
||||
{
|
||||
HDC hDC = GetDCEx(This->hWnd, NULL, DCX_WINDOW);
|
||||
if (hDC)
|
||||
{
|
||||
HRGN hRgn = CreateRectRgn(0,0,0,0);
|
||||
if (GetRandomRgn(hDC, hRgn, SYSRGN))
|
||||
{
|
||||
if (GetVersion() & 0x80000000)
|
||||
{
|
||||
/* map region to screen coordinates */
|
||||
POINT org;
|
||||
GetDCOrgEx( hDC, &org );
|
||||
OffsetRgn( hRgn, org.x, org.y );
|
||||
}
|
||||
if (Rect)
|
||||
{
|
||||
HRGN hRgnClip = CreateRectRgn(Rect->left, Rect->top,
|
||||
Rect->right, Rect->bottom);
|
||||
CombineRgn(hRgn, hRgn, hRgnClip, RGN_AND);
|
||||
DeleteObject(hRgnClip);
|
||||
}
|
||||
*Size = GetRegionData(hRgn, *Size, ClipList);
|
||||
}
|
||||
DeleteObject(hRgn);
|
||||
ReleaseDC(This->hWnd, hDC);
|
||||
}
|
||||
return WINED3D_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
static int warned = 0;
|
||||
if (warned++ < 10)
|
||||
FIXME("(%p,%p,%p,%p),stub!\n",This,Rect,ClipList,Size);
|
||||
if (Size) *Size=0;
|
||||
return WINEDDERR_NOCLIPLIST;
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DClipperImpl_SetClipList(IWineD3DClipper *iface, RGNDATA *rgn, DWORD Flags)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
static int warned = 0;
|
||||
|
||||
if (warned++ < 10 || rgn == NULL)
|
||||
FIXME("(%p,%p,%d),stub!\n",This,rgn,Flags);
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DClipperImpl_GetHwnd(IWineD3DClipper *iface, HWND *hwnd)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
TRACE("(%p)->(%p)\n", This, hwnd);
|
||||
|
||||
*hwnd = This->hWnd;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IWineD3DClipperImpl_IsClipListChanged(IWineD3DClipper *iface, BOOL *changed)
|
||||
{
|
||||
IWineD3DClipperImpl *This = (IWineD3DClipperImpl *)iface;
|
||||
FIXME("(%p)->(%p),stub!\n",This,changed);
|
||||
|
||||
/* XXX What is safest? */
|
||||
*changed = FALSE;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static const IWineD3DClipperVtbl IWineD3DClipper_Vtbl =
|
||||
{
|
||||
IWineD3DClipperImpl_QueryInterface,
|
||||
IWineD3DClipperImpl_AddRef,
|
||||
IWineD3DClipperImpl_Release,
|
||||
IWineD3DClipperImpl_GetParent,
|
||||
IWineD3DClipperImpl_GetClipList,
|
||||
IWineD3DClipperImpl_GetHwnd,
|
||||
IWineD3DClipperImpl_IsClipListChanged,
|
||||
IWineD3DClipperImpl_SetClipList,
|
||||
IWineD3DClipperImpl_SetHwnd
|
||||
};
|
||||
|
||||
IWineD3DClipper* WINAPI WineDirect3DCreateClipper(IUnknown *Parent)
|
||||
{
|
||||
IWineD3DClipperImpl *obj;
|
||||
|
||||
TRACE("Creating clipper, parent %p\n", Parent);
|
||||
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*obj));
|
||||
if(!obj)
|
||||
{
|
||||
ERR("Out of memory when trying to allocate a WineD3D Clipper\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
obj->lpVtbl = &IWineD3DClipper_Vtbl;
|
||||
obj->Parent = Parent;
|
||||
|
||||
IWineD3DClipper_AddRef((IWineD3DClipper *)obj);
|
||||
return (IWineD3DClipper *) obj;
|
||||
}
|
|
@ -3419,6 +3419,25 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *S
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DSurfaceImpl_SetClipper(IWineD3DSurface *iface, IWineD3DClipper *clipper)
|
||||
{
|
||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
|
||||
TRACE("(%p)->(%p)\n", This, clipper);
|
||||
|
||||
This->clipper = clipper;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DClipper **clipper)
|
||||
{
|
||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
|
||||
TRACE("(%p)->(%p)\n", This, clipper);
|
||||
|
||||
*clipper = This->clipper;
|
||||
IWineD3DClipper_AddRef(*clipper);
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
|
@ -3459,6 +3478,8 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
|
|||
IWineD3DSurfaceImpl_GetOverlayPosition,
|
||||
IWineD3DSurfaceImpl_UpdateOverlayZOrder,
|
||||
IWineD3DSurfaceImpl_UpdateOverlay,
|
||||
IWineD3DSurfaceImpl_SetClipper,
|
||||
IWineD3DSurfaceImpl_GetClipper,
|
||||
/* Internal use: */
|
||||
IWineD3DSurfaceImpl_AddDirtyRect,
|
||||
IWineD3DSurfaceImpl_LoadTexture,
|
||||
|
|
|
@ -1589,6 +1589,8 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
|
|||
IWineD3DSurfaceImpl_GetOverlayPosition,
|
||||
IWineD3DSurfaceImpl_UpdateOverlayZOrder,
|
||||
IWineD3DSurfaceImpl_UpdateOverlay,
|
||||
IWineD3DSurfaceImpl_SetClipper,
|
||||
IWineD3DSurfaceImpl_GetClipper,
|
||||
/* Internal use: */
|
||||
IWineD3DSurfaceImpl_AddDirtyRect,
|
||||
IWineGDISurfaceImpl_LoadTexture,
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
@ stdcall WineDirect3DCreate(long long ptr)
|
||||
@ stdcall WineDirect3DCreateClipper(ptr)
|
||||
|
|
|
@ -1010,6 +1010,19 @@ typedef struct {
|
|||
UINT height;
|
||||
} renderbuffer_entry_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* IWineD3DClipp implementation structure
|
||||
*/
|
||||
typedef struct IWineD3DClipperImpl
|
||||
{
|
||||
const IWineD3DClipperVtbl *lpVtbl;
|
||||
LONG ref;
|
||||
|
||||
IUnknown *Parent;
|
||||
HWND hWnd;
|
||||
} IWineD3DClipperImpl;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* IWineD3DSurface implementation structure
|
||||
*/
|
||||
|
@ -1064,6 +1077,9 @@ struct IWineD3DSurfaceImpl
|
|||
|
||||
struct list renderbuffers;
|
||||
renderbuffer_entry_t *current_renderbuffer;
|
||||
|
||||
/* DirectDraw clippers */
|
||||
IWineD3DClipper *clipper;
|
||||
};
|
||||
|
||||
extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl;
|
||||
|
@ -1111,6 +1127,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetOverlayPosition(IWineD3DSurface *iface, LO
|
|||
HRESULT WINAPI IWineD3DSurfaceImpl_GetOverlayPosition(IWineD3DSurface *iface, LONG *X, LONG *Y);
|
||||
HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlayZOrder(IWineD3DSurface *iface, DWORD Flags, IWineD3DSurface *Ref);
|
||||
HRESULT WINAPI IWineD3DSurfaceImpl_UpdateOverlay(IWineD3DSurface *iface, RECT *SrcRect, IWineD3DSurface *DstSurface, RECT *DstRect, DWORD Flags, WINEDDOVERLAYFX *FX);
|
||||
HRESULT WINAPI IWineD3DSurfaceImpl_SetClipper(IWineD3DSurface *iface, IWineD3DClipper *clipper);
|
||||
HRESULT WINAPI IWineD3DSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DClipper **clipper);
|
||||
|
||||
/* Surface flags: */
|
||||
#define SFLAG_OVERSIZE 0x00000001 /* Surface is bigger than gl size, blts only */
|
||||
|
|
|
@ -79,6 +79,7 @@ struct IWineD3DSurface;
|
|||
#define WINEDDERR_NOTFLIPPABLE MAKE_WINED3DHRESULT(582)
|
||||
#define WINEDDERR_SURFACEBUSY MAKE_WINED3DHRESULT(430)
|
||||
#define WINEDDERR_INVALIDRECT MAKE_WINED3DHRESULT(150)
|
||||
#define WINEDDERR_NOCLIPLIST MAKE_WINED3DHRESULT(205)
|
||||
#define WINED3DOK_NOAUTOGEN MAKE_WINED3DSTATUS(2159)
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -104,6 +105,7 @@ struct IWineD3DVertexShader;
|
|||
struct IWineD3DPixelShader;
|
||||
struct IWineD3DQuery;
|
||||
struct IWineD3DSwapChain;
|
||||
struct IWineD3DClipper;
|
||||
|
||||
|
||||
/* {108F9C44-6F30-11d9-C687-00046142C14F} */
|
||||
|
@ -187,6 +189,10 @@ DEFINE_GUID(IID_IWineD3DStateBlock,
|
|||
DEFINE_GUID(IID_IWineD3DQuery,
|
||||
0x905ddbac, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
|
||||
|
||||
/* {8f2bceb1-d338-488c-ab7f-0ec980bf5d2d} */
|
||||
DEFINE_GUID(IID_IWineD3DClipper,
|
||||
0x8f2bceb1, 0xd338, 0x488c, 0xab, 0x7f, 0x0e, 0xc9, 0x80, 0xbf, 0x5d, 0x2d);
|
||||
|
||||
/*****************************************************************************
|
||||
* Callback functions required for predefining surfaces / stencils
|
||||
*/
|
||||
|
@ -1119,6 +1125,8 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource)
|
|||
STDMETHOD(GetOverlayPosition)(THIS_ LONG *X, LONG *Y) PURE;
|
||||
STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD Flags, IWineD3DSurface *Ref) PURE;
|
||||
STDMETHOD(UpdateOverlay)(THIS_ RECT *SrcRect, IWineD3DSurface *DstSurface, RECT *DstRect, DWORD Flags, WINEDDOVERLAYFX *FX);
|
||||
STDMETHOD(SetClipper)(THIS_ struct IWineD3DClipper *clipper);
|
||||
STDMETHOD(GetClipper)(THIS_ struct IWineD3DClipper **clipper);
|
||||
/* Internally used methods */
|
||||
STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pRect) PURE;
|
||||
STDMETHOD(LoadTexture)(THIS) PURE;
|
||||
|
@ -1172,6 +1180,8 @@ DECLARE_INTERFACE_(IWineD3DSurface,IWineD3DResource)
|
|||
#define IWineD3DSurface_GetOverlayPosition(p, a, b) (p)->lpVtbl->GetOverlayPosition(p, a, b)
|
||||
#define IWineD3DSurface_UpdateOverlayZOrder(p, a, b) (p)->lpVtbl->UpdateOverlayZOrder(p, a, b)
|
||||
#define IWineD3DSurface_UpdateOverlay(p, a, b, c, d, e) (p)->lpVtbl->UpdateOverlay(p, a, b, c, d, e)
|
||||
#define IWineD3DSurface_SetClipper(p, a) (p)->lpVtbl->SetClipper(p, a)
|
||||
#define IWineD3DSurface_GetClipper(p, a) (p)->lpVtbl->GetClipper(p, a)
|
||||
/*** IWineD3DSurface (Internal, no d3d mapping) methods ***/
|
||||
#define IWineD3DSurface_AddDirtyRect(p,a) (p)->lpVtbl->AddDirtyRect(p,a)
|
||||
#define IWineD3DSurface_LoadTexture(p) (p)->lpVtbl->LoadTexture(p)
|
||||
|
@ -1532,6 +1542,54 @@ DECLARE_INTERFACE_(IWineD3DPalette,IUnknown)
|
|||
#define IWineD3DPalette_SetEntries(p, a, b, c, d) (p)->lpVtbl->SetEntries(p, a, b, c, d)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* IDirectDrawClipper interface
|
||||
*/
|
||||
#define INTERFACE IWineD3DClipper
|
||||
DECLARE_INTERFACE_(IWineD3DClipper,IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
/*** WineD3DBase methods ***/
|
||||
STDMETHOD_(HRESULT,GetParent)(THIS_ IUnknown **parent) PURE;
|
||||
/*** IWineD3DClipper methods ***/
|
||||
STDMETHOD(GetClipList)(THIS_ LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize) PURE;
|
||||
STDMETHOD(GetHWnd)(THIS_ HWND *lphWnd) PURE;
|
||||
STDMETHOD(IsClipListChanged)(THIS_ BOOL *lpbChanged) PURE;
|
||||
STDMETHOD(SetClipList)(THIS_ LPRGNDATA lpClipList, DWORD dwFlags) PURE;
|
||||
STDMETHOD(SetHWnd)(THIS_ DWORD dwFlags, HWND hWnd) PURE;
|
||||
};
|
||||
#undef INTERFACE
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IWineD3DClipper_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IWineD3DClipper_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IWineD3DClipper_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IWineD3DClipper methods ***/
|
||||
#define IWineD3DClipper_GetClipList(p,a,b,c) (p)->lpVtbl->GetClipList(p,a,b,c)
|
||||
#define IWineD3DClipper_GetHWnd(p,a) (p)->lpVtbl->GetHWnd(p,a)
|
||||
#define IWineD3DClipper_IsClipListChanged(p,a) (p)->lpVtbl->IsClipListChanged(p,a)
|
||||
#define IWineD3DClipper_SetClipList(p,a,b) (p)->lpVtbl->SetClipList(p,a,b)
|
||||
#define IWineD3DClipper_SetHWnd(p,a,b) (p)->lpVtbl->SetHWnd(p,a,b)
|
||||
#else
|
||||
/*** IUnknown methods ***/
|
||||
#define IWineD3DClipper_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
|
||||
#define IWineD3DClipper_AddRef(p) (p)->AddRef()
|
||||
#define IWineD3DClipper_Release(p) (p)->Release()
|
||||
/*** IWineD3DClipper methods ***/
|
||||
#define IWineD3DClipper_GetClipList(p,a,b,c) (p)->GetClipList(a,b,c)
|
||||
#define IWineD3DClipper_GetHWnd(p,a) (p)->GetHWnd(a)
|
||||
#define IWineD3DClipper_IsClipListChanged(p,a) (p)->IsClipListChanged(a)
|
||||
#define IWineD3DClipper_SetClipList(p,a,b) (p)->SetClipList(a,b)
|
||||
#define IWineD3DClipper_SetHWnd(p,a,b) (p)->SetHWnd(a,b)
|
||||
#endif
|
||||
|
||||
/* DDraw Clippers are not created from DDraw objects, they have a seperate creation function */
|
||||
IWineD3DClipper* WINAPI WineDirect3DCreateClipper(IUnknown *parent);
|
||||
|
||||
#if 0 /* FIXME: During porting in from d3d8 - the following will be used */
|
||||
extern HRESULT WINAPI IDirect3DVertexShaderImpl_ParseProgram(IDirect3DVertexShaderImpl* This, CONST DWORD* pFunction);
|
||||
/* internal Interfaces */
|
||||
|
|
Loading…
Reference in a new issue