11 |
cycrow |
1 |
#pragma once
|
|
|
2 |
|
|
|
3 |
#include "../Overlay.h"
|
|
|
4 |
|
|
|
5 |
class MyDirect3DDevice9 : public IDirect3DDevice9
|
|
|
6 |
{
|
|
|
7 |
public:
|
|
|
8 |
// We need d3d so that we'd use a pointer to MyDirect3D9 instead of the original IDirect3D9 implementor
|
|
|
9 |
// in functions like GetDirect3D9
|
|
|
10 |
MyDirect3DDevice9(IDirect3D9* d3d, IDirect3DDevice9* device, COverlay *o) : m_d3d(d3d), m_device(device), m_pOverlay(o)
|
|
|
11 |
{
|
|
|
12 |
m_pOverlay->init ( this );
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
/*** IUnknown methods ***/
|
|
|
16 |
STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj)
|
|
|
17 |
{
|
|
|
18 |
return m_device->QueryInterface(riid, ppvObj);
|
|
|
19 |
}
|
|
|
20 |
|
|
|
21 |
STDMETHOD_(ULONG,AddRef)(THIS)
|
|
|
22 |
{
|
|
|
23 |
return m_device->AddRef();
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
STDMETHOD_(ULONG,Release)(THIS)
|
|
|
27 |
{
|
|
|
28 |
ULONG count = m_device->Release();
|
|
|
29 |
if(0 == count)
|
|
|
30 |
delete this;
|
|
|
31 |
|
|
|
32 |
return count;
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
/*** IDirect3DDevice9 methods ***/
|
|
|
36 |
STDMETHOD(TestCooperativeLevel)(THIS)
|
|
|
37 |
{
|
|
|
38 |
return m_device->TestCooperativeLevel();
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
STDMETHOD_(UINT, GetAvailableTextureMem)(THIS)
|
|
|
42 |
{
|
|
|
43 |
return m_device->GetAvailableTextureMem();
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
STDMETHOD(EvictManagedResources)(THIS)
|
|
|
47 |
{
|
|
|
48 |
return m_device->EvictManagedResources();
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9)
|
|
|
52 |
{
|
|
|
53 |
// Let the device validate the incoming pointer for us
|
|
|
54 |
HRESULT hr = m_device->GetDirect3D(ppD3D9);
|
|
|
55 |
if(SUCCEEDED(hr))
|
|
|
56 |
*ppD3D9 = m_d3d;
|
|
|
57 |
|
|
|
58 |
return hr;
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps)
|
|
|
62 |
{
|
|
|
63 |
return m_device->GetDeviceCaps(pCaps);
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode)
|
|
|
67 |
{
|
|
|
68 |
return m_device->GetDisplayMode(iSwapChain, pMode);
|
|
|
69 |
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters)
|
|
|
73 |
{
|
|
|
74 |
return m_device->GetCreationParameters(pParameters);
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap)
|
|
|
78 |
{
|
|
|
79 |
return m_device->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags)
|
|
|
83 |
{
|
|
|
84 |
m_device->SetCursorPosition(X, Y, Flags);
|
|
|
85 |
}
|
|
|
86 |
|
|
|
87 |
STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow)
|
|
|
88 |
{
|
|
|
89 |
return m_device->ShowCursor(bShow);
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain)
|
|
|
93 |
{
|
|
|
94 |
return m_device->CreateAdditionalSwapChain(pPresentationParameters, pSwapChain);
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain)
|
|
|
98 |
{
|
|
|
99 |
return m_device->GetSwapChain(iSwapChain, pSwapChain);
|
|
|
100 |
}
|
|
|
101 |
|
|
|
102 |
STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS)
|
|
|
103 |
{
|
|
|
104 |
return m_device->GetNumberOfSwapChains();
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters)
|
|
|
108 |
{
|
|
|
109 |
return m_device->Reset(pPresentationParameters);
|
|
|
110 |
}
|
|
|
111 |
|
|
|
112 |
STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
|
|
|
113 |
{
|
|
|
114 |
return m_device->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer)
|
|
|
118 |
{
|
|
|
119 |
return m_device->GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer);
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus)
|
|
|
123 |
{
|
|
|
124 |
return m_device->GetRasterStatus(iSwapChain, pRasterStatus);
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs)
|
|
|
128 |
{
|
|
|
129 |
return m_device->SetDialogBoxMode(bEnableDialogs);
|
|
|
130 |
}
|
|
|
131 |
|
|
|
132 |
STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp)
|
|
|
133 |
{
|
|
|
134 |
return m_device->SetGammaRamp(iSwapChain, Flags, pRamp);
|
|
|
135 |
}
|
|
|
136 |
|
|
|
137 |
STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp)
|
|
|
138 |
{
|
|
|
139 |
return m_device->GetGammaRamp(iSwapChain, pRamp);
|
|
|
140 |
}
|
|
|
141 |
|
|
|
142 |
STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle)
|
|
|
143 |
{
|
|
|
144 |
return m_device->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle)
|
|
|
148 |
{
|
|
|
149 |
return m_device->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture, pSharedHandle);
|
|
|
150 |
}
|
|
|
151 |
|
|
|
152 |
STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle)
|
|
|
153 |
{
|
|
|
154 |
return m_device->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture, pSharedHandle);
|
|
|
155 |
}
|
|
|
156 |
|
|
|
157 |
STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle)
|
|
|
158 |
{
|
|
|
159 |
return m_device->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle)
|
|
|
163 |
{
|
|
|
164 |
return m_device->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
|
|
|
168 |
{
|
|
|
169 |
return m_device->CreateRenderTarget(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle);
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
|
|
|
173 |
{
|
|
|
174 |
return m_device->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle);
|
|
|
175 |
}
|
|
|
176 |
|
|
|
177 |
STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint)
|
|
|
178 |
{
|
|
|
179 |
return m_device->UpdateSurface(pSourceSurface, pSourceRect, pDestinationSurface, pDestPoint);
|
|
|
180 |
}
|
|
|
181 |
|
|
|
182 |
STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture)
|
|
|
183 |
{
|
|
|
184 |
return m_device->UpdateTexture(pSourceTexture, pDestinationTexture);
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface)
|
|
|
188 |
{
|
|
|
189 |
return m_device->GetRenderTargetData(pRenderTarget, pDestSurface);
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface)
|
|
|
193 |
{
|
|
|
194 |
return m_device->GetFrontBufferData(iSwapChain, pDestSurface);
|
|
|
195 |
}
|
|
|
196 |
|
|
|
197 |
STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter)
|
|
|
198 |
{
|
|
|
199 |
return m_device->StretchRect(pSourceSurface, pSourceRect, pDestSurface, pDestRect, Filter);
|
|
|
200 |
}
|
|
|
201 |
|
|
|
202 |
STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color)
|
|
|
203 |
{
|
|
|
204 |
return m_device->ColorFill(pSurface, pRect, color);
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle)
|
|
|
208 |
{
|
|
|
209 |
return m_device->CreateOffscreenPlainSurface(Width, Height, Format, Pool, ppSurface, pSharedHandle);
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget)
|
|
|
213 |
{
|
|
|
214 |
return m_device->SetRenderTarget(RenderTargetIndex, pRenderTarget);
|
|
|
215 |
}
|
|
|
216 |
|
|
|
217 |
STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget)
|
|
|
218 |
{
|
|
|
219 |
return m_device->GetRenderTarget(RenderTargetIndex, ppRenderTarget);
|
|
|
220 |
}
|
|
|
221 |
|
|
|
222 |
STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil)
|
|
|
223 |
{
|
|
|
224 |
return m_device->SetDepthStencilSurface(pNewZStencil);
|
|
|
225 |
}
|
|
|
226 |
|
|
|
227 |
STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface)
|
|
|
228 |
{
|
|
|
229 |
return m_device->GetDepthStencilSurface(ppZStencilSurface);
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
STDMETHOD(BeginScene)(THIS)
|
|
|
233 |
{
|
|
|
234 |
return m_device->BeginScene();
|
|
|
235 |
}
|
|
|
236 |
|
|
|
237 |
STDMETHOD(EndScene)(THIS)
|
|
|
238 |
{
|
|
|
239 |
m_pOverlay->render ( this );
|
|
|
240 |
|
|
|
241 |
return m_device->EndScene();
|
|
|
242 |
}
|
|
|
243 |
|
|
|
244 |
STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil)
|
|
|
245 |
{
|
|
|
246 |
return m_device->Clear(Count, pRects, Flags, Color, Z, Stencil);
|
|
|
247 |
}
|
|
|
248 |
|
|
|
249 |
STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix)
|
|
|
250 |
{
|
|
|
251 |
return m_device->SetTransform(State, pMatrix);
|
|
|
252 |
}
|
|
|
253 |
|
|
|
254 |
STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix)
|
|
|
255 |
{
|
|
|
256 |
return m_device->GetTransform(State, pMatrix);
|
|
|
257 |
}
|
|
|
258 |
|
|
|
259 |
STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix)
|
|
|
260 |
{
|
|
|
261 |
return m_device->MultiplyTransform(State, pMatrix);
|
|
|
262 |
}
|
|
|
263 |
|
|
|
264 |
STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport)
|
|
|
265 |
{
|
|
|
266 |
return m_device->SetViewport(pViewport);
|
|
|
267 |
}
|
|
|
268 |
|
|
|
269 |
STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport)
|
|
|
270 |
{
|
|
|
271 |
return m_device->GetViewport(pViewport);
|
|
|
272 |
}
|
|
|
273 |
|
|
|
274 |
STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial)
|
|
|
275 |
{
|
|
|
276 |
return m_device->SetMaterial(pMaterial);
|
|
|
277 |
}
|
|
|
278 |
|
|
|
279 |
STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial)
|
|
|
280 |
{
|
|
|
281 |
return m_device->GetMaterial(pMaterial);
|
|
|
282 |
}
|
|
|
283 |
|
|
|
284 |
STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9* pLight)
|
|
|
285 |
{
|
|
|
286 |
return m_device->SetLight(Index, pLight);
|
|
|
287 |
}
|
|
|
288 |
|
|
|
289 |
STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9* pLight)
|
|
|
290 |
{
|
|
|
291 |
return m_device->GetLight(Index, pLight);
|
|
|
292 |
}
|
|
|
293 |
|
|
|
294 |
STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable)
|
|
|
295 |
{
|
|
|
296 |
return m_device->LightEnable(Index, Enable);
|
|
|
297 |
}
|
|
|
298 |
|
|
|
299 |
STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable)
|
|
|
300 |
{
|
|
|
301 |
return m_device->GetLightEnable(Index, pEnable);
|
|
|
302 |
}
|
|
|
303 |
|
|
|
304 |
STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane)
|
|
|
305 |
{
|
|
|
306 |
return m_device->SetClipPlane(Index, pPlane);
|
|
|
307 |
}
|
|
|
308 |
|
|
|
309 |
STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane)
|
|
|
310 |
{
|
|
|
311 |
return m_device->GetClipPlane(Index, pPlane);
|
|
|
312 |
}
|
|
|
313 |
|
|
|
314 |
STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value)
|
|
|
315 |
{
|
|
|
316 |
return m_device->SetRenderState(State, Value);
|
|
|
317 |
}
|
|
|
318 |
|
|
|
319 |
STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue)
|
|
|
320 |
{
|
|
|
321 |
return m_device->GetRenderState(State, pValue);
|
|
|
322 |
}
|
|
|
323 |
|
|
|
324 |
STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB)
|
|
|
325 |
{
|
|
|
326 |
return m_device->CreateStateBlock(Type, ppSB);
|
|
|
327 |
}
|
|
|
328 |
|
|
|
329 |
STDMETHOD(BeginStateBlock)(THIS)
|
|
|
330 |
{
|
|
|
331 |
return m_device->BeginStateBlock();
|
|
|
332 |
}
|
|
|
333 |
|
|
|
334 |
STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB)
|
|
|
335 |
{
|
|
|
336 |
return m_device->EndStateBlock(ppSB);
|
|
|
337 |
}
|
|
|
338 |
|
|
|
339 |
STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus)
|
|
|
340 |
{
|
|
|
341 |
return m_device->SetClipStatus(pClipStatus);
|
|
|
342 |
}
|
|
|
343 |
|
|
|
344 |
STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus)
|
|
|
345 |
{
|
|
|
346 |
return m_device->GetClipStatus(pClipStatus);
|
|
|
347 |
}
|
|
|
348 |
|
|
|
349 |
STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture)
|
|
|
350 |
{
|
|
|
351 |
return m_device->GetTexture(Stage, ppTexture);
|
|
|
352 |
}
|
|
|
353 |
|
|
|
354 |
STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture)
|
|
|
355 |
{
|
|
|
356 |
return m_device->SetTexture(Stage, pTexture);
|
|
|
357 |
}
|
|
|
358 |
|
|
|
359 |
STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue)
|
|
|
360 |
{
|
|
|
361 |
return m_device->GetTextureStageState(Stage, Type, pValue);
|
|
|
362 |
}
|
|
|
363 |
|
|
|
364 |
STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value)
|
|
|
365 |
{
|
|
|
366 |
return m_device->SetTextureStageState(Stage, Type, Value);
|
|
|
367 |
}
|
|
|
368 |
|
|
|
369 |
STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue)
|
|
|
370 |
{
|
|
|
371 |
return m_device->GetSamplerState(Sampler, Type, pValue);
|
|
|
372 |
}
|
|
|
373 |
|
|
|
374 |
STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value)
|
|
|
375 |
{
|
|
|
376 |
return m_device->SetSamplerState(Sampler, Type, Value);
|
|
|
377 |
}
|
|
|
378 |
|
|
|
379 |
STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses)
|
|
|
380 |
{
|
|
|
381 |
return m_device->ValidateDevice(pNumPasses);
|
|
|
382 |
}
|
|
|
383 |
|
|
|
384 |
STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries)
|
|
|
385 |
{
|
|
|
386 |
return m_device->SetPaletteEntries(PaletteNumber, pEntries);
|
|
|
387 |
}
|
|
|
388 |
|
|
|
389 |
STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries)
|
|
|
390 |
{
|
|
|
391 |
return m_device->GetPaletteEntries(PaletteNumber, pEntries);
|
|
|
392 |
}
|
|
|
393 |
|
|
|
394 |
STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber)
|
|
|
395 |
{
|
|
|
396 |
return m_device->SetCurrentTexturePalette(PaletteNumber);
|
|
|
397 |
}
|
|
|
398 |
|
|
|
399 |
STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber)
|
|
|
400 |
{
|
|
|
401 |
return m_device->GetCurrentTexturePalette(PaletteNumber);
|
|
|
402 |
}
|
|
|
403 |
|
|
|
404 |
STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect)
|
|
|
405 |
{
|
|
|
406 |
return m_device->SetScissorRect(pRect);
|
|
|
407 |
}
|
|
|
408 |
|
|
|
409 |
STDMETHOD(GetScissorRect)(THIS_ RECT* pRect)
|
|
|
410 |
{
|
|
|
411 |
return m_device->GetScissorRect(pRect);
|
|
|
412 |
}
|
|
|
413 |
|
|
|
414 |
STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware)
|
|
|
415 |
{
|
|
|
416 |
return m_device->SetSoftwareVertexProcessing(bSoftware);
|
|
|
417 |
}
|
|
|
418 |
|
|
|
419 |
STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS)
|
|
|
420 |
{
|
|
|
421 |
return m_device->GetSoftwareVertexProcessing();
|
|
|
422 |
}
|
|
|
423 |
|
|
|
424 |
STDMETHOD(SetNPatchMode)(THIS_ float nSegments)
|
|
|
425 |
{
|
|
|
426 |
return m_device->SetNPatchMode(nSegments);
|
|
|
427 |
}
|
|
|
428 |
|
|
|
429 |
STDMETHOD_(float, GetNPatchMode)(THIS)
|
|
|
430 |
{
|
|
|
431 |
return m_device->GetNPatchMode();
|
|
|
432 |
}
|
|
|
433 |
|
|
|
434 |
STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount)
|
|
|
435 |
{
|
|
|
436 |
return m_device->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
|
|
|
437 |
}
|
|
|
438 |
|
|
|
439 |
STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
|
|
|
440 |
{
|
|
|
441 |
return m_device->DrawIndexedPrimitive(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
|
|
|
442 |
}
|
|
|
443 |
|
|
|
444 |
STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride)
|
|
|
445 |
{
|
|
|
446 |
return m_device->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
|
|
|
447 |
}
|
|
|
448 |
|
|
|
449 |
STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride)
|
|
|
450 |
{
|
|
|
451 |
return m_device->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
|
|
|
452 |
}
|
|
|
453 |
|
|
|
454 |
STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags)
|
|
|
455 |
{
|
|
|
456 |
return m_device->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags);
|
|
|
457 |
}
|
|
|
458 |
|
|
|
459 |
STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl)
|
|
|
460 |
{
|
|
|
461 |
return m_device->CreateVertexDeclaration(pVertexElements, ppDecl);
|
|
|
462 |
}
|
|
|
463 |
|
|
|
464 |
STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl)
|
|
|
465 |
{
|
|
|
466 |
return m_device->SetVertexDeclaration(pDecl);
|
|
|
467 |
}
|
|
|
468 |
|
|
|
469 |
STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl)
|
|
|
470 |
{
|
|
|
471 |
return m_device->GetVertexDeclaration(ppDecl);
|
|
|
472 |
}
|
|
|
473 |
|
|
|
474 |
STDMETHOD(SetFVF)(THIS_ DWORD FVF)
|
|
|
475 |
{
|
|
|
476 |
return m_device->SetFVF(FVF);
|
|
|
477 |
}
|
|
|
478 |
|
|
|
479 |
STDMETHOD(GetFVF)(THIS_ DWORD* pFVF)
|
|
|
480 |
{
|
|
|
481 |
return m_device->GetFVF(pFVF);
|
|
|
482 |
}
|
|
|
483 |
|
|
|
484 |
STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader)
|
|
|
485 |
{
|
|
|
486 |
return m_device->CreateVertexShader(pFunction, ppShader);
|
|
|
487 |
}
|
|
|
488 |
|
|
|
489 |
STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader)
|
|
|
490 |
{
|
|
|
491 |
return m_device->SetVertexShader(pShader);
|
|
|
492 |
}
|
|
|
493 |
|
|
|
494 |
STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader)
|
|
|
495 |
{
|
|
|
496 |
return m_device->GetVertexShader(ppShader);
|
|
|
497 |
}
|
|
|
498 |
|
|
|
499 |
STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
|
|
|
500 |
{
|
|
|
501 |
return m_device->SetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
|
|
502 |
}
|
|
|
503 |
|
|
|
504 |
STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount)
|
|
|
505 |
{
|
|
|
506 |
return m_device->GetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
|
|
507 |
}
|
|
|
508 |
|
|
|
509 |
STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
|
|
|
510 |
{
|
|
|
511 |
return m_device->SetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
|
|
512 |
}
|
|
|
513 |
|
|
|
514 |
STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount)
|
|
|
515 |
{
|
|
|
516 |
return m_device->GetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
|
|
517 |
}
|
|
|
518 |
|
|
|
519 |
STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount)
|
|
|
520 |
{
|
|
|
521 |
return m_device->SetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
|
|
522 |
}
|
|
|
523 |
|
|
|
524 |
STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
|
|
|
525 |
{
|
|
|
526 |
return m_device->GetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
|
|
527 |
}
|
|
|
528 |
|
|
|
529 |
STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
|
|
|
530 |
{
|
|
|
531 |
return m_device->SetStreamSource(StreamNumber, pStreamData, OffsetInBytes, Stride);
|
|
|
532 |
}
|
|
|
533 |
|
|
|
534 |
STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride)
|
|
|
535 |
{
|
|
|
536 |
return m_device->GetStreamSource(StreamNumber, ppStreamData, pOffsetInBytes, pStride);
|
|
|
537 |
}
|
|
|
538 |
|
|
|
539 |
STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting)
|
|
|
540 |
{
|
|
|
541 |
return m_device->SetStreamSourceFreq(StreamNumber, Setting);
|
|
|
542 |
}
|
|
|
543 |
|
|
|
544 |
STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting)
|
|
|
545 |
{
|
|
|
546 |
return m_device->GetStreamSourceFreq(StreamNumber, pSetting);
|
|
|
547 |
}
|
|
|
548 |
|
|
|
549 |
STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData)
|
|
|
550 |
{
|
|
|
551 |
return m_device->SetIndices(pIndexData);
|
|
|
552 |
}
|
|
|
553 |
|
|
|
554 |
STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData)
|
|
|
555 |
{
|
|
|
556 |
return m_device->GetIndices(ppIndexData);
|
|
|
557 |
}
|
|
|
558 |
|
|
|
559 |
STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader)
|
|
|
560 |
{
|
|
|
561 |
return m_device->CreatePixelShader(pFunction, ppShader);
|
|
|
562 |
}
|
|
|
563 |
|
|
|
564 |
STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader)
|
|
|
565 |
{
|
|
|
566 |
return m_device->SetPixelShader(pShader);
|
|
|
567 |
}
|
|
|
568 |
|
|
|
569 |
STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader)
|
|
|
570 |
{
|
|
|
571 |
return m_device->GetPixelShader(ppShader);
|
|
|
572 |
}
|
|
|
573 |
|
|
|
574 |
STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount)
|
|
|
575 |
{
|
|
|
576 |
return m_device->SetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
|
|
577 |
}
|
|
|
578 |
|
|
|
579 |
STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount)
|
|
|
580 |
{
|
|
|
581 |
return m_device->GetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
|
|
582 |
}
|
|
|
583 |
|
|
|
584 |
STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount)
|
|
|
585 |
{
|
|
|
586 |
return m_device->SetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
|
|
587 |
}
|
|
|
588 |
|
|
|
589 |
STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount)
|
|
|
590 |
{
|
|
|
591 |
return m_device->GetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
|
|
592 |
}
|
|
|
593 |
|
|
|
594 |
STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount)
|
|
|
595 |
{
|
|
|
596 |
return m_device->SetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
|
|
597 |
}
|
|
|
598 |
|
|
|
599 |
STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
|
|
|
600 |
{
|
|
|
601 |
return m_device->GetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
|
|
602 |
}
|
|
|
603 |
|
|
|
604 |
STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo)
|
|
|
605 |
{
|
|
|
606 |
return m_device->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
|
|
|
607 |
}
|
|
|
608 |
|
|
|
609 |
STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo)
|
|
|
610 |
{
|
|
|
611 |
return m_device->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
|
|
|
612 |
}
|
|
|
613 |
|
|
|
614 |
STDMETHOD(DeletePatch)(THIS_ UINT Handle)
|
|
|
615 |
{
|
|
|
616 |
return m_device->DeletePatch(Handle);
|
|
|
617 |
}
|
|
|
618 |
|
|
|
619 |
STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
|
|
|
620 |
{
|
|
|
621 |
return m_device->CreateQuery(Type, ppQuery);
|
|
|
622 |
}
|
|
|
623 |
|
|
|
624 |
private:
|
|
|
625 |
IDirect3DDevice9* m_device;
|
|
|
626 |
IDirect3D9* m_d3d;
|
|
|
627 |
|
|
|
628 |
COverlay *m_pOverlay;
|
|
|
629 |
};
|