ReactOS 0.4.16-dev-329-g9223134
d3d9_device.h File Reference
#include "d3d9_common.h"
#include <d3d9.h>
#include <d3d9types.h>
#include "d3d9_private.h"
#include "d3d9_swapchain.h"
#include "d3d9_surface.h"
Include dependency graph for d3d9_device.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IDirect3DDevice9Vtbl_INT
 
struct  _D3D9HeapTexture
 
struct  _D3D9ResourceManager
 
struct  _Direct3DDevice9_INT
 

Typedefs

typedef struct _IDirect3DDevice9Vtbl_INT IDirect3DDevice9Vtbl_INT
 
typedef struct _D3D9HeapTexture D3D9HeapTexture
 
typedef struct _D3D9ResourceManager D3D9ResourceManager
 
typedef struct _Direct3DDevice9_INT DIRECT3DDEVICE9_INT
 
typedef struct _Direct3DDevice9_INTLPDIRECT3DDEVICE9_INT
 

Functions

LPDIRECT3DDEVICE9_INT IDirect3DDevice9ToImpl (LPDIRECT3DDEVICE9 iface)
 
HRESULT WINAPI IDirect3DDevice9Base_QueryInterface (LPDIRECT3DDEVICE9 iface, REFIID riid, void **ppvObject)
 
ULONG WINAPI IDirect3DDevice9Base_AddRef (LPDIRECT3DDEVICE9 iface)
 
ULONG WINAPI IDirect3DDevice9Base_Release (LPDIRECT3DDEVICE9 iface)
 
HRESULT WINAPI IDirect3DDevice9Base_TestCooperativeLevel (LPDIRECT3DDEVICE9 iface)
 
UINT WINAPI IDirect3DDevice9Base_GetAvailableTextureMem (LPDIRECT3DDEVICE9 iface)
 
HRESULT WINAPI IDirect3DDevice9Base_EvictManagedResources (LPDIRECT3DDEVICE9 iface)
 
HRESULT WINAPI IDirect3DDevice9Base_GetDirect3D (LPDIRECT3DDEVICE9 iface, IDirect3D9 **ppD3D9)
 
HRESULT WINAPI IDirect3DDevice9Base_GetDeviceCaps (LPDIRECT3DDEVICE9 iface, D3DCAPS9 *pCaps)
 
HRESULT WINAPI IDirect3DDevice9Base_GetDisplayMode (LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE *pMode)
 
HRESULT WINAPI IDirect3DDevice9Base_GetCreationParameters (LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS *pParameters)
 
HRESULT WINAPI IDirect3DDevice9Base_SetCursorProperties (LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9 *pCursorBitmap)
 
VOID WINAPI IDirect3DDevice9Base_SetCursorPosition (LPDIRECT3DDEVICE9 iface, int X, int Y, DWORD Flags)
 
