home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / d3drmvis.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  6KB  |  202 lines

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