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
25 #define NONAMELESSUNION
26 #define NONAMELESSSTRUCT
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);
50 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
54 ULONG WINAPI IDirect3D9Impl_AddRef(LPDIRECT3D9 iface) {
55 ICOM_THIS(IDirect3D9Impl,iface);
56 TRACE("(%p) : AddRef from %ld\n", This, 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);
65 HeapFree(GetProcessHeap(), 0, This);
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);
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);
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);
89 UINT WINAPI IDirect3D9Impl_GetAdapterModeCount(LPDIRECT3D9 iface, UINT Adapter, D3DFORMAT Format) {
90 ICOM_THIS(IDirect3D9Impl,iface);
91 FIXME("(%p): stub\n", This);
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);
101 HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT Adapter, D3DDISPLAYMODE* pMode) {
102 ICOM_THIS(IDirect3D9Impl,iface);
103 FIXME("(%p): stub\n", This);
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);
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);
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);
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);
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);
146 HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
147 ICOM_THIS(IDirect3D9Impl,iface);
148 FIXME("(%p): stub\n", This);
152 HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT Adapter) {
153 ICOM_THIS(IDirect3D9Impl,iface);
154 FIXME("(%p) : stub\n", This);
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);
167 ICOM_VTABLE(IDirect3D9) Direct3D9_Vtbl =
169 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
170 IDirect3D9Impl_QueryInterface,
171 IDirect3D9Impl_AddRef,
172 IDirect3D9Impl_Release,
173 IDirect3D9Impl_RegisterSoftwareDevice,
174 IDirect3D9Impl_GetAdapterCount,
175 IDirect3D9Impl_GetAdapterIdentifier,
176 IDirect3D9Impl_GetAdapterModeCount,
177 IDirect3D9Impl_EnumAdapterModes,
178 IDirect3D9Impl_GetAdapterDisplayMode,
179 IDirect3D9Impl_CheckDeviceType,
180 IDirect3D9Impl_CheckDeviceFormat,
181 IDirect3D9Impl_CheckDeviceMultiSampleType,
182 IDirect3D9Impl_CheckDepthStencilMatch,
183 IDirect3D9Impl_CheckDeviceFormatConversion,
184 IDirect3D9Impl_GetDeviceCaps,
185 IDirect3D9Impl_GetAdapterMonitor,
186 IDirect3D9Impl_CreateDevice