BOOL WINAPI IDirect3DDevice9Base_ShowCursor (LPDIRECT3DDEVICE9 iface, BOOL bShow)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateAdditionalSwapChain (LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
 
HRESULT WINAPI IDirect3DDevice9Base_GetSwapChain (LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9 **ppSwapChain)
 
UINT WINAPI IDirect3DDevice9Base_GetNumberOfSwapChains (LPDIRECT3DDEVICE9 iface)
 
HRESULT WINAPI IDirect3DDevice9Base_Reset (LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS *pPresentationParameters)
 
HRESULT WINAPI IDirect3DDevice9Base_Present (LPDIRECT3DDEVICE9 iface, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
 
HRESULT WINAPI IDirect3DDevice9Base_GetBackBuffer (LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9 **ppBackBuffer)
 
HRESULT WINAPI IDirect3DDevice9Base_GetRasterStatus (LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS *pRasterStatus)
 
HRESULT WINAPI IDirect3DDevice9Base_SetDialogBoxMode (LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs)
 
VOID WINAPI IDirect3DDevice9Base_SetGammaRamp (LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP *pRamp)
 
VOID WINAPI IDirect3DDevice9Base_GetGammaRamp (LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP *pRamp)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateTexture (LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9 **ppTexture, HANDLE *pSharedHandle)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateVolumeTexture (LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9 **ppVolumeTexture, HANDLE *pSharedHandle)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateCubeTexture (LPDIRECT3DDEVICE9 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9 **ppCubeTexture, HANDLE *pSharedHandle)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateVertexBuffer (LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9 **ppVertexBuffer, HANDLE *pSharedHandle)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateIndexBuffer (LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9 **ppIndexBuffer, HANDLE *pSharedHandle)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateRenderTarget (LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateDepthStencilSurface (LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle)
 
HRESULT WINAPI IDirect3DDevice9Base_UpdateSurface (LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pSourceSurface, CONST RECT *pSourceRect, IDirect3DSurface9 *pDestinationSurface, CONST POINT *pDestPoint)
 
HRESULT WINAPI IDirect3DDevice9Base_UpdateTexture (LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9 *pSourceTexture, IDirect3DBaseTexture9 *pDestinationTexture)
 
HRESULT WINAPI IDirect3DDevice9Base_GetRenderTargetData (LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pRenderTarget, IDirect3DSurface9 *pDestSurface)
 
HRESULT WINAPI IDirect3DDevice9Base_GetFrontBufferData (LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9 *pDestSurface)
 
HRESULT WINAPI IDirect3DDevice9Base_StretchRect (LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pSourceSurface, CONST RECT *pSourceRect, IDirect3DSurface9 *pDestSurface, CONST RECT *pDestRect, D3DTEXTUREFILTERTYPE Filter)
 
HRESULT WINAPI IDirect3DDevice9Base_ColorFill (LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pSurface, CONST RECT *pRect, D3DCOLOR color)
 
HRESULT WINAPI IDirect3DDevice9Base_CreateOffscreenPlainSurface (LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle)
 
VOID WINAPI IDirect3DDevice9Base_Destroy (LPDIRECT3DDEVICE9 iface)
 
VOID WINAPI IDirect3DDevice9Base_VirtualDestructor (LPDIRECT3DDEVICE9 iface)
 

Typedef Documentation

◆ D3D9HeapTexture

◆ D3D9ResourceManager

◆ DIRECT3DDEVICE9_INT

◆ IDirect3DDevice9Vtbl_INT

◆ LPDIRECT3DDEVICE9_INT

Function Documentation

◆ IDirect3DDevice9Base_AddRef()

ULONG WINAPI IDirect3DDevice9Base_AddRef ( LPDIRECT3DDEVICE9  iface)

Definition at line 50 of file d3d9_device.c.

51{
54
55 return ref;
56}
#define InterlockedIncrement
Definition: armddk.h:53
LPDIRECT3DDEVICE9_INT IDirect3DDevice9ToImpl(LPDIRECT3DDEVICE9 iface)
Definition: d3d9_device.c:19
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ IDirect3DDevice9Base_ColorFill()

HRESULT WINAPI IDirect3DDevice9Base_ColorFill ( LPDIRECT3DDEVICE9  iface,
IDirect3DSurface9 *  pSurface,
CONST RECT pRect,
D3DCOLOR  color 
)

Definition at line 940 of file d3d9_device.c.

941{
943
944 return D3D_OK;
945}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define D3D_OK
Definition: d3d.h:106

◆ IDirect3DDevice9Base_CreateAdditionalSwapChain()

HRESULT WINAPI IDirect3DDevice9Base_CreateAdditionalSwapChain ( LPDIRECT3DDEVICE9  iface,
D3DPRESENT_PARAMETERS pPresentationParameters,
IDirect3DSwapChain9 **  ppSwapChain 
)

Definition at line 343 of file d3d9_device.c.

344{
345 UINT iSwapChain;
346 IDirect3DSwapChain9* pSwapChain;
347 Direct3DSwapChain9_INT* pSwapChain_INT;
350
351 if (NULL == ppSwapChain)
352 {
353 DPRINT1("Invalid ppSwapChain parameter specified");
355 return D3DERR_INVALIDCALL;
356 }
357
358 *ppSwapChain = NULL;
359 iSwapChain = IDirect3DDevice9_GetNumberOfSwapChains(iface) + 1;
360
361 pSwapChain_INT = CreateDirect3DSwapChain9(RT_EXTERNAL, This, iSwapChain);
362 if (NULL == pSwapChain_INT)
363 {
364 DPRINT1("Out of memory");
367 }
368
369 Direct3DSwapChain9_Init(pSwapChain_INT, pPresentationParameters);
370
371 This->pSwapChains[iSwapChain] = pSwapChain_INT;
372 pSwapChain = (IDirect3DSwapChain9*)&pSwapChain_INT->lpVtbl;
373 IDirect3DSwapChain9_AddRef(pSwapChain);
374 *ppSwapChain = pSwapChain;
375
377 return D3D_OK;
378}
#define DPRINT1
Definition: precomp.h:8
#define IDirect3DSwapChain9_AddRef(p)
Definition: d3d9.h:438
#define IDirect3DDevice9_GetNumberOfSwapChains(p)
Definition: d3d9.h:1522
@ RT_EXTERNAL
#define UNLOCK_D3DDEVICE9()
Definition: d3d9_device.c:16
#define LOCK_D3DDEVICE9()
Definition: d3d9_device.c:15
Direct3DSwapChain9_INT * CreateDirect3DSwapChain9(enum REF_TYPE RefType, struct _Direct3DDevice9_INT *pBaseDevice, DWORD ChainIndex)
HRESULT Direct3DSwapChain9_Init(Direct3DSwapChain9_INT *pThisSwapChain, D3DPRESENT_PARAMETERS *pPresentationParameters)
#define D3DERR_INVALIDCALL
#define NULL
Definition: types.h:112
unsigned int UINT
Definition: ndis.h:50
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:85
struct IDirect3DSwapChain9Vtbl * lpVtbl

◆ IDirect3DDevice9Base_CreateCubeTexture()

HRESULT WINAPI IDirect3DDevice9Base_CreateCubeTexture ( LPDIRECT3DDEVICE9  iface,
UINT  EdgeLength,
UINT  Levels,
DWORD  Usage,
D3DFORMAT  Format,
D3DPOOL  Pool,
IDirect3DCubeTexture9 **  ppCubeTexture,
HANDLE pSharedHandle 
)

Definition at line 827 of file d3d9_device.c.

828{
830
831 return D3D_OK;
832}

◆ IDirect3DDevice9Base_CreateDepthStencilSurface()

HRESULT WINAPI IDirect3DDevice9Base_CreateDepthStencilSurface ( LPDIRECT3DDEVICE9  iface,
UINT  Width,
UINT  Height,
D3DFORMAT  Format,
D3DMULTISAMPLE_TYPE  MultiSample,
DWORD  MultisampleQuality,
BOOL  Discard,
IDirect3DSurface9 **  ppSurface,
HANDLE pSharedHandle 
)

Definition at line 855 of file d3d9_device.c.

856{
858
859 return D3D_OK;
860}

◆ IDirect3DDevice9Base_CreateIndexBuffer()

HRESULT WINAPI IDirect3DDevice9Base_CreateIndexBuffer ( LPDIRECT3DDEVICE9  iface,
UINT  Length,
DWORD  Usage,
D3DFORMAT  Format,
D3DPOOL  Pool,
IDirect3DIndexBuffer9 **  ppIndexBuffer,
HANDLE pSharedHandle 
)

Definition at line 841 of file d3d9_device.c.

842{
844
845 return D3D_OK;
846}

◆ IDirect3DDevice9Base_CreateOffscreenPlainSurface()

HRESULT WINAPI IDirect3DDevice9Base_CreateOffscreenPlainSurface ( LPDIRECT3DDEVICE9  iface,
UINT  Width,
UINT  Height,
D3DFORMAT  Format,
D3DPOOL  Pool,
IDirect3DSurface9 **  ppSurface,
HANDLE pSharedHandle 
)

Definition at line 947 of file d3d9_device.c.

948{
950
951 return D3D_OK;
952}

◆ IDirect3DDevice9Base_CreateRenderTarget()

HRESULT WINAPI IDirect3DDevice9Base_CreateRenderTarget ( LPDIRECT3DDEVICE9  iface,
UINT  Width,
UINT  Height,
D3DFORMAT  Format,
D3DMULTISAMPLE_TYPE  MultiSample,
DWORD  MultisampleQuality,
BOOL  Lockable,
IDirect3DSurface9 **  ppSurface,
HANDLE pSharedHandle 
)

Definition at line 848 of file d3d9_device.c.

849{
851
852 return D3D_OK;
853}

◆ IDirect3DDevice9Base_CreateTexture()

HRESULT WINAPI IDirect3DDevice9Base_CreateTexture ( LPDIRECT3DDEVICE9  iface,
UINT  Width,
UINT  Height,
UINT  Levels,
DWORD  Usage,
D3DFORMAT  Format,
D3DPOOL  Pool,
IDirect3DTexture9 **  ppTexture,
HANDLE pSharedHandle 
)

Definition at line 789 of file d3d9_device.c.

790{
791 HRESULT hResult;
794
795 if (NULL == This)
796 return InvalidCall(This, "Invalid 'this' parameter specified");
797
798 if (NULL == ppTexture)
799 return InvalidCall(This, "Invalid ppTexture parameter specified");
800
801 *ppTexture = NULL;
802
803 if (D3DFMT_UNKNOWN == Format)
804 return InvalidCall(This, "Invalid Format parameter specified, D3DFMT_UNKNOWN is not a valid Format");
805
806 if (NULL != pSharedHandle)
807 {
809 return InvalidCall(This, "Invalid pSharedHandle parameter specified, only NULL is supported at the moment");
810 }
811
812 hResult = CreateD3D9MipMap(This, Width, Height, Levels, Usage, Format, Pool, ppTexture);
813 if (FAILED(hResult))
814 DPRINT1("Failed to create texture");
815
817 return hResult;
818}
Definition: bufpool.h:50
@ D3DFMT_UNKNOWN
Definition: d3d8types.h:601
static HRESULT InvalidCall(LPDIRECT3DDEVICE9_INT This, LPSTR ErrorMsg)
Definition: d3d9_device.c:27
HRESULT CreateD3D9MipMap(DIRECT3DDEVICE9_INT *pDevice, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9 **ppTexture)
Definition: d3d9_mipmap.c:287
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:384
#define FAILED(hr)
Definition: intsafe.h:51
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

◆ IDirect3DDevice9Base_CreateVertexBuffer()

HRESULT WINAPI IDirect3DDevice9Base_CreateVertexBuffer ( LPDIRECT3DDEVICE9  iface,
UINT  Length,
DWORD  Usage,
DWORD  FVF,
D3DPOOL  Pool,
IDirect3DVertexBuffer9 **  ppVertexBuffer,
HANDLE pSharedHandle 
)

Definition at line 834 of file d3d9_device.c.

835{
837
838 return D3D_OK;
839}

◆ IDirect3DDevice9Base_CreateVolumeTexture()

HRESULT WINAPI IDirect3DDevice9Base_CreateVolumeTexture ( LPDIRECT3DDEVICE9  iface,
UINT  Width,
UINT  Height,
UINT  Depth,
UINT  Levels,
DWORD  Usage,
D3DFORMAT  Format,
D3DPOOL  Pool,
IDirect3DVolumeTexture9 **  ppVolumeTexture,
HANDLE pSharedHandle 
)

Definition at line 820 of file d3d9_device.c.

821{
823
824 return D3D_OK;
825}

◆ IDirect3DDevice9Base_Destroy()

VOID WINAPI IDirect3DDevice9Base_Destroy ( LPDIRECT3DDEVICE9  iface)

Definition at line 955 of file d3d9_device.c.

956{
958}

◆ IDirect3DDevice9Base_EvictManagedResources()

HRESULT WINAPI IDirect3DDevice9Base_EvictManagedResources ( LPDIRECT3DDEVICE9  iface)

Definition at line 128 of file d3d9_device.c.

129{
131
132 return D3D_OK;
133}

◆ IDirect3DDevice9Base_GetAvailableTextureMem()

UINT WINAPI IDirect3DDevice9Base_GetAvailableTextureMem ( LPDIRECT3DDEVICE9  iface)

Definition at line 106 of file d3d9_device.c.

107{
108 UINT AvailableTextureMemory = 0;
109 D3D9_GETAVAILDRIVERMEMORYDATA d3d9GetAvailDriverMemoryData;
110
113
114 memset(&d3d9GetAvailDriverMemoryData, 0, sizeof(d3d9GetAvailDriverMemoryData));
115 d3d9GetAvailDriverMemoryData.pUnknown6BC = This->DeviceData[0].pUnknown6BC;
116 d3d9GetAvailDriverMemoryData.dwMemoryType = D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL;
117
118 if (TRUE == (*This->DeviceData[0].D3D9Callbacks.DdGetAvailDriverMemory)(&d3d9GetAvailDriverMemoryData))
119 {
120 /* Round it up to the nearest MB */
121 AvailableTextureMemory = (d3d9GetAvailDriverMemoryData.dwFree + 0x80000) & 0xFFF00000;
122 }
123
125 return AvailableTextureMemory;
126}
@ D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL
#define TRUE
Definition: types.h:120
#define memset(x, y, z)
Definition: compat.h:39
D3D9_GETAVAILDRIVERMEMORY_TYPE dwMemoryType
struct _D3D9_Unknown6BC * pUnknown6BC

◆ IDirect3DDevice9Base_GetBackBuffer()

HRESULT WINAPI IDirect3DDevice9Base_GetBackBuffer ( LPDIRECT3DDEVICE9  iface,
UINT  iSwapChain,
UINT  iBackBuffer,
D3DBACKBUFFER_TYPE  Type,
IDirect3DSurface9 **  ppBackBuffer 
)

Definition at line 568 of file d3d9_device.c.

569{
570 HRESULT hResult;
571 IDirect3DSwapChain9* pSwapChain = NULL;
574
575 IDirect3DDevice9Base_GetSwapChain(iface, iSwapChain, &pSwapChain);
576 if (NULL == pSwapChain)
577 {
578 DPRINT1("Invalid iSwapChain parameter specified");
580 return D3DERR_INVALIDCALL;
581 }
582
583 if (NULL == ppBackBuffer)
584 {
585 DPRINT1("Invalid ppBackBuffer parameter specified");
587 return D3DERR_INVALIDCALL;
588 }
589
590 hResult = IDirect3DSwapChain9_GetBackBuffer(pSwapChain, iBackBuffer, Type, ppBackBuffer);
591
593 return hResult;
594}
Type
Definition: Type.h:7
#define IDirect3DSwapChain9_GetBackBuffer(p, a, b, c)
Definition: d3d9.h:443
HRESULT WINAPI IDirect3DDevice9Base_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9 **ppSwapChain)
Definition: d3d9_device.c:402

◆ IDirect3DDevice9Base_GetCreationParameters()

HRESULT WINAPI IDirect3DDevice9Base_GetCreationParameters ( LPDIRECT3DDEVICE9  iface,
D3DDEVICE_CREATION_PARAMETERS pParameters 
)

Definition at line 279 of file d3d9_device.c.

280{
283
284 if (NULL == pParameters)
285 {
286 DPRINT1("Invalid pParameters parameter specified");
288 return D3DERR_INVALIDCALL;
289 }
290
291 pParameters->AdapterOrdinal = This->AdapterIndexInGroup[0];
292 pParameters->DeviceType = This->DeviceType;
293 pParameters->hFocusWindow = This->hWnd;
294 pParameters->BehaviorFlags = This->BehaviourFlags;
295
297 return D3D_OK;
298}

◆ IDirect3DDevice9Base_GetDeviceCaps()

HRESULT WINAPI IDirect3DDevice9Base_GetDeviceCaps ( LPDIRECT3DDEVICE9  iface,
D3DCAPS9 pCaps 
)

Definition at line 192 of file d3d9_device.c.

193{
196
197 if (NULL == pCaps)
198 {
199 DPRINT1("Invalid pCaps parameter specified");
201 return D3DERR_INVALIDCALL;
202 }
203
204 GetAdapterCaps(&This->pDirect3D9->DisplayAdapters[0], This->DeviceData[0].DeviceType, pCaps);
205
207 return D3D_OK;
208}
HRESULT GetAdapterCaps(const LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapter, D3DDEVTYPE DeviceType, D3DCAPS9 *pDstCaps)
Definition: adapter.c:240

◆ IDirect3DDevice9Base_GetDirect3D()

HRESULT WINAPI IDirect3DDevice9Base_GetDirect3D ( LPDIRECT3DDEVICE9  iface,
IDirect3D9 **  ppD3D9 
)

Definition at line 153 of file d3d9_device.c.

154{
155 IDirect3D9* pDirect3D9;
158
159 if (NULL == ppD3D9)
160 {
161 DPRINT1("Invalid ppD3D9 parameter specified");
163 return D3DERR_INVALIDCALL;
164 }
165
166 pDirect3D9 = (IDirect3D9*)&This->pDirect3D9->lpVtbl;
167 IDirect3D9_AddRef(pDirect3D9);
168 *ppD3D9 = pDirect3D9;
169
171 return D3D_OK;
172}
#define IDirect3D9_AddRef(p)
Definition: d3d9.h:219

◆ IDirect3DDevice9Base_GetDisplayMode()

HRESULT WINAPI IDirect3DDevice9Base_GetDisplayMode ( LPDIRECT3DDEVICE9  iface,
UINT  iSwapChain,
D3DDISPLAYMODE pMode 
)

Definition at line 232 of file d3d9_device.c.

233{
236
237 if (iSwapChain >= IDirect3DDevice9_GetNumberOfSwapChains(iface))
238 {
239 DPRINT1("Invalid iSwapChain parameter specified");
241 return D3DERR_INVALIDCALL;
242 }
243
244 if (NULL == pMode)
245 {
246 DPRINT1("Invalid pMode parameter specified");
248 return D3DERR_INVALIDCALL;
249 }
250
251 pMode->Width = This->DeviceData[iSwapChain].DriverCaps.dwDisplayWidth;
252 pMode->Height = This->DeviceData[iSwapChain].DriverCaps.dwDisplayHeight;
253 pMode->Format = This->DeviceData[iSwapChain].DriverCaps.RawDisplayFormat;
254 pMode->RefreshRate = This->DeviceData[iSwapChain].DriverCaps.dwRefreshRate;
255
257 return D3D_OK;
258}
D3DFORMAT Format
Definition: d3d8types.h:1042

◆ IDirect3DDevice9Base_GetFrontBufferData()

HRESULT WINAPI IDirect3DDevice9Base_GetFrontBufferData ( LPDIRECT3DDEVICE9  iface,
UINT  iSwapChain,
IDirect3DSurface9 *  pDestSurface 
)

Definition at line 905 of file d3d9_device.c.

906{
907 HRESULT hResult;
908 IDirect3DSwapChain9* pSwapChain = NULL;
911
912 IDirect3DDevice9Base_GetSwapChain(iface, iSwapChain, &pSwapChain);
913 if (NULL == pSwapChain)
914 {
915 DPRINT1("Invalid iSwapChain parameter specified");
917 return D3DERR_INVALIDCALL;
918 }
919
920 if (NULL == pDestSurface)
921 {
922 DPRINT1("Invalid pDestSurface parameter specified");
924 return D3DERR_INVALIDCALL;
925 }
926
927 hResult = IDirect3DSwapChain9_GetFrontBufferData(pSwapChain, pDestSurface);
928
930 return hResult;
931}
#define IDirect3DSwapChain9_GetFrontBufferData(p, a)
Definition: d3d9.h:442

◆ IDirect3DDevice9Base_GetGammaRamp()

VOID WINAPI IDirect3DDevice9Base_GetGammaRamp ( LPDIRECT3DDEVICE9  iface,
UINT  iSwapChain,
D3DGAMMARAMP pRamp 
)

Definition at line 724 of file d3d9_device.c.

725{
726 IDirect3DSwapChain9* pSwapChain = NULL;
727 Direct3DSwapChain9_INT* pSwapChain_INT;
730
731 IDirect3DDevice9Base_GetSwapChain(iface, iSwapChain, &pSwapChain);
732 if (NULL == pSwapChain)
733 {
734 DPRINT1("Invalid iSwapChain parameter specified");
736 return;
737 }
738
739 if (NULL == pRamp)
740 {
741 DPRINT1("Invalid pRamp parameter specified");
743 return;
744 }
745
746 pSwapChain_INT = IDirect3DSwapChain9ToImpl(pSwapChain);
747 Direct3DSwapChain9_GetGammaRamp(pSwapChain_INT, pRamp);
748
750}
LPDIRECT3DSWAPCHAIN9_INT IDirect3DSwapChain9ToImpl(LPDIRECT3DSWAPCHAIN9 iface)
VOID Direct3DSwapChain9_GetGammaRamp(Direct3DSwapChain9_INT *pThisSwapChain, D3DGAMMARAMP *pRamp)

◆ IDirect3DDevice9Base_GetNumberOfSwapChains()

UINT WINAPI IDirect3DDevice9Base_GetNumberOfSwapChains ( LPDIRECT3DDEVICE9  iface)

Definition at line 455 of file d3d9_device.c.

456{
457 UINT NumSwapChains;
458
461
462 NumSwapChains = This->NumAdaptersInDevice;
463
465 return NumSwapChains;
466}

Referenced by IDirect3DDevice9Base_Present().

◆ IDirect3DDevice9Base_GetRasterStatus()

HRESULT WINAPI IDirect3DDevice9Base_GetRasterStatus ( LPDIRECT3DDEVICE9  iface,
UINT  iSwapChain,
D3DRASTER_STATUS pRasterStatus 
)

Definition at line 618 of file d3d9_device.c.

619{
620 HRESULT hResult;
621 IDirect3DSwapChain9* pSwapChain = NULL;
624
625 IDirect3DDevice9Base_GetSwapChain(iface, iSwapChain, &pSwapChain);
626 if (NULL == pSwapChain)
627 {
628 DPRINT1("Invalid iSwapChain parameter specified");
630 return D3DERR_INVALIDCALL;
631 }
632
633 if (NULL == pRasterStatus)
634 {
635 DPRINT1("Invalid pRasterStatus parameter specified");
637 return D3DERR_INVALIDCALL;
638 }
639
640 hResult = IDirect3DSwapChain9_GetRasterStatus(pSwapChain, pRasterStatus);
641
643 return hResult;
644}
#define IDirect3DSwapChain9_GetRasterStatus(p, a)
Definition: d3d9.h:444

◆ IDirect3DDevice9Base_GetRenderTargetData()

HRESULT WINAPI IDirect3DDevice9Base_GetRenderTargetData ( LPDIRECT3DDEVICE9  iface,
IDirect3DSurface9 *  pRenderTarget,
IDirect3DSurface9 *  pDestSurface 
)

Definition at line 876 of file d3d9_device.c.

877{
879
880 return D3D_OK;
881}

◆ IDirect3DDevice9Base_GetSwapChain()

HRESULT WINAPI IDirect3DDevice9Base_GetSwapChain ( LPDIRECT3DDEVICE9  iface,
UINT  iSwapChain,
IDirect3DSwapChain9 **  ppSwapChain 
)

Definition at line 402 of file d3d9_device.c.

403{
406
407 if (NULL == ppSwapChain)
408 {
409 DPRINT1("Invalid ppSwapChain parameter specified");
411 return D3DERR_INVALIDCALL;
412 }
413
414 *ppSwapChain = NULL;
415
416 if (iSwapChain >= IDirect3DDevice9_GetNumberOfSwapChains(iface))
417 {
418 DPRINT1("Invalid iSwapChain parameter specified");
420 return D3DERR_INVALIDCALL;
421 }
422
423 if (This->pSwapChains[iSwapChain] != NULL)
424 {
425 IDirect3DSwapChain9* pSwapChain = (IDirect3DSwapChain9*)&This->pSwapChains[iSwapChain]->lpVtbl;
426 IDirect3DSwapChain9_AddRef(pSwapChain);
427 *ppSwapChain = pSwapChain;
428 }
429 else
430 {
431 *ppSwapChain = NULL;
432 }
433
435 return D3D_OK;
436}

Referenced by IDirect3DDevice9Base_GetBackBuffer(), IDirect3DDevice9Base_GetFrontBufferData(), IDirect3DDevice9Base_GetGammaRamp(), IDirect3DDevice9Base_GetRasterStatus(), IDirect3DDevice9Base_Present(), and IDirect3DDevice9Base_SetGammaRamp().

◆ IDirect3DDevice9Base_Present()

HRESULT WINAPI IDirect3DDevice9Base_Present ( LPDIRECT3DDEVICE9  iface,
CONST RECT pSourceRect,
CONST RECT pDestRect,
HWND  hDestWindowOverride,
CONST RGNDATA pDirtyRegion 
)

Definition at line 508 of file d3d9_device.c.

509{
510 UINT i;
511 UINT iNumSwapChains;
514
515 iNumSwapChains = IDirect3DDevice9Base_GetNumberOfSwapChains(iface);
516 if (0 == iNumSwapChains)
517 {
518 DPRINT1("Not enough swap chains, Present() fails");
520 return D3DERR_INVALIDCALL;
521 }
522
523 for (i = 0; i < iNumSwapChains; i++)
524 {
525 HRESULT hResult;
526 IDirect3DSwapChain9* pSwapChain;
527
528 IDirect3DDevice9Base_GetSwapChain(iface, i, &pSwapChain);
529 hResult = IDirect3DSwapChain9_Present(pSwapChain, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, 0);
530
531 if (FAILED(hResult))
532 {
534 return hResult;
535 }
536 }
537
539 return D3D_OK;
540}
#define IDirect3DSwapChain9_Present(p, a, b, c, d, e)
Definition: d3d9.h:441
UINT WINAPI IDirect3DDevice9Base_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface)
Definition: d3d9_device.c:455
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

◆ IDirect3DDevice9Base_QueryInterface()

HRESULT WINAPI IDirect3DDevice9Base_QueryInterface ( LPDIRECT3DDEVICE9  iface,
REFIID  riid,
void **  ppvObject 
)

Definition at line 35 of file d3d9_device.c.

36{
38
39 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirect3DDevice9))
40 {
41 IUnknown_AddRef(iface);
42 *ppvObject = &This->lpVtbl;
43 return D3D_OK;
44 }
45
46 *ppvObject = NULL;
47 return E_NOINTERFACE;
48}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ IDirect3DDevice9Base_Release()

