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.

67 lines
1.9 KiB

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