Author: gbrunmar
Date: Wed Dec 19 20:41:05 2007
New Revision: 31330
URL:
http://svn.reactos.org/svn/reactos?rev=31330&view=rev
Log:
Added stubs and vtable for IDirect3D9 implementation
Added:
trunk/reactos/dll/directx/d3d9/d3d9_impl.c (with props)
Modified:
trunk/reactos/dll/directx/d3d9/d3d9.rbuild
trunk/reactos/dll/directx/d3d9/d3d9_private.h
Modified: trunk/reactos/dll/directx/d3d9/d3d9.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9.rbui…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9.rbuild (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9.rbuild Wed Dec 19 20:41:05 2007
@@ -8,5 +8,6 @@
<file>d3d9.c</file>
<file>d3d9_helpers.c</file>
+ <file>d3d9_impl.c</file>
<file>d3d9.rc</file>
</module>
Added: trunk/reactos/dll/directx/d3d9/d3d9_impl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_impl…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_impl.c (added)
+++ trunk/reactos/dll/directx/d3d9/d3d9_impl.c Wed Dec 19 20:41:05 2007
@@ -1,0 +1,178 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS ReactX
+ * FILE: dll/directx/d3d9/d3d9_impl.c
+ * PURPOSE: IDirect3D9 implementation
+ * PROGRAMERS: Gregor Brunmar <gregor (dot) brunmar (at) home (dot) se>
+ */
+#include "d3d9_private.h"
+
+#include <debug.h>
+
+/* IDirect3D9: IUnknown implementation */
+static HRESULT WINAPI IDirect3D9Impl_QueryInterface(LPDIRECT3D9 iface, REFIID riid,
LPVOID* ppobj)
+{
+ UNIMPLEMENTED
+
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI IDirect3D9Impl_AddRef(LPDIRECT3D9 iface)
+{
+ LPDIRECTD3D9_INT This = (LPDIRECTD3D9_INT)iface;
+ ULONG ref = InterlockedIncrement(&This->dwRefCnt);
+
+ return ref;
+}
+
+static ULONG WINAPI IDirect3D9Impl_Release(LPDIRECT3D9 iface)
+{
+ LPDIRECTD3D9_INT This = (LPDIRECTD3D9_INT)iface;
+ ULONG ref = InterlockedDecrement(&This->dwRefCnt);
+
+ if (ref == 0)
+ {
+ EnterCriticalSection(&This->d3d9_cs);
+ /* TODO: Free resources here */
+ LeaveCriticalSection(&This->d3d9_cs);
+ HeapFree(GetProcessHeap(), 0, This);
+ }
+
+ return ref;
+}
+
+/* IDirect3D9 interface */
+static HRESULT WINAPI IDirect3D9Impl_RegisterSoftwareDevice(LPDIRECT3D9 iface, void*
pInitializeFunction)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static UINT WINAPI IDirect3D9Impl_GetAdapterCount(LPDIRECT3D9 iface)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_GetAdapterIdentifier(LPDIRECT3D9 iface, UINT
Adapter, DWORD Flags,
+ D3DADAPTER_IDENTIFIER9*
pIdentifier)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static UINT WINAPI IDirect3D9Impl_GetAdapterModeCount(LPDIRECT3D9 iface, UINT Adapter,
D3DFORMAT Format)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_EnumAdapterModes(LPDIRECT3D9 iface, UINT Adapter,
D3DFORMAT Format,
+ UINT Mode, D3DDISPLAYMODE* pMode)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_GetAdapterDisplayMode(LPDIRECT3D9 iface, UINT
Adapter, D3DDISPLAYMODE* pMode)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_CheckDeviceType(LPDIRECT3D9 iface, UINT Adapter,
D3DDEVTYPE CheckType,
+ D3DFORMAT DisplayFormat, D3DFORMAT
BackBufferFormat, BOOL Windowed)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormat(LPDIRECT3D9 iface, UINT Adapter,
D3DDEVTYPE DeviceType,
+ D3DFORMAT AdapterFormat, DWORD
Usage, D3DRESOURCETYPE RType,
+ D3DFORMAT CheckFormat)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_CheckDeviceMultiSampleType(LPDIRECT3D9 iface, UINT
Adapter, D3DDEVTYPE DeviceType,
+ D3DFORMAT SurfaceFormat,
BOOL Windowed,
+ D3DMULTISAMPLE_TYPE
MultiSampleType, DWORD* pQualityLevels)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_CheckDepthStencilMatch(LPDIRECT3D9 iface, UINT
Adapter, D3DDEVTYPE DeviceType,
+ D3DFORMAT AdapterFormat,
D3DFORMAT RenderTargetFormat,
+ D3DFORMAT
DepthStencilFormat)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(LPDIRECT3D9 iface, UINT
Adapter, D3DDEVTYPE DeviceType,
+ D3DFORMAT SourceFormat,
D3DFORMAT TargetFormat)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_GetDeviceCaps(LPDIRECT3D9 iface, UINT Adapter,
D3DDEVTYPE DeviceType, D3DCAPS9* pCaps)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HMONITOR WINAPI IDirect3D9Impl_GetAdapterMonitor(LPDIRECT3D9 iface, UINT Adapter)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapter,
D3DDEVTYPE DeviceType,
+ HWND hFocusWindow, DWORD
BehaviourFlags,
+ D3DPRESENT_PARAMETERS*
pPresentationParameters,
+ IDirect3DDevice9**
ppReturnedDeviceInterface)
+{
+ UNIMPLEMENTED
+
+ return D3D_OK;
+}
+
+const IDirect3D9Vtbl Direct3D9_Vtbl =
+{
+ /* IUnknown */
+ IDirect3D9Impl_QueryInterface,
+ IDirect3D9Impl_AddRef,
+ IDirect3D9Impl_Release,
+
+ /* IDirect3D9 */
+ IDirect3D9Impl_RegisterSoftwareDevice,
+ IDirect3D9Impl_GetAdapterCount,
+ IDirect3D9Impl_GetAdapterIdentifier,
+ IDirect3D9Impl_GetAdapterModeCount,
+ IDirect3D9Impl_EnumAdapterModes,
+ IDirect3D9Impl_GetAdapterDisplayMode,
+ IDirect3D9Impl_CheckDeviceType,
+ IDirect3D9Impl_CheckDeviceFormat,
+ IDirect3D9Impl_CheckDeviceMultiSampleType,
+ IDirect3D9Impl_CheckDepthStencilMatch,
+ IDirect3D9Impl_CheckDeviceFormatConversion,
+ IDirect3D9Impl_GetDeviceCaps,
+ IDirect3D9Impl_GetAdapterMonitor,
+ IDirect3D9Impl_CreateDevice
+};
Propchange: trunk/reactos/dll/directx/d3d9/d3d9_impl.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/d3d9/d3d9_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_priv…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_private.h (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_private.h Wed Dec 19 20:41:05 2007
@@ -20,7 +20,7 @@
/* 0x001c */ DWORD unknown000007; /* 0x00000001 */
/* 0x0020 */ DWORD dwProcessId;
/* 0x0024 */ struct _tagDIRECTD3D9_INT_ * lpInt;
-/* 0x0028 */ DWORD dwIntRefCnt; /* Increases and decreases by AddRef() and
Release() */
+/* 0x0028 */ volatile LONG dwRefCnt; /* Increases and decreases by AddRef() and
Release() */
/* 0x002c */ DWORD unknown000011; /* 0x00000001 - Probably AdapterIndex */
/* 0x0030 */ GUID DisplayGuid; /*? Always {67685559-3106-11D0-B971-00AA00342F9F}
? */
/* 0x0040 */ CHAR DeviceName[16];