Get rid of the no longer used ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
[wine/multimedia.git] / dlls / d3d9 / directx.c
blob30f03c2d5fe72954fdd90f4f851ce3a9bf258042
1 /*
2 * IDirect3D9 implementation
4 * Copyright 2002 Jason Edmeades
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.
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.
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
21 #include "config.h"
23 #include <stdarg.h>
25 #define NONAMELESSUNION
26 #define NONAMELESSSTRUCT
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winuser.h"
30 #include "wingdi.h"
31 #include "wine/debug.h"
32 #include "wine/unicode.h"
34 #include "d3d9_private.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
38 /* IDirect3D9 IUnknown parts follow: */
39 HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface, REFIID riid, LPVOID* ppobj)
41 ICOM_THIS(IDirect3D9Impl,iface);
43 if (IsEqualGUID(riid, &IID_IUnknown)
44 || IsEqualGUID(riid, &IID_IDirect3D9)) {
45 IDirect3D9Impl_AddRef(iface);
46 *ppobj = This;
47 return D3D_OK;
50 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
51 return E_NOINTERFACE;
54 ULONG WINAPI IDirect3D9Impl_AddRef(LPDIRECT3D9 iface) {
55 ICOM_THIS(IDirect3D9Impl,iface);
56 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
57 return ++(This->ref);
60 ULONG WINAPI IDirect3D9Impl_Release(LPDIRECT3D9 iface) {
61 ICOM_THIS(IDirect3D9Impl,iface);
62 ULONG ref = --This->ref;
63 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
64 if (ref == 0)
65 HeapFree(GetProcessHeap(), 0, This);
66 return ref;
69 /* IDirect3D9 Interface follow: */
70 HRESULT WINAPI IDirect3D9Impl_RegisterSoftwareDevice(LPDIRECT3D9 iface, void* pInitializeFunction) {
71 ICOM_THIS(IDirect3D9Impl,iface);
72 FIXME("(%p)->(%p): stub\n", This, pInitializeFunction);
73 return D3D_OK;
76 UINT WINAPI IDirect3D9Impl_GetAdapterCount(LPDIRECT3D9 iface) {
77 ICOM_THIS(IDirect3D9Impl,iface);
78 /* FIXME: Set to one for now to imply the display */
79 TRACE("(%p): Mostly stub, only returns primary display\n", This);
80 return 1;
83 HRESULT WINAPI IDirect3D9Impl_GetAdapterIdentifier(LPDIRECT3D9 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) {
84 ICOM_THIS(IDirect3D9Impl,iface);
85 FIXME("(%p): stub\n", This);
86 return D3D_OK;
89 UINT WINAPI IDirect3D9Impl_GetAdapterModeCount(LPDIRECT3D9 iface, UINT Adapter, D3DFORMAT Format) {
90 ICOM_THIS(IDirect3D9Impl,iface);
91 FIXME("(%p): stub\n", This);
92 return 0;
95 HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(LPDIRECT3D9 iface, UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) {
96 ICOM_THIS(IDirect3D9Impl,iface);
97 FIXME("(%p): stub\n", This);
98 return D3D_OK;
101 HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT Adapter, D3DDISPLAYMODE* pMode) {
102 ICOM_THIS(IDirect3D9Impl,iface);
103 FIXME("(%p): stub\n", This);
104 return D3D_OK;
107 HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface,
108 UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
109 D3DFORMAT BackBufferFormat, BOOL Windowed) {
110 ICOM_THIS(IDirect3D9Impl,iface);
111 FIXME("(%p): stub\n", This);
112 return D3D_OK;
115 HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9 iface,
116 UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
117 DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) {
118 ICOM_THIS(IDirect3D9Impl,iface);
119 FIXME("(%p): stub\n", This);
120 return D3D_OK;
123 HRESULT WINAPI IDirect3D9Impl_CheckDeviceMultiSampleType(LPDIRECT3D9 iface,
124 UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
125 BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
126 ICOM_THIS(IDirect3D9Impl,iface);
127 FIXME("(%p): stub\n", This);
128 return D3D_OK;
131 HRESULT WINAPI IDirect3D9Impl_CheckDepthStencilMatch(LPDIRECT3D9 iface,
132 UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
133 D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
134 ICOM_THIS(IDirect3D9Impl,iface);
135 FIXME("(%p): stub\n", This);
136 return D3D_OK;
139 HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) {
140 ICOM_THIS(IDirect3D9Impl,iface);
141 FIXME("(%p): stub\n", This);
142 return D3D_OK;
146 HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
147 ICOM_THIS(IDirect3D9Impl,iface);
148 FIXME("(%p): stub\n", This);
149 return D3D_OK;
152 HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT Adapter) {
153 ICOM_THIS(IDirect3D9Impl,iface);
154 FIXME("(%p) : stub\n", This);
155 return NULL;
158 HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
159 DWORD BehaviourFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
160 IDirect3DDevice9** ppReturnedDeviceInterface) {
162 ICOM_THIS(IDirect3D9Impl,iface);
163 FIXME("(%p) : stub\n", This);
164 return D3D_OK;
167 IDirect3D9Vtbl Direct3D9_Vtbl =
169 IDirect3D9Impl_QueryInterface,
170 IDirect3D9Impl_AddRef,
171 IDirect3D9Impl_Release,
172 IDirect3D9Impl_RegisterSoftwareDevice,
173 IDirect3D9Impl_GetAdapterCount,
174 IDirect3D9Impl_GetAdapterIdentifier,
175 IDirect3D9Impl_GetAdapterModeCount,
176 IDirect3D9Impl_EnumAdapterModes,
177 IDirect3D9Impl_GetAdapterDisplayMode,
178 IDirect3D9Impl_CheckDeviceType,
179 IDirect3D9Impl_CheckDeviceFormat,
180 IDirect3D9Impl_CheckDeviceMultiSampleType,
181 IDirect3D9Impl_CheckDepthStencilMatch,
182 IDirect3D9Impl_CheckDeviceFormatConversion,
183 IDirect3D9Impl_GetDeviceCaps,
184 IDirect3D9Impl_GetAdapterMonitor,
185 IDirect3D9Impl_CreateDevice