ULONG WINAPI IDirect3DDevice9Base_Release ( LPDIRECT3DDEVICE9  iface)

Definition at line 58 of file d3d9_device.c.

59{
62
63 if (ref == 0)
64 {
66
67 EnterCriticalSection(&This->CriticalSection);
68
69 /* TODO: Free resources here */
70 for (iAdapter = 0; iAdapter < This->NumAdaptersInDevice; iAdapter++)
71 {
72 DestroyD3D9DeviceData(&This->DeviceData[iAdapter]);
73 }
74 This->lpVtbl->VirtualDestructor(iface);
75
76 LeaveCriticalSection(&This->CriticalSection);
78 }
79
80 return ref;
81}
#define InterlockedDecrement
Definition: armddk.h:52
VOID DestroyD3D9DeviceData(IN LPD3D9_DEVICEDATA pDeviceData)
Definition: d3d9_create.c:150
VOID AlignedFree(IN OUT LPVOID pObject)
Definition: d3d9_helpers.c:130
static const WCHAR iAdapter[]
Definition: provider.c:100
unsigned long DWORD
Definition: ntddk_ex.h:95
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

◆ IDirect3DDevice9Base_Reset()

HRESULT WINAPI IDirect3DDevice9Base_Reset ( LPDIRECT3DDEVICE9  iface,
D3DPRESENT_PARAMETERS pPresentationParameters 
)

