15#define LOCK_D3DDEVICE9() if (This->bLockDevice) EnterCriticalSection(&This->CriticalSection);
16#define UNLOCK_D3DDEVICE9() if (This->bLockDevice) LeaveCriticalSection(&This->CriticalSection);
41 IUnknown_AddRef(iface);
74 This->lpVtbl->VirtualDestructor(iface);
108 UINT AvailableTextureMemory = 0;
114 memset(&d3d9GetAvailDriverMemoryData, 0,
sizeof(d3d9GetAvailDriverMemoryData));
115 d3d9GetAvailDriverMemoryData.
pUnknown6BC =
This->DeviceData[0].pUnknown6BC;
118 if (
TRUE == (*
This->DeviceData[0].D3D9Callbacks.DdGetAvailDriverMemory)(&d3d9GetAvailDriverMemoryData))
121 AvailableTextureMemory = (d3d9GetAvailDriverMemoryData.
dwFree + 0x80000) & 0xFFF00000;
125 return AvailableTextureMemory;
155 IDirect3D9* pDirect3D9;
161 DPRINT1(
"Invalid ppD3D9 parameter specified");
166 pDirect3D9 = (IDirect3D9*)&
This->pDirect3D9->lpVtbl;
168 *ppD3D9 = pDirect3D9;
199 DPRINT1(
"Invalid pCaps parameter specified");
239 DPRINT1(
"Invalid iSwapChain parameter specified");
246 DPRINT1(
"Invalid pMode parameter specified");
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;
284 if (
NULL == pParameters)
286 DPRINT1(
"Invalid pParameters parameter specified");
346 IDirect3DSwapChain9* pSwapChain;
351 if (
NULL == ppSwapChain)
353 DPRINT1(
"Invalid ppSwapChain parameter specified");
362 if (
NULL == pSwapChain_INT)
371 This->pSwapChains[iSwapChain] = pSwapChain_INT;
372 pSwapChain = (IDirect3DSwapChain9*)&pSwapChain_INT->
lpVtbl;
374 *ppSwapChain = pSwapChain;
407 if (
NULL == ppSwapChain)
409 DPRINT1(
"Invalid ppSwapChain parameter specified");
418 DPRINT1(
"Invalid iSwapChain parameter specified");
423 if (
This->pSwapChains[iSwapChain] !=
NULL)
425 IDirect3DSwapChain9* pSwapChain = (IDirect3DSwapChain9*)&
This->pSwapChains[iSwapChain]->lpVtbl;
427 *ppSwapChain = pSwapChain;
462 NumSwapChains =
This->NumAdaptersInDevice;
465 return NumSwapChains;
516 if (0 == iNumSwapChains)
518 DPRINT1(
"Not enough swap chains, Present() fails");
523 for (
i = 0;
i < iNumSwapChains;
i++)
526 IDirect3DSwapChain9* pSwapChain;
571 IDirect3DSwapChain9* pSwapChain =
NULL;
576 if (
NULL == pSwapChain)
578 DPRINT1(
"Invalid iSwapChain parameter specified");
583 if (
NULL == ppBackBuffer)
585 DPRINT1(
"Invalid ppBackBuffer parameter specified");
621 IDirect3DSwapChain9* pSwapChain =
NULL;
626 if (
NULL == pSwapChain)
628 DPRINT1(
"Invalid iSwapChain parameter specified");
633 if (
NULL == pRasterStatus)
635 DPRINT1(
"Invalid pRasterStatus parameter specified");
680 IDirect3DSwapChain9* pSwapChain =
NULL;
686 if (
NULL == pSwapChain)
688 DPRINT1(
"Invalid iSwapChain parameter specified");
695 DPRINT1(
"Invalid pRamp parameter specified");
726 IDirect3DSwapChain9* pSwapChain =
NULL;
732 if (
NULL == pSwapChain)
734 DPRINT1(
"Invalid iSwapChain parameter specified");
741 DPRINT1(
"Invalid pRamp parameter specified");
798 if (
NULL == ppTexture)
804 return InvalidCall(
This,
"Invalid Format parameter specified, D3DFMT_UNKNOWN is not a valid Format");
806 if (
NULL != pSharedHandle)
809 return InvalidCall(
This,
"Invalid pSharedHandle parameter specified, only NULL is supported at the moment");
814 DPRINT1(
"Failed to create texture");
908 IDirect3DSwapChain9* pSwapChain =
NULL;
913 if (
NULL == pSwapChain)
915 DPRINT1(
"Invalid iSwapChain parameter specified");
920 if (
NULL == pDestSurface)
922 DPRINT1(
"Invalid pDestSurface parameter specified");
#define InterlockedIncrement
#define InterlockedDecrement
enum _D3DBACKBUFFER_TYPE D3DBACKBUFFER_TYPE
enum _D3DFORMAT D3DFORMAT
enum _D3DTEXTUREFILTERTYPE D3DTEXTUREFILTERTYPE
enum _D3DMULTISAMPLE_TYPE D3DMULTISAMPLE_TYPE
struct IDirect3DDevice9 * LPDIRECT3DDEVICE9
#define IDirect3DSwapChain9_GetBackBuffer(p, a, b, c)
#define IDirect3D9_AddRef(p)
#define IDirect3DSwapChain9_GetRasterStatus(p, a)
#define IDirect3DSwapChain9_AddRef(p)
#define IDirect3DSwapChain9_GetFrontBufferData(p, a)
#define IDirect3DDevice9_GetNumberOfSwapChains(p)
#define IDirect3DSwapChain9_Present(p, a, b, c, d, e)
@ D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL
VOID DestroyD3D9DeviceData(IN LPD3D9_DEVICEDATA pDeviceData)
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_GetDeviceCaps(LPDIRECT3DDEVICE9 iface, D3DCAPS9 *pCaps)
UINT WINAPI IDirect3DDevice9Base_GetNumberOfSwapChains(LPDIRECT3DDEVICE9 iface)
VOID WINAPI IDirect3DDevice9Base_VirtualDestructor(LPDIRECT3DDEVICE9 iface)
HRESULT WINAPI IDirect3DDevice9Base_GetRenderTargetData(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pRenderTarget, IDirect3DSurface9 *pDestSurface)
LPDIRECT3DDEVICE9_INT IDirect3DDevice9ToImpl(LPDIRECT3DDEVICE9 iface)
HRESULT WINAPI IDirect3DDevice9Base_CreateIndexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9 **ppIndexBuffer, HANDLE *pSharedHandle)
HRESULT WINAPI IDirect3DDevice9Base_QueryInterface(LPDIRECT3DDEVICE9 iface, REFIID riid, void **ppvObject)
VOID WINAPI IDirect3DDevice9Base_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP *pRamp)
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_EvictManagedResources(LPDIRECT3DDEVICE9 iface)
HRESULT WINAPI IDirect3DDevice9Base_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE *pMode)
HRESULT WINAPI IDirect3DDevice9Base_ColorFill(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pSurface, CONST RECT *pRect, D3DCOLOR color)
HRESULT WINAPI IDirect3DDevice9Base_UpdateTexture(LPDIRECT3DDEVICE9 iface, IDirect3DBaseTexture9 *pSourceTexture, IDirect3DBaseTexture9 *pDestinationTexture)
BOOL WINAPI IDirect3DDevice9Base_ShowCursor(LPDIRECT3DDEVICE9 iface, BOOL bShow)
VOID WINAPI IDirect3DDevice9Base_SetCursorPosition(LPDIRECT3DDEVICE9 iface, int X, int Y, DWORD Flags)
#define UNLOCK_D3DDEVICE9()
#define LOCK_D3DDEVICE9()
VOID WINAPI IDirect3DDevice9Base_Destroy(LPDIRECT3DDEVICE9 iface)
HRESULT WINAPI IDirect3DDevice9Base_GetCreationParameters(LPDIRECT3DDEVICE9 iface, D3DDEVICE_CREATION_PARAMETERS *pParameters)
HRESULT WINAPI IDirect3DDevice9Base_GetBackBuffer(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9 **ppBackBuffer)
static HRESULT InvalidCall(LPDIRECT3DDEVICE9_INT This, LPSTR ErrorMsg)
HRESULT WINAPI IDirect3DDevice9Base_Reset(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS *pPresentationParameters)
ULONG WINAPI IDirect3DDevice9Base_Release(LPDIRECT3DDEVICE9 iface)
HRESULT WINAPI IDirect3DDevice9Base_GetFrontBufferData(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSurface9 *pDestSurface)
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_GetSwapChain(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, IDirect3DSwapChain9 **ppSwapChain)
VOID WINAPI IDirect3DDevice9Base_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP *pRamp)
HRESULT WINAPI IDirect3DDevice9Base_CreateVertexBuffer(LPDIRECT3DDEVICE9 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9 **ppVertexBuffer, HANDLE *pSharedHandle)
HRESULT WINAPI IDirect3DDevice9Base_CreateAdditionalSwapChain(LPDIRECT3DDEVICE9 iface, D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain)
HRESULT WINAPI IDirect3DDevice9Base_CreateCubeTexture(LPDIRECT3DDEVICE9 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9 **ppCubeTexture, HANDLE *pSharedHandle)
HRESULT WINAPI IDirect3DDevice9Base_CreateOffscreenPlainSurface(LPDIRECT3DDEVICE9 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle)
HRESULT WINAPI IDirect3DDevice9Base_UpdateSurface(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pSourceSurface, CONST RECT *pSourceRect, IDirect3DSurface9 *pDestinationSurface, CONST POINT *pDestPoint)
HRESULT WINAPI IDirect3DDevice9Base_SetCursorProperties(LPDIRECT3DDEVICE9 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9 *pCursorBitmap)
HRESULT WINAPI IDirect3DDevice9Base_GetDirect3D(LPDIRECT3DDEVICE9 iface, IDirect3D9 **ppD3D9)
UINT WINAPI IDirect3DDevice9Base_GetAvailableTextureMem(LPDIRECT3DDEVICE9 iface)
ULONG WINAPI IDirect3DDevice9Base_AddRef(LPDIRECT3DDEVICE9 iface)
HRESULT WINAPI IDirect3DDevice9Base_TestCooperativeLevel(LPDIRECT3DDEVICE9 iface)
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_Present(LPDIRECT3DDEVICE9 iface, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
HRESULT WINAPI IDirect3DDevice9Base_GetRasterStatus(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DRASTER_STATUS *pRasterStatus)
HRESULT WINAPI IDirect3DDevice9Base_SetDialogBoxMode(LPDIRECT3DDEVICE9 iface, BOOL bEnableDialogs)
HRESULT WINAPI IDirect3DDevice9Base_StretchRect(LPDIRECT3DDEVICE9 iface, IDirect3DSurface9 *pSourceSurface, CONST RECT *pSourceRect, IDirect3DSurface9 *pDestSurface, CONST RECT *pDestRect, D3DTEXTUREFILTERTYPE Filter)
VOID AlignedFree(IN OUT LPVOID pObject)
HRESULT CreateD3D9MipMap(DIRECT3DDEVICE9_INT *pDevice, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9 **ppTexture)
VOID Direct3DSwapChain9_SetGammaRamp(Direct3DSwapChain9_INT *pThisSwapChain, DWORD Flags, CONST D3DGAMMARAMP *pRamp)
LPDIRECT3DSWAPCHAIN9_INT IDirect3DSwapChain9ToImpl(LPDIRECT3DSWAPCHAIN9 iface)
Direct3DSwapChain9_INT * CreateDirect3DSwapChain9(enum REF_TYPE RefType, struct _Direct3DDevice9_INT *pBaseDevice, DWORD ChainIndex)
HRESULT Direct3DSwapChain9_Init(Direct3DSwapChain9_INT *pThisSwapChain, D3DPRESENT_PARAMETERS *pPresentationParameters)
VOID Direct3DSwapChain9_GetGammaRamp(Direct3DSwapChain9_INT *pThisSwapChain, D3DGAMMARAMP *pRamp)
#define D3DERR_INVALIDCALL
HRESULT GetAdapterCaps(const LPDIRECT3D9_DISPLAYADAPTER pDisplayAdapter, D3DDEVTYPE DeviceType, D3DCAPS9 *pDstCaps)
static const WCHAR iAdapter[]
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
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
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IsEqualGUID(rguid1, rguid2)
#define D3DERR_OUTOFVIDEOMEMORY
D3D9_GETAVAILDRIVERMEMORY_TYPE dwMemoryType
struct _D3D9_Unknown6BC * pUnknown6BC
struct IDirect3DSwapChain9Vtbl * lpVtbl
#define FIELD_OFFSET(t, f)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
_In_ DD_SURFACE_LOCAL * pSurface
_Must_inspect_result_ _In_ ULONG Flags
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth