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.

290 lines
13 KiB

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