Definition at line 468 of file d3d9_device.c.

469{
471
472 return D3D_OK;
473}

◆ IDirect3DDevice9Base_SetCursorPosition()

VOID WINAPI IDirect3DDevice9Base_SetCursorPosition ( LPDIRECT3DDEVICE9  iface,
int  X,
int  Y,
DWORD  Flags 
)

Definition at line 307 of file d3d9_device.c.

308{
310}

◆ IDirect3DDevice9Base_SetCursorProperties()

HRESULT WINAPI IDirect3DDevice9Base_SetCursorProperties ( LPDIRECT3DDEVICE9  iface,
UINT  XHotSpot,
UINT  YHotSpot,
IDirect3DSurface9 *  pCursorBitmap 
)

Definition at line 300 of file d3d9_device.c.

301{
303
304 return D3D_OK;
305}

◆ IDirect3DDevice9Base_SetDialogBoxMode()

HRESULT WINAPI IDirect3DDevice9Base_SetDialogBoxMode ( LPDIRECT3DDEVICE9  iface,
BOOL  bEnableDialogs 
)

Definition at line 646 of file d3d9_device.c.

647{
649
650 return D3D_OK;
651}

◆ IDirect3DDevice9Base_SetGammaRamp()

VOID WINAPI IDirect3DDevice9Base_SetGammaRamp ( LPDIRECT3DDEVICE9  iface,
UINT  iSwapChain,
DWORD  Flags,
CONST D3DGAMMARAMP pRamp 
)

