Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: d3drmpicked2arrayobj.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // d3dRMPick2edArrayObj.cpp : Implementation of CDirectApp and DLL registration.
  11. #include "stdafx.h"
  12. #include "Direct.h"
  13. #include "dms.h"
  14. #include "d3drmPick2ArrayObj.h"
  15. #include "d3drmFrameArrayObj.h"
  16. #include "d3drmVisualObj.h"
  17. CONSTRUCTOR( _dxj_Direct3dRMPick2Array, {});
  18. DESTRUCTOR( _dxj_Direct3dRMPick2Array, {});
  19. GETSET_OBJECT(_dxj_Direct3dRMPick2Array);
  20. GET_DIRECT_R(_dxj_Direct3dRMPick2Array, getSize, GetSize, long)
  21. /////////////////////////////////////////////////////////////////////////////
  22. STDMETHODIMP C_dxj_Direct3dRMPick2ArrayObject::getPickVisual(long index, D3dRMPickDesc2 *Desc, I_dxj_Direct3dRMVisual **visual)
  23. {
  24. LPDIRECT3DRMVISUAL lpVisual=NULL;
  25. LPDIRECT3DRMFRAMEARRAY lpFrameArray=NULL;
  26. HRESULT hr;
  27. hr=m__dxj_Direct3dRMPick2Array->GetPick((DWORD)index, &lpVisual, &lpFrameArray,
  28. (D3DRMPICKDESC2 *)Desc);
  29. if FAILED(hr) return hr;
  30. if (!lpVisual) return S_OK;
  31. hr=CreateCoverVisual(lpVisual, visual);
  32. if (lpFrameArray) lpFrameArray->Release();
  33. return hr;
  34. }
  35. /////////////////////////////////////////////////////////////////////////////
  36. STDMETHODIMP C_dxj_Direct3dRMPick2ArrayObject::getPickFrame(long index, D3dRMPickDesc2 *Desc, I_dxj_Direct3dRMFrameArray **frameArray)
  37. {
  38. LPDIRECT3DRMVISUAL lpVisual;
  39. LPDIRECT3DRMFRAMEARRAY lpFrameArray;
  40. HRESULT hr;
  41. hr=m__dxj_Direct3dRMPick2Array->GetPick((DWORD)index, &lpVisual, &lpFrameArray,
  42. (D3DRMPICKDESC2 *)Desc);
  43. if( hr != S_OK) return hr;
  44. if (!lpFrameArray) return S_OK;
  45. INTERNAL_CREATE(_dxj_Direct3dRMFrameArray, lpFrameArray, frameArray);
  46. if (lpVisual) lpVisual->Release();
  47. return S_OK;
  48. }