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.

780 lines
32 KiB

  1. sinclude(`d3d8mkhdr.m4')dnl This file must be preprocessed by the m4 preprocessor.
  2. /*==========================================================================;
  3. *
  4. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  5. *
  6. * File: d3d8.h
  7. * Content: Direct3D include file
  8. begindoc
  9. *
  10. * Special markers:
  11. *
  12. * Each special marker can either be applied to a single line
  13. * (appended to the end) or spread over a range. For example
  14. * suppose that ;mumble is a marker. Then you can either say
  15. *
  16. * blah blah blah ;mumble
  17. *
  18. * to apply the marker to a single line, or
  19. *
  20. * ;begin_mumble
  21. * blah blah
  22. * blah blah
  23. * blah blah
  24. * ;end_mumble
  25. *
  26. * to apply it to a range of lines.
  27. *
  28. *
  29. * Note that the command line to hsplit.exe must look like
  30. * this for these markers to work:
  31. *
  32. * hsplit -u -ta dx# -v #00
  33. *
  34. * where the two "#"s are the version of DX that the header
  35. * file is being generated for. They had better match, too.
  36. *
  37. *
  38. * Marker: ;public_300
  39. *
  40. * Lines tagged with this marker will appear in all header files
  41. * DX3 **and later**.
  42. * Use ;public_dx3 for lines that are specific to version 300 and
  43. * not to future versions.
  44. *
  45. * Marker: ;public_500
  46. *
  47. * Lines tagged with this marker will appear in all header files
  48. * DX5 **and later**.
  49. * Use ;public_dx5 for lines that are specific to version 500 and
  50. * not to future versions.
  51. *
  52. * Marker: ;public_600
  53. *
  54. * Lines tagged with this marker will appear in all header files
  55. * DX6 **and later**.
  56. * Use ;public_dx5 for lines that are specific to version 500 and
  57. * not to future versions.
  58. *
  59. * Marker: ;public_dx3
  60. * Marker: ;public_dx5
  61. * Marker: ;public_dx6
  62. *
  63. * Lines tagged with these markers will appear *only* in the DX3,
  64. * DX5, DX6 version of the header file.
  65. *
  66. * There should never be a ;public_dx5 since 500 is tha latest
  67. * version of the header file. Use ;public_500 for lines that
  68. * are new for version 500 and apply to all future versions.
  69. *
  70. * Marker: ;if_(DIRECT3D_VERSION)_500
  71. *
  72. * Lines tagged with this marker will appear only in the DX5
  73. * version of the header file. Furthermore, its appearance
  74. * in the header file will be bracketed with
  75. *
  76. * #if(DIRECT3D_VERSION) >= 0x0500
  77. * ...
  78. * #endif
  79. *
  80. * Try to avoid using this marker, because the number _500 needs
  81. * to change as each new beta version is released. (Yuck.)
  82. *
  83. * If you choose to use this as a bracketing tag, the end
  84. * tag is ";end" and not ";end_if_(DIRECTINPUT_VERSION)_500".
  85. *
  86. * Marker: ;if_(DIRECT3D_VERSION)_600
  87. *
  88. * Same as for DIRECT3D_VERSION_500
  89. *
  90. * Note that ;begin_internal, ;end_internal can no longer be nested
  91. * inside a ;begin_public_*, ;end_public_*. Either do an ;end_public
  92. * before the ;begin_internal, or do not use ;begin_internal and end
  93. * each internal line with ;internal.
  94. *
  95. enddoc
  96. *
  97. ****************************************************************************/
  98. ;begin_external
  99. #ifndef _D3D8_H_
  100. #define _D3D8_H_
  101. ;end_external
  102. ;begin_internal
  103. #ifndef _D3D8P_H_
  104. #define _D3D8P_H_
  105. #ifdef _D3D8_H_
  106. #pragma message( "ERROR: d3d8.h included with d3d8p.h" __FILE__ )
  107. #endif
  108. ;end_internal
  109. #ifndef DIRECT3D_VERSION
  110. #define DIRECT3D_VERSION 0x0800
  111. #endif //DIRECT3D_VERSION
  112. // include this file content only if compiling for DX8 interfaces
  113. #if(DIRECT3D_VERSION >= 0x0800)
  114. /* This identifier is passed to Direct3DCreate8 in order to ensure that an
  115. * application was built against the correct header files. This number is
  116. * incremented whenever a header (or other) change would require applications
  117. * to be rebuilt. If the version doesn't match, Direct3DCreate8 will fail.
  118. * (The number itself has no meaning.)*/
  119. #define D3D_SDK_VERSION 220
  120. #define D3D_SDK_VERSION_DX8 120 ;internal
  121. ;begin_internal
  122. #ifndef WIN32_LEAN_AND_MEAN
  123. #define WIN32_LEAN_AND_MEAN
  124. #endif
  125. ;end_internal
  126. #include <stdlib.h>
  127. #define COM_NO_WINDOWS_H
  128. #include <objbase.h>
  129. #include <windows.h>
  130. #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
  131. #define HMONITOR_DECLARED
  132. DECLARE_HANDLE(HMONITOR);
  133. #endif
  134. #define D3DAPI WINAPI
  135. /*
  136. * Interface IID's
  137. */
  138. #if defined( _WIN32 ) && !defined( _NO_COM)
  139. /* IID_IDirect3D8 */
  140. /* {1DD9E8DA-1C77-4d40-B0CF-98FEFDFF9512} */
  141. DEFINE_GUID(IID_IDirect3D8, 0x1dd9e8da, 0x1c77, 0x4d40, 0xb0, 0xcf, 0x98, 0xfe, 0xfd, 0xff, 0x95, 0x12);
  142. /* IID_IDirect3DDevice8 */
  143. /* {7385E5DF-8FE8-41D5-86B6-D7B48547B6CF} */
  144. DEFINE_GUID(IID_IDirect3DDevice8, 0x7385e5df, 0x8fe8, 0x41d5, 0x86, 0xb6, 0xd7, 0xb4, 0x85, 0x47, 0xb6, 0xcf);
  145. /* IID_IDirect3DResource8 */
  146. /* {1B36BB7B-09B7-410a-B445-7D1430D7B33F} */
  147. DEFINE_GUID(IID_IDirect3DResource8, 0x1b36bb7b, 0x9b7, 0x410a, 0xb4, 0x45, 0x7d, 0x14, 0x30, 0xd7, 0xb3, 0x3f);
  148. /* IID_IDirect3DBaseTexture8 */
  149. /* {B4211CFA-51B9-4a9f-AB78-DB99B2BB678E} */
  150. DEFINE_GUID(IID_IDirect3DBaseTexture8, 0xb4211cfa, 0x51b9, 0x4a9f, 0xab, 0x78, 0xdb, 0x99, 0xb2, 0xbb, 0x67, 0x8e);
  151. /* IID_IDirect3DTexture8 */
  152. /* {E4CDD575-2866-4f01-B12E-7EECE1EC9358} */
  153. DEFINE_GUID(IID_IDirect3DTexture8, 0xe4cdd575, 0x2866, 0x4f01, 0xb1, 0x2e, 0x7e, 0xec, 0xe1, 0xec, 0x93, 0x58);
  154. /* IID_IDirect3DCubeTexture8 */
  155. /* {3EE5B968-2ACA-4c34-8BB5-7E0C3D19B750} */
  156. DEFINE_GUID(IID_IDirect3DCubeTexture8, 0x3ee5b968, 0x2aca, 0x4c34, 0x8b, 0xb5, 0x7e, 0x0c, 0x3d, 0x19, 0xb7, 0x50);
  157. /* IID_IDirect3DVolumeTexture8 */
  158. /* {4B8AAAFA-140F-42ba-9131-597EAFAA2EAD} */
  159. DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4b8aaafa, 0x140f, 0x42ba, 0x91, 0x31, 0x59, 0x7e, 0xaf, 0xaa, 0x2e, 0xad);
  160. /* IID_IDirect3DVertexBuffer8 */
  161. /* {8AEEEAC7-05F9-44d4-B591-000B0DF1CB95} */
  162. DEFINE_GUID(IID_IDirect3DVertexBuffer8, 0x8aeeeac7, 0x05f9, 0x44d4, 0xb5, 0x91, 0x00, 0x0b, 0x0d, 0xf1, 0xcb, 0x95);
  163. /* IID_IDirect3DIndexBuffer8 */
  164. /* {0E689C9A-053D-44a0-9D92-DB0E3D750F86} */
  165. DEFINE_GUID(IID_IDirect3DIndexBuffer8, 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86);
  166. /* IID_IDirect3DSurface8 */
  167. /* {B96EEBCA-B326-4ea5-882F-2FF5BAE021DD} */
  168. DEFINE_GUID(IID_IDirect3DSurface8, 0xb96eebca, 0xb326, 0x4ea5, 0x88, 0x2f, 0x2f, 0xf5, 0xba, 0xe0, 0x21, 0xdd);
  169. /* IID_IDirect3DVolume8 */
  170. /* {BD7349F5-14F1-42e4-9C79-972380DB40C0} */
  171. DEFINE_GUID(IID_IDirect3DVolume8, 0xbd7349f5, 0x14f1, 0x42e4, 0x9c, 0x79, 0x97, 0x23, 0x80, 0xdb, 0x40, 0xc0);
  172. /* IID_IDirect3DSwapChain8 */
  173. /* {928C088B-76B9-4C6B-A536-A590853876CD} */
  174. DEFINE_GUID(IID_IDirect3DSwapChain8, 0x928c088b, 0x76b9, 0x4c6b, 0xa5, 0x36, 0xa5, 0x90, 0x85, 0x38, 0x76, 0xcd);
  175. #endif
  176. #ifdef __cplusplus
  177. interface IDirect3D8;
  178. interface IDirect3DDevice8;
  179. interface IDirect3DResource8;
  180. interface IDirect3DBaseTexture8;
  181. interface IDirect3DTexture8;
  182. interface IDirect3DVolumeTexture8;
  183. interface IDirect3DCubeTexture8;
  184. interface IDirect3DVertexBuffer8;
  185. interface IDirect3DIndexBuffer8;
  186. interface IDirect3DSurface8;
  187. interface IDirect3DVolume8;
  188. interface IDirect3DSwapChain8;
  189. #endif
  190. /* We need these so that we don't have to have say "interface IDirect3D8 *" */ ;internal
  191. /* everywhere in the prototypes. The LP syntax is legacy and de-emphasized in dx8 */ ;internal
  192. typedef interface IDirect3D8 IDirect3D8;
  193. typedef interface IDirect3DDevice8 IDirect3DDevice8;
  194. typedef interface IDirect3DResource8 IDirect3DResource8;
  195. typedef interface IDirect3DBaseTexture8 IDirect3DBaseTexture8;
  196. typedef interface IDirect3DTexture8 IDirect3DTexture8;
  197. typedef interface IDirect3DVolumeTexture8 IDirect3DVolumeTexture8;
  198. typedef interface IDirect3DCubeTexture8 IDirect3DCubeTexture8;
  199. typedef interface IDirect3DVertexBuffer8 IDirect3DVertexBuffer8;
  200. typedef interface IDirect3DIndexBuffer8 IDirect3DIndexBuffer8;
  201. typedef interface IDirect3DSurface8 IDirect3DSurface8;
  202. typedef interface IDirect3DVolume8 IDirect3DVolume8;
  203. typedef interface IDirect3DSwapChain8 IDirect3DSwapChain8;
  204. ;begin_external
  205. #include "d3d8types.h"
  206. #include "d3d8caps.h"
  207. ;end_external
  208. ;begin_internal
  209. #include "d3d8typesp.h"
  210. #include "d3d8capsp.h"
  211. ;end_internal
  212. #ifdef __cplusplus
  213. extern "C" {
  214. #endif
  215. /*
  216. * DLL Function for creating a Direct3D8 object. This object supports
  217. * enumeration and allows the creation of Direct3DDevice8 objects.
  218. * Pass the value of the constant D3D_SDK_VERSION to this function, so
  219. * that the run-time can validate that your application was compiled
  220. * against the right headers.
  221. */
  222. IDirect3D8 * WINAPI Direct3DCreate8(UINT SDKVersion);
  223. /*
  224. * Direct3D interfaces
  225. */
  226. begin_interface(IDirect3D8)
  227. begin_methods()
  228. declare_method(RegisterSoftwareDevice, void* pInitializeFunction);
  229. declare_method2(UINT, GetAdapterCount);
  230. declare_method(GetAdapterIdentifier, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier);
  231. declare_method2(UINT, GetAdapterModeCount, UINT Adapter);
  232. declare_method(EnumAdapterModes, UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode);
  233. declare_method(GetAdapterDisplayMode, UINT Adapter, D3DDISPLAYMODE* pMode);
  234. declare_method(CheckDeviceType, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed);
  235. declare_method(CheckDeviceFormat, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
  236. declare_method(CheckDeviceMultiSampleType, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType);
  237. declare_method(CheckDepthStencilMatch, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
  238. declare_method(GetDeviceCaps, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps);
  239. declare_method2(HMONITOR, GetAdapterMonitor, UINT Adapter);
  240. declare_method(CreateDevice, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice8** ppReturnedDeviceInterface);
  241. end_methods()
  242. end_interface()
  243. begin_interface(IDirect3DDevice8)
  244. begin_methods()
  245. /* Display Mode */ ;internal
  246. declare_method(TestCooperativeLevel);
  247. /* Memory Management */ ;internal
  248. declare_method2(UINT, GetAvailableTextureMem);
  249. declare_method(ResourceManagerDiscardBytes, DWORD Bytes);
  250. /* Caps and Enumeration */;internal
  251. declare_method(GetDirect3D, IDirect3D8** ppD3D8);
  252. declare_method(GetDeviceCaps, D3DCAPS8* pCaps);
  253. declare_method(GetDisplayMode, D3DDISPLAYMODE* pMode);
  254. declare_method(GetCreationParameters, D3DDEVICE_CREATION_PARAMETERS *pParameters);
  255. /* Cursor */;internal
  256. declare_method(SetCursorProperties, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap);
  257. declare_method2(void, SetCursorPosition, UINT XScreenSpace, UINT YScreenSpace, DWORD Flags);
  258. declare_method2(BOOL, ShowCursor, BOOL bShow);
  259. /* SwapChain Creation */;internal
  260. declare_method(CreateAdditionalSwapChain, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain)
  261. /* Reset */;internal
  262. declare_method(Reset, D3DPRESENT_PARAMETERS* pPresentationParameters);
  263. /* Presentation */;internal
  264. declare_method(Present, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
  265. declare_method(GetBackBuffer, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer);
  266. declare_method(GetRasterStatus, D3DRASTER_STATUS* pRasterStatus);
  267. /* Default SwapChain Gamma */;internal
  268. declare_method2(void, SetGammaRamp, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
  269. declare_method2(void, GetGammaRamp, D3DGAMMARAMP* pRamp);
  270. /* Resource Creation */;internal
  271. declare_method(CreateTexture, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture);
  272. declare_method(CreateVolumeTexture, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture);
  273. declare_method(CreateCubeTexture, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture);
  274. declare_method(CreateVertexBuffer, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer);
  275. declare_method(CreateIndexBuffer, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer);
  276. /* Surface Creation */;internal
  277. declare_method(CreateRenderTarget, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface);
  278. declare_method(CreateDepthStencilSurface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface);
  279. declare_method(CreateImageSurface, UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface);
  280. /* Copying */;internal
  281. declare_method(CopyRects, IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray);
  282. declare_method(UpdateTexture, IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture);
  283. declare_method(GetFrontBuffer, IDirect3DSurface8* pDestSurface);
  284. /* RenderTarget */;internal
  285. declare_method(SetRenderTarget, IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil);
  286. declare_method(GetRenderTarget, IDirect3DSurface8** ppRenderTarget);
  287. declare_method(GetDepthStencilSurface, IDirect3DSurface8** ppZStencilSurface);
  288. /* Rendering */;internal
  289. declare_method(BeginScene);
  290. declare_method(EndScene);
  291. declare_method(Clear, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
  292. declare_method(SetTransform, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
  293. declare_method(GetTransform, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
  294. declare_method(MultiplyTransform, D3DTRANSFORMSTATETYPE, CONST D3DMATRIX*);
  295. declare_method(SetViewport, CONST D3DVIEWPORT8* pViewport);
  296. declare_method(GetViewport, D3DVIEWPORT8* pViewport);
  297. declare_method(SetMaterial, CONST D3DMATERIAL8* pMaterial);
  298. declare_method(GetMaterial, D3DMATERIAL8* pMaterial);
  299. declare_method(SetLight, DWORD Index, CONST D3DLIGHT8*);
  300. declare_method(GetLight, DWORD Index, D3DLIGHT8*);
  301. declare_method(LightEnable, DWORD Index, BOOL Enable);
  302. declare_method(GetLightEnable, DWORD Index, BOOL* pEnable);
  303. declare_method(SetClipPlane, DWORD Index, CONST float* pPlane);
  304. declare_method(GetClipPlane, DWORD Index, float* pPlane);
  305. declare_method(SetRenderState, D3DRENDERSTATETYPE State, DWORD Value);
  306. declare_method(GetRenderState, D3DRENDERSTATETYPE State, DWORD* pValue);
  307. declare_method(BeginStateBlock);
  308. declare_method(EndStateBlock, DWORD* pToken);
  309. declare_method(ApplyStateBlock, DWORD Token);
  310. declare_method(CaptureStateBlock, DWORD Token);
  311. declare_method(DeleteStateBlock, DWORD Token);
  312. declare_method(CreateStateBlock, D3DSTATEBLOCKTYPE Type, DWORD* pToken);
  313. declare_method(SetClipStatus, CONST D3DCLIPSTATUS8* pClipStatus);
  314. declare_method(GetClipStatus, D3DCLIPSTATUS8* pClipStatus);
  315. declare_method(GetTexture, DWORD Stage, IDirect3DBaseTexture8** ppTexture);
  316. declare_method(SetTexture, DWORD Stage, IDirect3DBaseTexture8* pTexture);
  317. declare_method(GetTextureStageState, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
  318. declare_method(SetTextureStageState, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
  319. declare_method(ValidateDevice, DWORD* pNumPasses);
  320. declare_method(GetInfo, DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize);
  321. declare_method(SetPaletteEntries, UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
  322. declare_method(GetPaletteEntries, UINT PaletteNumber, PALETTEENTRY* pEntries);
  323. declare_method(SetCurrentTexturePalette, UINT PaletteNumber);
  324. declare_method(GetCurrentTexturePalette, UINT *PaletteNumber);
  325. declare_method(DrawPrimitive, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
  326. declare_method(DrawIndexedPrimitive, D3DPRIMITIVETYPE, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
  327. declare_method(DrawPrimitiveUP, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
  328. declare_method(DrawIndexedPrimitiveUP, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
  329. declare_method(ProcessVertices, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer8* pDestBuffer, DWORD Flags);
  330. /* Vertex Shader */;internal
  331. declare_method(CreateVertexShader, CONST DWORD* pDeclaration, CONST DWORD* pFunction, DWORD* pHandle, DWORD Usage);
  332. declare_method(SetVertexShader, DWORD Handle);
  333. declare_method(GetVertexShader, DWORD* pHandle);
  334. declare_method(DeleteVertexShader, DWORD Handle);
  335. declare_method(SetVertexShaderConstant, DWORD Register, CONST void* pConstantData, DWORD ConstantCount);
  336. declare_method(GetVertexShaderConstant, DWORD Register, void* pConstantData, DWORD ConstantCount);
  337. declare_method(GetVertexShaderDeclaration, DWORD Handle, void* pData, DWORD* pSizeOfData);
  338. declare_method(GetVertexShaderFunction, DWORD Handle, void* pData, DWORD* pSizeOfData);
  339. /* Streams */;internal
  340. declare_method(SetStreamSource, UINT StreamNumber, IDirect3DVertexBuffer8* pStreamData, UINT Stride);
  341. declare_method(GetStreamSource, UINT StreamNumber, IDirect3DVertexBuffer8** ppStreamData, UINT* pStride);
  342. declare_method(SetIndices, IDirect3DIndexBuffer8* pIndexData, UINT BaseVertexIndex);
  343. declare_method(GetIndices, IDirect3DIndexBuffer8** ppIndexData, UINT* pBaseVertexIndex);
  344. /* Pixel Shader */;internal
  345. declare_method(CreatePixelShader, CONST DWORD* pFunction, DWORD* pHandle);
  346. declare_method(SetPixelShader, DWORD Handle);
  347. declare_method(GetPixelShader, DWORD* pHandle);
  348. declare_method(DeletePixelShader, DWORD Handle);
  349. declare_method(SetPixelShaderConstant, DWORD Register, CONST void* pConstantData, DWORD ConstantCount);
  350. declare_method(GetPixelShaderConstant, DWORD Register, void* pConstantData, DWORD ConstantCount);
  351. declare_method(GetPixelShaderFunction, DWORD Handle, void* pData, DWORD* pSizeOfData);
  352. /* HO Prims */;internal
  353. declare_method(DrawRectPatch, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo);
  354. declare_method(DrawTriPatch, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo);
  355. declare_method(DeletePatch, UINT Handle);
  356. end_methods()
  357. end_interface()
  358. begin_interface(IDirect3DSwapChain8)
  359. begin_methods()
  360. declare_method(Present, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
  361. declare_method(GetBackBuffer, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer);
  362. end_methods()
  363. end_interface()
  364. begin_interface(IDirect3DResource8)
  365. begin_methods()
  366. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  367. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  368. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  369. declare_method(FreePrivateData, REFGUID refguid);
  370. declare_method2(DWORD, SetPriority, DWORD PriorityNew);
  371. declare_method2(DWORD, GetPriority);
  372. declare_method2(void, PreLoad);
  373. declare_method2(D3DRESOURCETYPE, GetType);
  374. end_methods()
  375. end_interface()
  376. begin_interface(IDirect3DBaseTexture8, IDirect3DResource8)
  377. begin_methods()
  378. /* IDirect3DResource8 methods */;internal
  379. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  380. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  381. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  382. declare_method(FreePrivateData, REFGUID refguid);
  383. declare_method2(DWORD, SetPriority, DWORD PriorityNew);
  384. declare_method2(DWORD, GetPriority);
  385. declare_method2(void, PreLoad);
  386. declare_method2(D3DRESOURCETYPE, GetType);
  387. /* IDirect3DBaseTexture8 methods */;internal
  388. declare_method2(DWORD, SetLOD, DWORD LODNew);
  389. declare_method2(DWORD, GetLOD);
  390. declare_method2(DWORD, GetLevelCount);
  391. end_methods()
  392. end_interface()
  393. begin_interface(IDirect3DTexture8, IDirect3DBaseTexture8)
  394. begin_methods()
  395. /* IDirect3DResource8 methods */;internal
  396. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  397. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  398. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  399. declare_method(FreePrivateData, REFGUID refguid);
  400. declare_method2(DWORD, SetPriority, DWORD PriorityNew);
  401. declare_method2(DWORD, GetPriority);
  402. declare_method2(void, PreLoad);
  403. declare_method2(D3DRESOURCETYPE, GetType);
  404. /* IDirect3DBaseTexture8 methods */;internal
  405. declare_method2(DWORD, SetLOD, DWORD LODNew);
  406. declare_method2(DWORD, GetLOD);
  407. declare_method2(DWORD, GetLevelCount);
  408. /* IDirect3DTexture8 methods */;internal
  409. declare_method(GetLevelDesc, UINT Level, D3DSURFACE_DESC *pDesc);
  410. declare_method(GetSurfaceLevel, UINT Level, IDirect3DSurface8** ppSurfaceLevel);
  411. declare_method(LockRect, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
  412. declare_method(UnlockRect, UINT Level)
  413. declare_method(AddDirtyRect, CONST RECT* pDirtyRect);
  414. end_methods()
  415. end_interface()
  416. begin_interface(IDirect3DVolumeTexture8, IDirect3DBaseTexture8)
  417. begin_methods()
  418. /* IDirect3DResource8 methods */;internal
  419. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  420. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  421. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  422. declare_method(FreePrivateData, REFGUID refguid);
  423. declare_method2(DWORD, SetPriority, DWORD PriorityNew);
  424. declare_method2(DWORD, GetPriority);
  425. declare_method2(void, PreLoad);
  426. declare_method2(D3DRESOURCETYPE, GetType);
  427. /* IDirect3DBaseTexture8 methods */;internal
  428. declare_method2(DWORD, SetLOD, DWORD LODNew);
  429. declare_method2(DWORD, GetLOD);
  430. declare_method2(DWORD, GetLevelCount);
  431. /* IDirect3DVolumeTexture methods */;internal
  432. declare_method(GetLevelDesc, UINT Level, D3DVOLUME_DESC *pDesc);
  433. declare_method(GetVolumeLevel, UINT Level, IDirect3DVolume8** ppVolumeLevel);
  434. declare_method(LockBox, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
  435. declare_method(UnlockBox, UINT Level);
  436. declare_method(AddDirtyBox, CONST D3DBOX* pDirtyBox);
  437. end_methods()
  438. end_interface()
  439. begin_interface(IDirect3DCubeTexture8, IDirect3DBaseTexture8)
  440. begin_methods()
  441. /* IDirect3DResource8 methods */;internal
  442. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  443. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  444. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  445. declare_method(FreePrivateData, REFGUID refguid);
  446. declare_method2(DWORD, SetPriority, DWORD PriorityNew);
  447. declare_method2(DWORD, GetPriority);
  448. declare_method2(void, PreLoad);
  449. declare_method2(D3DRESOURCETYPE, GetType);
  450. /* IDirect3DBaseTexture8 methods */;internal
  451. declare_method2(DWORD, SetLOD, DWORD LODNew);
  452. declare_method2(DWORD, GetLOD);
  453. declare_method2(DWORD, GetLevelCount);
  454. /* IDirect3DCubeTexture8 methods */;internal
  455. declare_method(GetLevelDesc, UINT Level, D3DSURFACE_DESC *pDesc);
  456. declare_method(GetCubeMapSurface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8** ppCubeMapSurface);
  457. declare_method(LockRect, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
  458. declare_method(UnlockRect, D3DCUBEMAP_FACES FaceType, UINT Level)
  459. declare_method(AddDirtyRect, D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect);
  460. end_methods()
  461. end_interface()
  462. begin_interface(IDirect3DVertexBuffer8, IDirect3DResource8)
  463. begin_methods()
  464. /* IDirect3DResource8 methods */;internal
  465. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  466. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  467. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  468. declare_method(FreePrivateData, REFGUID refguid);
  469. declare_method2(DWORD, SetPriority, DWORD PriorityNew);
  470. declare_method2(DWORD, GetPriority);
  471. declare_method2(void, PreLoad);
  472. declare_method2(D3DRESOURCETYPE, GetType);
  473. /* IDirect3DVertexBuffer8 methods */;internal
  474. declare_method(Lock, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
  475. declare_method(Unlock);
  476. declare_method(GetDesc, D3DVERTEXBUFFER_DESC *pDesc);
  477. end_methods()
  478. end_interface()
  479. begin_interface(IDirect3DIndexBuffer8, IDirect3DResource8)
  480. begin_methods()
  481. /* IDirect3DResource8 methods */;internal
  482. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  483. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  484. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  485. declare_method(FreePrivateData, REFGUID refguid);
  486. declare_method2(DWORD, SetPriority, DWORD PriorityNew);
  487. declare_method2(DWORD, GetPriority);
  488. declare_method2(void, PreLoad);
  489. declare_method2(D3DRESOURCETYPE, GetType);
  490. /* IDirect3DIndexBuffer8 methods */;internal
  491. declare_method(Lock, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
  492. declare_method(Unlock);
  493. declare_method(GetDesc, D3DINDEXBUFFER_DESC *pDesc);
  494. end_methods()
  495. end_interface()
  496. begin_interface(IDirect3DSurface8)
  497. begin_methods()
  498. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  499. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  500. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  501. declare_method(FreePrivateData, REFGUID refguid);
  502. declare_method(GetContainer, REFIID riid, void** ppContainer);
  503. declare_method(GetDesc, D3DSURFACE_DESC *pDesc);
  504. declare_method(LockRect, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
  505. declare_method(UnlockRect);
  506. end_methods()
  507. end_interface()
  508. begin_interface(IDirect3DVolume8)
  509. begin_methods()
  510. declare_method(GetDevice, IDirect3DDevice8** ppDevice);
  511. declare_method(SetPrivateData, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
  512. declare_method(GetPrivateData, REFGUID refguid, void* pData, DWORD* pSizeOfData);
  513. declare_method(FreePrivateData, REFGUID refguid);
  514. declare_method(GetContainer, REFIID riid, void** ppContainer);
  515. declare_method(GetDesc, D3DVOLUME_DESC *pDesc);
  516. declare_method(LockBox, D3DLOCKED_BOX * pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
  517. declare_method(UnlockBox);
  518. end_methods()
  519. end_interface()
  520. /****************************************************************************
  521. * Flags for SetPrivateData method on all D3D8 interfaces
  522. *
  523. * The passed pointer is an IUnknown ptr. The SizeOfData argument to SetPrivateData
  524. * must be set to sizeof(IUnknown*). Direct3D will call AddRef through this
  525. * pointer and Release when the private data is destroyed. The data will be
  526. * destroyed when another SetPrivateData with the same GUID is set, when
  527. * FreePrivateData is called, or when the D3D8 object is freed.
  528. ****************************************************************************/
  529. #define D3DSPD_IUNKNOWN 0x00000001L
  530. /****************************************************************************
  531. *
  532. * Parameter for IDirect3D8 Enum and GetCaps8 functions to get the info for
  533. * the current mode only.
  534. *
  535. ****************************************************************************/
  536. #define D3DCURRENT_DISPLAY_MODE 0x00EFFFFFL
  537. /****************************************************************************
  538. *
  539. * Flags for IDirect3D8::CreateDevice's BehaviorFlags
  540. *
  541. ****************************************************************************/
  542. #define D3DCREATE_FPU_PRESERVE 0x00000002L
  543. #define D3DCREATE_MULTITHREADED 0x00000004L
  544. #define D3DCREATE_PUREDEVICE 0x00000010L
  545. #define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0x00000020L
  546. #define D3DCREATE_HARDWARE_VERTEXPROCESSING 0x00000040L
  547. #define D3DCREATE_MIXED_VERTEXPROCESSING 0x00000080L
  548. #define D3DCREATE_DISABLE_DRIVER_MANAGEMENT 0x00000100L
  549. #define D3DCREATE_SHOW_DP2ERROR 0x40000000L ;internal
  550. #define D3DCREATE_INTERNALTEMPDEVICE 0x80000000L ;internal
  551. #define VALID_D3DCREATE_FLAGS 0xC00001F6L ;internal
  552. /****************************************************************************
  553. *
  554. * Parameter for IDirect3D8::CreateDevice's iAdapter
  555. *
  556. ****************************************************************************/
  557. #define D3DADAPTER_DEFAULT 0
  558. /****************************************************************************
  559. *
  560. * Flags for IDirect3D8::EnumAdapters
  561. *
  562. ****************************************************************************/
  563. #define D3DENUM_NO_WHQL_LEVEL 0x00000002L
  564. #define VALID_D3DENUM_FLAGS 0x00000002L ;internal
  565. /****************************************************************************
  566. *
  567. * Maximum number of back-buffers supported in DX8
  568. *
  569. ****************************************************************************/
  570. #define D3DPRESENT_BACK_BUFFERS_MAX 3L
  571. /****************************************************************************
  572. *
  573. * Flags for IDirect3DDevice8::SetGammaRamp
  574. *
  575. ****************************************************************************/
  576. #define D3DSGR_NO_CALIBRATION 0x00000000L
  577. #define D3DSGR_CALIBRATE 0x00000001L
  578. /****************************************************************************
  579. *
  580. * Flags for IDirect3DDevice8::SetCursorPosition
  581. *
  582. ****************************************************************************/
  583. #define D3DCURSOR_IMMEDIATE_UPDATE 0x00000001L
  584. /****************************************************************************
  585. *
  586. * Flags for DrawPrimitive/DrawIndexedPrimitive
  587. * Also valid for Begin/BeginIndexed
  588. * Also valid for VertexBuffer::CreateVertexBuffer
  589. ;begin_internal
  590. *
  591. * Only 8 low bits are available for these flags. Remember this when
  592. * adding new flags.
  593. *
  594. ;end_internal
  595. ****************************************************************************/
  596. /*
  597. * DirectDraw error codes
  598. */
  599. #define _FACD3D 0x876
  600. #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
  601. /*
  602. * Direct3D Errors
  603. */
  604. #define D3D_OK S_OK
  605. ;begin_internal
  606. // Error codes added in DX6 and later should be in range 2048-3071
  607. // until further notice.
  608. // Error codes for ValidateDevice that are potentially returned by the
  609. // driver. Even though they are not referenced anywhere in our runtime,
  610. // they should not be deleted.
  611. ;end_internal
  612. #define D3DERR_WRONGTEXTUREFORMAT MAKE_D3DHRESULT(2072)
  613. #define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_D3DHRESULT(2073)
  614. #define D3DERR_UNSUPPORTEDCOLORARG MAKE_D3DHRESULT(2074)
  615. #define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_D3DHRESULT(2075)
  616. #define D3DERR_UNSUPPORTEDALPHAARG MAKE_D3DHRESULT(2076)
  617. #define D3DERR_TOOMANYOPERATIONS MAKE_D3DHRESULT(2077)
  618. #define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_D3DHRESULT(2078)
  619. #define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_D3DHRESULT(2079)
  620. #define D3DERR_CONFLICTINGRENDERSTATE MAKE_D3DHRESULT(2081)
  621. #define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_D3DHRESULT(2082)
  622. #define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_D3DHRESULT(2086)
  623. #define D3DERR_DRIVERINTERNALERROR MAKE_D3DHRESULT(2087)
  624. // New errors for DX8 Framework ; internal
  625. #define D3DERR_NOTFOUND MAKE_D3DHRESULT(2150)
  626. #define D3DERR_MOREDATA MAKE_D3DHRESULT(2151)
  627. #define D3DERR_DEVICELOST MAKE_D3DHRESULT(2152)
  628. #define D3DERR_DEVICENOTRESET MAKE_D3DHRESULT(2153)
  629. #define D3DERR_NOTAVAILABLE MAKE_D3DHRESULT(2154)
  630. // This is makes the D3DERR match the legacy DD error (DDERR_OUTOFVIDEOMEMORY) ;internal
  631. #define D3DERR_OUTOFVIDEOMEMORY MAKE_D3DHRESULT(380)
  632. #define D3DERR_INVALIDDEVICE MAKE_D3DHRESULT(2155)
  633. #define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
  634. #define D3DERR_DRIVERINVALIDCALL MAKE_D3DHRESULT(2157)
  635. #define D3DERR_DEFERRED_DP2ERROR MAKE_D3DHRESULT(2158) ; internal
  636. #ifdef __cplusplus
  637. };
  638. #endif
  639. #endif /* (DIRECT3D_VERSION >= 0x0800) */
  640. #endif /* _D3D_H_ */