home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / D3DCAPS.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  14KB  |  295 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1995-1996 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       d3dcaps.h
  6.  *  Content:    Direct3D capabilities include file
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef _D3DCAPS_H
  11. #define _D3DCAPS_H
  12. #pragma option -b
  13.  
  14. /* 
  15.  *  Pull in DirectDraw include file automatically:
  16.  */
  17. #pragma option -b.
  18. #include <ddraw.h>
  19. #pragma option -b
  20.  
  21. #pragma pack(4)
  22.  
  23. /* Description of capabilities of transform */
  24.  
  25. typedef struct _D3DTRANSFORMCAPS {
  26.     DWORD dwSize;
  27.     DWORD dwCaps;
  28. } D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
  29.  
  30. #define D3DTRANSFORMCAPS_CLIP           0x00000001L /* Will clip whilst transforming */
  31.  
  32. /* Description of capabilities of lighting */
  33.  
  34. typedef struct _D3DLIGHTINGCAPS {
  35.     DWORD dwSize;
  36.     DWORD dwCaps;                   /* Lighting caps */
  37.     DWORD dwLightingModel;          /* Lighting model - RGB or mono */
  38.     DWORD dwNumLights;              /* Number of lights that can be handled */
  39. } D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
  40.  
  41. #define D3DLIGHTINGMODEL_RGB            0x00000001L
  42. #define D3DLIGHTINGMODEL_MONO           0x00000002L
  43.  
  44. #define D3DLIGHTCAPS_POINT              0x00000001L /* Point lights supported */
  45. #define D3DLIGHTCAPS_SPOT               0x00000002L /* Spot lights supported */
  46. #define D3DLIGHTCAPS_DIRECTIONAL        0x00000004L /* Directional lights supported */
  47. #define D3DLIGHTCAPS_PARALLELPOINT      0x00000008L /* Parallel point lights supported */
  48. #define D3DLIGHTCAPS_GLSPOT             0x00000010L /* GL syle spot lights supported */
  49.  
  50. /* Description of capabilities for each primitive type */
  51.  
  52. typedef struct _D3DPrimCaps {
  53.     DWORD dwSize;
  54.     DWORD dwMiscCaps;                 /* Capability flags */
  55.     DWORD dwRasterCaps;
  56.     DWORD dwZCmpCaps;
  57.     DWORD dwSrcBlendCaps;
  58.     DWORD dwDestBlendCaps;
  59.     DWORD dwAlphaCmpCaps;
  60.     DWORD dwShadeCaps;
  61.     DWORD dwTextureCaps;
  62.     DWORD dwTextureFilterCaps;
  63.     DWORD dwTextureBlendCaps;
  64.     DWORD dwTextureAddressCaps;
  65.     DWORD dwStippleWidth;             /* maximum width and height of */
  66.     DWORD dwStippleHeight;            /* of supported stipple (up to 32x32) */
  67. } D3DPRIMCAPS, *LPD3DPRIMCAPS;
  68.  
  69. /* D3DPRIMCAPS dwMiscCaps */
  70.  
  71. #define D3DPMISCCAPS_MASKPLANES         0x00000001L
  72. #define D3DPMISCCAPS_MASKZ              0x00000002L
  73. #define D3DPMISCCAPS_LINEPATTERNREP     0x00000004L
  74. #define D3DPMISCCAPS_CONFORMANT         0x00000008L
  75. #define D3DPMISCCAPS_CULLNONE           0x00000010L
  76. #define D3DPMISCCAPS_CULLCW             0x00000020L
  77. #define D3DPMISCCAPS_CULLCCW            0x00000040L
  78.  
  79. /* D3DPRIMCAPS dwRasterCaps */
  80.  
  81. #define D3DPRASTERCAPS_DITHER           0x00000001L
  82. #define D3DPRASTERCAPS_ROP2             0x00000002L
  83. #define D3DPRASTERCAPS_XOR              0x00000004L
  84. #define D3DPRASTERCAPS_PAT              0x00000008L
  85. #define D3DPRASTERCAPS_ZTEST            0x00000010L
  86. #define D3DPRASTERCAPS_SUBPIXEL         0x00000020L
  87. #define D3DPRASTERCAPS_SUBPIXELX        0x00000040L
  88. #define D3DPRASTERCAPS_FOGVERTEX        0x00000080L
  89. #define D3DPRASTERCAPS_FOGTABLE         0x00000100L
  90. #define D3DPRASTERCAPS_STIPPLE          0x00000200L
  91.  
  92. /* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
  93.  
  94. #define D3DPCMPCAPS_NEVER               0x00000001L
  95. #define D3DPCMPCAPS_LESS                0x00000002L
  96. #define D3DPCMPCAPS_EQUAL               0x00000004L
  97. #define D3DPCMPCAPS_LESSEQUAL           0x00000008L
  98. #define D3DPCMPCAPS_GREATER             0x00000010L
  99. #define D3DPCMPCAPS_NOTEQUAL            0x00000020L
  100. #define D3DPCMPCAPS_GREATEREQUAL        0x00000040L
  101. #define D3DPCMPCAPS_ALWAYS              0x00000080L
  102.  
  103. /* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
  104.  
  105. #define D3DPBLENDCAPS_ZERO              0x00000001L
  106. #define D3DPBLENDCAPS_ONE               0x00000002L
  107. #define D3DPBLENDCAPS_SRCCOLOR          0x00000004L
  108. #define D3DPBLENDCAPS_INVSRCCOLOR       0x00000008L
  109. #define D3DPBLENDCAPS_SRCALPHA          0x00000010L
  110. #define D3DPBLENDCAPS_INVSRCALPHA       0x00000020L
  111. #define D3DPBLENDCAPS_DESTALPHA         0x00000040L
  112. #define D3DPBLENDCAPS_INVDESTALPHA      0x00000080L
  113. #define D3DPBLENDCAPS_DESTCOLOR         0x00000100L
  114. #define D3DPBLENDCAPS_INVDESTCOLOR      0x00000200L
  115. #define D3DPBLENDCAPS_SRCALPHASAT       0x00000400L
  116. #define D3DPBLENDCAPS_BOTHSRCALPHA      0x00000800L
  117. #define D3DPBLENDCAPS_BOTHINVSRCALPHA   0x00001000L
  118.  
  119. /* D3DPRIMCAPS dwShadeCaps */
  120.  
  121. #define D3DPSHADECAPS_COLORFLATMONO             0x00000001L
  122. #define D3DPSHADECAPS_COLORFLATRGB              0x00000002L
  123. #define D3DPSHADECAPS_COLORGOURAUDMONO          0x00000004L
  124. #define D3DPSHADECAPS_COLORGOURAUDRGB           0x00000008L
  125. #define D3DPSHADECAPS_COLORPHONGMONO            0x00000010L
  126. #define D3DPSHADECAPS_COLORPHONGRGB             0x00000020L
  127.  
  128. #define D3DPSHADECAPS_SPECULARFLATMONO          0x00000040L
  129. #define D3DPSHADECAPS_SPECULARFLATRGB           0x00000080L
  130. #define D3DPSHADECAPS_SPECULARGOURAUDMONO       0x00000100L
  131. #define D3DPSHADECAPS_SPECULARGOURAUDRGB        0x00000200L
  132. #define D3DPSHADECAPS_SPECULARPHONGMONO         0x00000400L
  133. #define D3DPSHADECAPS_SPECULARPHONGRGB          0x00000800L
  134.  
  135. #define D3DPSHADECAPS_ALPHAFLATBLEND            0x00001000L
  136. #define D3DPSHADECAPS_ALPHAFLATSTIPPLED         0x00002000L
  137. #define D3DPSHADECAPS_ALPHAGOURAUDBLEND         0x00004000L
  138. #define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED      0x00008000L
  139. #define D3DPSHADECAPS_ALPHAPHONGBLEND           0x00010000L
  140. #define D3DPSHADECAPS_ALPHAPHONGSTIPPLED        0x00020000L
  141.  
  142. #define D3DPSHADECAPS_FOGFLAT                   0x00040000L
  143. #define D3DPSHADECAPS_FOGGOURAUD                0x00080000L
  144. #define D3DPSHADECAPS_FOGPHONG                  0x00100000L
  145.  
  146. /* D3DPRIMCAPS dwTextureCaps */
  147.  
  148. #define D3DPTEXTURECAPS_PERSPECTIVE     0x00000001L
  149. #define D3DPTEXTURECAPS_POW2            0x00000002L
  150. #define D3DPTEXTURECAPS_ALPHA           0x00000004L
  151. #define D3DPTEXTURECAPS_TRANSPARENCY    0x00000008L
  152. #define D3DPTEXTURECAPS_BORDER          0x00000010L
  153. #define D3DPTEXTURECAPS_SQUAREONLY      0x00000020L
  154.  
  155. /* D3DPRIMCAPS dwTextureFilterCaps */
  156.  
  157. #define D3DPTFILTERCAPS_NEAREST         0x00000001L
  158. #define D3DPTFILTERCAPS_LINEAR          0x00000002L
  159. #define D3DPTFILTERCAPS_MIPNEAREST      0x00000004L
  160. #define D3DPTFILTERCAPS_MIPLINEAR       0x00000008L
  161. #define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
  162. #define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
  163.  
  164. /* D3DPRIMCAPS dwTextureBlendCaps */
  165.  
  166. #define D3DPTBLENDCAPS_DECAL            0x00000001L
  167. #define D3DPTBLENDCAPS_MODULATE         0x00000002L
  168. #define D3DPTBLENDCAPS_DECALALPHA       0x00000004L
  169. #define D3DPTBLENDCAPS_MODULATEALPHA    0x00000008L
  170. #define D3DPTBLENDCAPS_DECALMASK        0x00000010L
  171. #define D3DPTBLENDCAPS_MODULATEMASK     0x00000020L
  172. #define D3DPTBLENDCAPS_COPY             0x00000040L
  173.  
  174. /* D3DPRIMCAPS dwTextureAddressCaps */
  175. #define D3DPTADDRESSCAPS_WRAP           0x00000001L
  176. #define D3DPTADDRESSCAPS_MIRROR         0x00000002L
  177. #define D3DPTADDRESSCAPS_CLAMP          0x00000004L
  178.  
  179. /*
  180.  * Description for a device.
  181.  * This is used to describe a device that is to be created or to query
  182.  * the current device.
  183.  */
  184. typedef struct _D3DDeviceDesc {
  185.     DWORD            dwSize;                 /* Size of D3DDEVICEDESC structure */
  186.     DWORD            dwFlags;                /* Indicates which fields have valid data */
  187.     D3DCOLORMODEL    dcmColorModel;          /* Color model of device */
  188.     DWORD            dwDevCaps;              /* Capabilities of device */
  189.     D3DTRANSFORMCAPS dtcTransformCaps;       /* Capabilities of transform */
  190.     BOOL             bClipping;              /* Device can do 3D clipping */
  191.     D3DLIGHTINGCAPS  dlcLightingCaps;        /* Capabilities of lighting */
  192.     D3DPRIMCAPS      dpcLineCaps;
  193.     D3DPRIMCAPS      dpcTriCaps;
  194.     DWORD            dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
  195.     DWORD            dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
  196.     DWORD            dwMaxBufferSize;        /* Maximum execute buffer size */
  197.     DWORD            dwMaxVertexCount;       /* Maximum vertex count */
  198. } D3DDEVICEDESC, *LPD3DDEVICEDESC;
  199.  
  200. typedef HRESULT (FAR PASCAL * LPD3DENUMDEVICESCALLBACK)(LPGUID lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
  201.  
  202. /* D3DDEVICEDESC dwFlags indicating valid fields */
  203.  
  204. #define D3DDD_COLORMODEL            0x00000001L /* dcmColorModel is valid */
  205. #define D3DDD_DEVCAPS               0x00000002L /* dwDevCaps is valid */
  206. #define D3DDD_TRANSFORMCAPS         0x00000004L /* dtcTransformCaps is valid */
  207. #define D3DDD_LIGHTINGCAPS          0x00000008L /* dlcLightingCaps is valid */
  208. #define D3DDD_BCLIPPING             0x00000010L /* bClipping is valid */
  209. #define D3DDD_LINECAPS              0x00000020L /* dpcLineCaps is valid */
  210. #define D3DDD_TRICAPS               0x00000040L /* dpcTriCaps is valid */
  211. #define D3DDD_DEVICERENDERBITDEPTH  0x00000080L /* dwDeviceRenderBitDepth is valid */
  212. #define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
  213. #define D3DDD_MAXBUFFERSIZE         0x00000200L /* dwMaxBufferSize is valid */
  214. #define D3DDD_MAXVERTEXCOUNT        0x00000400L /* dwMaxVertexCount is valid */
  215.  
  216. /* D3DDEVICEDESC dwDevCaps flags */
  217.  
  218. #define D3DDEVCAPS_FLOATTLVERTEX        0x00000001L /* Device accepts floating point */
  219.                                                     /* for post-transform vertex data */
  220. #define D3DDEVCAPS_SORTINCREASINGZ      0x00000002L /* Device needs data sorted for increasing Z*/
  221. #define D3DDEVCAPS_SORTDECREASINGZ      0X00000004L /* Device needs data sorted for decreasing Z*/
  222. #define D3DDEVCAPS_SORTEXACT            0x00000008L /* Device needs data sorted exactly */
  223.  
  224. #define D3DDEVCAPS_EXECUTESYSTEMMEMORY  0x00000010L /* Device can use execute buffers from system memory */
  225. #define D3DDEVCAPS_EXECUTEVIDEOMEMORY   0x00000020L /* Device can use execute buffers from video memory */
  226. #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
  227. #define D3DDEVCAPS_TLVERTEXVIDEOMEMORY  0x00000080L /* Device can use TL buffers from video memory */
  228. #define D3DDEVCAPS_TEXTURESYSTEMMEMORY  0x00000100L /* Device can texture from system memory */
  229. #define D3DDEVCAPS_TEXTUREVIDEOMEMORY   0x00000200L /* Device can texture from device memory */
  230.  
  231. #define D3DFDS_COLORMODEL        0x00000001L /* Match color model */
  232. #define D3DFDS_GUID              0x00000002L /* Match guid */
  233. #define D3DFDS_HARDWARE          0x00000004L /* Match hardware/software */
  234. #define D3DFDS_TRIANGLES         0x00000008L /* Match in triCaps */
  235. #define D3DFDS_LINES             0x00000010L /* Match in lineCaps  */
  236. #define D3DFDS_MISCCAPS          0x00000020L /* Match primCaps.dwMiscCaps */
  237. #define D3DFDS_RASTERCAPS        0x00000040L /* Match primCaps.dwRasterCaps */
  238. #define D3DFDS_ZCMPCAPS          0x00000080L /* Match primCaps.dwZCmpCaps */
  239. #define D3DFDS_ALPHACMPCAPS      0x00000100L /* Match primCaps.dwAlphaCmpCaps */
  240. #define D3DFDS_SRCBLENDCAPS      0x00000200L /* Match primCaps.dwSourceBlendCaps */
  241. #define D3DFDS_DSTBLENDCAPS      0x00000400L /* Match primCaps.dwDestBlendCaps */
  242. #define D3DFDS_SHADECAPS         0x00000800L /* Match primCaps.dwShadeCaps */
  243. #define D3DFDS_TEXTURECAPS       0x00001000L /* Match primCaps.dwTextureCaps */
  244. #define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
  245. #define D3DFDS_TEXTUREBLENDCAPS  0x00004000L /* Match primCaps.dwTextureBlendCaps */
  246. #define D3DFDS_TEXTUREADDRESSCAPS  0x00008000L /* Match primCaps.dwTextureBlendCaps */
  247.  
  248. /*
  249.  * FindDevice arguments
  250.  */
  251. typedef struct _D3DFINDDEVICESEARCH {
  252.     DWORD               dwSize;
  253.     DWORD               dwFlags;
  254.     BOOL                bHardware;
  255.     D3DCOLORMODEL       dcmColorModel;
  256.     GUID                guid;
  257.     DWORD               dwCaps;
  258.     D3DPRIMCAPS         dpcPrimCaps;
  259. } D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
  260.  
  261. typedef struct _D3DFINDDEVICERESULT {
  262.     DWORD               dwSize;
  263.     GUID                guid;           /* guid which matched */
  264.     D3DDEVICEDESC       ddHwDesc;               /* hardware D3DDEVICEDESC */
  265.     D3DDEVICEDESC       ddSwDesc;       /* software D3DDEVICEDESC */
  266. } D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
  267.  
  268. /*
  269.  * Description of execute buffer.
  270.  */
  271. typedef struct _D3DExecuteBufferDesc {
  272.     DWORD               dwSize;         /* size of this structure */
  273.     DWORD               dwFlags;        /* flags indicating which fields are valid */
  274.     DWORD               dwCaps;         /* capabilities of execute buffer */
  275.     DWORD               dwBufferSize;   /* size of execute buffer data */
  276.     LPVOID              lpData;         /* pointer to actual data */
  277. } D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
  278.  
  279. /* D3DEXECUTEBUFFER dwFlags indicating valid fields */
  280.  
  281. #define D3DDEB_BUFSIZE          0x00000001l     /* buffer size valid */
  282. #define D3DDEB_CAPS             0x00000002l     /* caps valid */
  283. #define D3DDEB_LPDATA           0x00000004l     /* lpData valid */
  284.  
  285. /* D3DEXECUTEBUFFER dwCaps */
  286.  
  287. #define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l     /* buffer in system memory */
  288. #define D3DDEBCAPS_VIDEOMEMORY  0x00000002l     /* buffer in device memory */
  289. #define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
  290.  
  291. #pragma pack()
  292.  
  293. #pragma option -b.
  294. #endif /* _D3DCAPS_H_ */
  295.