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

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1995-1996 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       d3d.h
  6.  *  Content:    Direct3D include file
  7.  *
  8.  ***************************************************************************/
  9.  
  10. #ifndef _D3D_H_
  11. #define _D3D_H_
  12. #pragma option -b
  13.  
  14. #pragma option -b.
  15. #include <stdlib.h>
  16. #pragma option -b
  17.  
  18. #ifdef _WIN32
  19. #define COM_NO_WINDOWS_H
  20. #pragma option -b.
  21. #include <objbase.h>
  22. #pragma option -b
  23. #else
  24. #pragma option -b.
  25. #include "d3dcom.h"
  26. #pragma option -b
  27. #endif
  28.  
  29. #ifdef _WIN32
  30. #define D3DAPI WINAPI
  31. #else
  32. #define D3DAPI
  33. #endif
  34.  
  35. /*
  36.  * Interface IID's
  37.  */
  38. #if defined( _WIN32 ) && !defined( _NO_COM)
  39. DEFINE_GUID( IID_IDirect3D,             0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  40. DEFINE_GUID( IID_IDirect3DTexture,      0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  41. DEFINE_GUID( IID_IDirect3DLight,        0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  42. DEFINE_GUID( IID_IDirect3DMaterial,     0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  43. DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  44. DEFINE_GUID( IID_IDirect3DViewport,     0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51. /*
  52.  * Data structures
  53.  */
  54. #ifdef __cplusplus
  55.  
  56. /* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
  57. struct IDirect3D;
  58. struct IDirect3DDevice;
  59. struct IDirect3DExecuteBuffer;
  60. struct IDirect3DLight;
  61. struct IDirect3DMaterial;
  62. struct IDirect3DTexture;
  63. struct IDirect3DViewport;
  64. typedef struct IDirect3D                *LPDIRECT3D;
  65. typedef struct IDirect3DDevice          *LPDIRECT3DDEVICE;
  66. typedef struct IDirect3DExecuteBuffer   *LPDIRECT3DEXECUTEBUFFER;
  67. typedef struct IDirect3DLight           *LPDIRECT3DLIGHT;
  68. typedef struct IDirect3DMaterial        *LPDIRECT3DMATERIAL;
  69. typedef struct IDirect3DTexture         *LPDIRECT3DTEXTURE;
  70. typedef struct IDirect3DViewport        *LPDIRECT3DVIEWPORT;
  71.  
  72. #else
  73.  
  74. typedef struct IDirect3D                *LPDIRECT3D;
  75. typedef struct IDirect3DDevice          *LPDIRECT3DDEVICE;
  76. typedef struct IDirect3DExecuteBuffer   *LPDIRECT3DEXECUTEBUFFER;
  77. typedef struct IDirect3DLight           *LPDIRECT3DLIGHT;
  78. typedef struct IDirect3DMaterial        *LPDIRECT3DMATERIAL;
  79. typedef struct IDirect3DTexture         *LPDIRECT3DTEXTURE;
  80. typedef struct IDirect3DViewport        *LPDIRECT3DVIEWPORT;
  81.  
  82. #endif
  83.  
  84. #pragma option -b.
  85. #include "d3dtypes.h"
  86. #pragma option -b
  87. #pragma option -b.
  88. #include "d3dcaps.h"
  89. #pragma option -b
  90.  
  91. /*
  92.  * IDirect3D
  93.  */
  94. #undef INTERFACE
  95. #define INTERFACE IDirect3D
  96. DECLARE_INTERFACE_(IDirect3D, IUnknown)
  97. {
  98.     /*** IUnknown methods ***/
  99.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  100.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  101.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  102.     /*** IDirect3D methods ***/
  103.     STDMETHOD(Initialize) (THIS_ REFIID) PURE;
  104.     STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
  105.     STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
  106.     STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE;
  107.     STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE;
  108.     STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
  109. };
  110.  
  111. #if !defined(__cplusplus) || defined(CINTERFACE)
  112. #define IDirect3D_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  113. #define IDirect3D_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  114. #define IDirect3D_Release(p)                      (p)->lpVtbl->Release(p)
  115. #define IDirect3D_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  116. #define IDirect3D_EnumDevices(p, a, b)            (p)->lpVtbl->EnumDevices(p, a, b)
  117. #define IDirect3D_CreateLight(p, a, b)            (p)->lpVtbl->CreateLight(p, a, b)
  118. #define IDirect3D_CreateMaterial(p, a, b)         (p)->lpVtbl->CreateMaterial(p, a, b)
  119. #define IDirect3D_CreateViewport(p, a, b)         (p)->lpVtbl->CreateViewport(p, a, b)
  120. #define IDirect3D_FindDevice(p, a, b)             (p)->lpVtbl->FindDevice(p, a, b)
  121. #endif
  122.  
  123. /*
  124.  * IDirect3DDevice
  125.  */
  126. #undef INTERFACE
  127. #define INTERFACE IDirect3DDevice
  128. DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
  129. {
  130.     /*** IUnknown methods ***/
  131.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  132.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  133.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  134.     /*** IDirect3DDevice methods ***/
  135.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE;
  136.     STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
  137.     STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE;
  138.     STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE;
  139.     STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
  140.     STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE;
  141.     STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
  142.     STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
  143.     STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE;
  144.     STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE;
  145.     STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE;
  146.     STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
  147.     STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE;
  148.     STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
  149.     STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
  150.     STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE;
  151.     STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
  152.     STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
  153.     STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;
  154. };
  155.  
  156. #if !defined(__cplusplus) || defined(CINTERFACE)
  157. #define IDirect3DDevice_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  158. #define IDirect3DDevice_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  159. #define IDirect3DDevice_Release(p)                      (p)->lpVtbl->Release(p)
  160. #define IDirect3DDevice_Initialize(p, a, b, c)          (p)->lpVtbl->Initialize(p, a, b, c)
  161. #define IDirect3DDevice_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  162. #define IDirect3DDevice_SwapTextureHandles(p, a, b)     (p)->lpVtbl->SwapTextureHandles(p, a, b)
  163. #define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->ExecuteBuffer(p, a, b, c)
  164. #define IDirect3DDevice_GetStats(p, a)                  (p)->lpVtbl->CreateViewport(p, a)
  165. #define IDirect3DDevice_Execute(p, a, b, c)             (p)->lpVtbl->Execute(p, a, b, c)
  166. #define IDirect3DDevice_AddViewport(p, a)               (p)->lpVtbl->AddViewport(p, a)
  167. #define IDirect3DDevice_DeleteViewport(p, a)            (p)->lpVtbl->DeleteViewport(p, a)
  168. #define IDirect3DDevice_NextViewport(p, a, b)           (p)->lpVtbl->NextViewport(p, a, b)
  169. #define IDirect3DDevice_Pick(p, a, b, c, d)             (p)->lpVtbl->Pick(p, a, b, c, d)
  170. #define IDirect3DDevice_GetPickRecords(p, a, b)         (p)->lpVtbl->GetPickRecords(p, a, b)
  171. #define IDirect3DDevice_EnumTextureFormats(p, a, b)     (p)->lpVtbl->EnumTextureFormats(p, a, b)
  172. #define IDirect3DDevice_CreateMatrix(p, a)              (p)->lpVtbl->CreateMatrix(p, a)
  173. #define IDirect3DDevice_SetMatrix(p, a, b)              (p)->lpVtbl->SetMatrix(p, a, b)
  174. #define IDirect3DDevice_GetMatrix(p, a, b)              (p)->lpVtbl->GetMatrix(p, a, b)
  175. #define IDirect3DDevice_DeleteMatrix(p, a)              (p)->lpVtbl->DeleteMatrix(p, a)
  176. #define IDirect3DDevice_BeginScene(p)                   (p)->lpVtbl->BeginScene(p)
  177. #define IDirect3DDevice_EndScene(p)                     (p)->lpVtbl->EndScene(p)
  178. #define IDirect3DDevice_GetDirect3D(p, a)               (p)->lpVtbl->GetDirect3D(p, a)
  179. #endif
  180.  
  181. /*
  182.  * IDirect3DExecuteBuffer
  183.  */
  184. #undef INTERFACE
  185. #define INTERFACE IDirect3DExecuteBuffer
  186. DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
  187. {
  188.     /*** IUnknown methods ***/
  189.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  190.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  191.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  192.     /*** IDirect3DExecuteBuffer methods ***/
  193.     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE;
  194.     STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
  195.     STDMETHOD_(HRESULT, Unlock) (THIS) PURE;
  196.     STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
  197.     STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
  198.     STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE;
  199.     STDMETHOD(Optimize) (THIS_ DWORD) PURE;
  200. };
  201.  
  202. #if !defined(__cplusplus) || defined(CINTERFACE)
  203. #define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  204. #define IDirect3DExecuteBuffer_AddRef(p)               (p)->lpVtbl->AddRef(p)
  205. #define IDirect3DExecuteBuffer_Release(p)              (p)->lpVtbl->Release(p)
  206. #define IDirect3DExecuteBuffer_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
  207. #define IDirect3DExecuteBuffer_Lock(p, a)              (p)->lpVtbl->Lock(p, a)
  208. #define IDirect3DExecuteBuffer_Unlock(p, a)            (p)->lpVtbl->Unlock(p)
  209. #define IDirect3DExecuteBuffer_SetExecuteData(p, a)    (p)->lpVtbl->SetExecuteData(p, a)
  210. #define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validata(p, a, b, c, d)
  211. #endif
  212.  
  213. /*
  214.  * Flags for execute buffer calls
  215.  */
  216. #define D3DNEXT_NEXT    0x00000001l
  217. #define D3DNEXT_HEAD    0x00000002l
  218. #define D3DNEXT_TAIL    0x00000004l
  219.  
  220. /*
  221.  * IDirect3DLight
  222.  */
  223. #undef INTERFACE
  224. #define INTERFACE IDirect3DLight
  225. DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
  226. {
  227.     /*** IUnknown methods ***/
  228.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  229.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  230.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  231.     /*** IDirect3DLight methods ***/
  232.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  233.     STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE;
  234.     STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE;
  235. };
  236.  
  237. #if !defined(__cplusplus) || defined(CINTERFACE)
  238. #define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  239. #define IDirect3DLight_AddRef(p)               (p)->lpVtbl->AddRef(p)
  240. #define IDirect3DLight_Release(p)              (p)->lpVtbl->Release(p)
  241. #define IDirect3DLight_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
  242. #define IDirect3DLight_SetLight(p, a)          (p)->lpVtbl->SetLight(p, a)
  243. #define IDirect3DLight_GetLight(p, a)          (p)->lpVtbl->GetLight(p, a)
  244. #endif
  245.  
  246. /*
  247.  * IDirect3DMaterial
  248.  */
  249. #undef INTERFACE
  250. #define INTERFACE IDirect3DMaterial
  251. DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
  252. {
  253.     /*** IUnknown methods ***/
  254.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  255.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  256.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  257.     /*** IDirect3DMaterial methods ***/
  258.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  259.     STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  260.     STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  261.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE;
  262.     STDMETHOD_(HRESULT, Reserve) (THIS) PURE;
  263.     STDMETHOD_(HRESULT, Unreserve) (THIS) PURE;
  264. };
  265.  
  266. #if !defined(__cplusplus) || defined(CINTERFACE)
  267. #define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  268. #define IDirect3DMaterial_AddRef(p)               (p)->lpVtbl->AddRef(p)
  269. #define IDirect3DMaterial_Release(p)              (p)->lpVtbl->Release(p)
  270. #define IDirect3DMaterial_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
  271. #define IDirect3DMaterial_SetMaterial(p, a)       (p)->lpVtbl->SetLight(p, a)
  272. #define IDirect3DMaterial_GetMaterial(p, a)       (p)->lpVtbl->GetLight(p, a)
  273. #define IDirect3DMaterial_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  274. #define IDirect3DMaterial_Reserve(p)              (p)->lpVtbl->Reserve(p)
  275. #define IDirect3DMaterial_Unreserve(p)            (p)->lpVtbl->Unreserve(p)
  276. #endif
  277.  
  278. /*
  279.  * IDirect3DTexture
  280.  */
  281. #undef INTERFACE
  282. #define INTERFACE IDirect3DTexture
  283. DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
  284. {
  285.     /*** IUnknown methods ***/
  286.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  287.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  288.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  289.     /*** IDirect3DTexture methods ***/
  290.     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE;
  291.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE;
  292.     STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
  293.     STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE;
  294.     STDMETHOD_(HRESULT, Unload) (THIS) PURE;
  295. };
  296.  
  297. #if !defined(__cplusplus) || defined(CINTERFACE)
  298. #define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  299. #define IDirect3DTexture_AddRef(p)               (p)->lpVtbl->AddRef(p)
  300. #define IDirect3DTexture_Release(p)              (p)->lpVtbl->Release(p)
  301. #define IDirect3DTexture_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
  302. #define IDirect3DTexture_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  303. #define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
  304. #define IDirect3DTexture_Load(p, a)              (p)->lpVtbl->Load(p, a)
  305. #define IDirect3DTexture_Unload(p)               (p)->lpVtbl->Unload(p)
  306. #endif
  307.  
  308. /*
  309.  * IDirect3DViewport
  310.  */
  311. #undef INTERFACE
  312. #define INTERFACE IDirect3DViewport
  313. DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
  314. {
  315.     /*** IUnknown methods ***/
  316.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  317.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  318.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  319.     /*** IDirect3DViewport methods ***/
  320.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  321.     STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  322.     STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  323.     STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
  324.     STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
  325.     STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
  326.     STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
  327.     STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
  328.     STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
  329.     STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
  330.     STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  331.     STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  332.     STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
  333. };
  334.  
  335. #if !defined(__cplusplus) || defined(CINTERFACE)
  336. #define IDirect3DViewport_QueryInterface(p, a, b)          (p)->lpVtbl->QueryInterface(p, a, b)
  337. #define IDirect3DViewport_AddRef(p)                        (p)->lpVtbl->AddRef(p)
  338. #define IDirect3DViewport_Release(p)                       (p)->lpVtbl->Release(p)
  339. #define IDirect3DViewport_Initialize(p, a)                 (p)->lpVtbl->Initialize(p, a)
  340. #define IDirect3DViewport_GetViewport(p, a)                (p)->lpVtbl->GetViewport(p, a)
  341. #define IDirect3DViewport_SetViewport(p, a)                (p)->lpVtbl->SetViewport(p, a)
  342. #define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
  343. #define IDirect3DViewport_LightElements(p, a, b)           (p)->lpVtbl->LightElements(p, a, b)
  344. #define IDirect3DViewport_SetBackground(p, a)              (p)->lpVtbl->SetBackground(p, a)
  345. #define IDirect3DViewport_GetBackground(p, a, b)           (p)->lpVtbl->GetBackground(p, a, b)
  346. #define IDirect3DViewport_Clear(p, a, b, c)                (p)->lpVtbl->Clear(p, a, b, c)
  347. #define IDirect3DViewport_AddLight(p, a)                   (p)->lpVtbl->AddLight(p, a)
  348. #define IDirect3DViewport_DeleteLight(p, a)                (p)->lpVtbl->DeleteLight(p, a)
  349. #define IDirect3DViewport_NextLight(p, a, b, c)            (p)->lpVtbl->NextLight(p, a, b, c)
  350. #endif
  351.  
  352. /*
  353.  * Direct3D Errors
  354.  * DirectDraw error codes are used when errors not specified here.
  355.  */
  356. #define D3D_OK                          DD_OK
  357. #define D3DERR_BADMAJORVERSION          MAKE_DDHRESULT(700)
  358. #define D3DERR_BADMINORVERSION          MAKE_DDHRESULT(701)
  359.  
  360. #define D3DERR_EXECUTE_CREATE_FAILED    MAKE_DDHRESULT(710)
  361. #define D3DERR_EXECUTE_DESTROY_FAILED   MAKE_DDHRESULT(711)
  362. #define D3DERR_EXECUTE_LOCK_FAILED      MAKE_DDHRESULT(712)
  363. #define D3DERR_EXECUTE_UNLOCK_FAILED    MAKE_DDHRESULT(713)
  364. #define D3DERR_EXECUTE_LOCKED           MAKE_DDHRESULT(714)
  365. #define D3DERR_EXECUTE_NOT_LOCKED       MAKE_DDHRESULT(715)
  366.  
  367. #define D3DERR_EXECUTE_FAILED           MAKE_DDHRESULT(716)
  368. #define D3DERR_EXECUTE_CLIPPED_FAILED   MAKE_DDHRESULT(717)
  369.  
  370. #define D3DERR_TEXTURE_NO_SUPPORT       MAKE_DDHRESULT(720)
  371. #define D3DERR_TEXTURE_CREATE_FAILED    MAKE_DDHRESULT(721)
  372. #define D3DERR_TEXTURE_DESTROY_FAILED   MAKE_DDHRESULT(722)
  373. #define D3DERR_TEXTURE_LOCK_FAILED      MAKE_DDHRESULT(723)
  374. #define D3DERR_TEXTURE_UNLOCK_FAILED    MAKE_DDHRESULT(724)
  375. #define D3DERR_TEXTURE_LOAD_FAILED      MAKE_DDHRESULT(725)
  376. #define D3DERR_TEXTURE_SWAP_FAILED      MAKE_DDHRESULT(726)
  377. #define D3DERR_TEXTURE_LOCKED           MAKE_DDHRESULT(727)
  378. #define D3DERR_TEXTURE_NOT_LOCKED       MAKE_DDHRESULT(728)
  379. #define D3DERR_TEXTURE_GETSURF_FAILED   MAKE_DDHRESULT(729)
  380.  
  381. #define D3DERR_MATRIX_CREATE_FAILED     MAKE_DDHRESULT(730)
  382. #define D3DERR_MATRIX_DESTROY_FAILED    MAKE_DDHRESULT(731)
  383. #define D3DERR_MATRIX_SETDATA_FAILED    MAKE_DDHRESULT(732)
  384. #define D3DERR_MATRIX_GETDATA_FAILED    MAKE_DDHRESULT(733)
  385. #define D3DERR_SETVIEWPORTDATA_FAILED   MAKE_DDHRESULT(734)
  386.  
  387. #define D3DERR_MATERIAL_CREATE_FAILED   MAKE_DDHRESULT(740)
  388. #define D3DERR_MATERIAL_DESTROY_FAILED  MAKE_DDHRESULT(741)
  389. #define D3DERR_MATERIAL_SETDATA_FAILED  MAKE_DDHRESULT(742)
  390. #define D3DERR_MATERIAL_GETDATA_FAILED  MAKE_DDHRESULT(743)
  391.  
  392. #define D3DERR_LIGHT_SET_FAILED         MAKE_DDHRESULT(750)
  393.  
  394. #define D3DERR_SCENE_IN_SCENE           MAKE_DDHRESULT(760)
  395. #define D3DERR_SCENE_NOT_IN_SCENE       MAKE_DDHRESULT(761)
  396. #define D3DERR_SCENE_BEGIN_FAILED       MAKE_DDHRESULT(762)
  397. #define D3DERR_SCENE_END_FAILED         MAKE_DDHRESULT(763)
  398.  
  399. #ifdef __cplusplus
  400. };
  401. #endif
  402.  
  403. #pragma option -b.
  404. #endif /* _D3D_H_ */
  405.