Definition at line 678 of file d3d9_device.c.

679{
680 IDirect3DSwapChain9* pSwapChain = NULL;
681 Direct3DSwapChain9_INT* pSwapChain_INT;
684
685 IDirect3DDevice9Base_GetSwapChain(iface, iSwapChain, &pSwapChain);
686 if (NULL == pSwapChain)
687 {
688 DPRINT1("Invalid iSwapChain parameter specified");
690 return;
691 }
692
693 if (NULL == pRamp)
694 {
695 DPRINT1("Invalid pRamp parameter specified");
697 return;
698 }
699
700 pSwapChain_INT = IDirect3DSwapChain9ToImpl(pSwapChain);
701 Direct3DSwapChain9_SetGammaRamp(pSwapChain_INT, Flags, pRamp);
702
704}
VOID Direct3DSwapChain9_SetGammaRamp(Direct3DSwapChain9_INT *pThisSwapChain, DWORD Flags, CONST D3DGAMMARAMP *pRamp)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

◆ IDirect3DDevice9Base_ShowCursor()

BOOL WINAPI IDirect3DDevice9Base_ShowCursor ( LPDIRECT3DDEVICE9  iface,
BOOL  bShow 
)

Definition at line 312 of file d3d9_device.c.

313{
315
316 return TRUE;
317}

