Author: gbrunmar Date: Thu Dec 18 13:29:49 2008 New Revision: 38175
URL: http://svn.reactos.org/svn/reactos?rev=38175&view=rev Log: Implemented IDirect3DDevice9::GetGammaRamp()
Modified: trunk/reactos/dll/directx/d3d9/d3d9_device.c trunk/reactos/dll/directx/d3d9/d3d9_swapchain.c trunk/reactos/dll/directx/d3d9/d3d9_swapchain.h
Modified: trunk/reactos/dll/directx/d3d9/d3d9_device.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_devic... ============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] Thu Dec 18 13:29:49 2008 @@ -505,9 +505,50 @@ UNIMPLEMENTED }
+/*++ +* @name IDirect3DDevice9::GetGammaRamp +* @implemented +* +* The function IDirect3DDevice9Base_GetGammaRamp retrieves the gamma correction ramp values +* for the specified swap chain. +* +* @param LPDIRECT3D iface +* Pointer to the IDirect3DDevice9 object returned from IDirect3D9::CreateDevice(). +* +* @param UINT iSwapChain +* Swap chain index to get object for. +* The maximum value for this is the value returned by IDirect3DDevice9::GetNumberOfSwapChains() - 1. +* +* @param D3DGAMMARAMP* pRamp +* Pointer to a D3DGAMMARAMP to receive the gamma correction ramp values. +* +*/ VOID WINAPI IDirect3DDevice9Base_GetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DGAMMARAMP* pRamp) { - UNIMPLEMENTED + IDirect3DSwapChain9* pSwapChain = NULL; + Direct3DSwapChain9_INT* pSwapChain_INT; + LPDIRECT3DDEVICE9_INT This = IDirect3DDevice9ToImpl(iface); + LOCK_D3DDEVICE9(); + + IDirect3DDevice9Base_GetSwapChain(iface, iSwapChain, &pSwapChain); + if (NULL == pSwapChain) + { + DPRINT1("Invalid iSwapChain parameter specified"); + UNLOCK_D3DDEVICE9(); + return; + } + + if (NULL == pRamp) + { + DPRINT1("Invalid pRamp parameter specified"); + UNLOCK_D3DDEVICE9(); + return; + } + + pSwapChain_INT = IDirect3DSwapChain9ToImpl(pSwapChain); + Direct3DSwapChain9_GetGammaRamp(pSwapChain_INT, pRamp); + + UNLOCK_D3DDEVICE9(); }
/*++
Modified: trunk/reactos/dll/directx/d3d9/d3d9_swapchain.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_swapc... ============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_swapchain.c [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_swapchain.c [iso-8859-1] Thu Dec 18 13:29:49 2008 @@ -18,7 +18,7 @@ #define UNLOCK_D3DDEVICE9() D3D9BaseObject_UnlockDevice(&This->BaseObject)
/* Convert a IDirect3DSwapChain9 pointer safely to the internal implementation struct */ -static LPDIRECT3DSWAPCHAIN9_INT IDirect3DSwapChain9ToImpl(LPDIRECT3DSWAPCHAIN9 iface) +LPDIRECT3DSWAPCHAIN9_INT IDirect3DSwapChain9ToImpl(LPDIRECT3DSWAPCHAIN9 iface) { if (NULL == iface) return NULL; @@ -244,3 +244,8 @@ // TODO: Do all the dirty work... return D3D_OK; } + +VOID Direct3DSwapChain9_GetGammaRamp(Direct3DSwapChain9_INT* pThisSwapChain, D3DGAMMARAMP* pRamp) +{ + memcpy(pRamp, &pThisSwapChain->GammaRamp, sizeof(D3DGAMMARAMP)); +}
Modified: trunk/reactos/dll/directx/d3d9/d3d9_swapchain.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_swapc... ============================================================================== --- trunk/reactos/dll/directx/d3d9/d3d9_swapchain.h [iso-8859-1] (original) +++ trunk/reactos/dll/directx/d3d9/d3d9_swapchain.h [iso-8859-1] Thu Dec 18 13:29:49 2008 @@ -68,14 +68,15 @@ /* 0x01f4 */ D3DSWAPEFFECT SwapEffect; /* 0x01f8 */ DWORD dwUnknown01f8; /* 0x01fc */ DWORD dwUnknown01fc; -/* 0x0200 */ DDGAMMARAMP GammaRamp; +/* 0x0200 */ D3DGAMMARAMP GammaRamp; } Direct3DSwapChain9_INT, FAR* LPDIRECT3DSWAPCHAIN9_INT;
- +LPDIRECT3DSWAPCHAIN9_INT IDirect3DSwapChain9ToImpl(LPDIRECT3DSWAPCHAIN9 iface); Direct3DSwapChain9_INT* CreateDirect3DSwapChain9(enum REF_TYPE RefType, struct _Direct3DDevice9_INT* pBaseDevice, DWORD ChainIndex);
VOID Direct3DSwapChain9_SetDisplayMode(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters); HRESULT Direct3DSwapChain9_Init(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters); HRESULT Direct3DSwapChain9_Reset(Direct3DSwapChain9_INT* pThisSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters); +VOID Direct3DSwapChain9_GetGammaRamp(Direct3DSwapChain9_INT* pThisSwapChain, D3DGAMMARAMP* pRamp);
#endif // _D3D9_SWAPCHAIN_H_