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.

599 lines
26 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: d3dcaps.h
  6. * Content: Direct3D capabilities include file
  7. *
  8. ***************************************************************************/
  9. #ifndef _D3DCAPS_H
  10. #define _D3DCAPS_H
  11. /*
  12. * Pull in DirectDraw include file automatically:
  13. */
  14. #include "ddraw.h"
  15. #ifndef DIRECT3D_VERSION
  16. #define DIRECT3D_VERSION 0x0700
  17. #endif
  18. #pragma pack(4)
  19. /* Description of capabilities of transform */
  20. typedef struct _D3DTRANSFORMCAPS {
  21. DWORD dwSize;
  22. DWORD dwCaps;
  23. } D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
  24. #define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
  25. /* Description of capabilities of lighting */
  26. typedef struct _D3DLIGHTINGCAPS {
  27. DWORD dwSize;
  28. DWORD dwCaps; /* Lighting caps */
  29. DWORD dwLightingModel; /* Lighting model - RGB or mono */
  30. DWORD dwNumLights; /* Number of lights that can be handled */
  31. } D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
  32. #define D3DLIGHTINGMODEL_RGB 0x00000001L
  33. #define D3DLIGHTINGMODEL_MONO 0x00000002L
  34. #define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
  35. #define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
  36. #define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
  37. #if(DIRECT3D_VERSION < 0x700)
  38. #define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
  39. #endif
  40. #if(DIRECT3D_VERSION < 0x500)
  41. #define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */
  42. #endif
  43. /* Description of capabilities for each primitive type */
  44. typedef struct _D3DPrimCaps {
  45. DWORD dwSize;
  46. DWORD dwMiscCaps; /* Capability flags */
  47. DWORD dwRasterCaps;
  48. DWORD dwZCmpCaps;
  49. DWORD dwSrcBlendCaps;
  50. DWORD dwDestBlendCaps;
  51. DWORD dwAlphaCmpCaps;
  52. DWORD dwShadeCaps;
  53. DWORD dwTextureCaps;
  54. DWORD dwTextureFilterCaps;
  55. DWORD dwTextureBlendCaps;
  56. DWORD dwTextureAddressCaps;
  57. DWORD dwStippleWidth; /* maximum width and height of */
  58. DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
  59. } D3DPRIMCAPS, *LPD3DPRIMCAPS;
  60. /* D3DPRIMCAPS dwMiscCaps */
  61. #define D3DPMISCCAPS_MASKPLANES 0x00000001L
  62. #define D3DPMISCCAPS_MASKZ 0x00000002L
  63. #define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
  64. #define D3DPMISCCAPS_CONFORMANT 0x00000008L
  65. #define D3DPMISCCAPS_CULLNONE 0x00000010L
  66. #define D3DPMISCCAPS_CULLCW 0x00000020L
  67. #define D3DPMISCCAPS_CULLCCW 0x00000040L
  68. /* D3DPRIMCAPS dwRasterCaps */
  69. #define D3DPRASTERCAPS_DITHER 0x00000001L
  70. #define D3DPRASTERCAPS_ROP2 0x00000002L
  71. #define D3DPRASTERCAPS_XOR 0x00000004L
  72. #define D3DPRASTERCAPS_PAT 0x00000008L
  73. #define D3DPRASTERCAPS_ZTEST 0x00000010L
  74. #define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
  75. #define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
  76. #define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
  77. #define D3DPRASTERCAPS_FOGTABLE 0x00000100L
  78. #define D3DPRASTERCAPS_STIPPLE 0x00000200L
  79. #if(DIRECT3D_VERSION >= 0x0500)
  80. #define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
  81. #define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
  82. #define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
  83. #define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
  84. #define D3DPRASTERCAPS_ZBIAS 0x00004000L
  85. #define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
  86. #define D3DPRASTERCAPS_FOGRANGE 0x00010000L
  87. #define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
  88. #endif /* DIRECT3D_VERSION >= 0x0500 */
  89. #if(DIRECT3D_VERSION >= 0x0600)
  90. #define D3DPRASTERCAPS_WBUFFER 0x00040000L
  91. #define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
  92. #define D3DPRASTERCAPS_WFOG 0x00100000L
  93. #define D3DPRASTERCAPS_ZFOG 0x00200000L
  94. #endif /* DIRECT3D_VERSION >= 0x0600 */
  95. /* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
  96. #define D3DPCMPCAPS_NEVER 0x00000001L
  97. #define D3DPCMPCAPS_LESS 0x00000002L
  98. #define D3DPCMPCAPS_EQUAL 0x00000004L
  99. #define D3DPCMPCAPS_LESSEQUAL 0x00000008L
  100. #define D3DPCMPCAPS_GREATER 0x00000010L
  101. #define D3DPCMPCAPS_NOTEQUAL 0x00000020L
  102. #define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
  103. #define D3DPCMPCAPS_ALWAYS 0x00000080L
  104. /* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
  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. /* D3DPRIMCAPS dwShadeCaps */
  119. #define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
  120. #define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
  121. #define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
  122. #define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
  123. #define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
  124. #define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
  125. #define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
  126. #define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
  127. #define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
  128. #define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
  129. #define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
  130. #define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
  131. #define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
  132. #define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
  133. #define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
  134. #define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
  135. #define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
  136. #define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
  137. #define D3DPSHADECAPS_FOGFLAT 0x00040000L
  138. #define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
  139. #define D3DPSHADECAPS_FOGPHONG 0x00100000L
  140. /* D3DPRIMCAPS dwTextureCaps */
  141. /*
  142. * Perspective-correct texturing is supported
  143. */
  144. #define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
  145. /*
  146. * Power-of-2 texture dimensions are required
  147. */
  148. #define D3DPTEXTURECAPS_POW2 0x00000002L
  149. /*
  150. * Alpha in texture pixels is supported
  151. */
  152. #define D3DPTEXTURECAPS_ALPHA 0x00000004L
  153. /*
  154. * Color-keyed textures are supported
  155. */
  156. #define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
  157. /*
  158. * obsolete, see D3DPTADDRESSCAPS_BORDER
  159. */
  160. #define D3DPTEXTURECAPS_BORDER 0x00000010L
  161. /*
  162. * Only square textures are supported
  163. */
  164. #define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
  165. #if(DIRECT3D_VERSION >= 0x0600)
  166. /*
  167. * Texture indices are not scaled by the texture size prior
  168. * to interpolation.
  169. */
  170. #define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
  171. /*
  172. * Device can draw alpha from texture palettes
  173. */
  174. #define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L
  175. /*
  176. * Device can use non-POW2 textures if:
  177. * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
  178. * 2) D3DRS_WRAP(N) is zero for this texture's coordinates
  179. * 3) mip mapping is not enabled (use magnification filter only)
  180. */
  181. #define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
  182. #endif /* DIRECT3D_VERSION >= 0x0600 */
  183. #if(DIRECT3D_VERSION >= 0x0700)
  184. // 0x00000200L unused
  185. /*
  186. * Device can divide transformed texture coordinates by the
  187. * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
  188. */
  189. #define D3DPTEXTURECAPS_PROJECTED 0x00000400L
  190. /*
  191. * Device can do cubemap textures
  192. */
  193. #define D3DPTEXTURECAPS_CUBEMAP 0x00000800L
  194. #define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L
  195. #endif /* DIRECT3D_VERSION >= 0x0700 */
  196. /* D3DPRIMCAPS dwTextureFilterCaps */
  197. #define D3DPTFILTERCAPS_NEAREST 0x00000001L
  198. #define D3DPTFILTERCAPS_LINEAR 0x00000002L
  199. #define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
  200. #define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
  201. #define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
  202. #define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
  203. #if(DIRECT3D_VERSION >= 0x0600)
  204. /* Device3 Min Filter */
  205. #define D3DPTFILTERCAPS_MINFPOINT 0x00000100L
  206. #define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
  207. #define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
  208. /* Device3 Mip Filter */
  209. #define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L
  210. #define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
  211. /* Device3 Mag Filter */
  212. #define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L
  213. #define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
  214. #define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
  215. #define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
  216. #define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
  217. #endif /* DIRECT3D_VERSION >= 0x0600 */
  218. /* D3DPRIMCAPS dwTextureBlendCaps */
  219. #define D3DPTBLENDCAPS_DECAL 0x00000001L
  220. #define D3DPTBLENDCAPS_MODULATE 0x00000002L
  221. #define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
  222. #define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
  223. #define D3DPTBLENDCAPS_DECALMASK 0x00000010L
  224. #define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
  225. #define D3DPTBLENDCAPS_COPY 0x00000040L
  226. #if(DIRECT3D_VERSION >= 0x0500)
  227. #define D3DPTBLENDCAPS_ADD 0x00000080L
  228. #endif /* DIRECT3D_VERSION >= 0x0500 */
  229. /* D3DPRIMCAPS dwTextureAddressCaps */
  230. #define D3DPTADDRESSCAPS_WRAP 0x00000001L
  231. #define D3DPTADDRESSCAPS_MIRROR 0x00000002L
  232. #define D3DPTADDRESSCAPS_CLAMP 0x00000004L
  233. #if(DIRECT3D_VERSION >= 0x0500)
  234. #define D3DPTADDRESSCAPS_BORDER 0x00000008L
  235. #define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
  236. #endif /* DIRECT3D_VERSION >= 0x0500 */
  237. #if(DIRECT3D_VERSION >= 0x0600)
  238. /* D3DDEVICEDESC dwStencilCaps */
  239. #define D3DSTENCILCAPS_KEEP 0x00000001L
  240. #define D3DSTENCILCAPS_ZERO 0x00000002L
  241. #define D3DSTENCILCAPS_REPLACE 0x00000004L
  242. #define D3DSTENCILCAPS_INCRSAT 0x00000008L
  243. #define D3DSTENCILCAPS_DECRSAT 0x00000010L
  244. #define D3DSTENCILCAPS_INVERT 0x00000020L
  245. #define D3DSTENCILCAPS_INCR 0x00000040L
  246. #define D3DSTENCILCAPS_DECR 0x00000080L
  247. /* D3DDEVICEDESC dwTextureOpCaps */
  248. #define D3DTEXOPCAPS_DISABLE 0x00000001L
  249. #define D3DTEXOPCAPS_SELECTARG1 0x00000002L
  250. #define D3DTEXOPCAPS_SELECTARG2 0x00000004L
  251. #define D3DTEXOPCAPS_MODULATE 0x00000008L
  252. #define D3DTEXOPCAPS_MODULATE2X 0x00000010L
  253. #define D3DTEXOPCAPS_MODULATE4X 0x00000020L
  254. #define D3DTEXOPCAPS_ADD 0x00000040L
  255. #define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
  256. #define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
  257. #define D3DTEXOPCAPS_SUBTRACT 0x00000200L
  258. #define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
  259. #define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
  260. #define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
  261. #define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
  262. #define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
  263. #define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
  264. #define D3DTEXOPCAPS_PREMODULATE 0x00010000L
  265. #define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
  266. #define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
  267. #define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
  268. #define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
  269. #define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
  270. #define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
  271. #define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
  272. /* D3DDEVICEDESC dwFVFCaps flags */
  273. #define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
  274. #define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
  275. #endif /* DIRECT3D_VERSION >= 0x0600 */
  276. /*
  277. * Description for a device.
  278. * This is used to describe a device that is to be created or to query
  279. * the current device.
  280. */
  281. typedef struct _D3DDeviceDesc {
  282. DWORD dwSize; /* Size of D3DDEVICEDESC structure */
  283. DWORD dwFlags; /* Indicates which fields have valid data */
  284. D3DCOLORMODEL dcmColorModel; /* Color model of device */
  285. DWORD dwDevCaps; /* Capabilities of device */
  286. D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
  287. BOOL bClipping; /* Device can do 3D clipping */
  288. D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
  289. D3DPRIMCAPS dpcLineCaps;
  290. D3DPRIMCAPS dpcTriCaps;
  291. DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
  292. DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
  293. DWORD dwMaxBufferSize; /* Maximum execute buffer size */
  294. DWORD dwMaxVertexCount; /* Maximum vertex count */
  295. #if(DIRECT3D_VERSION >= 0x0500)
  296. // *** New fields for DX5 *** //
  297. // Width and height caps are 0 for legacy HALs.
  298. DWORD dwMinTextureWidth, dwMinTextureHeight;
  299. DWORD dwMaxTextureWidth, dwMaxTextureHeight;
  300. DWORD dwMinStippleWidth, dwMaxStippleWidth;
  301. DWORD dwMinStippleHeight, dwMaxStippleHeight;
  302. #endif /* DIRECT3D_VERSION >= 0x0500 */
  303. #if(DIRECT3D_VERSION >= 0x0600)
  304. // New fields for DX6
  305. DWORD dwMaxTextureRepeat;
  306. DWORD dwMaxTextureAspectRatio;
  307. DWORD dwMaxAnisotropy;
  308. // Guard band that the rasterizer can accommodate
  309. // Screen-space vertices inside this space but outside the viewport
  310. // will get clipped properly.
  311. D3DVALUE dvGuardBandLeft;
  312. D3DVALUE dvGuardBandTop;
  313. D3DVALUE dvGuardBandRight;
  314. D3DVALUE dvGuardBandBottom;
  315. D3DVALUE dvExtentsAdjust;
  316. DWORD dwStencilCaps;
  317. DWORD dwFVFCaps;
  318. DWORD dwTextureOpCaps;
  319. WORD wMaxTextureBlendStages;
  320. WORD wMaxSimultaneousTextures;
  321. #endif /* DIRECT3D_VERSION >= 0x0600 */
  322. } D3DDEVICEDESC, *LPD3DDEVICEDESC;
  323. #if(DIRECT3D_VERSION >= 0x0700)
  324. typedef struct _D3DDeviceDesc7 {
  325. DWORD dwDevCaps; /* Capabilities of device */
  326. D3DPRIMCAPS dpcLineCaps;
  327. D3DPRIMCAPS dpcTriCaps;
  328. DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
  329. DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
  330. DWORD dwMinTextureWidth, dwMinTextureHeight;
  331. DWORD dwMaxTextureWidth, dwMaxTextureHeight;
  332. DWORD dwMaxTextureRepeat;
  333. DWORD dwMaxTextureAspectRatio;
  334. DWORD dwMaxAnisotropy;
  335. D3DVALUE dvGuardBandLeft;
  336. D3DVALUE dvGuardBandTop;
  337. D3DVALUE dvGuardBandRight;
  338. D3DVALUE dvGuardBandBottom;
  339. D3DVALUE dvExtentsAdjust;
  340. DWORD dwStencilCaps;
  341. DWORD dwFVFCaps;
  342. DWORD dwTextureOpCaps;
  343. WORD wMaxTextureBlendStages;
  344. WORD wMaxSimultaneousTextures;
  345. DWORD dwMaxActiveLights;
  346. D3DVALUE dvMaxVertexW;
  347. GUID deviceGUID;
  348. WORD wMaxUserClipPlanes;
  349. WORD wMaxVertexBlendMatrices;
  350. DWORD dwVertexProcessingCaps;
  351. DWORD dwReserved1;
  352. DWORD dwReserved2;
  353. DWORD dwReserved3;
  354. DWORD dwReserved4;
  355. } D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
  356. #endif /* DIRECT3D_VERSION >= 0x0700 */
  357. #define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
  358. #define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
  359. typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
  360. #if(DIRECT3D_VERSION >= 0x0700)
  361. typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
  362. #endif /* DIRECT3D_VERSION >= 0x0700 */
  363. /* D3DDEVICEDESC dwFlags indicating valid fields */
  364. #define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
  365. #define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
  366. #define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
  367. #define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
  368. #define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
  369. #define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
  370. #define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
  371. #define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
  372. #define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
  373. #define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
  374. #define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
  375. /* D3DDEVICEDESC dwDevCaps flags */
  376. #define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
  377. /* for post-transform vertex data */
  378. #define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */
  379. #define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */
  380. #define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
  381. #define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
  382. #define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
  383. #define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
  384. #define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
  385. #define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
  386. #define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
  387. #if(DIRECT3D_VERSION >= 0x0500)
  388. #define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
  389. #define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
  390. #define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
  391. #endif /* DIRECT3D_VERSION >= 0x0500 */
  392. #if(DIRECT3D_VERSION >= 0x0600)
  393. #define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
  394. #define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
  395. #define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
  396. #endif /* DIRECT3D_VERSION >= 0x0600 */
  397. #if(DIRECT3D_VERSION >= 0x0700)
  398. #define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
  399. #define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
  400. #define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
  401. /*
  402. * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
  403. */
  404. /* device can do texgen */
  405. #define D3DVTXPCAPS_TEXGEN 0x00000001L
  406. /* device can do IDirect3DDevice7 colormaterialsource ops */
  407. #define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L
  408. /* device can do vertex fog */
  409. #define D3DVTXPCAPS_VERTEXFOG 0x00000004L
  410. /* device can do directional lights */
  411. #define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L
  412. /* device can do positional lights (includes point and spot) */
  413. #define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L
  414. /* device can do local viewer */
  415. #define D3DVTXPCAPS_LOCALVIEWER 0x00000020L
  416. #endif /* DIRECT3D_VERSION >= 0x0700 */
  417. #define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
  418. #define D3DFDS_GUID 0x00000002L /* Match guid */
  419. #define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
  420. #define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
  421. #define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
  422. #define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
  423. #define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
  424. #define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
  425. #define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
  426. #define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
  427. #define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
  428. #define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
  429. #define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
  430. #define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
  431. #define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
  432. #define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
  433. /*
  434. * FindDevice arguments
  435. */
  436. typedef struct _D3DFINDDEVICESEARCH {
  437. DWORD dwSize;
  438. DWORD dwFlags;
  439. BOOL bHardware;
  440. D3DCOLORMODEL dcmColorModel;
  441. GUID guid;
  442. DWORD dwCaps;
  443. D3DPRIMCAPS dpcPrimCaps;
  444. } D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
  445. typedef struct _D3DFINDDEVICERESULT {
  446. DWORD dwSize;
  447. GUID guid; /* guid which matched */
  448. D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
  449. D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
  450. } D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
  451. /*
  452. * Description of execute buffer.
  453. */
  454. typedef struct _D3DExecuteBufferDesc {
  455. DWORD dwSize; /* size of this structure */
  456. DWORD dwFlags; /* flags indicating which fields are valid */
  457. DWORD dwCaps; /* capabilities of execute buffer */
  458. DWORD dwBufferSize; /* size of execute buffer data */
  459. LPVOID lpData; /* pointer to actual data */
  460. } D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
  461. /* D3DEXECUTEBUFFER dwFlags indicating valid fields */
  462. #define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
  463. #define D3DDEB_CAPS 0x00000002l /* caps valid */
  464. #define D3DDEB_LPDATA 0x00000004l /* lpData valid */
  465. /* D3DEXECUTEBUFFER dwCaps */
  466. #define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
  467. #define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
  468. #define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
  469. #if(DIRECT3D_VERSION < 0x0800)
  470. #if(DIRECT3D_VERSION >= 0x0700)
  471. typedef struct _D3DDEVINFO_TEXTUREMANAGER {
  472. BOOL bThrashing; /* indicates if thrashing */
  473. DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */
  474. DWORD dwNumEvicts; /* number of textures evicted */
  475. DWORD dwNumVidCreates; /* number of textures created in video memory */
  476. DWORD dwNumTexturesUsed; /* number of textures used */
  477. DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */
  478. DWORD dwWorkingSet; /* number of textures in video memory */
  479. DWORD dwWorkingSetBytes; /* number of bytes in video memory */
  480. DWORD dwTotalManaged; /* total number of managed textures */
  481. DWORD dwTotalBytes; /* total number of bytes of managed textures */
  482. DWORD dwLastPri; /* priority of last texture evicted */
  483. } D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
  484. typedef struct _D3DDEVINFO_TEXTURING {
  485. DWORD dwNumLoads; /* counts Load() API calls */
  486. DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */
  487. DWORD dwNumPreLoads; /* counts PreLoad() API calls */
  488. DWORD dwNumSet; /* counts SetTexture() API calls */
  489. DWORD dwNumCreates; /* counts texture creates */
  490. DWORD dwNumDestroys; /* counts texture destroys */
  491. DWORD dwNumSetPriorities; /* counts SetPriority() API calls */
  492. DWORD dwNumSetLODs; /* counts SetLOD() API calls */
  493. DWORD dwNumLocks; /* counts number of texture locks */
  494. DWORD dwNumGetDCs; /* counts number of GetDCs to textures */
  495. } D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
  496. #endif /* DIRECT3D_VERSION >= 0x0700 */
  497. #endif //(DIRECT3D_VERSION < 0x0800)
  498. #pragma pack()
  499. #endif /* _D3DCAPS_H_ */