◆ IDirect3DDevice9Base_StretchRect()

HRESULT WINAPI IDirect3DDevice9Base_StretchRect ( LPDIRECT3DDEVICE9  iface,
IDirect3DSurface9 *  pSourceSurface,
CONST RECT pSourceRect,
IDirect3DSurface9 *  pDestSurface,
CONST RECT pDestRect,
D3DTEXTUREFILTERTYPE  Filter 
)

Definition at line 933 of file d3d9_device.c.

934{
936
937 return D3D_OK;
938}

◆ IDirect3DDevice9Base_TestCooperativeLevel()

HRESULT WINAPI IDirect3DDevice9Base_TestCooperativeLevel ( LPDIRECT3DDEVICE9  iface)

Definition at line 84 of file d3d9_device.c.

85{
87
88 return D3D_OK;
89}

◆ IDirect3DDevice9Base_UpdateSurface()

HRESULT WINAPI IDirect3DDevice9Base_UpdateSurface ( LPDIRECT3DDEVICE9  iface,
IDirect3DSurface9 *  pSourceSurface,
CONST RECT pSourceRect,
IDirect3DSurface9 *  pDestinationSurface,
CONST POINT pDestPoint 
)

Definition at line 862 of file d3d9_device.c.

863{
865
866 return D3D_OK;
867}

◆ IDirect3DDevice9Base_UpdateTexture()

HRESULT WINAPI IDirect3DDevice9Base_UpdateTexture ( LPDIRECT3DDEVICE9  iface,
IDirect3DBaseTexture9 *  pSourceTexture,
IDirect3DBaseTexture9 *  pDestinationTexture 
)

Definition at line 869 of file d3d9_device.c.

870{
872
873 return D3D_OK;
874}

◆ IDirect3DDevice9Base_VirtualDestructor()

VOID WINAPI IDirect3DDevice9Base_VirtualDestructor ( LPDIRECT3DDEVICE9  iface)

Definition at line 960 of file d3d9_device.c.

961{
963}

◆ IDirect3DDevice9ToImpl()