Author: gbrunmar
Date: Sun Dec 21 02:09:25 2008
New Revision: 38226
URL:
http://svn.reactos.org/svn/reactos?rev=38226&view=rev
Log:
* Implemented IDirect3D9Device::SetGammaRamp()
* Added stub for IDirect3DSwapChain9::SetGammaRamp()
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_devi…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] Sun Dec 21 02:09:25 2008
@@ -650,16 +650,11 @@
return D3D_OK;
}
-VOID WINAPI IDirect3DDevice9Base_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain,
DWORD Flags, CONST D3DGAMMARAMP* pRamp)
-{
- UNIMPLEMENTED
-}
-
-/*++
-* @name IDirect3DDevice9::GetGammaRamp
-* @implemented
-*
-* The function IDirect3DDevice9Base_GetGammaRamp retrieves the gamma correction ramp
values
+/*++
+* @name IDirect3DDevice9::SetGammaRamp
+* @implemented
+*
+* The function IDirect3DDevice9Base_SetGammaRamp sets the gamma correction ramp values
* for the specified swap chain.
*
* @param LPDIRECT3D iface
@@ -669,6 +664,59 @@
* Swap chain index to get object for.
* The maximum value for this is the value returned by
IDirect3DDevice9::GetNumberOfSwapChains() - 1.
*
+* @param UINT Flags
+* Can be on of the following:
+* D3DSGR_CALIBRATE - Detects if a gamma calibrator is installed and if so modifies the
values to correspond to
+* the monitor and system settings before sending them to the display
device.
+* D3DSGR_NO_CALIBRATION - The gamma calibrations values are sent directly to the display
device without
+* any modification.
+*
+* @param CONST D3DGAMMARAMP* pRamp
+* Pointer to a D3DGAMMARAMP representing the gamma correction ramp values to be set.
+*
+*/
+VOID WINAPI IDirect3DDevice9Base_SetGammaRamp(LPDIRECT3DDEVICE9 iface, UINT iSwapChain,
DWORD Flags, CONST D3DGAMMARAMP* pRamp)
+{
+ 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_SetGammaRamp(pSwapChain_INT, Flags, pRamp);
+
+ UNLOCK_D3DDEVICE9();
+}
+
+/*++
+* @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.
*
Modified: trunk/reactos/dll/directx/d3d9/d3d9_swapchain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_swap…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_swapchain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_swapchain.c [iso-8859-1] Sun Dec 21 02:09:25 2008
@@ -249,3 +249,8 @@
{
memcpy(pRamp, &pThisSwapChain->GammaRamp, sizeof(D3DGAMMARAMP));
}
+
+VOID Direct3DSwapChain9_SetGammaRamp(Direct3DSwapChain9_INT* pThisSwapChain, DWORD Flags,
CONST D3DGAMMARAMP* pRamp)
+{
+ UNIMPLEMENTED
+}
Modified: trunk/reactos/dll/directx/d3d9/d3d9_swapchain.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_swap…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_swapchain.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_swapchain.h [iso-8859-1] Sun Dec 21 02:09:25 2008
@@ -78,5 +78,6 @@
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);
+VOID Direct3DSwapChain9_SetGammaRamp(Direct3DSwapChain9_INT* pThisSwapChain, DWORD Flags,
CONST D3DGAMMARAMP* pRamp);
#endif // _D3D9_SWAPCHAIN_H_