Small spelling/punctuation fixes.
[wine/wine64.git] / dlls / d3d9 / swapchain.c
blobf042fcf94bf39b4117713d1b64b31f3df09a7f66
1 /*
2 * IDirect3DSwapChain9 implementation
4 * Copyright 2002-2003 Jason Edmeades
5 * Raphael Junqueira
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "config.h"
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "wingdi.h"
30 #include "wine/debug.h"
32 #include "d3d9_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
36 /* IDirect3DSwapChain IUnknown parts follow: */
37 HRESULT WINAPI IDirect3DSwapChain9Impl_QueryInterface(LPDIRECT3DSWAPCHAIN9 iface, REFIID riid, LPVOID* ppobj)
39 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
41 if (IsEqualGUID(riid, &IID_IUnknown)
42 || IsEqualGUID(riid, &IID_IDirect3DSwapChain9)) {
43 IDirect3DSwapChain9Impl_AddRef(iface);
44 *ppobj = This;
45 return D3D_OK;
48 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
49 return E_NOINTERFACE;
52 ULONG WINAPI IDirect3DSwapChain9Impl_AddRef(LPDIRECT3DSWAPCHAIN9 iface) {
53 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
54 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
55 return ++(This->ref);
58 ULONG WINAPI IDirect3DSwapChain9Impl_Release(LPDIRECT3DSWAPCHAIN9 iface) {
59 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
60 ULONG ref = --This->ref;
61 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
62 if (ref == 0) {
63 HeapFree(GetProcessHeap(), 0, This);
65 return ref;
68 /* IDirect3DSwapChain9 parts follow: */
69 HRESULT WINAPI IDirect3DSwapChain9Impl_Present(LPDIRECT3DSWAPCHAIN9 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags) {
70 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
71 FIXME("(%p) : stub\n", This);
72 return D3D_OK;
75 HRESULT WINAPI IDirect3DSwapChain9Impl_GetFrontBufferData(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DSurface9* pDestSurface) {
76 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
77 FIXME("(%p) : stub\n", This);
78 return D3D_OK;
81 HRESULT WINAPI IDirect3DSwapChain9Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN9 iface, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
82 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
83 FIXME("(%p) : stub\n", This);
84 return D3D_OK;
87 HRESULT WINAPI IDirect3DSwapChain9Impl_GetRasterStatus(LPDIRECT3DSWAPCHAIN9 iface, D3DRASTER_STATUS* pRasterStatus) {
88 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
89 FIXME("(%p) : stub\n", This);
90 return D3D_OK;
93 HRESULT WINAPI IDirect3DSwapChain9Impl_GetDisplayMode(LPDIRECT3DSWAPCHAIN9 iface, D3DDISPLAYMODE* pMode) {
94 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
95 FIXME("(%p) : stub\n", This);
96 return D3D_OK;
99 HRESULT WINAPI IDirect3DSwapChain9Impl_GetDevice(LPDIRECT3DSWAPCHAIN9 iface, IDirect3DDevice9** ppDevice) {
100 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
101 TRACE("(%p) : returning %p\n", This, This->Device);
102 *ppDevice = (LPDIRECT3DDEVICE9) This->Device;
104 /* Note Calling this method will increase the internal reference count
105 on the IDirect3DDevice9 interface. */
106 IDirect3DDevice9Impl_AddRef(*ppDevice);
107 return D3D_OK;
110 HRESULT WINAPI IDirect3DSwapChain9Impl_GetPresentParameters(LPDIRECT3DSWAPCHAIN9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters) {
111 ICOM_THIS(IDirect3DSwapChain9Impl,iface);
112 FIXME("(%p) : copy\n", This);
113 memcpy(pPresentationParameters, &This->PresentParms, sizeof(D3DPRESENT_PARAMETERS));
114 return D3D_OK;
118 ICOM_VTABLE(IDirect3DSwapChain9) Direct3DSwapChain9_Vtbl =
120 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
121 IDirect3DSwapChain9Impl_QueryInterface,
122 IDirect3DSwapChain9Impl_AddRef,
123 IDirect3DSwapChain9Impl_Release,
124 IDirect3DSwapChain9Impl_Present,
125 IDirect3DSwapChain9Impl_GetFrontBufferData,
126 IDirect3DSwapChain9Impl_GetBackBuffer,
127 IDirect3DSwapChain9Impl_GetRasterStatus,
128 IDirect3DSwapChain9Impl_GetDisplayMode,
129 IDirect3DSwapChain9Impl_GetDevice,
130 IDirect3DSwapChain9Impl_GetPresentParameters
134 /* IDirect3DDevice9 IDirect3DSwapChain9 Methods follow: */
135 HRESULT WINAPI IDirect3DDevice9Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) {
136 ICOM_THIS(IDirect3DDevice9Impl,iface);
137 FIXME("(%p) : stub\n", This);
138 return D3D_OK;
141 HRESULT WINAPI IDirect3DDevice9Impl_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) {
142 ICOM_THIS(IDirect3DDevice9Impl,iface);
143 FIXME("(%p) : stub\n", This);
144 return D3D_OK;
147 UINT WINAPI IDirect3DDevice9Impl_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface) {
148 ICOM_THIS(IDirect3DDevice9Impl,iface);
149 FIXME("(%p) : stub\n", This);
150 return 1;