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.

214 lines
5.9 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: d3drmvis.h
  6. * Content: Direct3DRM external visualinclude file
  7. *@@BEGIN_MSINTERNAL
  8. *
  9. * History:
  10. * Date By Reason
  11. * ==== == ======
  12. * 12/06/97 stevela Initial rev
  13. *@@END_MSINTERNAL
  14. *
  15. ***************************************************************************/
  16. #ifndef _D3DRMVIS_H_
  17. #define _D3DRMVIS_H_
  18. //@@BEGIN_MSINTERNAL
  19. #if 1
  20. #include "d3prm.h"
  21. #include "d3prmobj.h"
  22. #else
  23. //@@END_MSINTERNAL
  24. #include "d3drm.h"
  25. #include "d3drmobj.h"
  26. //@@BEGIN_MSINTERNAL
  27. #endif
  28. //@@END_MSINTERNAL
  29. #include <ocidl.h>
  30. #include "dxfile.h"
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. WIN_TYPES(IDirect3DRMExternalVisual, DIRECT3DRMEXTERNALVISUAL);
  35. WIN_TYPES(IDirect3DRMExternalUtil, DIRECT3DRMEXTERNALUTIL);
  36. DEFINE_GUID(IID_IDirect3DRMExternalVisual,
  37. 0x4516ec80, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
  38. DEFINE_GUID(IID_IDirect3DRMExternalUtil,
  39. 0x4516ec80, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
  40. /* In IDirect3DRMExternalVisual::CanSee() */
  41. #define D3DRMEXTVIS_CANNOTSEE 0x00000001L
  42. #define D3DRMEXTVIS_CANSEE 0x00000002L
  43. /* In IDirect3DRMExternalVisual::Pick() */
  44. #define D3DRMEXTVIS_NOTPICKED 0x00000001L
  45. #define D3DRMEXTVIS_PICKED 0x00000002L
  46. /* In D3DRMEXTVISRENDERCONTEXT.dwOverrides */
  47. #define D3DRMEXTVIS_RENDERCONTEXT_OVERRIDEMATERIAL 0x00000001L
  48. #define D3DRMEXTVIS_RENDERCONTEXT_OVERRIDETEXTURE 0x00000002L
  49. #define D3DRMEXTVIS_RENDERCONTEXT_DEVICEOVERRIDE 0x00000004L
  50. /* In D3DRMEXTVISRENDERCONTEXT.dwZBufferMode */
  51. #define D3DRMEXTVIS_RENDERCONTEXT_ZBUFFERON 0x00000001L
  52. #define D3DRMEXTVIS_RENDERCONTEXT_ZBUFFEROFF 0x00000002L
  53. /*
  54. * Structure for IDirect3DRMExternalVisual::SetRenderContext()
  55. */
  56. typedef struct
  57. {
  58. DWORD dwSize; /* Size of structure */
  59. DWORD dwFlags; /* Must be zero */
  60. DWORD dwOverrides; /* Indicates which overrides are in effect */
  61. D3DMATERIALHANDLE hMat; /* If non-zero, this material handle MUST
  62. be used for all rendering */
  63. D3DTEXTUREHANDLE hTex; /* If non-zero, this texture handle MUST
  64. be used for all rendering */
  65. D3DRMMATERIALOVERRIDE dmUserOverride; /* contains per-attribute overrides
  66. for materials */
  67. D3DRMSHADEMODE pShadeMode; /* Flat, gouraud or phong */
  68. D3DRMLIGHTMODE pLightMode; /* On or off */
  69. D3DRMFILLMODE pFillMode; /* Points, wireframe or solid */
  70. DWORD dwZBufferMode; /* As defined above */
  71. DWORD dwRenderMode; /* Blended transparency and/or sorted */
  72. } D3DRMEXTVISRENDERCONTEXT, *LPD3DRMEXTVISRENDERCONTEXT;
  73. /*
  74. * Structure for IDirect3DRMExternalVisual::RayPick()
  75. */
  76. typedef struct
  77. {
  78. D3DVALUE dDistance;
  79. D3DVECTOR dvPosition;
  80. D3DVECTOR dvNormal;
  81. D3DVALUE tu;
  82. D3DVALUE tv;
  83. D3DCOLOR dcColor;
  84. } D3DRMEXTVISRAYPICKINFO, *LPD3DRMEXTVISRAYPICKINFO;
  85. #undef INTERFACE
  86. #define INTERFACE IDirect3DRMExternalVisual
  87. DECLARE_INTERFACE_(IDirect3DRMExternalVisual, IUnknown)
  88. {
  89. IUNKNOWN_METHODS(PURE);
  90. /*
  91. * IDirect3DRMExternalVisual methods
  92. */
  93. STDMETHOD(Initialize)(THIS_ LPDIRECT3DRM, LPDIRECT3DRMEXTERNALUTIL,
  94. DWORD dwFlags) PURE;
  95. STDMETHOD(Load)(THIS_ IDirectXFileData *dObject,
  96. IPropertyBag *pPropBag,
  97. DWORD dwFlags) PURE;
  98. /*
  99. * Information about device state, viewport state, overrides, etc...
  100. */
  101. STDMETHOD(SetRenderContext)(THIS_ LPD3DRMEXTVISRENDERCONTEXT pCntx,
  102. DWORD dwFlags) PURE;
  103. /*
  104. * Rendering operations
  105. */
  106. STDMETHOD(CanSee)(THIS_ LPDIRECT3DRMDEVICE2, LPDIRECT3DRMVIEWPORT2,
  107. LPDWORD pdwCanSee) PURE;
  108. STDMETHOD(Render)(THIS_ LPDIRECT3DRMDEVICE2, LPDIRECT3DRMVIEWPORT2,
  109. DWORD dwFlags) PURE;
  110. STDMETHOD(DeviceChange)(THIS) PURE;
  111. /*
  112. * Notify external visuals when BeginScene/EndScene are called during
  113. * rendering
  114. */
  115. STDMETHOD(BeginScene)(THIS) PURE;
  116. STDMETHOD(EndScene)(THIS) PURE;
  117. /*
  118. * Picking
  119. */
  120. STDMETHOD(Pick)(THIS_ LPDIRECT3DRMVIEWPORT2 pViewIn,
  121. LPDIRECT3DRMFRAME3 pFrameIn,
  122. DWORD dwXIn, DWORD dwYIn,
  123. LPD3DVALUE pdvZOut, LPDWORD pdwPicked) PURE;
  124. /*
  125. * RayPicking
  126. *
  127. * dwFlags can contain:
  128. * D3DRMRAYPICK_INTERPOLATENORMAL - pPickInfo.dvNormal must be filled in
  129. * D3DRMRAYPICK_INTERPOLATECOLOR - pPickInfo.dcColor must be filled in
  130. * D3DRMRAYPICK_INTERPOLATEUV - pPickInfo.tu, tv must be filled in
  131. */
  132. STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME3 pFrameIn,
  133. LPD3DRMRAY pRayIn,
  134. DWORD dwFlags,
  135. LPDWORD pdwPicked,
  136. LPD3DRMEXTVISRAYPICKINFO pPickInfo) PURE;
  137. /*
  138. * Misc
  139. */
  140. STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE;
  141. STDMETHOD(GetAge)(THIS_ LPDWORD) PURE;
  142. };
  143. /*
  144. * Flags for UpdateBounds
  145. */
  146. #define D3DRMEXTUTIL_BOUNDSINVALIDATE 0x00000001L
  147. #define D3DRMEXTUTIL_BOUNDSVALID 0x00000002L
  148. #undef INTERFACE
  149. #define INTERFACE IDirect3DRMExternalUtil
  150. DECLARE_INTERFACE_(IDirect3DRMExternalUtil, IDirect3DRMObject)
  151. {
  152. IUNKNOWN_METHODS(PURE);
  153. /*
  154. * External Visual must use these methods to provide IDirect3DRMObject
  155. * functionality.
  156. */
  157. IDIRECT3DRMOBJECT_METHODS(PURE);
  158. /*
  159. * IDirect3DRMExternalUtil methods
  160. */
  161. /*
  162. * Texture Management
  163. */
  164. STDMETHOD(FindDeviceTexture)(LPDIRECT3DRMDEVICE2, LPDIRECT3DRMTEXTURE,
  165. LPDWORD dwDevTexId) PURE;
  166. STDMETHOD(GetTextureHandle)(DWORD dwDevTexId, LPDWORD pdwHandle) PURE;
  167. STDMETHOD(DestroyDeviceTexture)(DWORD dwDevTexId) PURE;
  168. STDMETHOD(ValidateDeviceTextures)(LPDIRECT3DRMDEVICE2,
  169. LPDWORD dwDevTexIds,
  170. DWORD dwNumIds) PURE;
  171. STDMETHOD(UpdateBounds)(DWORD dwFlags,
  172. LPD3DVECTOR dvMin,
  173. LPD3DVECTOR dvMax) PURE;
  174. STDMETHOD(SetExtents)(LPDIRECT3DRMVIEWPORT2,
  175. DWORD dwNumExtents,
  176. LPD3DCLIPSTATUS pExtents) PURE;
  177. };
  178. #ifdef __cplusplus
  179. };
  180. #endif /* __cplusplus */
  181. #endif /* _D3DRMVIS_H_ */