Framework for the doppler effect.
[wine] / dlls / d3d8 / swapchain.c
1 /*
2  * IDirect3DSwapChain8 implementation
3  *
4  * Copyright 2002 Jason Edmeades
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "windef.h"
22 #include "winbase.h"
23 #include "winuser.h"
24 #include "wingdi.h"
25 #include "wine/debug.h"
26
27 #include "d3d8_private.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
30
31 /* IDirect3DSwapChain IUnknown parts follow: */
32 HRESULT WINAPI IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface,REFIID riid,LPVOID *ppobj)
33 {
34     ICOM_THIS(IDirect3DSwapChain8Impl,iface);
35
36     if (IsEqualGUID(riid, &IID_IUnknown)
37         || IsEqualGUID(riid, &IID_IDirect3DSwapChain8)) {
38         IDirect3DSwapChain8Impl_AddRef(iface);
39         *ppobj = This;
40         return D3D_OK;
41     }
42
43     WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
44     return E_NOINTERFACE;
45 }
46
47 ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface) {
48     ICOM_THIS(IDirect3DSwapChain8Impl,iface);
49     TRACE("(%p) : AddRef from %ld\n", This, This->ref);
50     return ++(This->ref);
51 }
52
53 ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface) {
54     ICOM_THIS(IDirect3DSwapChain8Impl,iface);
55     ULONG ref = --This->ref;
56     TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
57     if (ref == 0)
58         HeapFree(GetProcessHeap(), 0, This);
59     return ref;
60 }
61
62 /* IDirect3DSwapChain parts follow: */
63 HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) {
64     ICOM_THIS(IDirect3DSwapChain8Impl,iface);
65     FIXME("(%p) : stub\n", This);    return D3D_OK;
66 }
67 HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) {
68     ICOM_THIS(IDirect3DSwapChain8Impl,iface);
69     FIXME("(%p) : stub\n", This);    return D3D_OK;
70 }
71
72
73 ICOM_VTABLE(IDirect3DSwapChain8) Direct3DSwapChain8_Vtbl =
74 {
75     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
76     IDirect3DSwapChain8Impl_QueryInterface,
77     IDirect3DSwapChain8Impl_AddRef,
78     IDirect3DSwapChain8Impl_Release,
79     IDirect3DSwapChain8Impl_Present,
80     IDirect3DSwapChain8Impl_GetBackBuffer
81 };