|
1 |
| -#include "stdafx.h" |
2 | 1 | #include "IDirect3D9.h"
|
| 2 | +#include <stdio.h> |
3 | 3 | #include "IDirect3DDevice9.h"
|
| 4 | +#include "stdafx.h" |
4 | 5 | #include "xrD3D9-Null_OutProc.h"
|
5 |
| -#include <stdio.h> |
6 |
| - |
7 | 6 |
|
8 | 7 | const GUID DECLSPEC_SELECTANY IID_IDirect3D9;
|
9 | 8 |
|
10 | 9 | xrIDirect3D9::xrIDirect3D9() : m_refCount(0)
|
11 | 10 | {
|
12 |
| - APIDEBUG("xrIDirect3D9::xrIDirect3D9"); |
13 |
| -//#ifdef D3D_DEBUG_INFO |
14 |
| - Version = NULL; |
15 |
| -//#endif |
| 11 | + APIDEBUG("xrIDirect3D9::xrIDirect3D9"); |
| 12 | + //#ifdef D3D_DEBUG_INFO |
| 13 | + Version = NULL; |
| 14 | + //#endif |
16 | 15 | };
|
17 | 16 |
|
18 |
| -ULONG xrIDirect3D9::AddRef(void) |
| 17 | +ULONG xrIDirect3D9::AddRef(void) |
19 | 18 | {
|
20 |
| - APIDEBUG("xrIDirect3D9::AddRef"); |
21 |
| - m_refCount++; |
22 |
| - return m_refCount; |
| 19 | + APIDEBUG("xrIDirect3D9::AddRef"); |
| 20 | + m_refCount++; |
| 21 | + return m_refCount; |
23 | 22 | }
|
24 | 23 |
|
25 |
| -ULONG xrIDirect3D9::Release(void) |
26 |
| -{ |
27 |
| - APIDEBUG("xrIDirect3D9::Release"); |
28 |
| - m_refCount--; |
29 |
| - if (m_refCount < 0) |
30 |
| - { |
31 |
| - delete this; |
32 |
| - return -1; |
33 |
| - } |
34 |
| - return m_refCount; |
| 24 | +ULONG xrIDirect3D9::Release(void) |
| 25 | +{ |
| 26 | + APIDEBUG("xrIDirect3D9::Release"); |
| 27 | + m_refCount--; |
| 28 | + if (m_refCount < 0) { |
| 29 | + delete this; |
| 30 | + return -1; |
| 31 | + } |
| 32 | + return m_refCount; |
35 | 33 | }
|
36 | 34 |
|
37 |
| -HRESULT xrIDirect3D9::QueryInterface(const IID &iid, void FAR* FAR* ppvObj) |
38 |
| -{ |
39 |
| - APIDEBUG("xrIDirect3D9::QueryInterface"); |
40 |
| - if (iid == IID_IUnknown || iid == IID_IDirect3D9) |
41 |
| - { |
42 |
| - *ppvObj = this; |
43 |
| - AddRef(); |
44 |
| - return NOERROR; |
45 |
| - } |
46 |
| - return E_NOINTERFACE; |
| 35 | +HRESULT xrIDirect3D9::QueryInterface(const IID& iid, void FAR* FAR* ppvObj) |
| 36 | +{ |
| 37 | + APIDEBUG("xrIDirect3D9::QueryInterface"); |
| 38 | + if (iid == IID_IUnknown || iid == IID_IDirect3D9) { |
| 39 | + *ppvObj = this; |
| 40 | + AddRef(); |
| 41 | + return NOERROR; |
| 42 | + } |
| 43 | + return E_NOINTERFACE; |
47 | 44 | }
|
48 | 45 |
|
49 | 46 | HRESULT xrIDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction)
|
50 | 47 | {
|
51 |
| - APIDEBUG("xrIDirect3D9::RegisterSoftwareDevice"); |
52 |
| - return S_OK; |
| 48 | + APIDEBUG("xrIDirect3D9::RegisterSoftwareDevice"); |
| 49 | + return S_OK; |
53 | 50 | };
|
54 | 51 | UINT xrIDirect3D9::GetAdapterCount()
|
55 | 52 | {
|
56 |
| - APIDEBUG("xrIDirect3D9::GetAdapterCount"); |
57 |
| - return 1; |
| 53 | + APIDEBUG("xrIDirect3D9::GetAdapterCount"); |
| 54 | + return 1; |
58 | 55 | };
|
59 | 56 |
|
60 |
| -HRESULT xrIDirect3D9::GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) |
| 57 | +HRESULT xrIDirect3D9::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) |
61 | 58 | {
|
62 |
| - APIDEBUG("xrIDirect3D9::GetAdapterIdentifier"); |
63 |
| - sprintf_s(pIdentifier->Driver, "Default Driver"); |
64 |
| - sprintf_s(pIdentifier->Description, "Default X-Ray Dedicated Adapter"); |
65 |
| - sprintf_s(pIdentifier->DeviceName, "Dedicated"); |
66 |
| - return S_OK; |
| 59 | + APIDEBUG("xrIDirect3D9::GetAdapterIdentifier"); |
| 60 | + sprintf_s(pIdentifier->Driver, "Default Driver"); |
| 61 | + sprintf_s(pIdentifier->Description, "Default X-Ray Dedicated Adapter"); |
| 62 | + sprintf_s(pIdentifier->DeviceName, "Dedicated"); |
| 63 | + return S_OK; |
67 | 64 | };
|
68 |
| -UINT xrIDirect3D9::GetAdapterModeCount( UINT Adapter,D3DFORMAT Format) |
| 65 | +UINT xrIDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) |
69 | 66 | {
|
70 |
| - APIDEBUG("xrIDirect3D9::GetAdapterModeCount"); |
71 |
| - return 1; |
| 67 | + APIDEBUG("xrIDirect3D9::GetAdapterModeCount"); |
| 68 | + return 1; |
72 | 69 | };
|
73 | 70 |
|
74 |
| -HRESULT xrIDirect3D9::EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) |
| 71 | +HRESULT xrIDirect3D9::EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) |
75 | 72 | {
|
76 |
| - APIDEBUG("xrIDirect3D9::EnumAdapterModes"); |
77 |
| - return S_OK; |
| 73 | + APIDEBUG("xrIDirect3D9::EnumAdapterModes"); |
| 74 | + return S_OK; |
78 | 75 | };
|
79 |
| -HRESULT xrIDirect3D9::GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode) |
| 76 | +HRESULT xrIDirect3D9::GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode) |
80 | 77 | {
|
81 |
| - APIDEBUG("xrIDirect3D9::GetAdapterDisplayMode"); |
82 |
| - pMode->Format = D3DFMT_A8R8G8B8; |
83 |
| - return S_OK; |
| 78 | + APIDEBUG("xrIDirect3D9::GetAdapterDisplayMode"); |
| 79 | + pMode->Format = D3DFMT_A8R8G8B8; |
| 80 | + return S_OK; |
84 | 81 | };
|
85 |
| -HRESULT xrIDirect3D9::CheckDeviceType( UINT Adapter,D3DDEVTYPE DevType,D3DFORMAT AdapterFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) |
| 82 | +HRESULT xrIDirect3D9::CheckDeviceType( |
| 83 | + UINT Adapter, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) |
86 | 84 | {
|
87 |
| - APIDEBUG("xrIDirect3D9::CheckDeviceType"); |
88 |
| - return S_OK; |
| 85 | + APIDEBUG("xrIDirect3D9::CheckDeviceType"); |
| 86 | + return S_OK; |
89 | 87 | };
|
90 |
| -HRESULT xrIDirect3D9::CheckDeviceFormat( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) |
| 88 | +HRESULT xrIDirect3D9::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, |
| 89 | + D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) |
91 | 90 | {
|
92 |
| - APIDEBUG("xrIDirect3D9::CheckDeviceFormat"); |
93 |
| - return S_OK; |
| 91 | + APIDEBUG("xrIDirect3D9::CheckDeviceFormat"); |
| 92 | + return S_OK; |
94 | 93 | };
|
95 |
| -HRESULT xrIDirect3D9::CheckDeviceMultiSampleType( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) |
| 94 | +HRESULT xrIDirect3D9::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, |
| 95 | + BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) |
96 | 96 | {
|
97 |
| - APIDEBUG("xrIDirect3D9::CheckDeviceMultiSampleType"); |
98 |
| - return S_OK; |
| 97 | + APIDEBUG("xrIDirect3D9::CheckDeviceMultiSampleType"); |
| 98 | + return S_OK; |
99 | 99 | };
|
100 |
| -HRESULT xrIDirect3D9::CheckDepthStencilMatch( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) |
| 100 | +HRESULT xrIDirect3D9::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, |
| 101 | + D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) |
101 | 102 | {
|
102 |
| - APIDEBUG("xrIDirect3D9::CheckDepthStencilMatch"); |
103 |
| - return S_OK; |
| 103 | + APIDEBUG("xrIDirect3D9::CheckDepthStencilMatch"); |
| 104 | + return S_OK; |
104 | 105 | };
|
105 |
| -HRESULT xrIDirect3D9::CheckDeviceFormatConversion( UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat) |
| 106 | +HRESULT xrIDirect3D9::CheckDeviceFormatConversion( |
| 107 | + UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) |
106 | 108 | {
|
107 |
| - APIDEBUG("xrIDirect3D9::CheckDeviceFormatConversion"); |
108 |
| - return S_OK; |
| 109 | + APIDEBUG("xrIDirect3D9::CheckDeviceFormatConversion"); |
| 110 | + return S_OK; |
109 | 111 | };
|
110 |
| -HRESULT xrIDirect3D9::GetDeviceCaps( UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) |
| 112 | +HRESULT xrIDirect3D9::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) |
111 | 113 | {
|
112 |
| - APIDEBUG("xrIDirect3D9::GetDeviceCaps"); |
113 |
| - if (pCaps) |
114 |
| - ZeroMemory(pCaps,sizeof(D3DCAPS9)); |
115 |
| - return S_OK; |
| 114 | + APIDEBUG("xrIDirect3D9::GetDeviceCaps"); |
| 115 | + if (pCaps) ZeroMemory(pCaps, sizeof(D3DCAPS9)); |
| 116 | + return S_OK; |
116 | 117 | };
|
117 |
| -HMONITOR xrIDirect3D9::GetAdapterMonitor( UINT Adapter) |
| 118 | +HMONITOR xrIDirect3D9::GetAdapterMonitor(UINT Adapter) |
118 | 119 | {
|
119 |
| - APIDEBUG("xrIDirect3D9::GetAdapterMonitor"); |
120 |
| - return NULL; |
| 120 | + APIDEBUG("xrIDirect3D9::GetAdapterMonitor"); |
| 121 | + return NULL; |
121 | 122 | };
|
122 | 123 |
|
123 |
| -HRESULT xrIDirect3D9::CreateDevice (UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) |
124 |
| -{ |
125 |
| - APIDEBUG("xrIDirect3D9::CreateDevice"); |
126 |
| - *ppReturnedDeviceInterface = NULL; |
127 |
| - xrIDirect3DDevice9* I = new xrIDirect3DDevice9(this, pPresentationParameters); |
128 |
| - *ppReturnedDeviceInterface = I; |
129 |
| - return S_OK; |
| 124 | +HRESULT xrIDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, |
| 125 | + D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface) |
| 126 | +{ |
| 127 | + APIDEBUG("xrIDirect3D9::CreateDevice"); |
| 128 | + *ppReturnedDeviceInterface = NULL; |
| 129 | + xrIDirect3DDevice9* I = new xrIDirect3DDevice9(this, pPresentationParameters); |
| 130 | + *ppReturnedDeviceInterface = I; |
| 131 | + return S_OK; |
130 | 132 | };
|
0 commit comments