home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / D3D.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  46.2 KB  |  899 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1995-1997 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:    d3d.h
  6.  *  Content:    Direct3D include file
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef _D3D_H_
  11. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  12. #define _D3D_H_
  13.  
  14. #include <stdlib.h>
  15.  
  16. #ifdef _WIN32
  17. #define COM_NO_WINDOWS_H
  18. #include <objbase.h>
  19. #else
  20. #include "d3dcom.h"
  21. #endif
  22.  
  23. #ifdef _WIN32
  24. #define D3DAPI WINAPI
  25. #else
  26. #define D3DAPI
  27. #endif
  28.  
  29. /*
  30.  * Interface IID's
  31.  */
  32. #if defined( _WIN32 ) && !defined( _NO_COM)
  33. DEFINE_GUID( IID_IDirect3D,             0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  34. DEFINE_GUID( IID_IDirect3D2,            0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
  35.  
  36. DEFINE_GUID( IID_IDirect3DRampDevice,   0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  37. DEFINE_GUID( IID_IDirect3DRGBDevice,    0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  38. DEFINE_GUID( IID_IDirect3DHALDevice,    0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  39. DEFINE_GUID( IID_IDirect3DMMXDevice,    0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
  40.  
  41. DEFINE_GUID( IID_IDirect3DDevice,        0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
  42. DEFINE_GUID( IID_IDirect3DDevice2,    0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
  43. DEFINE_GUID( IID_IDirect3DTexture,      0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  44. DEFINE_GUID( IID_IDirect3DTexture2,    0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
  45. DEFINE_GUID( IID_IDirect3DLight,        0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  46. DEFINE_GUID( IID_IDirect3DMaterial,     0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  47. DEFINE_GUID( IID_IDirect3DMaterial2,    0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
  48. DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  49. DEFINE_GUID( IID_IDirect3DViewport,     0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  50. DEFINE_GUID( IID_IDirect3DViewport2,    0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
  51. #endif
  52.  
  53. /*
  54.  * Data structures
  55.  */
  56. #ifdef __cplusplus
  57.  
  58. /* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
  59. struct IDirect3D;
  60. struct IDirect3D2;
  61. struct IDirect3DDevice;
  62. struct IDirect3DDevice2;
  63. struct IDirect3DExecuteBuffer;
  64. struct IDirect3DLight;
  65. struct IDirect3DMaterial;
  66. struct IDirect3DMaterial2;
  67. struct IDirect3DTexture;
  68. struct IDirect3DTexture2;
  69. struct IDirect3DViewport;
  70. struct IDirect3DViewport2;
  71. typedef struct IDirect3D        *LPDIRECT3D;
  72. typedef struct IDirect3D2        *LPDIRECT3D2;
  73. typedef struct IDirect3DDevice        *LPDIRECT3DDEVICE;
  74. typedef struct IDirect3DDevice2        *LPDIRECT3DDEVICE2;
  75. typedef struct IDirect3DExecuteBuffer    *LPDIRECT3DEXECUTEBUFFER;
  76. typedef struct IDirect3DLight        *LPDIRECT3DLIGHT;
  77. typedef struct IDirect3DMaterial    *LPDIRECT3DMATERIAL;
  78. typedef struct IDirect3DMaterial2    *LPDIRECT3DMATERIAL2;
  79. typedef struct IDirect3DTexture        *LPDIRECT3DTEXTURE;
  80. typedef struct IDirect3DTexture2        *LPDIRECT3DTEXTURE2;
  81. typedef struct IDirect3DViewport    *LPDIRECT3DVIEWPORT;
  82. typedef struct IDirect3DViewport2    *LPDIRECT3DVIEWPORT2;
  83.  
  84. #else
  85.  
  86. typedef struct IDirect3D        *LPDIRECT3D;
  87. typedef struct IDirect3D2       *LPDIRECT3D2;
  88. typedef struct IDirect3DDevice        *LPDIRECT3DDEVICE;
  89. typedef struct IDirect3DDevice2        *LPDIRECT3DDEVICE2;
  90. typedef struct IDirect3DExecuteBuffer    *LPDIRECT3DEXECUTEBUFFER;
  91. typedef struct IDirect3DLight        *LPDIRECT3DLIGHT;
  92. typedef struct IDirect3DMaterial    *LPDIRECT3DMATERIAL;
  93. typedef struct IDirect3DMaterial2    *LPDIRECT3DMATERIAL2;
  94. typedef struct IDirect3DTexture        *LPDIRECT3DTEXTURE;
  95. typedef struct IDirect3DTexture2        *LPDIRECT3DTEXTURE2;
  96. typedef struct IDirect3DViewport    *LPDIRECT3DVIEWPORT;
  97. typedef struct IDirect3DViewport2    *LPDIRECT3DVIEWPORT2;
  98.  
  99. #endif
  100.  
  101. #include "d3dtypes.h"
  102. #include "d3dcaps.h"
  103.  
  104. #ifdef __cplusplus
  105. extern "C" {
  106. #endif
  107.  
  108. /*
  109.  * IDirect3D
  110.  */
  111. #undef INTERFACE
  112. #define INTERFACE IDirect3D
  113. DECLARE_INTERFACE_(IDirect3D, IUnknown)
  114. {
  115.     /*** IUnknown methods ***/
  116.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  117.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  118.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  119.     /*** IDirect3D methods ***/
  120.     STDMETHOD(Initialize) (THIS_ REFIID) PURE;
  121.     STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
  122.     STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
  123.     STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE;
  124.     STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE;
  125.     STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
  126. };
  127.  
  128. #if !defined(__cplusplus) || defined(CINTERFACE)
  129. #define IDirect3D_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  130. #define IDirect3D_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  131. #define IDirect3D_Release(p)                      (p)->lpVtbl->Release(p)
  132. #define IDirect3D_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  133. #define IDirect3D_EnumDevices(p, a, b)            (p)->lpVtbl->EnumDevices(p, a, b)
  134. #define IDirect3D_CreateLight(p, a, b)            (p)->lpVtbl->CreateLight(p, a, b)
  135. #define IDirect3D_CreateMaterial(p, a, b)         (p)->lpVtbl->CreateMaterial(p, a, b)
  136. #define IDirect3D_CreateViewport(p, a, b)         (p)->lpVtbl->CreateViewport(p, a, b)
  137. #define IDirect3D_FindDevice(p, a, b)             (p)->lpVtbl->FindDevice(p, a, b)
  138. #else
  139. #define IDirect3D_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  140. #define IDirect3D_AddRef(p)                       (p)->AddRef()
  141. #define IDirect3D_Release(p)                      (p)->Release()
  142. #define IDirect3D_Initialize(p, a)                (p)->Initialize(a)
  143. #define IDirect3D_EnumDevices(p, a, b)            (p)->EnumDevices(a, b)
  144. #define IDirect3D_CreateLight(p, a, b)            (p)->CreateLight(a, b)
  145. #define IDirect3D_CreateMaterial(p, a, b)         (p)->CreateMaterial(a, b)
  146. #define IDirect3D_CreateViewport(p, a, b)         (p)->CreateViewport(a, b)
  147. #define IDirect3D_FindDevice(p, a, b)             (p)->FindDevice(a, b)
  148. #endif
  149.  
  150. /*
  151.  * IDirect3D2
  152.  */
  153. #undef INTERFACE
  154. #define INTERFACE IDirect3D2
  155. DECLARE_INTERFACE_(IDirect3D2, IUnknown)
  156. {
  157.     /*** IUnknown methods ***/
  158.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  159.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  160.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  161.     /*** IDirect3D methods ***/
  162.     STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
  163.     STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
  164.     STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL2*, IUnknown*) PURE;
  165.     STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT2*, IUnknown*) PURE;
  166.     STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
  167.  
  168.     STDMETHOD(CreateDevice)(THIS_ REFCLSID, LPDIRECTDRAWSURFACE, LPDIRECT3DDEVICE2 *) PURE;
  169.  
  170. };
  171.  
  172. #if !defined(__cplusplus) || defined(CINTERFACE)
  173. #define IDirect3D2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  174. #define IDirect3D2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  175. #define IDirect3D2_Release(p)                      (p)->lpVtbl->Release(p)
  176. #define IDirect3D2_EnumDevices(p, a, b)            (p)->lpVtbl->EnumDevices(p, a, b)
  177. #define IDirect3D2_CreateLight(p, a, b)            (p)->lpVtbl->CreateLight(p, a, b)
  178. #define IDirect3D2_CreateMaterial(p, a, b)         (p)->lpVtbl->CreateMaterial(p, a, b)
  179. #define IDirect3D2_CreateViewport(p, a, b)         (p)->lpVtbl->CreateViewport(p, a, b)
  180. #define IDirect3D2_FindDevice(p, a, b)             (p)->lpVtbl->FindDevice(p, a, b)
  181. #define IDirect3D2_CreateDevice(p, a, b, c)           (p)->lpVtbl->CreateDevice(p, a, b, c)
  182. #else
  183. #define IDirect3D2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  184. #define IDirect3D2_AddRef(p)                       (p)->AddRef()
  185. #define IDirect3D2_Release(p)                      (p)->Release()
  186. #define IDirect3D2_EnumDevices(p, a, b)            (p)->EnumDevices(a, b)
  187. #define IDirect3D2_CreateLight(p, a, b)            (p)->CreateLight(a, b)
  188. #define IDirect3D2_CreateMaterial(p, a, b)         (p)->CreateMaterial(a, b)
  189. #define IDirect3D2_CreateViewport(p, a, b)         (p)->CreateViewport(a, b)
  190. #define IDirect3D2_FindDevice(p, a, b)             (p)->FindDevice(a, b)
  191. #define IDirect3D2_CreateDevice(p, a, b, c)        (p)->CreateDevice(a, b, c)
  192. #endif
  193.  
  194. /*
  195.  * IDirect3DDevice
  196.  */
  197. #undef INTERFACE
  198. #define INTERFACE IDirect3DDevice
  199. DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
  200. {
  201.     /*** IUnknown methods ***/
  202.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  203.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  204.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  205.     /*** IDirect3DDevice methods ***/
  206.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE;
  207.     STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
  208.     STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE;
  209.     STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE;
  210.     STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
  211.     STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE;
  212.     STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
  213.     STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
  214.     STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE;
  215.     STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE;
  216.     STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE;
  217.     STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
  218.     STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE;
  219.     STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, const LPD3DMATRIX) PURE;
  220.     STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
  221.     STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE;
  222.     STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
  223.     STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
  224.     STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;
  225. };
  226.  
  227. #if !defined(__cplusplus) || defined(CINTERFACE)
  228. #define IDirect3DDevice_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  229. #define IDirect3DDevice_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  230. #define IDirect3DDevice_Release(p)                      (p)->lpVtbl->Release(p)
  231. #define IDirect3DDevice_Initialize(p, a, b, c)          (p)->lpVtbl->Initialize(p, a, b, c)
  232. #define IDirect3DDevice_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  233. #define IDirect3DDevice_SwapTextureHandles(p, a, b)     (p)->lpVtbl->SwapTextureHandles(p, a, b)
  234. #define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->CreateExecuteBuffer(p, a, b, c)
  235. #define IDirect3DDevice_GetStats(p, a)                  (p)->lpVtbl->GetStats(p, a)
  236. #define IDirect3DDevice_Execute(p, a, b, c)             (p)->lpVtbl->Execute(p, a, b, c)
  237. #define IDirect3DDevice_AddViewport(p, a)               (p)->lpVtbl->AddViewport(p, a)
  238. #define IDirect3DDevice_DeleteViewport(p, a)            (p)->lpVtbl->DeleteViewport(p, a)
  239. #define IDirect3DDevice_NextViewport(p, a, b)           (p)->lpVtbl->NextViewport(p, a, b)
  240. #define IDirect3DDevice_Pick(p, a, b, c, d)             (p)->lpVtbl->Pick(p, a, b, c, d)
  241. #define IDirect3DDevice_GetPickRecords(p, a, b)         (p)->lpVtbl->GetPickRecords(p, a, b)
  242. #define IDirect3DDevice_EnumTextureFormats(p, a, b)     (p)->lpVtbl->EnumTextureFormats(p, a, b)
  243. #define IDirect3DDevice_CreateMatrix(p, a)              (p)->lpVtbl->CreateMatrix(p, a)
  244. #define IDirect3DDevice_SetMatrix(p, a, b)              (p)->lpVtbl->SetMatrix(p, a, b)
  245. #define IDirect3DDevice_GetMatrix(p, a, b)              (p)->lpVtbl->GetMatrix(p, a, b)
  246. #define IDirect3DDevice_DeleteMatrix(p, a)              (p)->lpVtbl->DeleteMatrix(p, a)
  247. #define IDirect3DDevice_BeginScene(p)                   (p)->lpVtbl->BeginScene(p)
  248. #define IDirect3DDevice_EndScene(p)                     (p)->lpVtbl->EndScene(p)
  249. #define IDirect3DDevice_GetDirect3D(p, a)               (p)->lpVtbl->GetDirect3D(p, a)
  250. #else
  251. #define IDirect3DDevice_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  252. #define IDirect3DDevice_AddRef(p)                       (p)->AddRef()
  253. #define IDirect3DDevice_Release(p)                      (p)->Release()
  254. #define IDirect3DDevice_Initialize(p, a, b, c)          (p)->Initialize(a, b, c)
  255. #define IDirect3DDevice_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  256. #define IDirect3DDevice_SwapTextureHandles(p, a, b)     (p)->SwapTextureHandles(a, b)
  257. #define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->CreateExecuteBuffer(a, b, c)
  258. #define IDirect3DDevice_GetStats(p, a)                  (p)->GetStats(a)
  259. #define IDirect3DDevice_Execute(p, a, b, c)             (p)->Execute(a, b, c)
  260. #define IDirect3DDevice_AddViewport(p, a)               (p)->AddViewport(a)
  261. #define IDirect3DDevice_DeleteViewport(p, a)            (p)->DeleteViewport(a)
  262. #define IDirect3DDevice_NextViewport(p, a, b)           (p)->NextViewport(a, b)
  263. #define IDirect3DDevice_Pick(p, a, b, c, d)             (p)->Pick(a, b, c, d)
  264. #define IDirect3DDevice_GetPickRecords(p, a, b)         (p)->GetPickRecords(a, b)
  265. #define IDirect3DDevice_EnumTextureFormats(p, a, b)     (p)->EnumTextureFormats(a, b)
  266. #define IDirect3DDevice_CreateMatrix(p, a)              (p)->CreateMatrix(a)
  267. #define IDirect3DDevice_SetMatrix(p, a, b)              (p)->SetMatrix(a, b)
  268. #define IDirect3DDevice_GetMatrix(p, a, b)              (p)->GetMatrix(a, b)
  269. #define IDirect3DDevice_DeleteMatrix(p, a)              (p)->DeleteMatrix(a)
  270. #define IDirect3DDevice_BeginScene(p)                   (p)->BeginScene()
  271. #define IDirect3DDevice_EndScene(p)                     (p)->EndScene()
  272. #define IDirect3DDevice_GetDirect3D(p, a)               (p)->GetDirect3D(a)
  273. #endif
  274.  
  275. /*
  276.  * IDirect3DDevice2
  277.  */
  278. #undef INTERFACE
  279. #define INTERFACE IDirect3DDevice2
  280. DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown)
  281. {
  282.     /*** IUnknown methods ***/
  283.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  284.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  285.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  286.     /*** IDirect3DDevice2 methods ***/
  287.     STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
  288.     STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2) PURE;
  289.     STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
  290.     STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
  291.     STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
  292.     STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT2, LPDIRECT3DVIEWPORT2*, DWORD) PURE;
  293.     STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
  294.     STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
  295.     STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
  296.     STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D2*) PURE;
  297.  
  298.     /*** DrawPrimitive API ***/
  299.     STDMETHOD(SetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
  300.     STDMETHOD(GetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2 *) PURE;
  301.  
  302.     STDMETHOD(SetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
  303.     STDMETHOD(GetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE *) PURE;
  304.  
  305.     STDMETHOD(Begin) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, DWORD) PURE;
  306.     STDMETHOD(BeginIndexed) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
  307.     STDMETHOD(Vertex) (THIS_ LPVOID) PURE;
  308.     STDMETHOD(Index) (THIS_ WORD) PURE;
  309.     STDMETHOD(End) (THIS_ DWORD) PURE;
  310.  
  311.     STDMETHOD(GetRenderState) (THIS_ D3DRENDERSTATETYPE, LPDWORD) PURE;
  312.     STDMETHOD(SetRenderState) (THIS_ D3DRENDERSTATETYPE, DWORD) PURE;
  313.     STDMETHOD(GetLightState) (THIS_ D3DLIGHTSTATETYPE, LPDWORD) PURE;
  314.     STDMETHOD(SetLightState) (THIS_ D3DLIGHTSTATETYPE, DWORD) PURE;
  315.     STDMETHOD(SetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
  316.     STDMETHOD(GetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
  317.     STDMETHOD(MultiplyTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
  318.  
  319.     STDMETHOD(DrawPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
  320.     STDMETHOD(DrawIndexedPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, LPWORD, DWORD, DWORD) PURE;
  321.  
  322.     STDMETHOD(SetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
  323.     STDMETHOD(GetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
  324. };
  325.  
  326. #if !defined(__cplusplus) || defined(CINTERFACE)
  327. #define IDirect3DDevice2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  328. #define IDirect3DDevice2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  329. #define IDirect3DDevice2_Release(p)                      (p)->lpVtbl->Release(p)
  330. #define IDirect3DDevice2_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  331. #define IDirect3DDevice2_SwapTextureHandles(p, a, b)     (p)->lpVtbl->SwapTextureHandles(p, a, b)
  332. #define IDirect3DDevice2_GetStats(p, a)                  (p)->lpVtbl->CreateViewport(p, a)
  333. #define IDirect3DDevice2_AddViewport(p, a)               (p)->lpVtbl->AddViewport(p, a)
  334. #define IDirect3DDevice2_DeleteViewport(p, a)            (p)->lpVtbl->DeleteViewport(p, a)
  335. #define IDirect3DDevice2_NextViewport(p, a, b)           (p)->lpVtbl->NextViewport(p, a, b)
  336. #define IDirect3DDevice2_EnumTextureFormats(p, a, b)     (p)->lpVtbl->EnumTextureFormats(p, a, b)
  337. #define IDirect3DDevice2_BeginScene(p)                   (p)->lpVtbl->BeginScene(p)
  338. #define IDirect3DDevice2_EndScene(p)                     (p)->lpVtbl->EndScene(p)
  339. #define IDirect3DDevice2_GetDirect3D(p, a)               (p)->lpVtbl->GetDirect3D(p, a)
  340.  
  341. #define IDirect3DDevice2_SetCurrentViewport(p, a)        (p)->lpVtbl->SetCurrentViewport(p, a)
  342. #define IDirect3DDevice2_GetCurrentViewport(p, a)        (p)->lpVtbl->GetCurrentViewport(p, a)
  343.  
  344. #define IDirect3DDevice2_SetRenderTarget(p, a, b)        (p)->lpVtbl->SetRenderTarget(p, a, b)
  345. #define IDirect3DDevice2_GetRenderTarget(p, a)             (p)->lpVtbl->GetRenderTarget(p, a)
  346.  
  347. #define IDirect3DDevice2_Begin(p, a, b, c)               (p)->lpVtbl->Begin(p, a, b, c)
  348. #define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e)  (p)->lpVtbl->Begin(p, a, b, c, d, e)
  349. #define IDirect3DDevice2_Vertex(p, a)                    (p)->lpVtbl->Vertex(p, a)
  350. #define IDirect3DDevice2_Index(p, a)                     (p)->lpVtbl->Index(p, a)
  351. #define IDirect3DDevice2_End(p, a)                       (p)->lpVtbl->End(p, a)
  352.  
  353. #define IDirect3DDevice2_GetRenderState(p, a, b)         (p)->lpVtbl->GetRenderState(p, a, b)
  354. #define IDirect3DDevice2_SetRenderState(p, a, b)         (p)->lpVtbl->SetRenderState(p, a, b)
  355. #define IDirect3DDevice2_GetLightState(p, a, b)          (p)->lpVtbl->GetLightState(p, a, b)
  356. #define IDirect3DDevice2_SetLightState(p, a, b)          (p)->lpVtbl->SetLightState(p, a, b)
  357. #define IDirect3DDevice2_SetTransform(p, a, b)           (p)->lpVtbl->SetTransform(p, a, b)
  358. #define IDirect3DDevice2_GetTransform(p, a, b)           (p)->lpVtbl->GetTransform(p, a, b)
  359. #define IDirect3DDevice2_MultiplyTransform(p, a, b)      (p)->lpVtbl->MultiplyTransform(p, a, b)
  360.  
  361. #define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->lpVtbl->DrawPrimitive(p, a, b, c, d, e)
  362. #define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
  363.                                                          (p)->lpVtbl->DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
  364. #define IDirect3DDevice2_SetClipStatus(p, a)                 (p)->lpVtbl->SetClipStatus(p, a)
  365. #define IDirect3DDevice2_GetClipStatus(p, a)                 (p)->lpVtbl->GetClipStatus(p, a)
  366. #else
  367. #define IDirect3DDevice2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  368. #define IDirect3DDevice2_AddRef(p)                       (p)->AddRef()
  369. #define IDirect3DDevice2_Release(p)                      (p)->Release()
  370. #define IDirect3DDevice2_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  371. #define IDirect3DDevice2_SwapTextureHandles(p, a, b)     (p)->SwapTextureHandles(a, b)
  372. #define IDirect3DDevice2_GetStats(p, a)                  (p)->CreateViewport(a)
  373. #define IDirect3DDevice2_AddViewport(p, a)               (p)->AddViewport(a)
  374. #define IDirect3DDevice2_DeleteViewport(p, a)            (p)->DeleteViewport(a)
  375. #define IDirect3DDevice2_NextViewport(p, a, b)           (p)->NextViewport(a, b)
  376. #define IDirect3DDevice2_EnumTextureFormats(p, a, b)     (p)->EnumTextureFormats(a, b)
  377. #define IDirect3DDevice2_BeginScene(p)                   (p)->BeginScene()
  378. #define IDirect3DDevice2_EndScene(p)                     (p)->EndScene()
  379. #define IDirect3DDevice2_GetDirect3D(p, a)               (p)->GetDirect3D(a)
  380.  
  381. #define IDirect3DDevice2_SetCurrentViewport(p, a)        (p)->SetCurrentViewport(a)
  382. #define IDirect3DDevice2_GetCurrentViewport(p, a)        (p)->GetCurrentViewport(a)
  383.  
  384. #define IDirect3DDevice2_SetRenderTarget(p, a, b)        (p)->SetRenderTarget(a, b)
  385. #define IDirect3DDevice2_GetRenderTarget(p, a)           (p)->GetRenderTarget(a)
  386.  
  387. #define IDirect3DDevice2_Begin(p, a, b, c)               (p)->Begin(a, b, c)
  388. #define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e)  (p)->Begin(a, b, c, d, e)
  389. #define IDirect3DDevice2_Vertex(p, a)                    (p)->Vertex(a)
  390. #define IDirect3DDevice2_Index(p, a)                     (p)->Index(a)
  391. #define IDirect3DDevice2_End(p, a)                       (p)->End(a)
  392.  
  393. #define IDirect3DDevice2_GetRenderState(p, a, b)         (p)->GetRenderState(a, b)
  394. #define IDirect3DDevice2_SetRenderState(p, a, b)         (p)->SetRenderState(a, b)
  395. #define IDirect3DDevice2_GetLightState(p, a, b)          (p)->GetLightState(a, b)
  396. #define IDirect3DDevice2_SetLightState(p, a, b)          (p)->SetLightState(a, b)
  397. #define IDirect3DDevice2_SetTransform(p, a, b)           (p)->SetTransform(a, b)
  398. #define IDirect3DDevice2_GetTransform(p, a, b)           (p)->GetTransform(a, b)
  399. #define IDirect3DDevice2_MultiplyTransform(p, a, b)      (p)->MultiplyTransform(a, b)
  400.  
  401. #define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->DrawPrimitive(a, b, c, d, e)
  402. #define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
  403.                                                          (p)->DrawIndexedPrimitive(a, b, c, d, e, f, g)
  404. #define IDirect3DDevice2_SetClipStatus(p, a)                             (p)->SetClipStatus(a)
  405. #define IDirect3DDevice2_GetClipStatus(p, a)                             (p)->GetClipStatus(a)
  406.  
  407. #endif
  408.  
  409. /*
  410.  * IDirect3DExecuteBuffer
  411.  */
  412. #undef INTERFACE
  413. #define INTERFACE IDirect3DExecuteBuffer
  414. DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
  415. {
  416.     /*** IUnknown methods ***/
  417.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  418.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  419.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  420.     /*** IDirect3DExecuteBuffer methods ***/
  421.     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE;
  422.     STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
  423.     STDMETHOD_(HRESULT, Unlock) (THIS) PURE;
  424.     STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
  425.     STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
  426.     STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE;
  427.     STDMETHOD(Optimize) (THIS_ DWORD) PURE;
  428. };
  429.  
  430. #if !defined(__cplusplus) || defined(CINTERFACE)
  431. #define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  432. #define IDirect3DExecuteBuffer_AddRef(p)               (p)->lpVtbl->AddRef(p)
  433. #define IDirect3DExecuteBuffer_Release(p)              (p)->lpVtbl->Release(p)
  434. #define IDirect3DExecuteBuffer_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
  435. #define IDirect3DExecuteBuffer_Lock(p, a)              (p)->lpVtbl->Lock(p, a)
  436. #define IDirect3DExecuteBuffer_Unlock(p)               (p)->lpVtbl->Unlock(p)
  437. #define IDirect3DExecuteBuffer_SetExecuteData(p, a)    (p)->lpVtbl->SetExecuteData(p, a)
  438. #define IDirect3DExecuteBuffer_GetExecuteData(p, a)    (p)->lpVtbl->GetExecuteData(p, a)
  439. #define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validate(p, a, b, c, d)
  440. #define IDirect3DExecuteBuffer_Optimize(p, a)          (p)->lpVtbl->Optimize(p, a)
  441. #else
  442. #define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  443. #define IDirect3DExecuteBuffer_AddRef(p)               (p)->AddRef()
  444. #define IDirect3DExecuteBuffer_Release(p)              (p)->Release()
  445. #define IDirect3DExecuteBuffer_Initialize(p, a, b)     (p)->Initialize(a, b)
  446. #define IDirect3DExecuteBuffer_Lock(p, a)              (p)->Lock(a)
  447. #define IDirect3DExecuteBuffer_Unlock(p)               (p)->Unlock()
  448. #define IDirect3DExecuteBuffer_SetExecuteData(p, a)    (p)->SetExecuteData(a)
  449. #define IDirect3DExecuteBuffer_GetExecuteData(p, a)    (p)->GetExecuteData(a)
  450. #define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->Validate(a, b, c, d)
  451. #define IDirect3DExecuteBuffer_Optimize(p, a)          (p)->Optimize(a)
  452. #endif
  453.  
  454. /*
  455.  * IDirect3DLight
  456.  */
  457. #undef INTERFACE
  458. #define INTERFACE IDirect3DLight
  459. DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
  460. {
  461.     /*** IUnknown methods ***/
  462.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  463.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  464.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  465.     /*** IDirect3DLight methods ***/
  466.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  467.     STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE;
  468.     STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE;
  469. };
  470.  
  471. #if !defined(__cplusplus) || defined(CINTERFACE)
  472. #define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  473. #define IDirect3DLight_AddRef(p)               (p)->lpVtbl->AddRef(p)
  474. #define IDirect3DLight_Release(p)              (p)->lpVtbl->Release(p)
  475. #define IDirect3DLight_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
  476. #define IDirect3DLight_SetLight(p, a)          (p)->lpVtbl->SetLight(p, a)
  477. #define IDirect3DLight_GetLight(p, a)          (p)->lpVtbl->GetLight(p, a)
  478. #else
  479. #define IDirect3DLight_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  480. #define IDirect3DLight_AddRef(p)               (p)->AddRef()
  481. #define IDirect3DLight_Release(p)              (p)->Release()
  482. #define IDirect3DLight_Initialize(p, a)        (p)->Initialize(a)
  483. #define IDirect3DLight_SetLight(p, a)          (p)->SetLight(a)
  484. #define IDirect3DLight_GetLight(p, a)          (p)->GetLight(a)
  485. #endif
  486.  
  487. /*
  488.  * IDirect3DMaterial
  489.  */
  490. #undef INTERFACE
  491. #define INTERFACE IDirect3DMaterial
  492. DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
  493. {
  494.     /*** IUnknown methods ***/
  495.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  496.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  497.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  498.     /*** IDirect3DMaterial methods ***/
  499.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  500.     STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  501.     STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  502.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE;
  503.     STDMETHOD_(HRESULT, Reserve) (THIS) PURE;
  504.     STDMETHOD_(HRESULT, Unreserve) (THIS) PURE;
  505. };
  506.  
  507. #if !defined(__cplusplus) || defined(CINTERFACE)
  508. #define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  509. #define IDirect3DMaterial_AddRef(p)               (p)->lpVtbl->AddRef(p)
  510. #define IDirect3DMaterial_Release(p)              (p)->lpVtbl->Release(p)
  511. #define IDirect3DMaterial_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
  512. #define IDirect3DMaterial_SetMaterial(p, a)       (p)->lpVtbl->SetMaterial(p, a)
  513. #define IDirect3DMaterial_GetMaterial(p, a)       (p)->lpVtbl->GetMaterial(p, a)
  514. #define IDirect3DMaterial_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  515. #define IDirect3DMaterial_Reserve(p)              (p)->lpVtbl->Reserve(p)
  516. #define IDirect3DMaterial_Unreserve(p)            (p)->lpVtbl->Unreserve(p)
  517. #else
  518. #define IDirect3DMaterial_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  519. #define IDirect3DMaterial_AddRef(p)               (p)->AddRef()
  520. #define IDirect3DMaterial_Release(p)              (p)->Release()
  521. #define IDirect3DMaterial_Initialize(p, a)        (p)->Initialize(a)
  522. #define IDirect3DMaterial_SetMaterial(p, a)       (p)->SetMaterial(a)
  523. #define IDirect3DMaterial_GetMaterial(p, a)       (p)->GetMaterial(a)
  524. #define IDirect3DMaterial_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  525. #define IDirect3DMaterial_Reserve(p)              (p)->Reserve()
  526. #define IDirect3DMaterial_Unreserve(p)            (p)->Unreserve()
  527. #endif
  528.  
  529. /*
  530.  * IDirect3DMaterial2
  531.  */
  532. #undef INTERFACE
  533. #define INTERFACE IDirect3DMaterial2
  534. DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown)
  535. {
  536.     /*** IUnknown methods ***/
  537.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  538.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  539.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  540.     /*** IDirect3DMaterial2 methods ***/
  541.     STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  542.     STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  543.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DMATERIALHANDLE) PURE;
  544. };
  545.  
  546. #if !defined(__cplusplus) || defined(CINTERFACE)
  547. #define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  548. #define IDirect3DMaterial2_AddRef(p)               (p)->lpVtbl->AddRef(p)
  549. #define IDirect3DMaterial2_Release(p)              (p)->lpVtbl->Release(p)
  550. #define IDirect3DMaterial2_SetMaterial(p, a)       (p)->lpVtbl->SetMaterial(p, a)
  551. #define IDirect3DMaterial2_GetMaterial(p, a)       (p)->lpVtbl->GetMaterial(p, a)
  552. #define IDirect3DMaterial2_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  553. #else
  554. #define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  555. #define IDirect3DMaterial2_AddRef(p)               (p)->AddRef()
  556. #define IDirect3DMaterial2_Release(p)              (p)->Release()
  557. #define IDirect3DMaterial2_SetMaterial(p, a)       (p)->SetMaterial(a)
  558. #define IDirect3DMaterial2_GetMaterial(p, a)       (p)->GetMaterial(a)
  559. #define IDirect3DMaterial2_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  560. #endif
  561.  
  562. /*
  563.  * IDirect3DTexture
  564.  */
  565. #undef INTERFACE
  566. #define INTERFACE IDirect3DTexture
  567. DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
  568. {
  569.     /*** IUnknown methods ***/
  570.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  571.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  572.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  573.     /*** IDirect3DTexture methods ***/
  574.     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE;
  575.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE;
  576.     STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
  577.     STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE;
  578.     STDMETHOD_(HRESULT, Unload) (THIS) PURE;
  579. };
  580.  
  581. #if !defined(__cplusplus) || defined(CINTERFACE)
  582. #define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  583. #define IDirect3DTexture_AddRef(p)               (p)->lpVtbl->AddRef(p)
  584. #define IDirect3DTexture_Release(p)              (p)->lpVtbl->Release(p)
  585. #define IDirect3DTexture_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
  586. #define IDirect3DTexture_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  587. #define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
  588. #define IDirect3DTexture_Load(p, a)              (p)->lpVtbl->Load(p, a)
  589. #define IDirect3DTexture_Unload(p)               (p)->lpVtbl->Unload(p)
  590. #else
  591. #define IDirect3DTexture_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  592. #define IDirect3DTexture_AddRef(p)               (p)->AddRef()
  593. #define IDirect3DTexture_Release(p)              (p)->Release()
  594. #define IDirect3DTexture_Initialize(p, a, b)     (p)->Initialize(a, b)
  595. #define IDirect3DTexture_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  596. #define IDirect3DTexture_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
  597. #define IDirect3DTexture_Load(p, a)              (p)->Load(a)
  598. #define IDirect3DTexture_Unload(p)               (p)->Unload()
  599. #endif
  600.  
  601. /*
  602.  * IDirect3DTexture2
  603.  */
  604. #undef INTERFACE
  605. #define INTERFACE IDirect3DTexture2
  606. DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown)
  607. {
  608.     /*** IUnknown methods ***/
  609.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  610.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  611.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  612.     /*** IDirect3DTexture2 methods ***/
  613.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DTEXTUREHANDLE) PURE;
  614.     STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
  615.     STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE2) PURE;
  616. };
  617.  
  618. #if !defined(__cplusplus) || defined(CINTERFACE)
  619. #define IDirect3DTexture2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  620. #define IDirect3DTexture2_AddRef(p)               (p)->lpVtbl->AddRef(p)
  621. #define IDirect3DTexture2_Release(p)              (p)->lpVtbl->Release(p)
  622. #define IDirect3DTexture2_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  623. #define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
  624. #define IDirect3DTexture2_Load(p, a)              (p)->lpVtbl->Load(p, a)
  625. #else
  626. #define IDirect3DTexture2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  627. #define IDirect3DTexture2_AddRef(p)               (p)->AddRef()
  628. #define IDirect3DTexture2_Release(p)              (p)->Release()
  629. #define IDirect3DTexture2_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  630. #define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
  631. #define IDirect3DTexture2_Load(p, a)              (p)->Load(a)
  632. #endif
  633.  
  634. /* 
  635.  * IDirect3DViewport
  636.  */
  637. #undef INTERFACE
  638. #define INTERFACE IDirect3DViewport
  639. DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
  640. {
  641.     /*** IUnknown methods ***/
  642.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  643.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  644.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  645.     /*** IDirect3DViewport methods ***/
  646.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  647.     STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  648.     STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  649.     STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
  650.     STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
  651.     STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
  652.     STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
  653.     STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
  654.     STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
  655.     STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
  656.     STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  657.     STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  658.     STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
  659. };
  660.  
  661. #if !defined(__cplusplus) || defined(CINTERFACE)
  662. #define IDirect3DViewport_QueryInterface(p, a, b)          (p)->lpVtbl->QueryInterface(p, a, b)
  663. #define IDirect3DViewport_AddRef(p)                        (p)->lpVtbl->AddRef(p)
  664. #define IDirect3DViewport_Release(p)                       (p)->lpVtbl->Release(p)
  665. #define IDirect3DViewport_Initialize(p, a)                 (p)->lpVtbl->Initialize(p, a)
  666. #define IDirect3DViewport_GetViewport(p, a)                (p)->lpVtbl->GetViewport(p, a)
  667. #define IDirect3DViewport_SetViewport(p, a)                (p)->lpVtbl->SetViewport(p, a)
  668. #define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
  669. #define IDirect3DViewport_LightElements(p, a, b)           (p)->lpVtbl->LightElements(p, a, b)
  670. #define IDirect3DViewport_SetBackground(p, a)              (p)->lpVtbl->SetBackground(p, a)
  671. #define IDirect3DViewport_GetBackground(p, a, b)           (p)->lpVtbl->GetBackground(p, a, b)
  672. #define IDirect3DViewport_SetBackgroundDepth(p, a)         (p)->lpVtbl->SetBackgroundDepth(p, a)
  673. #define IDirect3DViewport_GetBackgroundDepth(p, a, b)      (p)->lpVtbl->GetBackgroundDepth(p, a, b)
  674. #define IDirect3DViewport_Clear(p, a, b, c)                (p)->lpVtbl->Clear(p, a, b, c)
  675. #define IDirect3DViewport_AddLight(p, a)                   (p)->lpVtbl->AddLight(p, a)
  676. #define IDirect3DViewport_DeleteLight(p, a)                (p)->lpVtbl->DeleteLight(p, a)
  677. #define IDirect3DViewport_NextLight(p, a, b, c)            (p)->lpVtbl->NextLight(p, a, b, c)
  678. #else
  679. #define IDirect3DViewport_QueryInterface(p, a, b)          (p)->QueryInterface(a, b)
  680. #define IDirect3DViewport_AddRef(p)                        (p)->AddRef()
  681. #define IDirect3DViewport_Release(p)                       (p)->Release()
  682. #define IDirect3DViewport_Initialize(p, a)                 (p)->Initialize(a)
  683. #define IDirect3DViewport_GetViewport(p, a)                (p)->GetViewport(a)
  684. #define IDirect3DViewport_SetViewport(p, a)                (p)->SetViewport(a)
  685. #define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
  686. #define IDirect3DViewport_LightElements(p, a, b)           (p)->LightElements(a, b)
  687. #define IDirect3DViewport_SetBackground(p, a)              (p)->SetBackground(a)
  688. #define IDirect3DViewport_GetBackground(p, a, b)           (p)->GetBackground(a, b)
  689. #define IDirect3DViewport_SetBackgroundDepth(p, a)         (p)->SetBackgroundDepth(a)
  690. #define IDirect3DViewport_GetBackgroundDepth(p, a, b)      (p)->GetBackgroundDepth(a, b)
  691. #define IDirect3DViewport_Clear(p, a, b, c)                (p)->Clear(a, b, c)
  692. #define IDirect3DViewport_AddLight(p, a)                   (p)->AddLight(a)
  693. #define IDirect3DViewport_DeleteLight(p, a)                (p)->DeleteLight(a)
  694. #define IDirect3DViewport_NextLight(p, a, b, c)            (p)->NextLight(a, b, c)
  695. #endif
  696.  
  697. /*
  698.  * IDirect3DViewport2
  699.  */
  700. #undef INTERFACE
  701. #define INTERFACE IDirect3DViewport2
  702. DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport)
  703. {
  704.     /*** IUnknown methods ***/
  705.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  706.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  707.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  708.     /*** IDirect3DViewport methods ***/
  709.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  710.     STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  711.     STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  712.     STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
  713.     STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
  714.     STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
  715.     STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
  716.     STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
  717.     STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
  718.     STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
  719.     STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  720.     STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  721.     STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
  722.     /*** IDirect3DViewport2 methods ***/
  723.     STDMETHOD(GetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
  724.     STDMETHOD(SetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
  725. };
  726.  
  727. #if !defined(__cplusplus) || defined(CINTERFACE)
  728. #define IDirect3DViewport2_QueryInterface(p, a, b)          (p)->lpVtbl->QueryInterface(p, a, b)
  729. #define IDirect3DViewport2_AddRef(p)                        (p)->lpVtbl->AddRef(p)
  730. #define IDirect3DViewport2_Release(p)                       (p)->lpVtbl->Release(p)
  731. #define IDirect3DViewport2_Initialize(p, a)                 (p)->lpVtbl->Initialize(p, a)
  732. #define IDirect3DViewport2_GetViewport(p, a)                (p)->lpVtbl->GetViewport(p, a)
  733. #define IDirect3DViewport2_SetViewport(p, a)                (p)->lpVtbl->SetViewport(p, a)
  734. #define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
  735. #define IDirect3DViewport2_LightElements(p, a, b)           (p)->lpVtbl->LightElements(p, a, b)
  736. #define IDirect3DViewport2_SetBackground(p, a)              (p)->lpVtbl->SetBackground(p, a)
  737. #define IDirect3DViewport2_GetBackground(p, a, b)           (p)->lpVtbl->GetBackground(p, a, b)
  738. #define IDirect3DViewport2_SetBackgroundDepth(p, a)         (p)->lpVtbl->SetBackgroundDepth(p, a)
  739. #define IDirect3DViewport2_GetBackgroundDepth(p, a, b)      (p)->lpVtbl->GetBackgroundDepth(p, a, b)
  740. #define IDirect3DViewport2_Clear(p, a, b, c)                (p)->lpVtbl->Clear(p, a, b, c)
  741. #define IDirect3DViewport2_AddLight(p, a)                   (p)->lpVtbl->AddLight(p, a)
  742. #define IDirect3DViewport2_DeleteLight(p, a)                (p)->lpVtbl->DeleteLight(p, a)
  743. #define IDirect3DViewport2_NextLight(p, a, b, c)            (p)->lpVtbl->NextLight(p, a, b, c)
  744. #define IDirect3DViewport2_GetViewport2(p, a)                (p)->lpVtbl->GetViewport2(p, a)
  745. #define IDirect3DViewport2_SetViewport2(p, a)                (p)->lpVtbl->SetViewport2(p, a)
  746. #else
  747. #define IDirect3DViewport2_QueryInterface(p, a, b)          (p)->QueryInterface(a, b)
  748. #define IDirect3DViewport2_AddRef(p)                        (p)->AddRef()
  749. #define IDirect3DViewport2_Release(p)                       (p)->Release()
  750. #define IDirect3DViewport2_Initialize(p, a)                 (p)->Initialize(a)
  751. #define IDirect3DViewport2_GetViewport(p, a)                (p)->GetViewport(a)
  752. #define IDirect3DViewport2_SetViewport(p, a)                (p)->SetViewport(a)
  753. #define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
  754. #define IDirect3DViewport2_LightElements(p, a, b)           (p)->LightElements(a, b)
  755. #define IDirect3DViewport2_SetBackground(p, a)              (p)->SetBackground(a)
  756. #define IDirect3DViewport2_GetBackground(p, a, b)           (p)->GetBackground(a, b)
  757. #define IDirect3DViewport2_SetBackgroundDepth(p, a)         (p)->SetBackgroundDepth(a)
  758. #define IDirect3DViewport2_GetBackgroundDepth(p, a, b)      (p)->GetBackgroundDepth(a, b)
  759. #define IDirect3DViewport2_Clear(p, a, b, c)                (p)->Clear(a, b, c)
  760. #define IDirect3DViewport2_AddLight(p, a)                   (p)->AddLight(a)
  761. #define IDirect3DViewport2_DeleteLight(p, a)                (p)->DeleteLight(a)
  762. #define IDirect3DViewport2_NextLight(p, a, b, c)            (p)->NextLight(a, b, c)
  763. #define IDirect3DViewport2_GetViewport2(p, a)                (p)->GetViewport2(a)
  764. #define IDirect3DViewport2_SetViewport2(p, a)                (p)->SetViewport2(a)
  765. #endif
  766.  
  767.  
  768. /****************************************************************************
  769.  *
  770.  * Flags for IDirect3DDevice::NextViewport
  771.  *
  772.  ****************************************************************************/
  773.  
  774. /*
  775.  * Return the next viewport
  776.  */
  777. #define D3DNEXT_NEXT    0x00000001l
  778.  
  779. /*
  780.  * Return the first viewport
  781.  */
  782. #define D3DNEXT_HEAD    0x00000002l
  783.  
  784. /*
  785.  * Return the last viewport
  786.  */
  787. #define D3DNEXT_TAIL    0x00000004l
  788.  
  789.  
  790. /****************************************************************************
  791.  *
  792.  * Flags for DrawPrimitive/DrawIndexedPrimitive
  793.  *   Also valid for Begin/BeginIndexed
  794.  *
  795.  ****************************************************************************/
  796.  
  797. /*
  798.  * Wait until the device is ready to draw the primitive
  799.  * This will cause DP to not return DDERR_WASSTILLDRAWING
  800.  */
  801. #define D3DDP_WAIT                    0x00000001l
  802.  
  803.  
  804. /*
  805.  * Hint that the primitives have been clipped by the application.
  806.  */
  807. #define D3DDP_DONOTCLIP                0x00000004l
  808.  
  809. /*
  810.  * Hint that the extents need not be updated.
  811.  */
  812. #define D3DDP_DONOTUPDATEEXTENTS    0x00000008l
  813.  
  814. /*
  815.  * Direct3D Errors
  816.  * DirectDraw error codes are used when errors not specified here.
  817.  */
  818. #define D3D_OK                DD_OK
  819. #define D3DERR_BADMAJORVERSION        MAKE_DDHRESULT(700)
  820. #define D3DERR_BADMINORVERSION        MAKE_DDHRESULT(701)
  821.  
  822. /*
  823.  * An invalid device was requested by the application.
  824.  */
  825. #define D3DERR_INVALID_DEVICE   MAKE_DDHRESULT(705)
  826. #define D3DERR_INITFAILED       MAKE_DDHRESULT(706)
  827.  
  828. /*
  829.  * SetRenderTarget attempted on a device that was
  830.  * QI'd off the render target.
  831.  */
  832. #define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
  833.  
  834. #define D3DERR_EXECUTE_CREATE_FAILED    MAKE_DDHRESULT(710)
  835. #define D3DERR_EXECUTE_DESTROY_FAILED    MAKE_DDHRESULT(711)
  836. #define D3DERR_EXECUTE_LOCK_FAILED    MAKE_DDHRESULT(712)
  837. #define D3DERR_EXECUTE_UNLOCK_FAILED    MAKE_DDHRESULT(713)
  838. #define D3DERR_EXECUTE_LOCKED        MAKE_DDHRESULT(714)
  839. #define D3DERR_EXECUTE_NOT_LOCKED    MAKE_DDHRESULT(715)
  840.  
  841. #define D3DERR_EXECUTE_FAILED        MAKE_DDHRESULT(716)
  842. #define D3DERR_EXECUTE_CLIPPED_FAILED    MAKE_DDHRESULT(717)
  843.  
  844. #define D3DERR_TEXTURE_NO_SUPPORT    MAKE_DDHRESULT(720)
  845. #define D3DERR_TEXTURE_CREATE_FAILED    MAKE_DDHRESULT(721)
  846. #define D3DERR_TEXTURE_DESTROY_FAILED    MAKE_DDHRESULT(722)
  847. #define D3DERR_TEXTURE_LOCK_FAILED    MAKE_DDHRESULT(723)
  848. #define D3DERR_TEXTURE_UNLOCK_FAILED    MAKE_DDHRESULT(724)
  849. #define D3DERR_TEXTURE_LOAD_FAILED    MAKE_DDHRESULT(725)
  850. #define D3DERR_TEXTURE_SWAP_FAILED    MAKE_DDHRESULT(726)
  851. #define D3DERR_TEXTURE_LOCKED        MAKE_DDHRESULT(727)
  852. #define D3DERR_TEXTURE_NOT_LOCKED    MAKE_DDHRESULT(728)
  853. #define D3DERR_TEXTURE_GETSURF_FAILED    MAKE_DDHRESULT(729)
  854.  
  855. #define D3DERR_MATRIX_CREATE_FAILED    MAKE_DDHRESULT(730)
  856. #define D3DERR_MATRIX_DESTROY_FAILED    MAKE_DDHRESULT(731)
  857. #define D3DERR_MATRIX_SETDATA_FAILED    MAKE_DDHRESULT(732)
  858. #define D3DERR_MATRIX_GETDATA_FAILED    MAKE_DDHRESULT(733)
  859. #define D3DERR_SETVIEWPORTDATA_FAILED    MAKE_DDHRESULT(734)
  860.  
  861. #define D3DERR_INVALIDCURRENTVIEWPORT   MAKE_DDHRESULT(735)
  862. #define D3DERR_INVALIDPRIMITIVETYPE     MAKE_DDHRESULT(736)
  863. #define D3DERR_INVALIDVERTEXTYPE        MAKE_DDHRESULT(737)
  864. #define D3DERR_TEXTURE_BADSIZE          MAKE_DDHRESULT(738)
  865. #define D3DERR_INVALIDRAMPTEXTURE        MAKE_DDHRESULT(739)
  866.  
  867. #define D3DERR_MATERIAL_CREATE_FAILED    MAKE_DDHRESULT(740)
  868. #define D3DERR_MATERIAL_DESTROY_FAILED    MAKE_DDHRESULT(741)
  869. #define D3DERR_MATERIAL_SETDATA_FAILED    MAKE_DDHRESULT(742)
  870. #define D3DERR_MATERIAL_GETDATA_FAILED    MAKE_DDHRESULT(743)
  871. #define D3DERR_INVALIDPALETTE            MAKE_DDHRESULT(744)
  872.  
  873. #define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
  874. #define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY  MAKE_DDHRESULT(746)
  875. #define D3DERR_SURFACENOTINVIDMEM       MAKE_DDHRESULT(747)
  876.  
  877. #define D3DERR_LIGHT_SET_FAILED        MAKE_DDHRESULT(750)
  878. #define D3DERR_LIGHTHASVIEWPORT        MAKE_DDHRESULT(751)
  879. #define D3DERR_LIGHTNOTINTHISVIEWPORT           MAKE_DDHRESULT(752)
  880.  
  881. #define D3DERR_SCENE_IN_SCENE        MAKE_DDHRESULT(760)
  882. #define D3DERR_SCENE_NOT_IN_SCENE    MAKE_DDHRESULT(761)
  883. #define D3DERR_SCENE_BEGIN_FAILED    MAKE_DDHRESULT(762)
  884. #define D3DERR_SCENE_END_FAILED        MAKE_DDHRESULT(763)
  885.  
  886. #define D3DERR_INBEGIN                  MAKE_DDHRESULT(770)
  887. #define D3DERR_NOTINBEGIN               MAKE_DDHRESULT(771)
  888. #define D3DERR_NOVIEWPORTS              MAKE_DDHRESULT(772)
  889. #define D3DERR_VIEWPORTDATANOTSET       MAKE_DDHRESULT(773)
  890. #define D3DERR_VIEWPORTHASNODEVICE      MAKE_DDHRESULT(774)
  891. #define D3DERR_NOCURRENTVIEWPORT        MAKE_DDHRESULT(775)
  892.  
  893. #ifdef __cplusplus
  894. };
  895. #endif
  896.  
  897. #pragma option pop /*P_O_Pop*/
  898. #endif /* _D3D_H_ */
  899.