Leaked source code of windows server 2003
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.

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