[ros-diffs] [gbrunmar] 33326: Implemented IDirect3DDevice9::GetDisplayMode()

gbrunmar at svn.reactos.org gbrunmar at svn.reactos.org
Tue May 6 18:15:33 CEST 2008


Author: gbrunmar
Date: Tue May  6 11:15:33 2008
New Revision: 33326

URL: http://svn.reactos.org/svn/reactos?rev=33326&view=rev
Log:
Implemented IDirect3DDevice9::GetDisplayMode()

Modified:
    trunk/reactos/dll/directx/d3d9/d3d9_device.c

Modified: trunk/reactos/dll/directx/d3d9/d3d9_device.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_device.c?rev=33326&r1=33325&r2=33326&view=diff
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_device.c [iso-8859-1] Tue May  6 11:15:33 2008
@@ -192,10 +192,53 @@
     return D3D_OK;
 }
 
+/*++
+* @name IDirect3DDevice9::GetDisplayMode
+* @implemented
+*
+* The function IDirect3DDevice9Impl_GetDisplayMode fills the pMode argument with the
+* display mode for the specified swap chain.
+*
+* @param LPDIRECT3D iface
+* Pointer to the IDirect3D9 object returned from Direct3DCreate9()
+*
+* @param UINT iSwapChain
+* Swap chain index to get object for.
+* The maximum value for this is the value returned by IDirect3DDevice9::GetNumberOfSwapChains() - 1.
+*
+* @param D3DDISPLAYMODE* pMode
+* Pointer to a D3DDISPLAYMODE structure to be filled with the current swap chain's display mode information.
+*
+* @return HRESULT
+* If the method successfully fills the pMode structure, the return value is D3D_OK.
+* If iSwapChain is out of range or pMode is a bad pointer, the return value will be D3DERR_INVALIDCALL.
+*
+*/
 static HRESULT WINAPI IDirect3DDevice9Impl_GetDisplayMode(LPDIRECT3DDEVICE9 iface, UINT iSwapChain, D3DDISPLAYMODE* pMode)
 {
-    UNIMPLEMENTED
-
+    LPDIRECT3DDEVICE9_INT This = impl_from_IDirect3DDevice9(iface);
+    LOCK_D3DDEVICE9();
+
+    if (iSwapChain >= IDirect3DDevice9_GetNumberOfSwapChains(iface))
+    {
+        DPRINT1("Invalid iSwapChain parameter specified");
+        UNLOCK_D3DDEVICE9();
+        return D3DERR_INVALIDCALL;
+    }
+
+    if (IsBadWritePtr(pMode, sizeof(D3DDISPLAYMODE*)))
+    {
+        DPRINT1("Invalid pMode parameter specified");
+        UNLOCK_D3DDEVICE9();
+        return D3DERR_INVALIDCALL;
+    }
+
+    pMode->Width = This->DeviceData[iSwapChain].DriverCaps.dwDisplayWidth;
+    pMode->Height = This->DeviceData[iSwapChain].DriverCaps.dwDisplayHeight;
+    pMode->Format = This->DeviceData[iSwapChain].DriverCaps.RawDisplayFormat;
+    pMode->RefreshRate = This->DeviceData[iSwapChain].DriverCaps.dwRefreshRate;
+
+    UNLOCK_D3DDEVICE9();
     return D3D_OK;
 }
 



More information about the Ros-diffs mailing list