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