diff --git a/ReadMe.md b/ReadMe.md
index 8e373dd..729a387 100644
--- a/ReadMe.md
+++ b/ReadMe.md
@@ -3,6 +3,9 @@
**原始来源:** [zibility](https://github.com/zibility/Remote)
**功能概述:** 基于gh0st的远程控制器:实现了终端管理、进程管理、窗口管理、桌面管理、文件管理、语音管理、视频管理、服务管理、注册表管理等功能。
+如果您热爱研究控制程序,喜欢本项目,请您对该项目添加星标。Fork、Watch此项目,提交Issues,发起Pull Request都是受欢迎的。
+
+根据本人空闲情况,此项目会不定期更新。若您想对该项目了解更多技术细节,喜欢讨论软件的各方面,学习和交流请通过适当的方式联系。
**起始日期**:2019.1.1
@@ -304,9 +307,11 @@ reorg: Move commands to common/commands.h
2024.12.31
生成服务时增加加密选项,当前支持XOR加密。配合使用解密程序来加载加密后的服务。
-2024.01.12
+2025.01.12
修复被控程序关于远程桌面相关可能的2处问题(#28 #29)。增加对主控端列表窗口的排序功能(#26 #27),以便快速定位窗口、服务或进程。
+发布一个运行**非常稳定**的版本v1.0.6,该版本不支持在较老的Windows XP系统运行(注:VS2019及以后版本已不支持XP工具集,为此需要更早的VS)。
+您可以从GitHub下载最新的Release,也可以clone该项目在相关目录找到。如果杀毒软件报告病毒,这是正常现象,请信任即可,或者您可以亲自编译。
# 沟通反馈
diff --git a/Releases/v1.0.6/ServerDll.dll b/Releases/v1.0.6/ServerDll.dll
new file mode 100644
index 0000000..48ad3dd
Binary files /dev/null and b/Releases/v1.0.6/ServerDll.dll differ
diff --git a/Releases/v1.0.6/TestRun.exe b/Releases/v1.0.6/TestRun.exe
new file mode 100644
index 0000000..fd60ab6
Binary files /dev/null and b/Releases/v1.0.6/TestRun.exe differ
diff --git a/Releases/v1.0.6/Yama.exe b/Releases/v1.0.6/Yama.exe
new file mode 100644
index 0000000..5dea42f
Binary files /dev/null and b/Releases/v1.0.6/Yama.exe differ
diff --git a/Releases/v1.0.6/ghost.exe b/Releases/v1.0.6/ghost.exe
new file mode 100644
index 0000000..8b7f57e
Binary files /dev/null and b/Releases/v1.0.6/ghost.exe differ
diff --git a/client/ClientDll_vs2015.vcxproj b/client/ClientDll_vs2015.vcxproj
index 0b78cad..ef43d7e 100644
--- a/client/ClientDll_vs2015.vcxproj
+++ b/client/ClientDll_vs2015.vcxproj
@@ -42,13 +42,13 @@
- $(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
+ ./d3d;$(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
$(WindowsSDK_LibraryPath_x86);$(VLDPATH)\lib\Win32\;$(LibraryPath)
$(Configuration)\dll
$(WindowsSDK_LibraryPath_x86);$(VLDPATH)\lib\Win32\;$(LibraryPath)
- $(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
+ ./d3d;$(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
$(Configuration)\dll
diff --git a/client/Script.rc b/client/Script.rc
index 8f489a7..8a273fe 100644
--- a/client/Script.rc
+++ b/client/Script.rc
@@ -81,13 +81,14 @@ END
IDR_WAVE WAVE "Res\\msg.wav"
+
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,5
+ FILEVERSION 1,0,0,6
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
@@ -105,7 +106,7 @@ BEGIN
BEGIN
VALUE "CompanyName", "FUCK THE UNIVERSE"
VALUE "FileDescription", "A GHOST"
- VALUE "FileVersion", "1.0.0.5"
+ VALUE "FileVersion", "1.0.0.6"
VALUE "InternalName", "ServerDll.dll"
VALUE "LegalCopyright", "Copyright (C) 2019-2025"
VALUE "OriginalFilename", "ServerDll.dll"
@@ -128,7 +129,9 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON_MAIN ICON "Res\\ghost.ico"
+
IDI_ICON_MSG ICON "Res\\msg.ico"
+
#endif // (壬й) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/client/d3d/d3d.h b/client/d3d/d3d.h
new file mode 100644
index 0000000..fb7d455
--- /dev/null
+++ b/client/d3d/d3d.h
@@ -0,0 +1,1696 @@
+/*==========================================================================;
+ *
+ * Copyright (C) Microsoft Corporation. All Rights Reserved.
+ *
+ * File: d3d.h
+ * Content: Direct3D include file
+ *
+ ****************************************************************************/
+
+#include
+
+#pragma region Desktop Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+#ifndef _D3D_H_
+#define _D3D_H_
+
+#ifndef DIRECT3D_VERSION
+#define DIRECT3D_VERSION 0x0700
+#endif
+
+// include this file content only if compiling for <=DX7 interfaces
+#if(DIRECT3D_VERSION < 0x0800)
+
+
+#include
+
+#define COM_NO_WINDOWS_H
+#include
+
+#define D3DAPI WINAPI
+
+/*
+ * Interface IID's
+ */
+#if defined( _WIN32 ) && !defined( _NO_COM)
+DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
+#if(DIRECT3D_VERSION >= 0x0500)
+DEFINE_GUID( IID_IDirect3D2, 0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+#if(DIRECT3D_VERSION >= 0x0600)
+DEFINE_GUID( IID_IDirect3D3, 0xbb223240,0xe72b,0x11d0,0xa9,0xb4,0x00,0xaa,0x00,0xc0,0x99,0x3e);
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0700)
+DEFINE_GUID( IID_IDirect3D7, 0xf5049e77,0x4861,0x11d2,0xa4,0x7,0x0,0xa0,0xc9,0x6,0x29,0xa8);
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#if(DIRECT3D_VERSION >= 0x0500)
+DEFINE_GUID( IID_IDirect3DRampDevice, 0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
+DEFINE_GUID( IID_IDirect3DRGBDevice, 0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
+DEFINE_GUID( IID_IDirect3DHALDevice, 0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
+DEFINE_GUID( IID_IDirect3DMMXDevice, 0x881949a1,0xd6f3,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+DEFINE_GUID( IID_IDirect3DRefDevice, 0x50936643, 0x13e9, 0x11d1, 0x89, 0xaa, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
+DEFINE_GUID( IID_IDirect3DNullDevice, 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0700)
+DEFINE_GUID( IID_IDirect3DTnLHalDevice, 0xf5049e78, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+/*
+ * Internal Guid to distinguish requested MMX from MMX being used as an RGB rasterizer
+ */
+
+DEFINE_GUID( IID_IDirect3DDevice, 0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
+#if(DIRECT3D_VERSION >= 0x0500)
+DEFINE_GUID( IID_IDirect3DDevice2, 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+#if(DIRECT3D_VERSION >= 0x0600)
+DEFINE_GUID( IID_IDirect3DDevice3, 0xb0ab3b60, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74);
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0700)
+DEFINE_GUID( IID_IDirect3DDevice7, 0xf5049e79, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
+#if(DIRECT3D_VERSION >= 0x0500)
+DEFINE_GUID( IID_IDirect3DTexture2, 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
+
+DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
+#if(DIRECT3D_VERSION >= 0x0500)
+DEFINE_GUID( IID_IDirect3DMaterial2, 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+#if(DIRECT3D_VERSION >= 0x0600)
+DEFINE_GUID( IID_IDirect3DMaterial3, 0xca9c46f4, 0xd3c5, 0x11d1, 0xb7, 0x5a, 0x0, 0x60, 0x8, 0x52, 0xb3, 0x12);
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
+DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
+#if(DIRECT3D_VERSION >= 0x0500)
+DEFINE_GUID( IID_IDirect3DViewport2, 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+#if(DIRECT3D_VERSION >= 0x0600)
+DEFINE_GUID( IID_IDirect3DViewport3, 0xb0ab3b61, 0x33d7, 0x11d1, 0xa9, 0x81, 0x0, 0xc0, 0x4f, 0xd7, 0xb1, 0x74);
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0600)
+DEFINE_GUID( IID_IDirect3DVertexBuffer, 0x7a503555, 0x4a83, 0x11d1, 0xa5, 0xdb, 0x0, 0xa0, 0xc9, 0x3, 0x67, 0xf8);
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0700)
+DEFINE_GUID( IID_IDirect3DVertexBuffer7, 0xf5049e7d, 0x4861, 0x11d2, 0xa4, 0x7, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+#endif
+
+#ifdef __cplusplus
+struct IDirect3D;
+struct IDirect3DDevice;
+struct IDirect3DLight;
+struct IDirect3DMaterial;
+struct IDirect3DExecuteBuffer;
+struct IDirect3DTexture;
+struct IDirect3DViewport;
+typedef struct IDirect3D *LPDIRECT3D;
+typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
+typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
+typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
+typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
+typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
+typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
+
+#if(DIRECT3D_VERSION >= 0x0500)
+struct IDirect3D2;
+struct IDirect3DDevice2;
+struct IDirect3DMaterial2;
+struct IDirect3DTexture2;
+struct IDirect3DViewport2;
+typedef struct IDirect3D2 *LPDIRECT3D2;
+typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
+typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
+typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
+typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+struct IDirect3D3;
+struct IDirect3DDevice3;
+struct IDirect3DMaterial3;
+struct IDirect3DViewport3;
+struct IDirect3DVertexBuffer;
+typedef struct IDirect3D3 *LPDIRECT3D3;
+typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3;
+typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3;
+typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3;
+typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER;
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+struct IDirect3D7;
+struct IDirect3DDevice7;
+struct IDirect3DVertexBuffer7;
+typedef struct IDirect3D7 *LPDIRECT3D7;
+typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7;
+typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7;
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#else
+
+typedef struct IDirect3D *LPDIRECT3D;
+typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
+typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
+typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
+typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
+typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
+typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
+
+#if(DIRECT3D_VERSION >= 0x0500)
+typedef struct IDirect3D2 *LPDIRECT3D2;
+typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
+typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
+typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
+typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+typedef struct IDirect3D3 *LPDIRECT3D3;
+typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3;
+typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3;
+typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3;
+typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER;
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+typedef struct IDirect3D7 *LPDIRECT3D7;
+typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7;
+typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7;
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#endif
+
+#include "d3dtypes.h"
+#include "d3dcaps.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Direct3D interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3D
+
+DECLARE_INTERFACE_(IDirect3D, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3D methods ***/
+ STDMETHOD(Initialize)(THIS_ REFCLSID) PURE;
+ STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE;
+ STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE;
+ STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL*,IUnknown*) PURE;
+ STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT*,IUnknown*) PURE;
+ STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE;
+};
+
+typedef struct IDirect3D *LPDIRECT3D;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3D_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3D_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#define IDirect3D_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b)
+#define IDirect3D_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
+#define IDirect3D_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
+#define IDirect3D_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
+#define IDirect3D_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
+#else
+#define IDirect3D_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D_AddRef(p) (p)->AddRef()
+#define IDirect3D_Release(p) (p)->Release()
+#define IDirect3D_Initialize(p,a) (p)->Initialize(a)
+#define IDirect3D_EnumDevices(p,a,b) (p)->EnumDevices(a,b)
+#define IDirect3D_CreateLight(p,a,b) (p)->CreateLight(a,b)
+#define IDirect3D_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b)
+#define IDirect3D_CreateViewport(p,a,b) (p)->CreateViewport(a,b)
+#define IDirect3D_FindDevice(p,a,b) (p)->FindDevice(a,b)
+#endif
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#undef INTERFACE
+#define INTERFACE IDirect3D2
+
+DECLARE_INTERFACE_(IDirect3D2, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3D2 methods ***/
+ STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE;
+ STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,IUnknown*) PURE;
+ STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL2*,IUnknown*) PURE;
+ STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT2*,IUnknown*) PURE;
+ STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE;
+ STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE,LPDIRECT3DDEVICE2*) PURE;
+};
+
+typedef struct IDirect3D2 *LPDIRECT3D2;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3D2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3D2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3D2_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3D2_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b)
+#define IDirect3D2_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
+#define IDirect3D2_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
+#define IDirect3D2_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
+#define IDirect3D2_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
+#define IDirect3D2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
+#else
+#define IDirect3D2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D2_AddRef(p) (p)->AddRef()
+#define IDirect3D2_Release(p) (p)->Release()
+#define IDirect3D2_EnumDevices(p,a,b) (p)->EnumDevices(a,b)
+#define IDirect3D2_CreateLight(p,a,b) (p)->CreateLight(a,b)
+#define IDirect3D2_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b)
+#define IDirect3D2_CreateViewport(p,a,b) (p)->CreateViewport(a,b)
+#define IDirect3D2_FindDevice(p,a,b) (p)->FindDevice(a,b)
+#define IDirect3D2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+#undef INTERFACE
+#define INTERFACE IDirect3D3
+
+DECLARE_INTERFACE_(IDirect3D3, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3D3 methods ***/
+ STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK,LPVOID) PURE;
+ STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT*,LPUNKNOWN) PURE;
+ STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL3*,LPUNKNOWN) PURE;
+ STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT3*,LPUNKNOWN) PURE;
+ STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH,LPD3DFINDDEVICERESULT) PURE;
+ STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE4,LPDIRECT3DDEVICE3*,LPUNKNOWN) PURE;
+ STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER*,DWORD,LPUNKNOWN) PURE;
+ STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE;
+ STDMETHOD(EvictManagedTextures)(THIS) PURE;
+};
+
+typedef struct IDirect3D3 *LPDIRECT3D3;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3D3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3D3_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3D3_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3D3_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b)
+#define IDirect3D3_CreateLight(p,a,b) (p)->lpVtbl->CreateLight(p,a,b)
+#define IDirect3D3_CreateMaterial(p,a,b) (p)->lpVtbl->CreateMaterial(p,a,b)
+#define IDirect3D3_CreateViewport(p,a,b) (p)->lpVtbl->CreateViewport(p,a,b)
+#define IDirect3D3_FindDevice(p,a,b) (p)->lpVtbl->FindDevice(p,a,b)
+#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d)
+#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d)
+#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c)
+#define IDirect3D3_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p)
+#else
+#define IDirect3D3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D3_AddRef(p) (p)->AddRef()
+#define IDirect3D3_Release(p) (p)->Release()
+#define IDirect3D3_EnumDevices(p,a,b) (p)->EnumDevices(a,b)
+#define IDirect3D3_CreateLight(p,a,b) (p)->CreateLight(a,b)
+#define IDirect3D3_CreateMaterial(p,a,b) (p)->CreateMaterial(a,b)
+#define IDirect3D3_CreateViewport(p,a,b) (p)->CreateViewport(a,b)
+#define IDirect3D3_FindDevice(p,a,b) (p)->FindDevice(a,b)
+#define IDirect3D3_CreateDevice(p,a,b,c,d) (p)->CreateDevice(a,b,c,d)
+#define IDirect3D3_CreateVertexBuffer(p,a,b,c,d) (p)->CreateVertexBuffer(a,b,c,d)
+#define IDirect3D3_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c)
+#define IDirect3D3_EvictManagedTextures(p) (p)->EvictManagedTextures()
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+#undef INTERFACE
+#define INTERFACE IDirect3D7
+
+DECLARE_INTERFACE_(IDirect3D7, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3D7 methods ***/
+ STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK7,LPVOID) PURE;
+ STDMETHOD(CreateDevice)(THIS_ REFCLSID,LPDIRECTDRAWSURFACE7,LPDIRECT3DDEVICE7*) PURE;
+ STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC,LPDIRECT3DVERTEXBUFFER7*,DWORD) PURE;
+ STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID,LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE;
+ STDMETHOD(EvictManagedTextures)(THIS) PURE;
+};
+
+typedef struct IDirect3D7 *LPDIRECT3D7;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3D7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3D7_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3D7_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3D7_EnumDevices(p,a,b) (p)->lpVtbl->EnumDevices(p,a,b)
+#define IDirect3D7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c)
+#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->lpVtbl->CreateVertexBuffer(p,a,b,c)
+#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->lpVtbl->EnumZBufferFormats(p,a,b,c)
+#define IDirect3D7_EvictManagedTextures(p) (p)->lpVtbl->EvictManagedTextures(p)
+#else
+#define IDirect3D7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D7_AddRef(p) (p)->AddRef()
+#define IDirect3D7_Release(p) (p)->Release()
+#define IDirect3D7_EnumDevices(p,a,b) (p)->EnumDevices(a,b)
+#define IDirect3D7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c)
+#define IDirect3D7_CreateVertexBuffer(p,a,b,c) (p)->CreateVertexBuffer(a,b,c)
+#define IDirect3D7_EnumZBufferFormats(p,a,b,c) (p)->EnumZBufferFormats(a,b,c)
+#define IDirect3D7_EvictManagedTextures(p) (p)->EvictManagedTextures()
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+/*
+ * Direct3D Device interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3DDevice
+
+DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DDevice methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3D,LPGUID,LPD3DDEVICEDESC) PURE;
+ STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE;
+ STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE,LPDIRECT3DTEXTURE) PURE;
+ STDMETHOD(CreateExecuteBuffer)(THIS_ LPD3DEXECUTEBUFFERDESC,LPDIRECT3DEXECUTEBUFFER*,IUnknown*) PURE;
+ STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE;
+ STDMETHOD(Execute)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD) PURE;
+ STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE;
+ STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT) PURE;
+ STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT,LPDIRECT3DVIEWPORT*,DWORD) PURE;
+ STDMETHOD(Pick)(THIS_ LPDIRECT3DEXECUTEBUFFER,LPDIRECT3DVIEWPORT,DWORD,LPD3DRECT) PURE;
+ STDMETHOD(GetPickRecords)(THIS_ LPDWORD,LPD3DPICKRECORD) PURE;
+ STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE;
+ STDMETHOD(CreateMatrix)(THIS_ LPD3DMATRIXHANDLE) PURE;
+ STDMETHOD(SetMatrix)(THIS_ D3DMATRIXHANDLE,const LPD3DMATRIX) PURE;
+ STDMETHOD(GetMatrix)(THIS_ D3DMATRIXHANDLE,LPD3DMATRIX) PURE;
+ STDMETHOD(DeleteMatrix)(THIS_ D3DMATRIXHANDLE) PURE;
+ STDMETHOD(BeginScene)(THIS) PURE;
+ STDMETHOD(EndScene)(THIS) PURE;
+ STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D*) PURE;
+};
+
+typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c)
+#define IDirect3DDevice_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b)
+#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b)
+#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->lpVtbl->CreateExecuteBuffer(p,a,b,c)
+#define IDirect3DDevice_GetStats(p,a) (p)->lpVtbl->GetStats(p,a)
+#define IDirect3DDevice_Execute(p,a,b,c) (p)->lpVtbl->Execute(p,a,b,c)
+#define IDirect3DDevice_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a)
+#define IDirect3DDevice_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a)
+#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c)
+#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->lpVtbl->Pick(p,a,b,c,d)
+#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->lpVtbl->GetPickRecords(p,a,b)
+#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b)
+#define IDirect3DDevice_CreateMatrix(p,a) (p)->lpVtbl->CreateMatrix(p,a)
+#define IDirect3DDevice_SetMatrix(p,a,b) (p)->lpVtbl->SetMatrix(p,a,b)
+#define IDirect3DDevice_GetMatrix(p,a,b) (p)->lpVtbl->GetMatrix(p,a,b)
+#define IDirect3DDevice_DeleteMatrix(p,a) (p)->lpVtbl->DeleteMatrix(p,a)
+#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p)
+#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p)
+#define IDirect3DDevice_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a)
+#else
+#define IDirect3DDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice_AddRef(p) (p)->AddRef()
+#define IDirect3DDevice_Release(p) (p)->Release()
+#define IDirect3DDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c)
+#define IDirect3DDevice_GetCaps(p,a,b) (p)->GetCaps(a,b)
+#define IDirect3DDevice_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b)
+#define IDirect3DDevice_CreateExecuteBuffer(p,a,b,c) (p)->CreateExecuteBuffer(a,b,c)
+#define IDirect3DDevice_GetStats(p,a) (p)->GetStats(a)
+#define IDirect3DDevice_Execute(p,a,b,c) (p)->Execute(a,b,c)
+#define IDirect3DDevice_AddViewport(p,a) (p)->AddViewport(a)
+#define IDirect3DDevice_DeleteViewport(p,a) (p)->DeleteViewport(a)
+#define IDirect3DDevice_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c)
+#define IDirect3DDevice_Pick(p,a,b,c,d) (p)->Pick(a,b,c,d)
+#define IDirect3DDevice_GetPickRecords(p,a,b) (p)->GetPickRecords(a,b)
+#define IDirect3DDevice_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b)
+#define IDirect3DDevice_CreateMatrix(p,a) (p)->CreateMatrix(a)
+#define IDirect3DDevice_SetMatrix(p,a,b) (p)->SetMatrix(a,b)
+#define IDirect3DDevice_GetMatrix(p,a,b) (p)->GetMatrix(a,b)
+#define IDirect3DDevice_DeleteMatrix(p,a) (p)->DeleteMatrix(a)
+#define IDirect3DDevice_BeginScene(p) (p)->BeginScene()
+#define IDirect3DDevice_EndScene(p) (p)->EndScene()
+#define IDirect3DDevice_GetDirect3D(p,a) (p)->GetDirect3D(a)
+#endif
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#undef INTERFACE
+#define INTERFACE IDirect3DDevice2
+
+DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DDevice2 methods ***/
+ STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE;
+ STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE2,LPDIRECT3DTEXTURE2) PURE;
+ STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE;
+ STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE;
+ STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE;
+ STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT2,LPDIRECT3DVIEWPORT2*,DWORD) PURE;
+ STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK,LPVOID) PURE;
+ STDMETHOD(BeginScene)(THIS) PURE;
+ STDMETHOD(EndScene)(THIS) PURE;
+ STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D2*) PURE;
+ STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2) PURE;
+ STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2 *) PURE;
+ STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE,DWORD) PURE;
+ STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE *) PURE;
+ STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,DWORD) PURE;
+ STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE;
+ STDMETHOD(Vertex)(THIS_ LPVOID) PURE;
+ STDMETHOD(Index)(THIS_ WORD) PURE;
+ STDMETHOD(End)(THIS_ DWORD) PURE;
+ STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE;
+ STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE;
+ STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE;
+ STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE;
+ STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,DWORD) PURE;
+ STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,D3DVERTEXTYPE,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE;
+ STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE;
+ STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE;
+};
+
+typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DDevice2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DDevice2_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DDevice2_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b)
+#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->lpVtbl->SwapTextureHandles(p,a,b)
+#define IDirect3DDevice2_GetStats(p,a) (p)->lpVtbl->GetStats(p,a)
+#define IDirect3DDevice2_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a)
+#define IDirect3DDevice2_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a)
+#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c)
+#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b)
+#define IDirect3DDevice2_BeginScene(p) (p)->lpVtbl->BeginScene(p)
+#define IDirect3DDevice2_EndScene(p) (p)->lpVtbl->EndScene(p)
+#define IDirect3DDevice2_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a)
+#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a)
+#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a)
+#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b)
+#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a)
+#define IDirect3DDevice2_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
+#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e)
+#define IDirect3DDevice2_Vertex(p,a) (p)->lpVtbl->Vertex(p,a)
+#define IDirect3DDevice2_Index(p,a) (p)->lpVtbl->Index(p,a)
+#define IDirect3DDevice2_End(p,a) (p)->lpVtbl->End(p,a)
+#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b)
+#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b)
+#define IDirect3DDevice2_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b)
+#define IDirect3DDevice2_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b)
+#define IDirect3DDevice2_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b)
+#define IDirect3DDevice2_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b)
+#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b)
+#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e)
+#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice2_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a)
+#define IDirect3DDevice2_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a)
+#else
+#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice2_AddRef(p) (p)->AddRef()
+#define IDirect3DDevice2_Release(p) (p)->Release()
+#define IDirect3DDevice2_GetCaps(p,a,b) (p)->GetCaps(a,b)
+#define IDirect3DDevice2_SwapTextureHandles(p,a,b) (p)->SwapTextureHandles(a,b)
+#define IDirect3DDevice2_GetStats(p,a) (p)->GetStats(a)
+#define IDirect3DDevice2_AddViewport(p,a) (p)->AddViewport(a)
+#define IDirect3DDevice2_DeleteViewport(p,a) (p)->DeleteViewport(a)
+#define IDirect3DDevice2_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c)
+#define IDirect3DDevice2_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b)
+#define IDirect3DDevice2_BeginScene(p) (p)->BeginScene()
+#define IDirect3DDevice2_EndScene(p) (p)->EndScene()
+#define IDirect3DDevice2_GetDirect3D(p,a) (p)->GetDirect3D(a)
+#define IDirect3DDevice2_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a)
+#define IDirect3DDevice2_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a)
+#define IDirect3DDevice2_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b)
+#define IDirect3DDevice2_GetRenderTarget(p,a) (p)->GetRenderTarget(a)
+#define IDirect3DDevice2_Begin(p,a,b,c) (p)->Begin(a,b,c)
+#define IDirect3DDevice2_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e)
+#define IDirect3DDevice2_Vertex(p,a) (p)->Vertex(a)
+#define IDirect3DDevice2_Index(p,a) (p)->Index(a)
+#define IDirect3DDevice2_End(p,a) (p)->End(a)
+#define IDirect3DDevice2_GetRenderState(p,a,b) (p)->GetRenderState(a,b)
+#define IDirect3DDevice2_SetRenderState(p,a,b) (p)->SetRenderState(a,b)
+#define IDirect3DDevice2_GetLightState(p,a,b) (p)->GetLightState(a,b)
+#define IDirect3DDevice2_SetLightState(p,a,b) (p)->SetLightState(a,b)
+#define IDirect3DDevice2_SetTransform(p,a,b) (p)->SetTransform(a,b)
+#define IDirect3DDevice2_GetTransform(p,a,b) (p)->GetTransform(a,b)
+#define IDirect3DDevice2_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b)
+#define IDirect3DDevice2_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e)
+#define IDirect3DDevice2_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g)
+#define IDirect3DDevice2_SetClipStatus(p,a) (p)->SetClipStatus(a)
+#define IDirect3DDevice2_GetClipStatus(p,a) (p)->GetClipStatus(a)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+#undef INTERFACE
+#define INTERFACE IDirect3DDevice3
+
+DECLARE_INTERFACE_(IDirect3DDevice3, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DDevice3 methods ***/
+ STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC,LPD3DDEVICEDESC) PURE;
+ STDMETHOD(GetStats)(THIS_ LPD3DSTATS) PURE;
+ STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE;
+ STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE;
+ STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT3,LPDIRECT3DVIEWPORT3*,DWORD) PURE;
+ STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE;
+ STDMETHOD(BeginScene)(THIS) PURE;
+ STDMETHOD(EndScene)(THIS) PURE;
+ STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D3*) PURE;
+ STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3) PURE;
+ STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3 *) PURE;
+ STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4,DWORD) PURE;
+ STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4 *) PURE;
+ STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE,DWORD,DWORD) PURE;
+ STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE;
+ STDMETHOD(Vertex)(THIS_ LPVOID) PURE;
+ STDMETHOD(Index)(THIS_ WORD) PURE;
+ STDMETHOD(End)(THIS_ DWORD) PURE;
+ STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE;
+ STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE;
+ STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE,LPDWORD) PURE;
+ STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE,DWORD) PURE;
+ STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE;
+ STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE;
+ STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE;
+ STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE;
+ STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE;
+ STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE;
+ STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,DWORD,DWORD,DWORD) PURE;
+ STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER,LPWORD,DWORD,DWORD) PURE;
+ STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE;
+ STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2 *) PURE;
+ STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECT3DTEXTURE2) PURE;
+ STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE;
+ STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE;
+ STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE;
+};
+
+typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DDevice3_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DDevice3_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DDevice3_GetCaps(p,a,b) (p)->lpVtbl->GetCaps(p,a,b)
+#define IDirect3DDevice3_GetStats(p,a) (p)->lpVtbl->GetStats(p,a)
+#define IDirect3DDevice3_AddViewport(p,a) (p)->lpVtbl->AddViewport(p,a)
+#define IDirect3DDevice3_DeleteViewport(p,a) (p)->lpVtbl->DeleteViewport(p,a)
+#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->lpVtbl->NextViewport(p,a,b,c)
+#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b)
+#define IDirect3DDevice3_BeginScene(p) (p)->lpVtbl->BeginScene(p)
+#define IDirect3DDevice3_EndScene(p) (p)->lpVtbl->EndScene(p)
+#define IDirect3DDevice3_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a)
+#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->lpVtbl->SetCurrentViewport(p,a)
+#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->lpVtbl->GetCurrentViewport(p,a)
+#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b)
+#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a)
+#define IDirect3DDevice3_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
+#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->lpVtbl->BeginIndexed(p,a,b,c,d,e)
+#define IDirect3DDevice3_Vertex(p,a) (p)->lpVtbl->Vertex(p,a)
+#define IDirect3DDevice3_Index(p,a) (p)->lpVtbl->Index(p,a)
+#define IDirect3DDevice3_End(p,a) (p)->lpVtbl->End(p,a)
+#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b)
+#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b)
+#define IDirect3DDevice3_GetLightState(p,a,b) (p)->lpVtbl->GetLightState(p,a,b)
+#define IDirect3DDevice3_SetLightState(p,a,b) (p)->lpVtbl->SetLightState(p,a,b)
+#define IDirect3DDevice3_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b)
+#define IDirect3DDevice3_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b)
+#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b)
+#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e)
+#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice3_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a)
+#define IDirect3DDevice3_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a)
+#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e)
+#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e)
+#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e)
+#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e)
+#define IDirect3DDevice3_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b)
+#define IDirect3DDevice3_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b)
+#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c)
+#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c)
+#define IDirect3DDevice3_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a)
+#else
+#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice3_AddRef(p) (p)->AddRef()
+#define IDirect3DDevice3_Release(p) (p)->Release()
+#define IDirect3DDevice3_GetCaps(p,a,b) (p)->GetCaps(a,b)
+#define IDirect3DDevice3_GetStats(p,a) (p)->GetStats(a)
+#define IDirect3DDevice3_AddViewport(p,a) (p)->AddViewport(a)
+#define IDirect3DDevice3_DeleteViewport(p,a) (p)->DeleteViewport(a)
+#define IDirect3DDevice3_NextViewport(p,a,b,c) (p)->NextViewport(a,b,c)
+#define IDirect3DDevice3_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b)
+#define IDirect3DDevice3_BeginScene(p) (p)->BeginScene()
+#define IDirect3DDevice3_EndScene(p) (p)->EndScene()
+#define IDirect3DDevice3_GetDirect3D(p,a) (p)->GetDirect3D(a)
+#define IDirect3DDevice3_SetCurrentViewport(p,a) (p)->SetCurrentViewport(a)
+#define IDirect3DDevice3_GetCurrentViewport(p,a) (p)->GetCurrentViewport(a)
+#define IDirect3DDevice3_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b)
+#define IDirect3DDevice3_GetRenderTarget(p,a) (p)->GetRenderTarget(a)
+#define IDirect3DDevice3_Begin(p,a,b,c) (p)->Begin(a,b,c)
+#define IDirect3DDevice3_BeginIndexed(p,a,b,c,d,e) (p)->BeginIndexed(a,b,c,d,e)
+#define IDirect3DDevice3_Vertex(p,a) (p)->Vertex(a)
+#define IDirect3DDevice3_Index(p,a) (p)->Index(a)
+#define IDirect3DDevice3_End(p,a) (p)->End(a)
+#define IDirect3DDevice3_GetRenderState(p,a,b) (p)->GetRenderState(a,b)
+#define IDirect3DDevice3_SetRenderState(p,a,b) (p)->SetRenderState(a,b)
+#define IDirect3DDevice3_GetLightState(p,a,b) (p)->GetLightState(a,b)
+#define IDirect3DDevice3_SetLightState(p,a,b) (p)->SetLightState(a,b)
+#define IDirect3DDevice3_SetTransform(p,a,b) (p)->SetTransform(a,b)
+#define IDirect3DDevice3_GetTransform(p,a,b) (p)->GetTransform(a,b)
+#define IDirect3DDevice3_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b)
+#define IDirect3DDevice3_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e)
+#define IDirect3DDevice3_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g)
+#define IDirect3DDevice3_SetClipStatus(p,a) (p)->SetClipStatus(a)
+#define IDirect3DDevice3_GetClipStatus(p,a) (p)->GetClipStatus(a)
+#define IDirect3DDevice3_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e)
+#define IDirect3DDevice3_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g)
+#define IDirect3DDevice3_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e)
+#define IDirect3DDevice3_DrawIndexedPrimitiveVB(p,a,b,c,d,e) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e)
+#define IDirect3DDevice3_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e)
+#define IDirect3DDevice3_GetTexture(p,a,b) (p)->GetTexture(a,b)
+#define IDirect3DDevice3_SetTexture(p,a,b) (p)->SetTexture(a,b)
+#define IDirect3DDevice3_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c)
+#define IDirect3DDevice3_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c)
+#define IDirect3DDevice3_ValidateDevice(p,a) (p)->ValidateDevice(a)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+#undef INTERFACE
+#define INTERFACE IDirect3DDevice7
+
+DECLARE_INTERFACE_(IDirect3DDevice7, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DDevice7 methods ***/
+ STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC7) PURE;
+ STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK,LPVOID) PURE;
+ STDMETHOD(BeginScene)(THIS) PURE;
+ STDMETHOD(EndScene)(THIS) PURE;
+ STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D7*) PURE;
+ STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7,DWORD) PURE;
+ STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7 *) PURE;
+ STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE;
+ STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT7) PURE;
+ STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,LPD3DMATRIX) PURE;
+ STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT7) PURE;
+ STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL7) PURE;
+ STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL7) PURE;
+ STDMETHOD(SetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE;
+ STDMETHOD(GetLight)(THIS_ DWORD,LPD3DLIGHT7) PURE;
+ STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE,DWORD) PURE;
+ STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE,LPDWORD) PURE;
+ STDMETHOD(BeginStateBlock)(THIS) PURE;
+ STDMETHOD(EndStateBlock)(THIS_ LPDWORD) PURE;
+ STDMETHOD(PreLoad)(THIS_ LPDIRECTDRAWSURFACE7) PURE;
+ STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,DWORD) PURE;
+ STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,DWORD,LPVOID,DWORD,LPWORD,DWORD,DWORD) PURE;
+ STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE;
+ STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS) PURE;
+ STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,DWORD) PURE;
+ STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPWORD,DWORD,DWORD) PURE;
+ STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,DWORD) PURE;
+ STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE,LPDIRECT3DVERTEXBUFFER7,DWORD,DWORD,LPWORD,DWORD,DWORD) PURE;
+ STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR,LPD3DVALUE,DWORD,DWORD,LPDWORD) PURE;
+ STDMETHOD(GetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7 *) PURE;
+ STDMETHOD(SetTexture)(THIS_ DWORD,LPDIRECTDRAWSURFACE7) PURE;
+ STDMETHOD(GetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,LPDWORD) PURE;
+ STDMETHOD(SetTextureStageState)(THIS_ DWORD,D3DTEXTURESTAGESTATETYPE,DWORD) PURE;
+ STDMETHOD(ValidateDevice)(THIS_ LPDWORD) PURE;
+ STDMETHOD(ApplyStateBlock)(THIS_ DWORD) PURE;
+ STDMETHOD(CaptureStateBlock)(THIS_ DWORD) PURE;
+ STDMETHOD(DeleteStateBlock)(THIS_ DWORD) PURE;
+ STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE,LPDWORD) PURE;
+ STDMETHOD(Load)(THIS_ LPDIRECTDRAWSURFACE7,LPPOINT,LPDIRECTDRAWSURFACE7,LPRECT,DWORD) PURE;
+ STDMETHOD(LightEnable)(THIS_ DWORD,BOOL) PURE;
+ STDMETHOD(GetLightEnable)(THIS_ DWORD,BOOL*) PURE;
+ STDMETHOD(SetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE;
+ STDMETHOD(GetClipPlane)(THIS_ DWORD,D3DVALUE*) PURE;
+ STDMETHOD(GetInfo)(THIS_ DWORD,LPVOID,DWORD) PURE;
+};
+
+typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DDevice7_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DDevice7_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DDevice7_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->lpVtbl->EnumTextureFormats(p,a,b)
+#define IDirect3DDevice7_BeginScene(p) (p)->lpVtbl->BeginScene(p)
+#define IDirect3DDevice7_EndScene(p) (p)->lpVtbl->EndScene(p)
+#define IDirect3DDevice7_GetDirect3D(p,a) (p)->lpVtbl->GetDirect3D(p,a)
+#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->lpVtbl->SetRenderTarget(p,a,b)
+#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->lpVtbl->GetRenderTarget(p,a)
+#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->lpVtbl->Clear(p,a,b,c,d,e,f)
+#define IDirect3DDevice7_SetTransform(p,a,b) (p)->lpVtbl->SetTransform(p,a,b)
+#define IDirect3DDevice7_GetTransform(p,a,b) (p)->lpVtbl->GetTransform(p,a,b)
+#define IDirect3DDevice7_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a)
+#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->lpVtbl->MultiplyTransform(p,a,b)
+#define IDirect3DDevice7_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a)
+#define IDirect3DDevice7_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DDevice7_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DDevice7_SetLight(p,a,b) (p)->lpVtbl->SetLight(p,a,b)
+#define IDirect3DDevice7_GetLight(p,a,b) (p)->lpVtbl->GetLight(p,a,b)
+#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->lpVtbl->SetRenderState(p,a,b)
+#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->lpVtbl->GetRenderState(p,a,b)
+#define IDirect3DDevice7_BeginStateBlock(p) (p)->lpVtbl->BeginStateBlock(p)
+#define IDirect3DDevice7_EndStateBlock(p,a) (p)->lpVtbl->EndStateBlock(p,a)
+#define IDirect3DDevice7_PreLoad(p,a) (p)->lpVtbl->PreLoad(p,a)
+#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitive(p,a,b,c,d,e)
+#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice7_SetClipStatus(p,a) (p)->lpVtbl->SetClipStatus(p,a)
+#define IDirect3DDevice7_GetClipStatus(p,a) (p)->lpVtbl->GetClipStatus(p,a)
+#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveStrided(p,a,b,c,d,e)
+#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->lpVtbl->DrawPrimitiveVB(p,a,b,c,d,e)
+#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->lpVtbl->DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->lpVtbl->ComputeSphereVisibility(p,a,b,c,d,e)
+#define IDirect3DDevice7_GetTexture(p,a,b) (p)->lpVtbl->GetTexture(p,a,b)
+#define IDirect3DDevice7_SetTexture(p,a,b) (p)->lpVtbl->SetTexture(p,a,b)
+#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->lpVtbl->GetTextureStageState(p,a,b,c)
+#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->lpVtbl->SetTextureStageState(p,a,b,c)
+#define IDirect3DDevice7_ValidateDevice(p,a) (p)->lpVtbl->ValidateDevice(p,a)
+#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->lpVtbl->ApplyStateBlock(p,a)
+#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->lpVtbl->CaptureStateBlock(p,a)
+#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->lpVtbl->DeleteStateBlock(p,a)
+#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->lpVtbl->CreateStateBlock(p,a,b)
+#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DDevice7_LightEnable(p,a,b) (p)->lpVtbl->LightEnable(p,a,b)
+#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->lpVtbl->GetLightEnable(p,a,b)
+#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->lpVtbl->SetClipPlane(p,a,b)
+#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->lpVtbl->GetClipPlane(p,a,b)
+#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->lpVtbl->GetInfo(p,a,b,c)
+#else
+#define IDirect3DDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice7_AddRef(p) (p)->AddRef()
+#define IDirect3DDevice7_Release(p) (p)->Release()
+#define IDirect3DDevice7_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirect3DDevice7_EnumTextureFormats(p,a,b) (p)->EnumTextureFormats(a,b)
+#define IDirect3DDevice7_BeginScene(p) (p)->BeginScene()
+#define IDirect3DDevice7_EndScene(p) (p)->EndScene()
+#define IDirect3DDevice7_GetDirect3D(p,a) (p)->GetDirect3D(a)
+#define IDirect3DDevice7_SetRenderTarget(p,a,b) (p)->SetRenderTarget(a,b)
+#define IDirect3DDevice7_GetRenderTarget(p,a) (p)->GetRenderTarget(a)
+#define IDirect3DDevice7_Clear(p,a,b,c,d,e,f) (p)->Clear(a,b,c,d,e,f)
+#define IDirect3DDevice7_SetTransform(p,a,b) (p)->SetTransform(a,b)
+#define IDirect3DDevice7_GetTransform(p,a,b) (p)->GetTransform(a,b)
+#define IDirect3DDevice7_SetViewport(p,a) (p)->SetViewport(a)
+#define IDirect3DDevice7_MultiplyTransform(p,a,b) (p)->MultiplyTransform(a,b)
+#define IDirect3DDevice7_GetViewport(p,a) (p)->GetViewport(a)
+#define IDirect3DDevice7_SetMaterial(p,a) (p)->SetMaterial(a)
+#define IDirect3DDevice7_GetMaterial(p,a) (p)->GetMaterial(a)
+#define IDirect3DDevice7_SetLight(p,a,b) (p)->SetLight(a,b)
+#define IDirect3DDevice7_GetLight(p,a,b) (p)->GetLight(a,b)
+#define IDirect3DDevice7_SetRenderState(p,a,b) (p)->SetRenderState(a,b)
+#define IDirect3DDevice7_GetRenderState(p,a,b) (p)->GetRenderState(a,b)
+#define IDirect3DDevice7_BeginStateBlock(p) (p)->BeginStateBlock()
+#define IDirect3DDevice7_EndStateBlock(p,a) (p)->EndStateBlock(a)
+#define IDirect3DDevice7_PreLoad(p,a) (p)->PreLoad(a)
+#define IDirect3DDevice7_DrawPrimitive(p,a,b,c,d,e) (p)->DrawPrimitive(a,b,c,d,e)
+#define IDirect3DDevice7_DrawIndexedPrimitive(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitive(a,b,c,d,e,f,g)
+#define IDirect3DDevice7_SetClipStatus(p,a) (p)->SetClipStatus(a)
+#define IDirect3DDevice7_GetClipStatus(p,a) (p)->GetClipStatus(a)
+#define IDirect3DDevice7_DrawPrimitiveStrided(p,a,b,c,d,e) (p)->DrawPrimitiveStrided(a,b,c,d,e)
+#define IDirect3DDevice7_DrawIndexedPrimitiveStrided(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveStrided(a,b,c,d,e,f,g)
+#define IDirect3DDevice7_DrawPrimitiveVB(p,a,b,c,d,e) (p)->DrawPrimitiveVB(a,b,c,d,e)
+#define IDirect3DDevice7_DrawIndexedPrimitiveVB(p,a,b,c,d,e,f,g) (p)->DrawIndexedPrimitiveVB(a,b,c,d,e,f,g)
+#define IDirect3DDevice7_ComputeSphereVisibility(p,a,b,c,d,e) (p)->ComputeSphereVisibility(a,b,c,d,e)
+#define IDirect3DDevice7_GetTexture(p,a,b) (p)->GetTexture(a,b)
+#define IDirect3DDevice7_SetTexture(p,a,b) (p)->SetTexture(a,b)
+#define IDirect3DDevice7_GetTextureStageState(p,a,b,c) (p)->GetTextureStageState(a,b,c)
+#define IDirect3DDevice7_SetTextureStageState(p,a,b,c) (p)->SetTextureStageState(a,b,c)
+#define IDirect3DDevice7_ValidateDevice(p,a) (p)->ValidateDevice(a)
+#define IDirect3DDevice7_ApplyStateBlock(p,a) (p)->ApplyStateBlock(a)
+#define IDirect3DDevice7_CaptureStateBlock(p,a) (p)->CaptureStateBlock(a)
+#define IDirect3DDevice7_DeleteStateBlock(p,a) (p)->DeleteStateBlock(a)
+#define IDirect3DDevice7_CreateStateBlock(p,a,b) (p)->CreateStateBlock(a,b)
+#define IDirect3DDevice7_Load(p,a,b,c,d,e) (p)->Load(a,b,c,d,e)
+#define IDirect3DDevice7_LightEnable(p,a,b) (p)->LightEnable(a,b)
+#define IDirect3DDevice7_GetLightEnable(p,a,b) (p)->GetLightEnable(a,b)
+#define IDirect3DDevice7_SetClipPlane(p,a,b) (p)->SetClipPlane(a,b)
+#define IDirect3DDevice7_GetClipPlane(p,a,b) (p)->GetClipPlane(a,b)
+#define IDirect3DDevice7_GetInfo(p,a,b,c) (p)->GetInfo(a,b,c)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+/*
+ * Execute Buffer interface
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3DExecuteBuffer
+
+DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DExecuteBuffer methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPD3DEXECUTEBUFFERDESC) PURE;
+ STDMETHOD(Lock)(THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
+ STDMETHOD(Unlock)(THIS) PURE;
+ STDMETHOD(SetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE;
+ STDMETHOD(GetExecuteData)(THIS_ LPD3DEXECUTEDATA) PURE;
+ STDMETHOD(Validate)(THIS_ LPDWORD,LPD3DVALIDATECALLBACK,LPVOID,DWORD) PURE;
+ STDMETHOD(Optimize)(THIS_ DWORD) PURE;
+};
+
+typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirect3DExecuteBuffer_Lock(p,a) (p)->lpVtbl->Lock(p,a)
+#define IDirect3DExecuteBuffer_Unlock(p) (p)->lpVtbl->Unlock(p)
+#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->lpVtbl->SetExecuteData(p,a)
+#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->lpVtbl->GetExecuteData(p,a)
+#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->lpVtbl->Validate(p,a,b,c,d)
+#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->lpVtbl->Optimize(p,a)
+#else
+#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DExecuteBuffer_AddRef(p) (p)->AddRef()
+#define IDirect3DExecuteBuffer_Release(p) (p)->Release()
+#define IDirect3DExecuteBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirect3DExecuteBuffer_Lock(p,a) (p)->Lock(a)
+#define IDirect3DExecuteBuffer_Unlock(p) (p)->Unlock()
+#define IDirect3DExecuteBuffer_SetExecuteData(p,a) (p)->SetExecuteData(a)
+#define IDirect3DExecuteBuffer_GetExecuteData(p,a) (p)->GetExecuteData(a)
+#define IDirect3DExecuteBuffer_Validate(p,a,b,c,d) (p)->Validate(a,b,c,d)
+#define IDirect3DExecuteBuffer_Optimize(p,a) (p)->Optimize(a)
+#endif
+
+/*
+ * Light interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3DLight
+
+DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DLight methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE;
+ STDMETHOD(SetLight)(THIS_ LPD3DLIGHT) PURE;
+ STDMETHOD(GetLight)(THIS_ LPD3DLIGHT) PURE;
+};
+
+typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DLight_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DLight_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DLight_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DLight_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#define IDirect3DLight_SetLight(p,a) (p)->lpVtbl->SetLight(p,a)
+#define IDirect3DLight_GetLight(p,a) (p)->lpVtbl->GetLight(p,a)
+#else
+#define IDirect3DLight_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DLight_AddRef(p) (p)->AddRef()
+#define IDirect3DLight_Release(p) (p)->Release()
+#define IDirect3DLight_Initialize(p,a) (p)->Initialize(a)
+#define IDirect3DLight_SetLight(p,a) (p)->SetLight(a)
+#define IDirect3DLight_GetLight(p,a) (p)->GetLight(a)
+#endif
+
+/*
+ * Material interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3DMaterial
+
+DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DMaterial methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE;
+ STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE;
+ STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE;
+ STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DMATERIALHANDLE) PURE;
+ STDMETHOD(Reserve)(THIS) PURE;
+ STDMETHOD(Unreserve)(THIS) PURE;
+};
+
+typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DMaterial_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DMaterial_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DMaterial_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#define IDirect3DMaterial_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DMaterial_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DMaterial_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b)
+#define IDirect3DMaterial_Reserve(p) (p)->lpVtbl->Reserve(p)
+#define IDirect3DMaterial_Unreserve(p) (p)->lpVtbl->Unreserve(p)
+#else
+#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DMaterial_AddRef(p) (p)->AddRef()
+#define IDirect3DMaterial_Release(p) (p)->Release()
+#define IDirect3DMaterial_Initialize(p,a) (p)->Initialize(a)
+#define IDirect3DMaterial_SetMaterial(p,a) (p)->SetMaterial(a)
+#define IDirect3DMaterial_GetMaterial(p,a) (p)->GetMaterial(a)
+#define IDirect3DMaterial_GetHandle(p,a,b) (p)->GetHandle(a,b)
+#define IDirect3DMaterial_Reserve(p) (p)->Reserve()
+#define IDirect3DMaterial_Unreserve(p) (p)->Unreserve()
+#endif
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#undef INTERFACE
+#define INTERFACE IDirect3DMaterial2
+
+DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DMaterial2 methods ***/
+ STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE;
+ STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE;
+ STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DMATERIALHANDLE) PURE;
+};
+
+typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DMaterial2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DMaterial2_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DMaterial2_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DMaterial2_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b)
+#else
+#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DMaterial2_AddRef(p) (p)->AddRef()
+#define IDirect3DMaterial2_Release(p) (p)->Release()
+#define IDirect3DMaterial2_SetMaterial(p,a) (p)->SetMaterial(a)
+#define IDirect3DMaterial2_GetMaterial(p,a) (p)->GetMaterial(a)
+#define IDirect3DMaterial2_GetHandle(p,a,b) (p)->GetHandle(a,b)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+#undef INTERFACE
+#define INTERFACE IDirect3DMaterial3
+
+DECLARE_INTERFACE_(IDirect3DMaterial3, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DMaterial3 methods ***/
+ STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL) PURE;
+ STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL) PURE;
+ STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE3,LPD3DMATERIALHANDLE) PURE;
+};
+
+typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DMaterial3_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DMaterial3_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DMaterial3_SetMaterial(p,a) (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DMaterial3_GetMaterial(p,a) (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b)
+#else
+#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DMaterial3_AddRef(p) (p)->AddRef()
+#define IDirect3DMaterial3_Release(p) (p)->Release()
+#define IDirect3DMaterial3_SetMaterial(p,a) (p)->SetMaterial(a)
+#define IDirect3DMaterial3_GetMaterial(p,a) (p)->GetMaterial(a)
+#define IDirect3DMaterial3_GetHandle(p,a,b) (p)->GetHandle(a,b)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+/*
+ * Texture interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3DTexture
+
+DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DTexture methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE,LPDIRECTDRAWSURFACE) PURE;
+ STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE,LPD3DTEXTUREHANDLE) PURE;
+ STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE;
+ STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE) PURE;
+ STDMETHOD(Unload)(THIS) PURE;
+};
+
+typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DTexture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DTexture_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DTexture_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DTexture_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirect3DTexture_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b)
+#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b)
+#define IDirect3DTexture_Load(p,a) (p)->lpVtbl->Load(p,a)
+#define IDirect3DTexture_Unload(p) (p)->lpVtbl->Unload(p)
+#else
+#define IDirect3DTexture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DTexture_AddRef(p) (p)->AddRef()
+#define IDirect3DTexture_Release(p) (p)->Release()
+#define IDirect3DTexture_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirect3DTexture_GetHandle(p,a,b) (p)->GetHandle(a,b)
+#define IDirect3DTexture_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b)
+#define IDirect3DTexture_Load(p,a) (p)->Load(a)
+#define IDirect3DTexture_Unload(p) (p)->Unload()
+#endif
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#undef INTERFACE
+#define INTERFACE IDirect3DTexture2
+
+DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DTexture2 methods ***/
+ STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2,LPD3DTEXTUREHANDLE) PURE;
+ STDMETHOD(PaletteChanged)(THIS_ DWORD,DWORD) PURE;
+ STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE2) PURE;
+};
+
+typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DTexture2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DTexture2_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DTexture2_GetHandle(p,a,b) (p)->lpVtbl->GetHandle(p,a,b)
+#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->lpVtbl->PaletteChanged(p,a,b)
+#define IDirect3DTexture2_Load(p,a) (p)->lpVtbl->Load(p,a)
+#else
+#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DTexture2_AddRef(p) (p)->AddRef()
+#define IDirect3DTexture2_Release(p) (p)->Release()
+#define IDirect3DTexture2_GetHandle(p,a,b) (p)->GetHandle(a,b)
+#define IDirect3DTexture2_PaletteChanged(p,a,b) (p)->PaletteChanged(a,b)
+#define IDirect3DTexture2_Load(p,a) (p)->Load(a)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+/*
+ * Viewport interfaces
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3DViewport
+
+DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DViewport methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE;
+ STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE;
+ STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE;
+ STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE;
+ STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE;
+ STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE;
+ STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE;
+ STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE;
+ STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE;
+ STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE;
+ STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE;
+ STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE;
+ STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE;
+};
+
+typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DViewport_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DViewport_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DViewport_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DViewport_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#define IDirect3DViewport_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a)
+#define IDirect3DViewport_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a)
+#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d)
+#define IDirect3DViewport_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b)
+#define IDirect3DViewport_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a)
+#define IDirect3DViewport_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b)
+#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a)
+#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b)
+#define IDirect3DViewport_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c)
+#define IDirect3DViewport_AddLight(p,a) (p)->lpVtbl->AddLight(p,a)
+#define IDirect3DViewport_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a)
+#define IDirect3DViewport_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c)
+#else
+#define IDirect3DViewport_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DViewport_AddRef(p) (p)->AddRef()
+#define IDirect3DViewport_Release(p) (p)->Release()
+#define IDirect3DViewport_Initialize(p,a) (p)->Initialize(a)
+#define IDirect3DViewport_GetViewport(p,a) (p)->GetViewport(a)
+#define IDirect3DViewport_SetViewport(p,a) (p)->SetViewport(a)
+#define IDirect3DViewport_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d)
+#define IDirect3DViewport_LightElements(p,a,b) (p)->LightElements(a,b)
+#define IDirect3DViewport_SetBackground(p,a) (p)->SetBackground(a)
+#define IDirect3DViewport_GetBackground(p,a,b) (p)->GetBackground(a,b)
+#define IDirect3DViewport_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a)
+#define IDirect3DViewport_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b)
+#define IDirect3DViewport_Clear(p,a,b,c) (p)->Clear(a,b,c)
+#define IDirect3DViewport_AddLight(p,a) (p)->AddLight(a)
+#define IDirect3DViewport_DeleteLight(p,a) (p)->DeleteLight(a)
+#define IDirect3DViewport_NextLight(p,a,b,c) (p)->NextLight(a,b,c)
+#endif
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#undef INTERFACE
+#define INTERFACE IDirect3DViewport2
+
+DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DViewport methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE;
+ STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE;
+ STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE;
+ STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE;
+ STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE;
+ STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE;
+ STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE;
+ STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE;
+ STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE;
+ STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE;
+ STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE;
+ STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE;
+ STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE;
+ STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE;
+ STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE;
+};
+
+typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DViewport2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DViewport2_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DViewport2_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#define IDirect3DViewport2_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a)
+#define IDirect3DViewport2_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a)
+#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d)
+#define IDirect3DViewport2_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b)
+#define IDirect3DViewport2_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a)
+#define IDirect3DViewport2_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b)
+#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a)
+#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b)
+#define IDirect3DViewport2_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c)
+#define IDirect3DViewport2_AddLight(p,a) (p)->lpVtbl->AddLight(p,a)
+#define IDirect3DViewport2_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a)
+#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c)
+#define IDirect3DViewport2_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a)
+#define IDirect3DViewport2_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a)
+#else
+#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DViewport2_AddRef(p) (p)->AddRef()
+#define IDirect3DViewport2_Release(p) (p)->Release()
+#define IDirect3DViewport2_Initialize(p,a) (p)->Initialize(a)
+#define IDirect3DViewport2_GetViewport(p,a) (p)->GetViewport(a)
+#define IDirect3DViewport2_SetViewport(p,a) (p)->SetViewport(a)
+#define IDirect3DViewport2_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d)
+#define IDirect3DViewport2_LightElements(p,a,b) (p)->LightElements(a,b)
+#define IDirect3DViewport2_SetBackground(p,a) (p)->SetBackground(a)
+#define IDirect3DViewport2_GetBackground(p,a,b) (p)->GetBackground(a,b)
+#define IDirect3DViewport2_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a)
+#define IDirect3DViewport2_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b)
+#define IDirect3DViewport2_Clear(p,a,b,c) (p)->Clear(a,b,c)
+#define IDirect3DViewport2_AddLight(p,a) (p)->AddLight(a)
+#define IDirect3DViewport2_DeleteLight(p,a) (p)->DeleteLight(a)
+#define IDirect3DViewport2_NextLight(p,a,b,c) (p)->NextLight(a,b,c)
+#define IDirect3DViewport2_GetViewport2(p,a) (p)->GetViewport2(a)
+#define IDirect3DViewport2_SetViewport2(p,a) (p)->SetViewport2(a)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+
+#undef INTERFACE
+#define INTERFACE IDirect3DViewport3
+
+DECLARE_INTERFACE_(IDirect3DViewport3, IDirect3DViewport2)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DViewport2 methods ***/
+ STDMETHOD(Initialize)(THIS_ LPDIRECT3D) PURE;
+ STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT) PURE;
+ STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT) PURE;
+ STDMETHOD(TransformVertices)(THIS_ DWORD,LPD3DTRANSFORMDATA,DWORD,LPDWORD) PURE;
+ STDMETHOD(LightElements)(THIS_ DWORD,LPD3DLIGHTDATA) PURE;
+ STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE) PURE;
+ STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE,LPBOOL) PURE;
+ STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE;
+ STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE*,LPBOOL) PURE;
+ STDMETHOD(Clear)(THIS_ DWORD,LPD3DRECT,DWORD) PURE;
+ STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT) PURE;
+ STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT) PURE;
+ STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT,LPDIRECT3DLIGHT*,DWORD) PURE;
+ STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2) PURE;
+ STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2) PURE;
+ STDMETHOD(SetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4) PURE;
+ STDMETHOD(GetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4*,LPBOOL) PURE;
+ STDMETHOD(Clear2)(THIS_ DWORD,LPD3DRECT,DWORD,D3DCOLOR,D3DVALUE,DWORD) PURE;
+};
+
+typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DViewport3_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DViewport3_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DViewport3_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#define IDirect3DViewport3_GetViewport(p,a) (p)->lpVtbl->GetViewport(p,a)
+#define IDirect3DViewport3_SetViewport(p,a) (p)->lpVtbl->SetViewport(p,a)
+#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->lpVtbl->TransformVertices(p,a,b,c,d)
+#define IDirect3DViewport3_LightElements(p,a,b) (p)->lpVtbl->LightElements(p,a,b)
+#define IDirect3DViewport3_SetBackground(p,a) (p)->lpVtbl->SetBackground(p,a)
+#define IDirect3DViewport3_GetBackground(p,a,b) (p)->lpVtbl->GetBackground(p,a,b)
+#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->lpVtbl->SetBackgroundDepth(p,a)
+#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->lpVtbl->GetBackgroundDepth(p,a,b)
+#define IDirect3DViewport3_Clear(p,a,b,c) (p)->lpVtbl->Clear(p,a,b,c)
+#define IDirect3DViewport3_AddLight(p,a) (p)->lpVtbl->AddLight(p,a)
+#define IDirect3DViewport3_DeleteLight(p,a) (p)->lpVtbl->DeleteLight(p,a)
+#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->lpVtbl->NextLight(p,a,b,c)
+#define IDirect3DViewport3_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a)
+#define IDirect3DViewport3_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a)
+#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->lpVtbl->SetBackgroundDepth2(p,a)
+#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->lpVtbl->GetBackgroundDepth2(p,a,b)
+#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->lpVtbl->Clear2(p,a,b,c,d,e,f)
+#else
+#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DViewport3_AddRef(p) (p)->AddRef()
+#define IDirect3DViewport3_Release(p) (p)->Release()
+#define IDirect3DViewport3_Initialize(p,a) (p)->Initialize(a)
+#define IDirect3DViewport3_GetViewport(p,a) (p)->GetViewport(a)
+#define IDirect3DViewport3_SetViewport(p,a) (p)->SetViewport(a)
+#define IDirect3DViewport3_TransformVertices(p,a,b,c,d) (p)->TransformVertices(a,b,c,d)
+#define IDirect3DViewport3_LightElements(p,a,b) (p)->LightElements(a,b)
+#define IDirect3DViewport3_SetBackground(p,a) (p)->SetBackground(a)
+#define IDirect3DViewport3_GetBackground(p,a,b) (p)->GetBackground(a,b)
+#define IDirect3DViewport3_SetBackgroundDepth(p,a) (p)->SetBackgroundDepth(a)
+#define IDirect3DViewport3_GetBackgroundDepth(p,a,b) (p)->GetBackgroundDepth(a,b)
+#define IDirect3DViewport3_Clear(p,a,b,c) (p)->Clear(a,b,c)
+#define IDirect3DViewport3_AddLight(p,a) (p)->AddLight(a)
+#define IDirect3DViewport3_DeleteLight(p,a) (p)->DeleteLight(a)
+#define IDirect3DViewport3_NextLight(p,a,b,c) (p)->NextLight(a,b,c)
+#define IDirect3DViewport3_GetViewport2(p,a) (p)->GetViewport2(a)
+#define IDirect3DViewport3_SetViewport2(p,a) (p)->SetViewport2(a)
+#define IDirect3DViewport3_SetBackgroundDepth2(p,a) (p)->SetBackgroundDepth2(a)
+#define IDirect3DViewport3_GetBackgroundDepth2(p,a,b) (p)->GetBackgroundDepth2(a,b)
+#define IDirect3DViewport3_Clear2(p,a,b,c,d,e,f) (p)->Clear2(a,b,c,d,e,f)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+#undef INTERFACE
+#define INTERFACE IDirect3DVertexBuffer
+
+DECLARE_INTERFACE_(IDirect3DVertexBuffer, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DVertexBuffer methods ***/
+ STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE;
+ STDMETHOD(Unlock)(THIS) PURE;
+ STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER,DWORD,LPDIRECT3DDEVICE3,DWORD) PURE;
+ STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE;
+ STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE3,DWORD) PURE;
+};
+
+typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVertexBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DVertexBuffer_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c)
+#define IDirect3DVertexBuffer_Unlock(p) (p)->lpVtbl->Unlock(p)
+#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g)
+#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a)
+#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b)
+#else
+#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DVertexBuffer_AddRef(p) (p)->AddRef()
+#define IDirect3DVertexBuffer_Release(p) (p)->Release()
+#define IDirect3DVertexBuffer_Lock(p,a,b,c) (p)->Lock(a,b,c)
+#define IDirect3DVertexBuffer_Unlock(p) (p)->Unlock()
+#define IDirect3DVertexBuffer_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g)
+#define IDirect3DVertexBuffer_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a)
+#define IDirect3DVertexBuffer_Optimize(p,a,b) (p)->Optimize(a,b)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+#undef INTERFACE
+#define INTERFACE IDirect3DVertexBuffer7
+
+DECLARE_INTERFACE_(IDirect3DVertexBuffer7, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+
+ /*** IDirect3DVertexBuffer7 methods ***/
+ STDMETHOD(Lock)(THIS_ DWORD,LPVOID*,LPDWORD) PURE;
+ STDMETHOD(Unlock)(THIS) PURE;
+ STDMETHOD(ProcessVertices)(THIS_ DWORD,DWORD,DWORD,LPDIRECT3DVERTEXBUFFER7,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE;
+ STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC) PURE;
+ STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE7,DWORD) PURE;
+ STDMETHOD(ProcessVerticesStrided)(THIS_ DWORD,DWORD,DWORD,LPD3DDRAWPRIMITIVESTRIDEDDATA,DWORD,LPDIRECT3DDEVICE7,DWORD) PURE;
+};
+
+typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7;
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVertexBuffer7_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DVertexBuffer7_Release(p) (p)->lpVtbl->Release(p)
+#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->lpVtbl->Lock(p,a,b,c)
+#define IDirect3DVertexBuffer7_Unlock(p) (p)->lpVtbl->Unlock(p)
+#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f,g)
+#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->lpVtbl->GetVertexBufferDesc(p,a)
+#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->lpVtbl->Optimize(p,a,b)
+#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->lpVtbl->ProcessVerticesStrided(p,a,b,c,d,e,f,g)
+#else
+#define IDirect3DVertexBuffer7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DVertexBuffer7_AddRef(p) (p)->AddRef()
+#define IDirect3DVertexBuffer7_Release(p) (p)->Release()
+#define IDirect3DVertexBuffer7_Lock(p,a,b,c) (p)->Lock(a,b,c)
+#define IDirect3DVertexBuffer7_Unlock(p) (p)->Unlock()
+#define IDirect3DVertexBuffer7_ProcessVertices(p,a,b,c,d,e,f,g) (p)->ProcessVertices(a,b,c,d,e,f,g)
+#define IDirect3DVertexBuffer7_GetVertexBufferDesc(p,a) (p)->GetVertexBufferDesc(a)
+#define IDirect3DVertexBuffer7_Optimize(p,a,b) (p)->Optimize(a,b)
+#define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->ProcessVerticesStrided(a,b,c,d,e,f,g)
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#if(DIRECT3D_VERSION >= 0x0500)
+/****************************************************************************
+ *
+ * Flags for IDirect3DDevice::NextViewport
+ *
+ ****************************************************************************/
+
+/*
+ * Return the next viewport
+ */
+#define D3DNEXT_NEXT 0x00000001l
+
+/*
+ * Return the first viewport
+ */
+#define D3DNEXT_HEAD 0x00000002l
+
+/*
+ * Return the last viewport
+ */
+#define D3DNEXT_TAIL 0x00000004l
+
+
+/****************************************************************************
+ *
+ * Flags for DrawPrimitive/DrawIndexedPrimitive
+ * Also valid for Begin/BeginIndexed
+ * Also valid for VertexBuffer::CreateVertexBuffer
+ ****************************************************************************/
+
+/*
+ * Wait until the device is ready to draw the primitive
+ * This will cause DP to not return DDERR_WASSTILLDRAWING
+ */
+#define D3DDP_WAIT 0x00000001l
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if (DIRECT3D_VERSION == 0x0500)
+/*
+ * Hint that it is acceptable to render the primitive out of order.
+ */
+#define D3DDP_OUTOFORDER 0x00000002l
+#endif
+
+
+#if(DIRECT3D_VERSION >= 0x0500)
+/*
+ * Hint that the primitives have been clipped by the application.
+ */
+#define D3DDP_DONOTCLIP 0x00000004l
+
+/*
+ * Hint that the extents need not be updated.
+ */
+#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+
+/*
+ * Hint that the lighting should not be applied on vertices.
+ */
+
+#define D3DDP_DONOTLIGHT 0x00000010l
+
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+/*
+ * Direct3D Errors
+ * DirectDraw error codes are used when errors not specified here.
+ */
+#define D3D_OK DD_OK
+#define D3DERR_BADMAJORVERSION MAKE_DDHRESULT(700)
+#define D3DERR_BADMINORVERSION MAKE_DDHRESULT(701)
+
+#if(DIRECT3D_VERSION >= 0x0500)
+/*
+ * An invalid device was requested by the application.
+ */
+#define D3DERR_INVALID_DEVICE MAKE_DDHRESULT(705)
+#define D3DERR_INITFAILED MAKE_DDHRESULT(706)
+
+/*
+ * SetRenderTarget attempted on a device that was
+ * QI'd off the render target.
+ */
+#define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#define D3DERR_EXECUTE_CREATE_FAILED MAKE_DDHRESULT(710)
+#define D3DERR_EXECUTE_DESTROY_FAILED MAKE_DDHRESULT(711)
+#define D3DERR_EXECUTE_LOCK_FAILED MAKE_DDHRESULT(712)
+#define D3DERR_EXECUTE_UNLOCK_FAILED MAKE_DDHRESULT(713)
+#define D3DERR_EXECUTE_LOCKED MAKE_DDHRESULT(714)
+#define D3DERR_EXECUTE_NOT_LOCKED MAKE_DDHRESULT(715)
+
+#define D3DERR_EXECUTE_FAILED MAKE_DDHRESULT(716)
+#define D3DERR_EXECUTE_CLIPPED_FAILED MAKE_DDHRESULT(717)
+
+#define D3DERR_TEXTURE_NO_SUPPORT MAKE_DDHRESULT(720)
+#define D3DERR_TEXTURE_CREATE_FAILED MAKE_DDHRESULT(721)
+#define D3DERR_TEXTURE_DESTROY_FAILED MAKE_DDHRESULT(722)
+#define D3DERR_TEXTURE_LOCK_FAILED MAKE_DDHRESULT(723)
+#define D3DERR_TEXTURE_UNLOCK_FAILED MAKE_DDHRESULT(724)
+#define D3DERR_TEXTURE_LOAD_FAILED MAKE_DDHRESULT(725)
+#define D3DERR_TEXTURE_SWAP_FAILED MAKE_DDHRESULT(726)
+#define D3DERR_TEXTURE_LOCKED MAKE_DDHRESULT(727)
+#define D3DERR_TEXTURE_NOT_LOCKED MAKE_DDHRESULT(728)
+#define D3DERR_TEXTURE_GETSURF_FAILED MAKE_DDHRESULT(729)
+
+#define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730)
+#define D3DERR_MATRIX_DESTROY_FAILED MAKE_DDHRESULT(731)
+#define D3DERR_MATRIX_SETDATA_FAILED MAKE_DDHRESULT(732)
+#define D3DERR_MATRIX_GETDATA_FAILED MAKE_DDHRESULT(733)
+#define D3DERR_SETVIEWPORTDATA_FAILED MAKE_DDHRESULT(734)
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DERR_INVALIDCURRENTVIEWPORT MAKE_DDHRESULT(735)
+#define D3DERR_INVALIDPRIMITIVETYPE MAKE_DDHRESULT(736)
+#define D3DERR_INVALIDVERTEXTYPE MAKE_DDHRESULT(737)
+#define D3DERR_TEXTURE_BADSIZE MAKE_DDHRESULT(738)
+#define D3DERR_INVALIDRAMPTEXTURE MAKE_DDHRESULT(739)
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#define D3DERR_MATERIAL_CREATE_FAILED MAKE_DDHRESULT(740)
+#define D3DERR_MATERIAL_DESTROY_FAILED MAKE_DDHRESULT(741)
+#define D3DERR_MATERIAL_SETDATA_FAILED MAKE_DDHRESULT(742)
+#define D3DERR_MATERIAL_GETDATA_FAILED MAKE_DDHRESULT(743)
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DERR_INVALIDPALETTE MAKE_DDHRESULT(744)
+
+#define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
+#define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY MAKE_DDHRESULT(746)
+#define D3DERR_SURFACENOTINVIDMEM MAKE_DDHRESULT(747)
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#define D3DERR_LIGHT_SET_FAILED MAKE_DDHRESULT(750)
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DERR_LIGHTHASVIEWPORT MAKE_DDHRESULT(751)
+#define D3DERR_LIGHTNOTINTHISVIEWPORT MAKE_DDHRESULT(752)
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#define D3DERR_SCENE_IN_SCENE MAKE_DDHRESULT(760)
+#define D3DERR_SCENE_NOT_IN_SCENE MAKE_DDHRESULT(761)
+#define D3DERR_SCENE_BEGIN_FAILED MAKE_DDHRESULT(762)
+#define D3DERR_SCENE_END_FAILED MAKE_DDHRESULT(763)
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DERR_INBEGIN MAKE_DDHRESULT(770)
+#define D3DERR_NOTINBEGIN MAKE_DDHRESULT(771)
+#define D3DERR_NOVIEWPORTS MAKE_DDHRESULT(772)
+#define D3DERR_VIEWPORTDATANOTSET MAKE_DDHRESULT(773)
+#define D3DERR_VIEWPORTHASNODEVICE MAKE_DDHRESULT(774)
+#define D3DERR_NOCURRENTVIEWPORT MAKE_DDHRESULT(775)
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+#define D3DERR_INVALIDVERTEXFORMAT MAKE_DDHRESULT(2048)
+
+/*
+ * Attempted to CreateTexture on a surface that had a color key
+ */
+#define D3DERR_COLORKEYATTACHED MAKE_DDHRESULT(2050)
+
+#define D3DERR_VERTEXBUFFEROPTIMIZED MAKE_DDHRESULT(2060)
+#define D3DERR_VBUF_CREATE_FAILED MAKE_DDHRESULT(2061)
+#define D3DERR_VERTEXBUFFERLOCKED MAKE_DDHRESULT(2062)
+#define D3DERR_VERTEXBUFFERUNLOCKFAILED MAKE_DDHRESULT(2063)
+
+#define D3DERR_ZBUFFER_NOTPRESENT MAKE_DDHRESULT(2070)
+#define D3DERR_STENCILBUFFER_NOTPRESENT MAKE_DDHRESULT(2071)
+
+#define D3DERR_WRONGTEXTUREFORMAT MAKE_DDHRESULT(2072)
+#define D3DERR_UNSUPPORTEDCOLOROPERATION MAKE_DDHRESULT(2073)
+#define D3DERR_UNSUPPORTEDCOLORARG MAKE_DDHRESULT(2074)
+#define D3DERR_UNSUPPORTEDALPHAOPERATION MAKE_DDHRESULT(2075)
+#define D3DERR_UNSUPPORTEDALPHAARG MAKE_DDHRESULT(2076)
+#define D3DERR_TOOMANYOPERATIONS MAKE_DDHRESULT(2077)
+#define D3DERR_CONFLICTINGTEXTUREFILTER MAKE_DDHRESULT(2078)
+#define D3DERR_UNSUPPORTEDFACTORVALUE MAKE_DDHRESULT(2079)
+#define D3DERR_CONFLICTINGRENDERSTATE MAKE_DDHRESULT(2081)
+#define D3DERR_UNSUPPORTEDTEXTUREFILTER MAKE_DDHRESULT(2082)
+#define D3DERR_TOOMANYPRIMITIVES MAKE_DDHRESULT(2083)
+#define D3DERR_INVALIDMATRIX MAKE_DDHRESULT(2084)
+#define D3DERR_TOOMANYVERTICES MAKE_DDHRESULT(2085)
+#define D3DERR_CONFLICTINGTEXTUREPALETTE MAKE_DDHRESULT(2086)
+
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+#define D3DERR_INVALIDSTATEBLOCK MAKE_DDHRESULT(2100)
+#define D3DERR_INBEGINSTATEBLOCK MAKE_DDHRESULT(2101)
+#define D3DERR_NOTINBEGINSTATEBLOCK MAKE_DDHRESULT(2102)
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+#endif /* _D3D_H_ */
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
+#pragma endregion
+
diff --git a/client/d3d/d3dcaps.h b/client/d3d/d3dcaps.h
new file mode 100644
index 0000000..2a987f7
--- /dev/null
+++ b/client/d3d/d3dcaps.h
@@ -0,0 +1,609 @@
+/*==========================================================================;
+ *
+ * Copyright (C) Microsoft Corporation. All Rights Reserved.
+ *
+ * File: d3dcaps.h
+ * Content: Direct3D capabilities include file
+ *
+ ***************************************************************************/
+
+#include
+
+#pragma region Desktop Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+#ifndef _D3DCAPS_H
+#define _D3DCAPS_H
+
+/*
+ * Pull in DirectDraw include file automatically:
+ */
+#include "ddraw.h"
+
+#ifndef DIRECT3D_VERSION
+#define DIRECT3D_VERSION 0x0700
+#endif
+
+#if defined(_X86_) || defined(_IA64_)
+#pragma pack(4)
+#endif
+
+/* Description of capabilities of transform */
+
+typedef struct _D3DTRANSFORMCAPS {
+ DWORD dwSize;
+ DWORD dwCaps;
+} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
+
+#define D3DTRANSFORMCAPS_CLIP 0x00000001L /* Will clip whilst transforming */
+
+/* Description of capabilities of lighting */
+
+typedef struct _D3DLIGHTINGCAPS {
+ DWORD dwSize;
+ DWORD dwCaps; /* Lighting caps */
+ DWORD dwLightingModel; /* Lighting model - RGB or mono */
+ DWORD dwNumLights; /* Number of lights that can be handled */
+} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
+
+#define D3DLIGHTINGMODEL_RGB 0x00000001L
+#define D3DLIGHTINGMODEL_MONO 0x00000002L
+
+#define D3DLIGHTCAPS_POINT 0x00000001L /* Point lights supported */
+#define D3DLIGHTCAPS_SPOT 0x00000002L /* Spot lights supported */
+#define D3DLIGHTCAPS_DIRECTIONAL 0x00000004L /* Directional lights supported */
+#if(DIRECT3D_VERSION < 0x700)
+#define D3DLIGHTCAPS_PARALLELPOINT 0x00000008L /* Parallel point lights supported */
+#endif
+#if(DIRECT3D_VERSION < 0x500)
+#define D3DLIGHTCAPS_GLSPOT 0x00000010L /* GL syle spot lights supported */
+#endif
+
+/* Description of capabilities for each primitive type */
+
+typedef struct _D3DPrimCaps {
+ DWORD dwSize;
+ DWORD dwMiscCaps; /* Capability flags */
+ DWORD dwRasterCaps;
+ DWORD dwZCmpCaps;
+ DWORD dwSrcBlendCaps;
+ DWORD dwDestBlendCaps;
+ DWORD dwAlphaCmpCaps;
+ DWORD dwShadeCaps;
+ DWORD dwTextureCaps;
+ DWORD dwTextureFilterCaps;
+ DWORD dwTextureBlendCaps;
+ DWORD dwTextureAddressCaps;
+ DWORD dwStippleWidth; /* maximum width and height of */
+ DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */
+} D3DPRIMCAPS, *LPD3DPRIMCAPS;
+
+/* D3DPRIMCAPS dwMiscCaps */
+
+#define D3DPMISCCAPS_MASKPLANES 0x00000001L
+#define D3DPMISCCAPS_MASKZ 0x00000002L
+#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L
+#define D3DPMISCCAPS_CONFORMANT 0x00000008L
+#define D3DPMISCCAPS_CULLNONE 0x00000010L
+#define D3DPMISCCAPS_CULLCW 0x00000020L
+#define D3DPMISCCAPS_CULLCCW 0x00000040L
+
+/* D3DPRIMCAPS dwRasterCaps */
+
+#define D3DPRASTERCAPS_DITHER 0x00000001L
+#define D3DPRASTERCAPS_ROP2 0x00000002L
+#define D3DPRASTERCAPS_XOR 0x00000004L
+#define D3DPRASTERCAPS_PAT 0x00000008L
+#define D3DPRASTERCAPS_ZTEST 0x00000010L
+#define D3DPRASTERCAPS_SUBPIXEL 0x00000020L
+#define D3DPRASTERCAPS_SUBPIXELX 0x00000040L
+#define D3DPRASTERCAPS_FOGVERTEX 0x00000080L
+#define D3DPRASTERCAPS_FOGTABLE 0x00000100L
+#define D3DPRASTERCAPS_STIPPLE 0x00000200L
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT 0x00000400L
+#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT 0x00000800L
+#define D3DPRASTERCAPS_ANTIALIASEDGES 0x00001000L
+#define D3DPRASTERCAPS_MIPMAPLODBIAS 0x00002000L
+#define D3DPRASTERCAPS_ZBIAS 0x00004000L
+#define D3DPRASTERCAPS_ZBUFFERLESSHSR 0x00008000L
+#define D3DPRASTERCAPS_FOGRANGE 0x00010000L
+#define D3DPRASTERCAPS_ANISOTROPY 0x00020000L
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+#if(DIRECT3D_VERSION >= 0x0600)
+#define D3DPRASTERCAPS_WBUFFER 0x00040000L
+#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000L
+#define D3DPRASTERCAPS_WFOG 0x00100000L
+#define D3DPRASTERCAPS_ZFOG 0x00200000L
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+/* D3DPRIMCAPS dwZCmpCaps, dwAlphaCmpCaps */
+
+#define D3DPCMPCAPS_NEVER 0x00000001L
+#define D3DPCMPCAPS_LESS 0x00000002L
+#define D3DPCMPCAPS_EQUAL 0x00000004L
+#define D3DPCMPCAPS_LESSEQUAL 0x00000008L
+#define D3DPCMPCAPS_GREATER 0x00000010L
+#define D3DPCMPCAPS_NOTEQUAL 0x00000020L
+#define D3DPCMPCAPS_GREATEREQUAL 0x00000040L
+#define D3DPCMPCAPS_ALWAYS 0x00000080L
+
+/* D3DPRIMCAPS dwSourceBlendCaps, dwDestBlendCaps */
+
+#define D3DPBLENDCAPS_ZERO 0x00000001L
+#define D3DPBLENDCAPS_ONE 0x00000002L
+#define D3DPBLENDCAPS_SRCCOLOR 0x00000004L
+#define D3DPBLENDCAPS_INVSRCCOLOR 0x00000008L
+#define D3DPBLENDCAPS_SRCALPHA 0x00000010L
+#define D3DPBLENDCAPS_INVSRCALPHA 0x00000020L
+#define D3DPBLENDCAPS_DESTALPHA 0x00000040L
+#define D3DPBLENDCAPS_INVDESTALPHA 0x00000080L
+#define D3DPBLENDCAPS_DESTCOLOR 0x00000100L
+#define D3DPBLENDCAPS_INVDESTCOLOR 0x00000200L
+#define D3DPBLENDCAPS_SRCALPHASAT 0x00000400L
+#define D3DPBLENDCAPS_BOTHSRCALPHA 0x00000800L
+#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000L
+
+/* D3DPRIMCAPS dwShadeCaps */
+
+#define D3DPSHADECAPS_COLORFLATMONO 0x00000001L
+#define D3DPSHADECAPS_COLORFLATRGB 0x00000002L
+#define D3DPSHADECAPS_COLORGOURAUDMONO 0x00000004L
+#define D3DPSHADECAPS_COLORGOURAUDRGB 0x00000008L
+#define D3DPSHADECAPS_COLORPHONGMONO 0x00000010L
+#define D3DPSHADECAPS_COLORPHONGRGB 0x00000020L
+
+#define D3DPSHADECAPS_SPECULARFLATMONO 0x00000040L
+#define D3DPSHADECAPS_SPECULARFLATRGB 0x00000080L
+#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100L
+#define D3DPSHADECAPS_SPECULARGOURAUDRGB 0x00000200L
+#define D3DPSHADECAPS_SPECULARPHONGMONO 0x00000400L
+#define D3DPSHADECAPS_SPECULARPHONGRGB 0x00000800L
+
+#define D3DPSHADECAPS_ALPHAFLATBLEND 0x00001000L
+#define D3DPSHADECAPS_ALPHAFLATSTIPPLED 0x00002000L
+#define D3DPSHADECAPS_ALPHAGOURAUDBLEND 0x00004000L
+#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000L
+#define D3DPSHADECAPS_ALPHAPHONGBLEND 0x00010000L
+#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED 0x00020000L
+
+#define D3DPSHADECAPS_FOGFLAT 0x00040000L
+#define D3DPSHADECAPS_FOGGOURAUD 0x00080000L
+#define D3DPSHADECAPS_FOGPHONG 0x00100000L
+
+/* D3DPRIMCAPS dwTextureCaps */
+
+/*
+ * Perspective-correct texturing is supported
+ */
+#define D3DPTEXTURECAPS_PERSPECTIVE 0x00000001L
+
+/*
+ * Power-of-2 texture dimensions are required
+ */
+#define D3DPTEXTURECAPS_POW2 0x00000002L
+
+/*
+ * Alpha in texture pixels is supported
+ */
+#define D3DPTEXTURECAPS_ALPHA 0x00000004L
+
+/*
+ * Color-keyed textures are supported
+ */
+#define D3DPTEXTURECAPS_TRANSPARENCY 0x00000008L
+
+/*
+ * obsolete, see D3DPTADDRESSCAPS_BORDER
+ */
+#define D3DPTEXTURECAPS_BORDER 0x00000010L
+
+/*
+ * Only square textures are supported
+ */
+#define D3DPTEXTURECAPS_SQUAREONLY 0x00000020L
+
+#if(DIRECT3D_VERSION >= 0x0600)
+/*
+ * Texture indices are not scaled by the texture size prior
+ * to interpolation.
+ */
+#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
+
+/*
+ * Device can draw alpha from texture palettes
+ */
+#define D3DPTEXTURECAPS_ALPHAPALETTE 0x00000080L
+
+/*
+ * Device can use non-POW2 textures if:
+ * 1) D3DTEXTURE_ADDRESS is set to CLAMP for this texture's stage
+ * 2) D3DRS_WRAP(N) is zero for this texture's coordinates
+ * 3) mip mapping is not enabled (use magnification filter only)
+ */
+#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL 0x00000100L
+
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0700)
+
+// 0x00000200L unused
+
+/*
+ * Device can divide transformed texture coordinates by the
+ * COUNTth texture coordinate (can do D3DTTFF_PROJECTED)
+ */
+#define D3DPTEXTURECAPS_PROJECTED 0x00000400L
+
+/*
+ * Device can do cubemap textures
+ */
+#define D3DPTEXTURECAPS_CUBEMAP 0x00000800L
+
+#define D3DPTEXTURECAPS_COLORKEYBLEND 0x00001000L
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+/* D3DPRIMCAPS dwTextureFilterCaps */
+
+#define D3DPTFILTERCAPS_NEAREST 0x00000001L
+#define D3DPTFILTERCAPS_LINEAR 0x00000002L
+#define D3DPTFILTERCAPS_MIPNEAREST 0x00000004L
+#define D3DPTFILTERCAPS_MIPLINEAR 0x00000008L
+#define D3DPTFILTERCAPS_LINEARMIPNEAREST 0x00000010L
+#define D3DPTFILTERCAPS_LINEARMIPLINEAR 0x00000020L
+
+#if(DIRECT3D_VERSION >= 0x0600)
+/* Device3 Min Filter */
+#define D3DPTFILTERCAPS_MINFPOINT 0x00000100L
+#define D3DPTFILTERCAPS_MINFLINEAR 0x00000200L
+#define D3DPTFILTERCAPS_MINFANISOTROPIC 0x00000400L
+
+/* Device3 Mip Filter */
+#define D3DPTFILTERCAPS_MIPFPOINT 0x00010000L
+#define D3DPTFILTERCAPS_MIPFLINEAR 0x00020000L
+
+/* Device3 Mag Filter */
+#define D3DPTFILTERCAPS_MAGFPOINT 0x01000000L
+#define D3DPTFILTERCAPS_MAGFLINEAR 0x02000000L
+#define D3DPTFILTERCAPS_MAGFANISOTROPIC 0x04000000L
+#define D3DPTFILTERCAPS_MAGFAFLATCUBIC 0x08000000L
+#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000L
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+/* D3DPRIMCAPS dwTextureBlendCaps */
+
+#define D3DPTBLENDCAPS_DECAL 0x00000001L
+#define D3DPTBLENDCAPS_MODULATE 0x00000002L
+#define D3DPTBLENDCAPS_DECALALPHA 0x00000004L
+#define D3DPTBLENDCAPS_MODULATEALPHA 0x00000008L
+#define D3DPTBLENDCAPS_DECALMASK 0x00000010L
+#define D3DPTBLENDCAPS_MODULATEMASK 0x00000020L
+#define D3DPTBLENDCAPS_COPY 0x00000040L
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DPTBLENDCAPS_ADD 0x00000080L
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+/* D3DPRIMCAPS dwTextureAddressCaps */
+#define D3DPTADDRESSCAPS_WRAP 0x00000001L
+#define D3DPTADDRESSCAPS_MIRROR 0x00000002L
+#define D3DPTADDRESSCAPS_CLAMP 0x00000004L
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DPTADDRESSCAPS_BORDER 0x00000008L
+#define D3DPTADDRESSCAPS_INDEPENDENTUV 0x00000010L
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+
+/* D3DDEVICEDESC dwStencilCaps */
+
+#define D3DSTENCILCAPS_KEEP 0x00000001L
+#define D3DSTENCILCAPS_ZERO 0x00000002L
+#define D3DSTENCILCAPS_REPLACE 0x00000004L
+#define D3DSTENCILCAPS_INCRSAT 0x00000008L
+#define D3DSTENCILCAPS_DECRSAT 0x00000010L
+#define D3DSTENCILCAPS_INVERT 0x00000020L
+#define D3DSTENCILCAPS_INCR 0x00000040L
+#define D3DSTENCILCAPS_DECR 0x00000080L
+
+/* D3DDEVICEDESC dwTextureOpCaps */
+
+#define D3DTEXOPCAPS_DISABLE 0x00000001L
+#define D3DTEXOPCAPS_SELECTARG1 0x00000002L
+#define D3DTEXOPCAPS_SELECTARG2 0x00000004L
+#define D3DTEXOPCAPS_MODULATE 0x00000008L
+#define D3DTEXOPCAPS_MODULATE2X 0x00000010L
+#define D3DTEXOPCAPS_MODULATE4X 0x00000020L
+#define D3DTEXOPCAPS_ADD 0x00000040L
+#define D3DTEXOPCAPS_ADDSIGNED 0x00000080L
+#define D3DTEXOPCAPS_ADDSIGNED2X 0x00000100L
+#define D3DTEXOPCAPS_SUBTRACT 0x00000200L
+#define D3DTEXOPCAPS_ADDSMOOTH 0x00000400L
+#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA 0x00000800L
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHA 0x00001000L
+#define D3DTEXOPCAPS_BLENDFACTORALPHA 0x00002000L
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM 0x00004000L
+#define D3DTEXOPCAPS_BLENDCURRENTALPHA 0x00008000L
+#define D3DTEXOPCAPS_PREMODULATE 0x00010000L
+#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR 0x00020000L
+#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA 0x00040000L
+#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR 0x00080000L
+#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA 0x00100000L
+#define D3DTEXOPCAPS_BUMPENVMAP 0x00200000L
+#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE 0x00400000L
+#define D3DTEXOPCAPS_DOTPRODUCT3 0x00800000L
+
+/* D3DDEVICEDESC dwFVFCaps flags */
+
+#define D3DFVFCAPS_TEXCOORDCOUNTMASK 0x0000ffffL /* mask for texture coordinate count field */
+#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x00080000L /* Device prefers that vertex elements not be stripped */
+
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+/*
+ * Description for a device.
+ * This is used to describe a device that is to be created or to query
+ * the current device.
+ */
+typedef struct _D3DDeviceDesc {
+ DWORD dwSize; /* Size of D3DDEVICEDESC structure */
+ DWORD dwFlags; /* Indicates which fields have valid data */
+ D3DCOLORMODEL dcmColorModel; /* Color model of device */
+ DWORD dwDevCaps; /* Capabilities of device */
+ D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */
+ BOOL bClipping; /* Device can do 3D clipping */
+ D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */
+ D3DPRIMCAPS dpcLineCaps;
+ D3DPRIMCAPS dpcTriCaps;
+ DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
+ DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
+ DWORD dwMaxBufferSize; /* Maximum execute buffer size */
+ DWORD dwMaxVertexCount; /* Maximum vertex count */
+#if(DIRECT3D_VERSION >= 0x0500)
+ // *** New fields for DX5 *** //
+
+ // Width and height caps are 0 for legacy HALs.
+ DWORD dwMinTextureWidth, dwMinTextureHeight;
+ DWORD dwMaxTextureWidth, dwMaxTextureHeight;
+ DWORD dwMinStippleWidth, dwMaxStippleWidth;
+ DWORD dwMinStippleHeight, dwMaxStippleHeight;
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+ // New fields for DX6
+ DWORD dwMaxTextureRepeat;
+ DWORD dwMaxTextureAspectRatio;
+ DWORD dwMaxAnisotropy;
+
+ // Guard band that the rasterizer can accommodate
+ // Screen-space vertices inside this space but outside the viewport
+ // will get clipped properly.
+ D3DVALUE dvGuardBandLeft;
+ D3DVALUE dvGuardBandTop;
+ D3DVALUE dvGuardBandRight;
+ D3DVALUE dvGuardBandBottom;
+
+ D3DVALUE dvExtentsAdjust;
+ DWORD dwStencilCaps;
+
+ DWORD dwFVFCaps;
+ DWORD dwTextureOpCaps;
+ WORD wMaxTextureBlendStages;
+ WORD wMaxSimultaneousTextures;
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+} D3DDEVICEDESC, *LPD3DDEVICEDESC;
+
+#if(DIRECT3D_VERSION >= 0x0700)
+typedef struct _D3DDeviceDesc7 {
+ DWORD dwDevCaps; /* Capabilities of device */
+ D3DPRIMCAPS dpcLineCaps;
+ D3DPRIMCAPS dpcTriCaps;
+ DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */
+ DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */
+
+ DWORD dwMinTextureWidth, dwMinTextureHeight;
+ DWORD dwMaxTextureWidth, dwMaxTextureHeight;
+
+ DWORD dwMaxTextureRepeat;
+ DWORD dwMaxTextureAspectRatio;
+ DWORD dwMaxAnisotropy;
+
+ D3DVALUE dvGuardBandLeft;
+ D3DVALUE dvGuardBandTop;
+ D3DVALUE dvGuardBandRight;
+ D3DVALUE dvGuardBandBottom;
+
+ D3DVALUE dvExtentsAdjust;
+ DWORD dwStencilCaps;
+
+ DWORD dwFVFCaps;
+ DWORD dwTextureOpCaps;
+ WORD wMaxTextureBlendStages;
+ WORD wMaxSimultaneousTextures;
+
+ DWORD dwMaxActiveLights;
+ D3DVALUE dvMaxVertexW;
+ GUID deviceGUID;
+
+ WORD wMaxUserClipPlanes;
+ WORD wMaxVertexBlendMatrices;
+
+ DWORD dwVertexProcessingCaps;
+
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ DWORD dwReserved3;
+ DWORD dwReserved4;
+} D3DDEVICEDESC7, *LPD3DDEVICEDESC7;
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
+#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
+
+typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK)(GUID FAR *lpGuid, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC, LPD3DDEVICEDESC, LPVOID);
+
+#if(DIRECT3D_VERSION >= 0x0700)
+typedef HRESULT (CALLBACK * LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+/* D3DDEVICEDESC dwFlags indicating valid fields */
+
+#define D3DDD_COLORMODEL 0x00000001L /* dcmColorModel is valid */
+#define D3DDD_DEVCAPS 0x00000002L /* dwDevCaps is valid */
+#define D3DDD_TRANSFORMCAPS 0x00000004L /* dtcTransformCaps is valid */
+#define D3DDD_LIGHTINGCAPS 0x00000008L /* dlcLightingCaps is valid */
+#define D3DDD_BCLIPPING 0x00000010L /* bClipping is valid */
+#define D3DDD_LINECAPS 0x00000020L /* dpcLineCaps is valid */
+#define D3DDD_TRICAPS 0x00000040L /* dpcTriCaps is valid */
+#define D3DDD_DEVICERENDERBITDEPTH 0x00000080L /* dwDeviceRenderBitDepth is valid */
+#define D3DDD_DEVICEZBUFFERBITDEPTH 0x00000100L /* dwDeviceZBufferBitDepth is valid */
+#define D3DDD_MAXBUFFERSIZE 0x00000200L /* dwMaxBufferSize is valid */
+#define D3DDD_MAXVERTEXCOUNT 0x00000400L /* dwMaxVertexCount is valid */
+
+/* D3DDEVICEDESC dwDevCaps flags */
+
+#define D3DDEVCAPS_FLOATTLVERTEX 0x00000001L /* Device accepts floating point */
+ /* for post-transform vertex data */
+#define D3DDEVCAPS_SORTINCREASINGZ 0x00000002L /* Device needs data sorted for increasing Z */
+#define D3DDEVCAPS_SORTDECREASINGZ 0X00000004L /* Device needs data sorted for decreasing Z */
+#define D3DDEVCAPS_SORTEXACT 0x00000008L /* Device needs data sorted exactly */
+
+#define D3DDEVCAPS_EXECUTESYSTEMMEMORY 0x00000010L /* Device can use execute buffers from system memory */
+#define D3DDEVCAPS_EXECUTEVIDEOMEMORY 0x00000020L /* Device can use execute buffers from video memory */
+#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY 0x00000040L /* Device can use TL buffers from system memory */
+#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY 0x00000080L /* Device can use TL buffers from video memory */
+#define D3DDEVCAPS_TEXTURESYSTEMMEMORY 0x00000100L /* Device can texture from system memory */
+#define D3DDEVCAPS_TEXTUREVIDEOMEMORY 0x00000200L /* Device can texture from device memory */
+#if(DIRECT3D_VERSION >= 0x0500)
+#define D3DDEVCAPS_DRAWPRIMTLVERTEX 0x00000400L /* Device can draw TLVERTEX primitives */
+#define D3DDEVCAPS_CANRENDERAFTERFLIP 0x00000800L /* Device can render without waiting for flip to complete */
+#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM 0x00001000L /* Device can texture from nonlocal video memory */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+#if(DIRECT3D_VERSION >= 0x0600)
+#define D3DDEVCAPS_DRAWPRIMITIVES2 0x00002000L /* Device can support DrawPrimitives2 */
+#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000L /* Device is texturing from separate memory pools */
+#define D3DDEVCAPS_DRAWPRIMITIVES2EX 0x00008000L /* Device can support Extended DrawPrimitives2 i.e. DX7 compliant driver*/
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0700)
+#define D3DDEVCAPS_HWTRANSFORMANDLIGHT 0x00010000L /* Device can support transformation and lighting in hardware and DRAWPRIMITIVES2EX must be also */
+#define D3DDEVCAPS_CANBLTSYSTONONLOCAL 0x00020000L /* Device supports a Tex Blt from system memory to non-local vidmem */
+#define D3DDEVCAPS_HWRASTERIZATION 0x00080000L /* Device has HW acceleration for rasterization */
+
+/*
+ * These are the flags in the D3DDEVICEDESC7.dwVertexProcessingCaps field
+ */
+
+/* device can do texgen */
+#define D3DVTXPCAPS_TEXGEN 0x00000001L
+/* device can do IDirect3DDevice7 colormaterialsource ops */
+#define D3DVTXPCAPS_MATERIALSOURCE7 0x00000002L
+/* device can do vertex fog */
+#define D3DVTXPCAPS_VERTEXFOG 0x00000004L
+/* device can do directional lights */
+#define D3DVTXPCAPS_DIRECTIONALLIGHTS 0x00000008L
+/* device can do positional lights (includes point and spot) */
+#define D3DVTXPCAPS_POSITIONALLIGHTS 0x00000010L
+/* device can do local viewer */
+#define D3DVTXPCAPS_LOCALVIEWER 0x00000020L
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#define D3DFDS_COLORMODEL 0x00000001L /* Match color model */
+#define D3DFDS_GUID 0x00000002L /* Match guid */
+#define D3DFDS_HARDWARE 0x00000004L /* Match hardware/software */
+#define D3DFDS_TRIANGLES 0x00000008L /* Match in triCaps */
+#define D3DFDS_LINES 0x00000010L /* Match in lineCaps */
+#define D3DFDS_MISCCAPS 0x00000020L /* Match primCaps.dwMiscCaps */
+#define D3DFDS_RASTERCAPS 0x00000040L /* Match primCaps.dwRasterCaps */
+#define D3DFDS_ZCMPCAPS 0x00000080L /* Match primCaps.dwZCmpCaps */
+#define D3DFDS_ALPHACMPCAPS 0x00000100L /* Match primCaps.dwAlphaCmpCaps */
+#define D3DFDS_SRCBLENDCAPS 0x00000200L /* Match primCaps.dwSourceBlendCaps */
+#define D3DFDS_DSTBLENDCAPS 0x00000400L /* Match primCaps.dwDestBlendCaps */
+#define D3DFDS_SHADECAPS 0x00000800L /* Match primCaps.dwShadeCaps */
+#define D3DFDS_TEXTURECAPS 0x00001000L /* Match primCaps.dwTextureCaps */
+#define D3DFDS_TEXTUREFILTERCAPS 0x00002000L /* Match primCaps.dwTextureFilterCaps */
+#define D3DFDS_TEXTUREBLENDCAPS 0x00004000L /* Match primCaps.dwTextureBlendCaps */
+#define D3DFDS_TEXTUREADDRESSCAPS 0x00008000L /* Match primCaps.dwTextureBlendCaps */
+
+/*
+ * FindDevice arguments
+ */
+typedef struct _D3DFINDDEVICESEARCH {
+ DWORD dwSize;
+ DWORD dwFlags;
+ BOOL bHardware;
+ D3DCOLORMODEL dcmColorModel;
+ GUID guid;
+ DWORD dwCaps;
+ D3DPRIMCAPS dpcPrimCaps;
+} D3DFINDDEVICESEARCH, *LPD3DFINDDEVICESEARCH;
+
+typedef struct _D3DFINDDEVICERESULT {
+ DWORD dwSize;
+ GUID guid; /* guid which matched */
+ D3DDEVICEDESC ddHwDesc; /* hardware D3DDEVICEDESC */
+ D3DDEVICEDESC ddSwDesc; /* software D3DDEVICEDESC */
+} D3DFINDDEVICERESULT, *LPD3DFINDDEVICERESULT;
+
+/*
+ * Description of execute buffer.
+ */
+typedef struct _D3DExecuteBufferDesc {
+ DWORD dwSize; /* size of this structure */
+ DWORD dwFlags; /* flags indicating which fields are valid */
+ DWORD dwCaps; /* capabilities of execute buffer */
+ DWORD dwBufferSize; /* size of execute buffer data */
+ LPVOID lpData; /* pointer to actual data */
+} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
+
+/* D3DEXECUTEBUFFER dwFlags indicating valid fields */
+
+#define D3DDEB_BUFSIZE 0x00000001l /* buffer size valid */
+#define D3DDEB_CAPS 0x00000002l /* caps valid */
+#define D3DDEB_LPDATA 0x00000004l /* lpData valid */
+
+/* D3DEXECUTEBUFFER dwCaps */
+
+#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001l /* buffer in system memory */
+#define D3DDEBCAPS_VIDEOMEMORY 0x00000002l /* buffer in device memory */
+#define D3DDEBCAPS_MEM (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY)
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+#if(DIRECT3D_VERSION >= 0x0700)
+typedef struct _D3DDEVINFO_TEXTUREMANAGER {
+ BOOL bThrashing; /* indicates if thrashing */
+ DWORD dwApproxBytesDownloaded; /* Approximate number of bytes downloaded by texture manager */
+ DWORD dwNumEvicts; /* number of textures evicted */
+ DWORD dwNumVidCreates; /* number of textures created in video memory */
+ DWORD dwNumTexturesUsed; /* number of textures used */
+ DWORD dwNumUsedTexInVid; /* number of used textures present in video memory */
+ DWORD dwWorkingSet; /* number of textures in video memory */
+ DWORD dwWorkingSetBytes; /* number of bytes in video memory */
+ DWORD dwTotalManaged; /* total number of managed textures */
+ DWORD dwTotalBytes; /* total number of bytes of managed textures */
+ DWORD dwLastPri; /* priority of last texture evicted */
+} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
+
+typedef struct _D3DDEVINFO_TEXTURING {
+ DWORD dwNumLoads; /* counts Load() API calls */
+ DWORD dwApproxBytesLoaded; /* Approximate number bytes loaded via Load() */
+ DWORD dwNumPreLoads; /* counts PreLoad() API calls */
+ DWORD dwNumSet; /* counts SetTexture() API calls */
+ DWORD dwNumCreates; /* counts texture creates */
+ DWORD dwNumDestroys; /* counts texture destroys */
+ DWORD dwNumSetPriorities; /* counts SetPriority() API calls */
+ DWORD dwNumSetLODs; /* counts SetLOD() API calls */
+ DWORD dwNumLocks; /* counts number of texture locks */
+ DWORD dwNumGetDCs; /* counts number of GetDCs to textures */
+} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+#pragma pack()
+
+
+#endif /* _D3DCAPS_H_ */
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
+#pragma endregion
+
diff --git a/client/d3drm.h b/client/d3d/d3drm.h
similarity index 100%
rename from client/d3drm.h
rename to client/d3d/d3drm.h
diff --git a/client/d3drmdef.h b/client/d3d/d3drmdef.h
similarity index 100%
rename from client/d3drmdef.h
rename to client/d3d/d3drmdef.h
diff --git a/client/d3drmobj.h b/client/d3d/d3drmobj.h
similarity index 100%
rename from client/d3drmobj.h
rename to client/d3d/d3drmobj.h
diff --git a/client/d3d/d3dtypes.h b/client/d3d/d3dtypes.h
new file mode 100644
index 0000000..c65ec70
--- /dev/null
+++ b/client/d3d/d3dtypes.h
@@ -0,0 +1,2133 @@
+/*==========================================================================;
+ *
+ * Copyright (C) Microsoft Corporation. All Rights Reserved.
+ *
+ * File: d3dtypes.h
+ * Content: Direct3D types include file
+ *
+ ***************************************************************************/
+
+#include
+
+#pragma region Desktop Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+#ifndef _D3DTYPES_H_
+#define _D3DTYPES_H_
+
+#ifndef DIRECT3D_VERSION
+#define DIRECT3D_VERSION 0x0700
+#endif
+
+#include
+
+#include
+
+#if (DIRECT3D_VERSION >= 0x0800)
+
+#ifndef _D3DHAL_H_
+#pragma message("should not include d3dtypes.h when compiling for DX8 or newer interfaces")
+#endif
+
+#if (DIRECT3D_VERSION >= 0x0900)
+#include
+#else
+#include
+#endif
+#endif
+
+#include "ddraw.h"
+
+#pragma warning(push)
+#pragma warning(disable:4201) // anonymous unions warning
+#if defined(_X86_) || defined(_IA64_)
+#pragma pack(4)
+#endif
+
+
+/* D3DVALUE is the fundamental Direct3D fractional data type */
+
+#define D3DVALP(val, prec) ((float)(val))
+#define D3DVAL(val) ((float)(val))
+
+#ifndef DX_SHARED_DEFINES
+
+/*
+ * This definition is shared with other DirectX components whose header files
+ * might already have defined it. Therefore, we don't define this type if
+ * someone else already has (as indicated by the definition of
+ * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are
+ * other types in this header that are also shared. The last of these
+ * shared defines in this file will set DX_SHARED_DEFINES.
+ */
+typedef float D3DVALUE, *LPD3DVALUE;
+
+#endif /* DX_SHARED_DEFINES */
+
+#define D3DDivide(a, b) (float)((double) (a) / (double) (b))
+#define D3DMultiply(a, b) ((a) * (b))
+
+typedef LONG D3DFIXED;
+
+#ifndef RGB_MAKE
+/*
+ * Format of CI colors is
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | alpha | color index | fraction |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#define CI_GETALPHA(ci) ((ci) >> 24)
+#define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff)
+#define CI_GETFRACTION(ci) ((ci) & 0xff)
+#define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80)
+#define CI_MASKALPHA(ci) ((ci) & 0xffffff)
+#define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f))
+
+/*
+ * Format of RGBA colors is
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | alpha | red | green | blue |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#define RGBA_GETALPHA(rgb) ((rgb) >> 24)
+#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
+#define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
+#define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
+#define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
+
+/* D3DRGB and D3DRGBA may be used as initialisers for D3DCOLORs
+ * The float values must be in the range 0..1
+ */
+#define D3DRGB(r, g, b) \
+ (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
+#define D3DRGBA(r, g, b, a) \
+ ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
+ | (((long)((g) * 255)) << 8) | (long)((b) * 255) \
+ )
+
+/*
+ * Format of RGB colors is
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | ignored | red | green | blue |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+#define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff)
+#define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
+#define RGB_GETBLUE(rgb) ((rgb) & 0xff)
+#define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
+#define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b)))
+#define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff))
+#define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000))
+
+#endif
+
+/*
+ * Flags for Enumerate functions
+ */
+
+/*
+ * Stop the enumeration
+ */
+#define D3DENUMRET_CANCEL DDENUMRET_CANCEL
+
+/*
+ * Continue the enumeration
+ */
+#define D3DENUMRET_OK DDENUMRET_OK
+
+typedef HRESULT (CALLBACK* LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
+typedef HRESULT (CALLBACK* LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
+typedef HRESULT (CALLBACK* LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext);
+
+#ifndef DX_SHARED_DEFINES
+
+/*
+ * This definition is shared with other DirectX components whose header files
+ * might already have defined it. Therefore, we don't define this type if
+ * someone else already has (as indicated by the definition of
+ * DX_SHARED_DEFINES). We don't set DX_SHARED_DEFINES here as there are
+ * other types in this header that are also shared. The last of these
+ * shared defines in this file will set DX_SHARED_DEFINES.
+ */
+#ifndef D3DCOLOR_DEFINED
+typedef DWORD D3DCOLOR;
+#define D3DCOLOR_DEFINED
+#endif
+typedef DWORD *LPD3DCOLOR;
+
+#endif /* DX_SHARED_DEFINES */
+
+typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
+typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE;
+typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE;
+
+#ifndef D3DCOLORVALUE_DEFINED
+typedef struct _D3DCOLORVALUE {
+ union {
+ D3DVALUE r;
+ D3DVALUE dvR;
+ };
+ union {
+ D3DVALUE g;
+ D3DVALUE dvG;
+ };
+ union {
+ D3DVALUE b;
+ D3DVALUE dvB;
+ };
+ union {
+ D3DVALUE a;
+ D3DVALUE dvA;
+ };
+} D3DCOLORVALUE;
+#define D3DCOLORVALUE_DEFINED
+#endif
+typedef struct _D3DCOLORVALUE *LPD3DCOLORVALUE;
+
+#ifndef D3DRECT_DEFINED
+typedef struct _D3DRECT {
+ union {
+ LONG x1;
+ LONG lX1;
+ };
+ union {
+ LONG y1;
+ LONG lY1;
+ };
+ union {
+ LONG x2;
+ LONG lX2;
+ };
+ union {
+ LONG y2;
+ LONG lY2;
+ };
+} D3DRECT;
+#define D3DRECT_DEFINED
+#endif
+typedef struct _D3DRECT *LPD3DRECT;
+
+#ifndef DX_SHARED_DEFINES
+
+/*
+ * This definition is shared with other DirectX components whose header files
+ * might already have defined it. Therefore, we don't define this type if
+ * someone else already has (as indicated by the definition of
+ * DX_SHARED_DEFINES).
+ */
+
+#ifndef D3DVECTOR_DEFINED
+typedef struct _D3DVECTOR {
+ union {
+ D3DVALUE x;
+ D3DVALUE dvX;
+ };
+ union {
+ D3DVALUE y;
+ D3DVALUE dvY;
+ };
+ union {
+ D3DVALUE z;
+ D3DVALUE dvZ;
+ };
+#if(DIRECT3D_VERSION >= 0x0500)
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+
+public:
+
+ // =====================================
+ // Constructors
+ // =====================================
+
+ _D3DVECTOR() { }
+ _D3DVECTOR(D3DVALUE f);
+ _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z);
+ _D3DVECTOR(const D3DVALUE f[3]);
+
+ // =====================================
+ // Access grants
+ // =====================================
+
+ const D3DVALUE&operator[](int i) const;
+ D3DVALUE&operator[](int i);
+
+ // =====================================
+ // Assignment operators
+ // =====================================
+
+ _D3DVECTOR& operator += (const _D3DVECTOR& v);
+ _D3DVECTOR& operator -= (const _D3DVECTOR& v);
+ _D3DVECTOR& operator *= (const _D3DVECTOR& v);
+ _D3DVECTOR& operator /= (const _D3DVECTOR& v);
+ _D3DVECTOR& operator *= (D3DVALUE s);
+ _D3DVECTOR& operator /= (D3DVALUE s);
+
+ // =====================================
+ // Unary operators
+ // =====================================
+
+ friend _D3DVECTOR operator + (const _D3DVECTOR& v);
+ friend _D3DVECTOR operator - (const _D3DVECTOR& v);
+
+
+ // =====================================
+ // Binary operators
+ // =====================================
+
+ // Addition and subtraction
+ friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+ friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+ // Scalar multiplication and division
+ friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s);
+ friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v);
+ friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s);
+ // Memberwise multiplication and division
+ friend _D3DVECTOR operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+ friend _D3DVECTOR operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+ // Vector dominance
+ friend int operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+ friend int operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+ // Bitwise equality
+ friend int operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+ // Length-related functions
+ friend D3DVALUE SquareMagnitude (const _D3DVECTOR& v);
+ friend D3DVALUE Magnitude (const _D3DVECTOR& v);
+
+ // Returns vector with same direction and unit length
+ friend _D3DVECTOR Normalize (const _D3DVECTOR& v);
+
+ // Return min/max component of the input vector
+ friend D3DVALUE Min (const _D3DVECTOR& v);
+ friend D3DVALUE Max (const _D3DVECTOR& v);
+
+ // Return memberwise min/max of input vectors
+ friend _D3DVECTOR Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+ friend _D3DVECTOR Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+ // Dot and cross product
+ friend D3DVALUE DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+ friend _D3DVECTOR CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DVECTOR;
+#define D3DVECTOR_DEFINED
+#endif
+typedef struct _D3DVECTOR *LPD3DVECTOR;
+
+/*
+ * As this is the last of the shared defines to be defined we now set
+ * D3D_SHARED_DEFINES to flag that fact that this header has defined these
+ * types.
+ */
+#define DX_SHARED_DEFINES
+
+#endif /* DX_SHARED_DEFINES */
+
+/*
+ * Vertex data types supported in an ExecuteBuffer.
+ */
+
+/*
+ * Homogeneous vertices
+ */
+
+typedef struct _D3DHVERTEX {
+ DWORD dwFlags; /* Homogeneous clipping flags */
+ union {
+ D3DVALUE hx;
+ D3DVALUE dvHX;
+ };
+ union {
+ D3DVALUE hy;
+ D3DVALUE dvHY;
+ };
+ union {
+ D3DVALUE hz;
+ D3DVALUE dvHZ;
+ };
+} D3DHVERTEX, *LPD3DHVERTEX;
+
+/*
+ * Transformed/lit vertices
+ */
+typedef struct _D3DTLVERTEX {
+ union {
+ D3DVALUE sx; /* Screen coordinates */
+ D3DVALUE dvSX;
+ };
+ union {
+ D3DVALUE sy;
+ D3DVALUE dvSY;
+ };
+ union {
+ D3DVALUE sz;
+ D3DVALUE dvSZ;
+ };
+ union {
+ D3DVALUE rhw; /* Reciprocal of homogeneous w */
+ D3DVALUE dvRHW;
+ };
+ union {
+ D3DCOLOR color; /* Vertex color */
+ D3DCOLOR dcColor;
+ };
+ union {
+ D3DCOLOR specular; /* Specular component of vertex */
+ D3DCOLOR dcSpecular;
+ };
+ union {
+ D3DVALUE tu; /* Texture coordinates */
+ D3DVALUE dvTU;
+ };
+ union {
+ D3DVALUE tv;
+ D3DVALUE dvTV;
+ };
+#if(DIRECT3D_VERSION >= 0x0500)
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+ _D3DTLVERTEX() { }
+ _D3DTLVERTEX(const D3DVECTOR& v, float _rhw,
+ D3DCOLOR _color, D3DCOLOR _specular,
+ float _tu, float _tv)
+ { sx = v.x; sy = v.y; sz = v.z; rhw = _rhw;
+ color = _color; specular = _specular;
+ tu = _tu; tv = _tv;
+ }
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DTLVERTEX, *LPD3DTLVERTEX;
+
+/*
+ * Untransformed/lit vertices
+ */
+typedef struct _D3DLVERTEX {
+ union {
+ D3DVALUE x; /* Homogeneous coordinates */
+ D3DVALUE dvX;
+ };
+ union {
+ D3DVALUE y;
+ D3DVALUE dvY;
+ };
+ union {
+ D3DVALUE z;
+ D3DVALUE dvZ;
+ };
+ DWORD dwReserved;
+ union {
+ D3DCOLOR color; /* Vertex color */
+ D3DCOLOR dcColor;
+ };
+ union {
+ D3DCOLOR specular; /* Specular component of vertex */
+ D3DCOLOR dcSpecular;
+ };
+ union {
+ D3DVALUE tu; /* Texture coordinates */
+ D3DVALUE dvTU;
+ };
+ union {
+ D3DVALUE tv;
+ D3DVALUE dvTV;
+ };
+#if(DIRECT3D_VERSION >= 0x0500)
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+ _D3DLVERTEX() { }
+ _D3DLVERTEX(const D3DVECTOR& v,
+ D3DCOLOR _color, D3DCOLOR _specular,
+ float _tu, float _tv)
+ { x = v.x; y = v.y; z = v.z; dwReserved = 0;
+ color = _color; specular = _specular;
+ tu = _tu; tv = _tv;
+ }
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DLVERTEX, *LPD3DLVERTEX;
+
+/*
+ * Untransformed/unlit vertices
+ */
+
+typedef struct _D3DVERTEX {
+ union {
+ D3DVALUE x; /* Homogeneous coordinates */
+ D3DVALUE dvX;
+ };
+ union {
+ D3DVALUE y;
+ D3DVALUE dvY;
+ };
+ union {
+ D3DVALUE z;
+ D3DVALUE dvZ;
+ };
+ union {
+ D3DVALUE nx; /* Normal */
+ D3DVALUE dvNX;
+ };
+ union {
+ D3DVALUE ny;
+ D3DVALUE dvNY;
+ };
+ union {
+ D3DVALUE nz;
+ D3DVALUE dvNZ;
+ };
+ union {
+ D3DVALUE tu; /* Texture coordinates */
+ D3DVALUE dvTU;
+ };
+ union {
+ D3DVALUE tv;
+ D3DVALUE dvTV;
+ };
+#if(DIRECT3D_VERSION >= 0x0500)
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+ _D3DVERTEX() { }
+ _D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv)
+ { x = v.x; y = v.y; z = v.z;
+ nx = n.x; ny = n.y; nz = n.z;
+ tu = _tu; tv = _tv;
+ }
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DVERTEX, *LPD3DVERTEX;
+
+
+/*
+ * Matrix, viewport, and tranformation structures and definitions.
+ */
+
+#ifndef D3DMATRIX_DEFINED
+typedef struct _D3DMATRIX {
+#if(DIRECT3D_VERSION >= 0x0500)
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+ union {
+ struct {
+#endif
+
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+ D3DVALUE _11, _12, _13, _14;
+ D3DVALUE _21, _22, _23, _24;
+ D3DVALUE _31, _32, _33, _34;
+ D3DVALUE _41, _42, _43, _44;
+
+#if(DIRECT3D_VERSION >= 0x0500)
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+ };
+ D3DVALUE m[4][4];
+ };
+ _D3DMATRIX() { }
+ _D3DMATRIX( D3DVALUE _m00, D3DVALUE _m01, D3DVALUE _m02, D3DVALUE _m03,
+ D3DVALUE _m10, D3DVALUE _m11, D3DVALUE _m12, D3DVALUE _m13,
+ D3DVALUE _m20, D3DVALUE _m21, D3DVALUE _m22, D3DVALUE _m23,
+ D3DVALUE _m30, D3DVALUE _m31, D3DVALUE _m32, D3DVALUE _m33
+ )
+ {
+ m[0][0] = _m00; m[0][1] = _m01; m[0][2] = _m02; m[0][3] = _m03;
+ m[1][0] = _m10; m[1][1] = _m11; m[1][2] = _m12; m[1][3] = _m13;
+ m[2][0] = _m20; m[2][1] = _m21; m[2][2] = _m22; m[2][3] = _m23;
+ m[3][0] = _m30; m[3][1] = _m31; m[3][2] = _m32; m[3][3] = _m33;
+ }
+
+ D3DVALUE& operator()(int iRow, int iColumn) { return m[iRow][iColumn]; }
+ const D3DVALUE& operator()(int iRow, int iColumn) const { return m[iRow][iColumn]; }
+#if(DIRECT3D_VERSION >= 0x0600)
+ friend _D3DMATRIX operator* (const _D3DMATRIX&, const _D3DMATRIX&);
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#endif
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DMATRIX;
+#define D3DMATRIX_DEFINED
+#endif
+typedef struct _D3DMATRIX *LPD3DMATRIX;
+
+#if (defined __cplusplus) && (defined D3D_OVERLOADS)
+#include "d3dvec.inl"
+#endif
+
+typedef struct _D3DVIEWPORT {
+ DWORD dwSize;
+ DWORD dwX;
+ DWORD dwY; /* Top left */
+ DWORD dwWidth;
+ DWORD dwHeight; /* Dimensions */
+ D3DVALUE dvScaleX; /* Scale homogeneous to screen */
+ D3DVALUE dvScaleY; /* Scale homogeneous to screen */
+ D3DVALUE dvMaxX; /* Min/max homogeneous x coord */
+ D3DVALUE dvMaxY; /* Min/max homogeneous y coord */
+ D3DVALUE dvMinZ;
+ D3DVALUE dvMaxZ; /* Min/max homogeneous z coord */
+} D3DVIEWPORT, *LPD3DVIEWPORT;
+
+#if(DIRECT3D_VERSION >= 0x0500)
+typedef struct _D3DVIEWPORT2 {
+ DWORD dwSize;
+ DWORD dwX;
+ DWORD dwY; /* Viewport Top left */
+ DWORD dwWidth;
+ DWORD dwHeight; /* Viewport Dimensions */
+ D3DVALUE dvClipX; /* Top left of clip volume */
+ D3DVALUE dvClipY;
+ D3DVALUE dvClipWidth; /* Clip Volume Dimensions */
+ D3DVALUE dvClipHeight;
+ D3DVALUE dvMinZ; /* Min/max of clip Volume */
+ D3DVALUE dvMaxZ;
+} D3DVIEWPORT2, *LPD3DVIEWPORT2;
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+typedef struct _D3DVIEWPORT7 {
+ DWORD dwX;
+ DWORD dwY; /* Viewport Top left */
+ DWORD dwWidth;
+ DWORD dwHeight; /* Viewport Dimensions */
+ D3DVALUE dvMinZ; /* Min/max of clip Volume */
+ D3DVALUE dvMaxZ;
+} D3DVIEWPORT7, *LPD3DVIEWPORT7;
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+/*
+ * Values for clip fields.
+ */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+
+// Max number of user clipping planes, supported in D3D.
+#define D3DMAXUSERCLIPPLANES 32
+
+// These bits could be ORed together to use with D3DRENDERSTATE_CLIPPLANEENABLE
+//
+#define D3DCLIPPLANE0 (1 << 0)
+#define D3DCLIPPLANE1 (1 << 1)
+#define D3DCLIPPLANE2 (1 << 2)
+#define D3DCLIPPLANE3 (1 << 3)
+#define D3DCLIPPLANE4 (1 << 4)
+#define D3DCLIPPLANE5 (1 << 5)
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#define D3DCLIP_LEFT 0x00000001L
+#define D3DCLIP_RIGHT 0x00000002L
+#define D3DCLIP_TOP 0x00000004L
+#define D3DCLIP_BOTTOM 0x00000008L
+#define D3DCLIP_FRONT 0x00000010L
+#define D3DCLIP_BACK 0x00000020L
+#define D3DCLIP_GEN0 0x00000040L
+#define D3DCLIP_GEN1 0x00000080L
+#define D3DCLIP_GEN2 0x00000100L
+#define D3DCLIP_GEN3 0x00000200L
+#define D3DCLIP_GEN4 0x00000400L
+#define D3DCLIP_GEN5 0x00000800L
+
+/*
+ * Values for d3d status.
+ */
+#define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT
+#define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT
+#define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP
+#define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM
+#define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT
+#define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK
+#define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0
+#define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1
+#define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2
+#define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3
+#define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4
+#define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5
+
+#define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000L
+#define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000L
+#define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000L
+#define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000L
+#define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000L
+#define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000L
+#define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000L
+#define D3DSTATUS_ZNOTVISIBLE 0x01000000L
+/* Do not use 0x80000000 for any status flags in future as it is reserved */
+
+#define D3DSTATUS_CLIPUNIONALL ( \
+ D3DSTATUS_CLIPUNIONLEFT | \
+ D3DSTATUS_CLIPUNIONRIGHT | \
+ D3DSTATUS_CLIPUNIONTOP | \
+ D3DSTATUS_CLIPUNIONBOTTOM | \
+ D3DSTATUS_CLIPUNIONFRONT | \
+ D3DSTATUS_CLIPUNIONBACK | \
+ D3DSTATUS_CLIPUNIONGEN0 | \
+ D3DSTATUS_CLIPUNIONGEN1 | \
+ D3DSTATUS_CLIPUNIONGEN2 | \
+ D3DSTATUS_CLIPUNIONGEN3 | \
+ D3DSTATUS_CLIPUNIONGEN4 | \
+ D3DSTATUS_CLIPUNIONGEN5 \
+ )
+
+#define D3DSTATUS_CLIPINTERSECTIONALL ( \
+ D3DSTATUS_CLIPINTERSECTIONLEFT | \
+ D3DSTATUS_CLIPINTERSECTIONRIGHT | \
+ D3DSTATUS_CLIPINTERSECTIONTOP | \
+ D3DSTATUS_CLIPINTERSECTIONBOTTOM | \
+ D3DSTATUS_CLIPINTERSECTIONFRONT | \
+ D3DSTATUS_CLIPINTERSECTIONBACK | \
+ D3DSTATUS_CLIPINTERSECTIONGEN0 | \
+ D3DSTATUS_CLIPINTERSECTIONGEN1 | \
+ D3DSTATUS_CLIPINTERSECTIONGEN2 | \
+ D3DSTATUS_CLIPINTERSECTIONGEN3 | \
+ D3DSTATUS_CLIPINTERSECTIONGEN4 | \
+ D3DSTATUS_CLIPINTERSECTIONGEN5 \
+ )
+
+#define D3DSTATUS_DEFAULT ( \
+ D3DSTATUS_CLIPINTERSECTIONALL | \
+ D3DSTATUS_ZNOTVISIBLE)
+
+
+/*
+ * Options for direct transform calls
+ */
+#define D3DTRANSFORM_CLIPPED 0x00000001l
+#define D3DTRANSFORM_UNCLIPPED 0x00000002l
+
+typedef struct _D3DTRANSFORMDATA {
+ DWORD dwSize;
+ LPVOID lpIn; /* Input vertices */
+ DWORD dwInSize; /* Stride of input vertices */
+ LPVOID lpOut; /* Output vertices */
+ DWORD dwOutSize; /* Stride of output vertices */
+ LPD3DHVERTEX lpHOut; /* Output homogeneous vertices */
+ DWORD dwClip; /* Clipping hint */
+ DWORD dwClipIntersection;
+ DWORD dwClipUnion; /* Union of all clip flags */
+ D3DRECT drExtent; /* Extent of transformed vertices */
+} D3DTRANSFORMDATA, *LPD3DTRANSFORMDATA;
+
+/*
+ * Structure defining position and direction properties for lighting.
+ */
+typedef struct _D3DLIGHTINGELEMENT {
+ D3DVECTOR dvPosition; /* Lightable point in model space */
+ D3DVECTOR dvNormal; /* Normalised unit vector */
+} D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT;
+
+/*
+ * Structure defining material properties for lighting.
+ */
+typedef struct _D3DMATERIAL {
+ DWORD dwSize;
+ union {
+ D3DCOLORVALUE diffuse; /* Diffuse color RGBA */
+ D3DCOLORVALUE dcvDiffuse;
+ };
+ union {
+ D3DCOLORVALUE ambient; /* Ambient color RGB */
+ D3DCOLORVALUE dcvAmbient;
+ };
+ union {
+ D3DCOLORVALUE specular; /* Specular 'shininess' */
+ D3DCOLORVALUE dcvSpecular;
+ };
+ union {
+ D3DCOLORVALUE emissive; /* Emissive color RGB */
+ D3DCOLORVALUE dcvEmissive;
+ };
+ union {
+ D3DVALUE power; /* Sharpness if specular highlight */
+ D3DVALUE dvPower;
+ };
+ D3DTEXTUREHANDLE hTexture; /* Handle to texture map */
+ DWORD dwRampSize;
+} D3DMATERIAL, *LPD3DMATERIAL;
+
+#if(DIRECT3D_VERSION >= 0x0700)
+
+typedef struct _D3DMATERIAL7 {
+ union {
+ D3DCOLORVALUE diffuse; /* Diffuse color RGBA */
+ D3DCOLORVALUE dcvDiffuse;
+ };
+ union {
+ D3DCOLORVALUE ambient; /* Ambient color RGB */
+ D3DCOLORVALUE dcvAmbient;
+ };
+ union {
+ D3DCOLORVALUE specular; /* Specular 'shininess' */
+ D3DCOLORVALUE dcvSpecular;
+ };
+ union {
+ D3DCOLORVALUE emissive; /* Emissive color RGB */
+ D3DCOLORVALUE dcvEmissive;
+ };
+ union {
+ D3DVALUE power; /* Sharpness if specular highlight */
+ D3DVALUE dvPower;
+ };
+} D3DMATERIAL7, *LPD3DMATERIAL7;
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DLIGHTTYPE {
+ D3DLIGHT_POINT = 1,
+ D3DLIGHT_SPOT = 2,
+ D3DLIGHT_DIRECTIONAL = 3,
+// Note: The following light type (D3DLIGHT_PARALLELPOINT)
+// is no longer supported from D3D for DX7 onwards.
+ D3DLIGHT_PARALLELPOINT = 4,
+#if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers
+ D3DLIGHT_GLSPOT = 5,
+#endif
+ D3DLIGHT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+} D3DLIGHTTYPE;
+
+#else
+#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4
+#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+/*
+ * Structure defining a light source and its properties.
+ */
+typedef struct _D3DLIGHT {
+ DWORD dwSize;
+ D3DLIGHTTYPE dltType; /* Type of light source */
+ D3DCOLORVALUE dcvColor; /* Color of light */
+ D3DVECTOR dvPosition; /* Position in world space */
+ D3DVECTOR dvDirection; /* Direction in world space */
+ D3DVALUE dvRange; /* Cutoff range */
+ D3DVALUE dvFalloff; /* Falloff */
+ D3DVALUE dvAttenuation0; /* Constant attenuation */
+ D3DVALUE dvAttenuation1; /* Linear attenuation */
+ D3DVALUE dvAttenuation2; /* Quadratic attenuation */
+ D3DVALUE dvTheta; /* Inner angle of spotlight cone */
+ D3DVALUE dvPhi; /* Outer angle of spotlight cone */
+} D3DLIGHT, *LPD3DLIGHT;
+
+#if(DIRECT3D_VERSION >= 0x0700)
+
+typedef struct _D3DLIGHT7 {
+ D3DLIGHTTYPE dltType; /* Type of light source */
+ D3DCOLORVALUE dcvDiffuse; /* Diffuse color of light */
+ D3DCOLORVALUE dcvSpecular; /* Specular color of light */
+ D3DCOLORVALUE dcvAmbient; /* Ambient color of light */
+ D3DVECTOR dvPosition; /* Position in world space */
+ D3DVECTOR dvDirection; /* Direction in world space */
+ D3DVALUE dvRange; /* Cutoff range */
+ D3DVALUE dvFalloff; /* Falloff */
+ D3DVALUE dvAttenuation0; /* Constant attenuation */
+ D3DVALUE dvAttenuation1; /* Linear attenuation */
+ D3DVALUE dvAttenuation2; /* Quadratic attenuation */
+ D3DVALUE dvTheta; /* Inner angle of spotlight cone */
+ D3DVALUE dvPhi; /* Outer angle of spotlight cone */
+} D3DLIGHT7, *LPD3DLIGHT7;
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#if(DIRECT3D_VERSION >= 0x0500)
+/*
+ * Structure defining a light source and its properties.
+ */
+
+/* flags bits */
+#define D3DLIGHT_ACTIVE 0x00000001
+#define D3DLIGHT_NO_SPECULAR 0x00000002
+#define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR)
+
+/* maximum valid light range */
+#define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX))
+
+typedef struct _D3DLIGHT2 {
+ DWORD dwSize;
+ D3DLIGHTTYPE dltType; /* Type of light source */
+ D3DCOLORVALUE dcvColor; /* Color of light */
+ D3DVECTOR dvPosition; /* Position in world space */
+ D3DVECTOR dvDirection; /* Direction in world space */
+ D3DVALUE dvRange; /* Cutoff range */
+ D3DVALUE dvFalloff; /* Falloff */
+ D3DVALUE dvAttenuation0; /* Constant attenuation */
+ D3DVALUE dvAttenuation1; /* Linear attenuation */
+ D3DVALUE dvAttenuation2; /* Quadratic attenuation */
+ D3DVALUE dvTheta; /* Inner angle of spotlight cone */
+ D3DVALUE dvPhi; /* Outer angle of spotlight cone */
+ DWORD dwFlags;
+} D3DLIGHT2, *LPD3DLIGHT2;
+
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+typedef struct _D3DLIGHTDATA {
+ DWORD dwSize;
+ LPD3DLIGHTINGELEMENT lpIn; /* Input positions and normals */
+ DWORD dwInSize; /* Stride of input elements */
+ LPD3DTLVERTEX lpOut; /* Output colors */
+ DWORD dwOutSize; /* Stride of output colors */
+} D3DLIGHTDATA, *LPD3DLIGHTDATA;
+
+#if(DIRECT3D_VERSION >= 0x0500)
+/*
+ * Before DX5, these values were in an enum called
+ * D3DCOLORMODEL. This was not correct, since they are
+ * bit flags. A driver can surface either or both flags
+ * in the dcmColorModel member of D3DDEVICEDESC.
+ */
+#define D3DCOLOR_MONO 1
+#define D3DCOLOR_RGB 2
+
+typedef DWORD D3DCOLORMODEL;
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+/*
+ * Options for clearing
+ */
+#define D3DCLEAR_TARGET 0x00000001l /* Clear target surface */
+#define D3DCLEAR_ZBUFFER 0x00000002l /* Clear target z buffer */
+#if(DIRECT3D_VERSION >= 0x0600)
+#define D3DCLEAR_STENCIL 0x00000004l /* Clear stencil planes */
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+/*
+ * Execute buffers are allocated via Direct3D. These buffers may then
+ * be filled by the application with instructions to execute along with
+ * vertex data.
+ */
+
+/*
+ * Supported op codes for execute instructions.
+ */
+typedef enum _D3DOPCODE {
+ D3DOP_POINT = 1,
+ D3DOP_LINE = 2,
+ D3DOP_TRIANGLE = 3,
+ D3DOP_MATRIXLOAD = 4,
+ D3DOP_MATRIXMULTIPLY = 5,
+ D3DOP_STATETRANSFORM = 6,
+ D3DOP_STATELIGHT = 7,
+ D3DOP_STATERENDER = 8,
+ D3DOP_PROCESSVERTICES = 9,
+ D3DOP_TEXTURELOAD = 10,
+ D3DOP_EXIT = 11,
+ D3DOP_BRANCHFORWARD = 12,
+ D3DOP_SPAN = 13,
+ D3DOP_SETSTATUS = 14,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DOPCODE;
+
+typedef struct _D3DINSTRUCTION {
+ BYTE bOpcode; /* Instruction opcode */
+ BYTE bSize; /* Size of each instruction data unit */
+ WORD wCount; /* Count of instruction data units to follow */
+} D3DINSTRUCTION, *LPD3DINSTRUCTION;
+
+/*
+ * Structure for texture loads
+ */
+typedef struct _D3DTEXTURELOAD {
+ D3DTEXTUREHANDLE hDestTexture;
+ D3DTEXTUREHANDLE hSrcTexture;
+} D3DTEXTURELOAD, *LPD3DTEXTURELOAD;
+
+/*
+ * Structure for picking
+ */
+typedef struct _D3DPICKRECORD {
+ BYTE bOpcode;
+ BYTE bPad;
+ DWORD dwOffset;
+ D3DVALUE dvZ;
+} D3DPICKRECORD, *LPD3DPICKRECORD;
+
+/*
+ * The following defines the rendering states which can be set in the
+ * execute buffer.
+ */
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DSHADEMODE {
+ D3DSHADE_FLAT = 1,
+ D3DSHADE_GOURAUD = 2,
+ D3DSHADE_PHONG = 3,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DSHADE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DSHADEMODE;
+
+typedef enum _D3DFILLMODE {
+ D3DFILL_POINT = 1,
+ D3DFILL_WIREFRAME = 2,
+ D3DFILL_SOLID = 3,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DFILL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DFILLMODE;
+
+typedef struct _D3DLINEPATTERN {
+ WORD wRepeatFactor;
+ WORD wLinePattern;
+} D3DLINEPATTERN;
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DTEXTUREFILTER {
+ D3DFILTER_NEAREST = 1,
+ D3DFILTER_LINEAR = 2,
+ D3DFILTER_MIPNEAREST = 3,
+ D3DFILTER_MIPLINEAR = 4,
+ D3DFILTER_LINEARMIPNEAREST = 5,
+ D3DFILTER_LINEARMIPLINEAR = 6,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DFILTER_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DTEXTUREFILTER;
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DBLEND {
+ D3DBLEND_ZERO = 1,
+ D3DBLEND_ONE = 2,
+ D3DBLEND_SRCCOLOR = 3,
+ D3DBLEND_INVSRCCOLOR = 4,
+ D3DBLEND_SRCALPHA = 5,
+ D3DBLEND_INVSRCALPHA = 6,
+ D3DBLEND_DESTALPHA = 7,
+ D3DBLEND_INVDESTALPHA = 8,
+ D3DBLEND_DESTCOLOR = 9,
+ D3DBLEND_INVDESTCOLOR = 10,
+ D3DBLEND_SRCALPHASAT = 11,
+ D3DBLEND_BOTHSRCALPHA = 12,
+ D3DBLEND_BOTHINVSRCALPHA = 13,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DBLEND;
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DTEXTUREBLEND {
+ D3DTBLEND_DECAL = 1,
+ D3DTBLEND_MODULATE = 2,
+ D3DTBLEND_DECALALPHA = 3,
+ D3DTBLEND_MODULATEALPHA = 4,
+ D3DTBLEND_DECALMASK = 5,
+ D3DTBLEND_MODULATEMASK = 6,
+ D3DTBLEND_COPY = 7,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DTBLEND_ADD = 8,
+ D3DTBLEND_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DTEXTUREBLEND;
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DTEXTUREADDRESS {
+ D3DTADDRESS_WRAP = 1,
+ D3DTADDRESS_MIRROR = 2,
+ D3DTADDRESS_CLAMP = 3,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DTADDRESS_BORDER = 4,
+ D3DTADDRESS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DTEXTUREADDRESS;
+
+typedef enum _D3DCULL {
+ D3DCULL_NONE = 1,
+ D3DCULL_CW = 2,
+ D3DCULL_CCW = 3,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DCULL_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DCULL;
+
+typedef enum _D3DCMPFUNC {
+ D3DCMP_NEVER = 1,
+ D3DCMP_LESS = 2,
+ D3DCMP_EQUAL = 3,
+ D3DCMP_LESSEQUAL = 4,
+ D3DCMP_GREATER = 5,
+ D3DCMP_NOTEQUAL = 6,
+ D3DCMP_GREATEREQUAL = 7,
+ D3DCMP_ALWAYS = 8,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DCMP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DCMPFUNC;
+
+#if(DIRECT3D_VERSION >= 0x0600)
+typedef enum _D3DSTENCILOP {
+ D3DSTENCILOP_KEEP = 1,
+ D3DSTENCILOP_ZERO = 2,
+ D3DSTENCILOP_REPLACE = 3,
+ D3DSTENCILOP_INCRSAT = 4,
+ D3DSTENCILOP_DECRSAT = 5,
+ D3DSTENCILOP_INVERT = 6,
+ D3DSTENCILOP_INCR = 7,
+ D3DSTENCILOP_DECR = 8,
+ D3DSTENCILOP_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+} D3DSTENCILOP;
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+typedef enum _D3DFOGMODE {
+ D3DFOG_NONE = 0,
+ D3DFOG_EXP = 1,
+ D3DFOG_EXP2 = 2,
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DFOG_LINEAR = 3,
+ D3DFOG_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DFOGMODE;
+
+#if(DIRECT3D_VERSION >= 0x0600)
+typedef enum _D3DZBUFFERTYPE {
+ D3DZB_FALSE = 0,
+ D3DZB_TRUE = 1, // Z buffering
+ D3DZB_USEW = 2, // W buffering
+ D3DZB_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+} D3DZBUFFERTYPE;
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+#if(DIRECT3D_VERSION >= 0x0500)
+typedef enum _D3DANTIALIASMODE {
+ D3DANTIALIAS_NONE = 0,
+ D3DANTIALIAS_SORTDEPENDENT = 1,
+ D3DANTIALIAS_SORTINDEPENDENT = 2,
+ D3DANTIALIAS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+} D3DANTIALIASMODE;
+
+// Vertex types supported by Direct3D
+typedef enum _D3DVERTEXTYPE {
+ D3DVT_VERTEX = 1,
+ D3DVT_LVERTEX = 2,
+ D3DVT_TLVERTEX = 3,
+ D3DVT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+} D3DVERTEXTYPE;
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+// Primitives supported by draw-primitive API
+typedef enum _D3DPRIMITIVETYPE {
+ D3DPT_POINTLIST = 1,
+ D3DPT_LINELIST = 2,
+ D3DPT_LINESTRIP = 3,
+ D3DPT_TRIANGLELIST = 4,
+ D3DPT_TRIANGLESTRIP = 5,
+ D3DPT_TRIANGLEFAN = 6,
+ D3DPT_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+} D3DPRIMITIVETYPE;
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+/*
+ * Amount to add to a state to generate the override for that state.
+ */
+#define D3DSTATE_OVERRIDE_BIAS 256
+
+/*
+ * A state which sets the override flag for the specified state type.
+ */
+#define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS))
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DTRANSFORMSTATETYPE {
+ D3DTRANSFORMSTATE_WORLD = 1,
+ D3DTRANSFORMSTATE_VIEW = 2,
+ D3DTRANSFORMSTATE_PROJECTION = 3,
+#if(DIRECT3D_VERSION >= 0x0700)
+ D3DTRANSFORMSTATE_WORLD1 = 4, // 2nd matrix to blend
+ D3DTRANSFORMSTATE_WORLD2 = 5, // 3rd matrix to blend
+ D3DTRANSFORMSTATE_WORLD3 = 6, // 4th matrix to blend
+ D3DTRANSFORMSTATE_TEXTURE0 = 16,
+ D3DTRANSFORMSTATE_TEXTURE1 = 17,
+ D3DTRANSFORMSTATE_TEXTURE2 = 18,
+ D3DTRANSFORMSTATE_TEXTURE3 = 19,
+ D3DTRANSFORMSTATE_TEXTURE4 = 20,
+ D3DTRANSFORMSTATE_TEXTURE5 = 21,
+ D3DTRANSFORMSTATE_TEXTURE6 = 22,
+ D3DTRANSFORMSTATE_TEXTURE7 = 23,
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DTRANSFORMSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DTRANSFORMSTATETYPE;
+
+#else
+
+//
+// legacy transform state names
+//
+#define D3DTRANSFORMSTATE_WORLD (D3DTRANSFORMSTATETYPE)1
+#define D3DTRANSFORMSTATE_VIEW (D3DTRANSFORMSTATETYPE)2
+#define D3DTRANSFORMSTATE_PROJECTION (D3DTRANSFORMSTATETYPE)3
+#define D3DTRANSFORMSTATE_WORLD1 (D3DTRANSFORMSTATETYPE)4
+#define D3DTRANSFORMSTATE_WORLD2 (D3DTRANSFORMSTATETYPE)5
+#define D3DTRANSFORMSTATE_WORLD3 (D3DTRANSFORMSTATETYPE)6
+#define D3DTRANSFORMSTATE_TEXTURE0 (D3DTRANSFORMSTATETYPE)16
+#define D3DTRANSFORMSTATE_TEXTURE1 (D3DTRANSFORMSTATETYPE)17
+#define D3DTRANSFORMSTATE_TEXTURE2 (D3DTRANSFORMSTATETYPE)18
+#define D3DTRANSFORMSTATE_TEXTURE3 (D3DTRANSFORMSTATETYPE)19
+#define D3DTRANSFORMSTATE_TEXTURE4 (D3DTRANSFORMSTATETYPE)20
+#define D3DTRANSFORMSTATE_TEXTURE5 (D3DTRANSFORMSTATETYPE)21
+#define D3DTRANSFORMSTATE_TEXTURE6 (D3DTRANSFORMSTATETYPE)22
+#define D3DTRANSFORMSTATE_TEXTURE7 (D3DTRANSFORMSTATETYPE)23
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DLIGHTSTATETYPE {
+ D3DLIGHTSTATE_MATERIAL = 1,
+ D3DLIGHTSTATE_AMBIENT = 2,
+ D3DLIGHTSTATE_COLORMODEL = 3,
+ D3DLIGHTSTATE_FOGMODE = 4,
+ D3DLIGHTSTATE_FOGSTART = 5,
+ D3DLIGHTSTATE_FOGEND = 6,
+ D3DLIGHTSTATE_FOGDENSITY = 7,
+#if(DIRECT3D_VERSION >= 0x0600)
+ D3DLIGHTSTATE_COLORVERTEX = 8,
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DLIGHTSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DLIGHTSTATETYPE;
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+typedef enum _D3DRENDERSTATETYPE {
+ D3DRENDERSTATE_ANTIALIAS = 2, /* D3DANTIALIASMODE */
+ D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4, /* TRUE for perspective correction */
+ D3DRENDERSTATE_ZENABLE = 7, /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */
+ D3DRENDERSTATE_FILLMODE = 8, /* D3DFILL_MODE */
+ D3DRENDERSTATE_SHADEMODE = 9, /* D3DSHADEMODE */
+ D3DRENDERSTATE_LINEPATTERN = 10, /* D3DLINEPATTERN */
+ D3DRENDERSTATE_ZWRITEENABLE = 14, /* TRUE to enable z writes */
+ D3DRENDERSTATE_ALPHATESTENABLE = 15, /* TRUE to enable alpha tests */
+ D3DRENDERSTATE_LASTPIXEL = 16, /* TRUE for last-pixel on lines */
+ D3DRENDERSTATE_SRCBLEND = 19, /* D3DBLEND */
+ D3DRENDERSTATE_DESTBLEND = 20, /* D3DBLEND */
+ D3DRENDERSTATE_CULLMODE = 22, /* D3DCULL */
+ D3DRENDERSTATE_ZFUNC = 23, /* D3DCMPFUNC */
+ D3DRENDERSTATE_ALPHAREF = 24, /* D3DFIXED */
+ D3DRENDERSTATE_ALPHAFUNC = 25, /* D3DCMPFUNC */
+ D3DRENDERSTATE_DITHERENABLE = 26, /* TRUE to enable dithering */
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DRENDERSTATE_ALPHABLENDENABLE = 27, /* TRUE to enable alpha blending */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+ D3DRENDERSTATE_FOGENABLE = 28, /* TRUE to enable fog blending */
+ D3DRENDERSTATE_SPECULARENABLE = 29, /* TRUE to enable specular */
+ D3DRENDERSTATE_ZVISIBLE = 30, /* TRUE to enable z checking */
+ D3DRENDERSTATE_STIPPLEDALPHA = 33, /* TRUE to enable stippled alpha (RGB device only) */
+ D3DRENDERSTATE_FOGCOLOR = 34, /* D3DCOLOR */
+ D3DRENDERSTATE_FOGTABLEMODE = 35, /* D3DFOGMODE */
+#if(DIRECT3D_VERSION >= 0x0700)
+ D3DRENDERSTATE_FOGSTART = 36, /* Fog start (for both vertex and pixel fog) */
+ D3DRENDERSTATE_FOGEND = 37, /* Fog end */
+ D3DRENDERSTATE_FOGDENSITY = 38, /* Fog density */
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DRENDERSTATE_EDGEANTIALIAS = 40, /* TRUE to enable edge antialiasing */
+ D3DRENDERSTATE_COLORKEYENABLE = 41, /* TRUE to enable source colorkeyed textures */
+ D3DRENDERSTATE_ZBIAS = 47, /* LONG Z bias */
+ D3DRENDERSTATE_RANGEFOGENABLE = 48, /* Enables range-based fog */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+ D3DRENDERSTATE_STENCILENABLE = 52, /* BOOL enable/disable stenciling */
+ D3DRENDERSTATE_STENCILFAIL = 53, /* D3DSTENCILOP to do if stencil test fails */
+ D3DRENDERSTATE_STENCILZFAIL = 54, /* D3DSTENCILOP to do if stencil test passes and Z test fails */
+ D3DRENDERSTATE_STENCILPASS = 55, /* D3DSTENCILOP to do if both stencil and Z tests pass */
+ D3DRENDERSTATE_STENCILFUNC = 56, /* D3DCMPFUNC fn. Stencil Test passes if ((ref & mask) stencilfn (stencil & mask)) is true */
+ D3DRENDERSTATE_STENCILREF = 57, /* Reference value used in stencil test */
+ D3DRENDERSTATE_STENCILMASK = 58, /* Mask value used in stencil test */
+ D3DRENDERSTATE_STENCILWRITEMASK = 59, /* Write mask applied to values written to stencil buffer */
+ D3DRENDERSTATE_TEXTUREFACTOR = 60, /* D3DCOLOR used for multi-texture blend */
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+
+ /*
+ * 128 values [128, 255] are reserved for texture coordinate wrap flags.
+ * These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using
+ * a flags word preserves forward compatibility with texture coordinates
+ * that are >2D.
+ */
+ D3DRENDERSTATE_WRAP0 = 128, /* wrap for 1st texture coord. set */
+ D3DRENDERSTATE_WRAP1 = 129, /* wrap for 2nd texture coord. set */
+ D3DRENDERSTATE_WRAP2 = 130, /* wrap for 3rd texture coord. set */
+ D3DRENDERSTATE_WRAP3 = 131, /* wrap for 4th texture coord. set */
+ D3DRENDERSTATE_WRAP4 = 132, /* wrap for 5th texture coord. set */
+ D3DRENDERSTATE_WRAP5 = 133, /* wrap for 6th texture coord. set */
+ D3DRENDERSTATE_WRAP6 = 134, /* wrap for 7th texture coord. set */
+ D3DRENDERSTATE_WRAP7 = 135, /* wrap for 8th texture coord. set */
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+#if(DIRECT3D_VERSION >= 0x0700)
+ D3DRENDERSTATE_CLIPPING = 136,
+ D3DRENDERSTATE_LIGHTING = 137,
+ D3DRENDERSTATE_EXTENTS = 138,
+ D3DRENDERSTATE_AMBIENT = 139,
+ D3DRENDERSTATE_FOGVERTEXMODE = 140,
+ D3DRENDERSTATE_COLORVERTEX = 141,
+ D3DRENDERSTATE_LOCALVIEWER = 142,
+ D3DRENDERSTATE_NORMALIZENORMALS = 143,
+ D3DRENDERSTATE_COLORKEYBLENDENABLE = 144,
+ D3DRENDERSTATE_DIFFUSEMATERIALSOURCE = 145,
+ D3DRENDERSTATE_SPECULARMATERIALSOURCE = 146,
+ D3DRENDERSTATE_AMBIENTMATERIALSOURCE = 147,
+ D3DRENDERSTATE_EMISSIVEMATERIALSOURCE = 148,
+ D3DRENDERSTATE_VERTEXBLEND = 151,
+ D3DRENDERSTATE_CLIPPLANEENABLE = 152,
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+//
+// retired renderstates - not supported for DX7 interfaces
+//
+ D3DRENDERSTATE_TEXTUREHANDLE = 1, /* Texture handle for legacy interfaces (Texture,Texture2) */
+ D3DRENDERSTATE_TEXTUREADDRESS = 3, /* D3DTEXTUREADDRESS */
+ D3DRENDERSTATE_WRAPU = 5, /* TRUE for wrapping in u */
+ D3DRENDERSTATE_WRAPV = 6, /* TRUE for wrapping in v */
+ D3DRENDERSTATE_MONOENABLE = 11, /* TRUE to enable mono rasterization */
+ D3DRENDERSTATE_ROP2 = 12, /* ROP2 */
+ D3DRENDERSTATE_PLANEMASK = 13, /* DWORD physical plane mask */
+ D3DRENDERSTATE_TEXTUREMAG = 17, /* D3DTEXTUREFILTER */
+ D3DRENDERSTATE_TEXTUREMIN = 18, /* D3DTEXTUREFILTER */
+ D3DRENDERSTATE_TEXTUREMAPBLEND = 21, /* D3DTEXTUREBLEND */
+ D3DRENDERSTATE_SUBPIXEL = 31, /* TRUE to enable subpixel correction */
+ D3DRENDERSTATE_SUBPIXELX = 32, /* TRUE to enable correction in X only */
+ D3DRENDERSTATE_STIPPLEENABLE = 39, /* TRUE to enable stippling */
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DRENDERSTATE_BORDERCOLOR = 43, /* Border color for texturing w/border */
+ D3DRENDERSTATE_TEXTUREADDRESSU = 44, /* Texture addressing mode for U coordinate */
+ D3DRENDERSTATE_TEXTUREADDRESSV = 45, /* Texture addressing mode for V coordinate */
+ D3DRENDERSTATE_MIPMAPLODBIAS = 46, /* D3DVALUE Mipmap LOD bias */
+ D3DRENDERSTATE_ANISOTROPY = 49, /* Max. anisotropy. 1 = no anisotropy */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+ D3DRENDERSTATE_FLUSHBATCH = 50, /* Explicit flush for DP batching (DX5 Only) */
+#if(DIRECT3D_VERSION >= 0x0600)
+ D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+ D3DRENDERSTATE_STIPPLEPATTERN00 = 64, /* Stipple pattern 01... */
+ D3DRENDERSTATE_STIPPLEPATTERN01 = 65,
+ D3DRENDERSTATE_STIPPLEPATTERN02 = 66,
+ D3DRENDERSTATE_STIPPLEPATTERN03 = 67,
+ D3DRENDERSTATE_STIPPLEPATTERN04 = 68,
+ D3DRENDERSTATE_STIPPLEPATTERN05 = 69,
+ D3DRENDERSTATE_STIPPLEPATTERN06 = 70,
+ D3DRENDERSTATE_STIPPLEPATTERN07 = 71,
+ D3DRENDERSTATE_STIPPLEPATTERN08 = 72,
+ D3DRENDERSTATE_STIPPLEPATTERN09 = 73,
+ D3DRENDERSTATE_STIPPLEPATTERN10 = 74,
+ D3DRENDERSTATE_STIPPLEPATTERN11 = 75,
+ D3DRENDERSTATE_STIPPLEPATTERN12 = 76,
+ D3DRENDERSTATE_STIPPLEPATTERN13 = 77,
+ D3DRENDERSTATE_STIPPLEPATTERN14 = 78,
+ D3DRENDERSTATE_STIPPLEPATTERN15 = 79,
+ D3DRENDERSTATE_STIPPLEPATTERN16 = 80,
+ D3DRENDERSTATE_STIPPLEPATTERN17 = 81,
+ D3DRENDERSTATE_STIPPLEPATTERN18 = 82,
+ D3DRENDERSTATE_STIPPLEPATTERN19 = 83,
+ D3DRENDERSTATE_STIPPLEPATTERN20 = 84,
+ D3DRENDERSTATE_STIPPLEPATTERN21 = 85,
+ D3DRENDERSTATE_STIPPLEPATTERN22 = 86,
+ D3DRENDERSTATE_STIPPLEPATTERN23 = 87,
+ D3DRENDERSTATE_STIPPLEPATTERN24 = 88,
+ D3DRENDERSTATE_STIPPLEPATTERN25 = 89,
+ D3DRENDERSTATE_STIPPLEPATTERN26 = 90,
+ D3DRENDERSTATE_STIPPLEPATTERN27 = 91,
+ D3DRENDERSTATE_STIPPLEPATTERN28 = 92,
+ D3DRENDERSTATE_STIPPLEPATTERN29 = 93,
+ D3DRENDERSTATE_STIPPLEPATTERN30 = 94,
+ D3DRENDERSTATE_STIPPLEPATTERN31 = 95,
+
+//
+// retired renderstate names - the values are still used under new naming conventions
+//
+ D3DRENDERSTATE_FOGTABLESTART = 36, /* Fog table start */
+ D3DRENDERSTATE_FOGTABLEEND = 37, /* Fog table end */
+ D3DRENDERSTATE_FOGTABLEDENSITY = 38, /* Fog table density */
+
+#if(DIRECT3D_VERSION >= 0x0500)
+ D3DRENDERSTATE_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+} D3DRENDERSTATETYPE;
+
+#else
+
+//
+// legacy renderstate names
+//
+#define D3DRENDERSTATE_TEXTUREPERSPECTIVE (D3DRENDERSTATETYPE)4
+#define D3DRENDERSTATE_ZENABLE (D3DRENDERSTATETYPE)7
+#define D3DRENDERSTATE_FILLMODE (D3DRENDERSTATETYPE)8
+#define D3DRENDERSTATE_SHADEMODE (D3DRENDERSTATETYPE)9
+#define D3DRENDERSTATE_LINEPATTERN (D3DRENDERSTATETYPE)10
+#define D3DRENDERSTATE_ZWRITEENABLE (D3DRENDERSTATETYPE)14
+#define D3DRENDERSTATE_ALPHATESTENABLE (D3DRENDERSTATETYPE)15
+#define D3DRENDERSTATE_LASTPIXEL (D3DRENDERSTATETYPE)16
+#define D3DRENDERSTATE_SRCBLEND (D3DRENDERSTATETYPE)19
+#define D3DRENDERSTATE_DESTBLEND (D3DRENDERSTATETYPE)20
+#define D3DRENDERSTATE_CULLMODE (D3DRENDERSTATETYPE)22
+#define D3DRENDERSTATE_ZFUNC (D3DRENDERSTATETYPE)23
+#define D3DRENDERSTATE_ALPHAREF (D3DRENDERSTATETYPE)24
+#define D3DRENDERSTATE_ALPHAFUNC (D3DRENDERSTATETYPE)25
+#define D3DRENDERSTATE_DITHERENABLE (D3DRENDERSTATETYPE)26
+#define D3DRENDERSTATE_ALPHABLENDENABLE (D3DRENDERSTATETYPE)27
+#define D3DRENDERSTATE_FOGENABLE (D3DRENDERSTATETYPE)28
+#define D3DRENDERSTATE_SPECULARENABLE (D3DRENDERSTATETYPE)29
+#define D3DRENDERSTATE_ZVISIBLE (D3DRENDERSTATETYPE)30
+#define D3DRENDERSTATE_STIPPLEDALPHA (D3DRENDERSTATETYPE)33
+#define D3DRENDERSTATE_FOGCOLOR (D3DRENDERSTATETYPE)34
+#define D3DRENDERSTATE_FOGTABLEMODE (D3DRENDERSTATETYPE)35
+#define D3DRENDERSTATE_FOGSTART (D3DRENDERSTATETYPE)36
+#define D3DRENDERSTATE_FOGEND (D3DRENDERSTATETYPE)37
+#define D3DRENDERSTATE_FOGDENSITY (D3DRENDERSTATETYPE)38
+#define D3DRENDERSTATE_EDGEANTIALIAS (D3DRENDERSTATETYPE)40
+#define D3DRENDERSTATE_ZBIAS (D3DRENDERSTATETYPE)47
+#define D3DRENDERSTATE_RANGEFOGENABLE (D3DRENDERSTATETYPE)48
+#define D3DRENDERSTATE_STENCILENABLE (D3DRENDERSTATETYPE)52
+#define D3DRENDERSTATE_STENCILFAIL (D3DRENDERSTATETYPE)53
+#define D3DRENDERSTATE_STENCILZFAIL (D3DRENDERSTATETYPE)54
+#define D3DRENDERSTATE_STENCILPASS (D3DRENDERSTATETYPE)55
+#define D3DRENDERSTATE_STENCILFUNC (D3DRENDERSTATETYPE)56
+#define D3DRENDERSTATE_STENCILREF (D3DRENDERSTATETYPE)57
+#define D3DRENDERSTATE_STENCILMASK (D3DRENDERSTATETYPE)58
+#define D3DRENDERSTATE_STENCILWRITEMASK (D3DRENDERSTATETYPE)59
+#define D3DRENDERSTATE_TEXTUREFACTOR (D3DRENDERSTATETYPE)60
+#define D3DRENDERSTATE_WRAP0 (D3DRENDERSTATETYPE)128
+#define D3DRENDERSTATE_WRAP1 (D3DRENDERSTATETYPE)129
+#define D3DRENDERSTATE_WRAP2 (D3DRENDERSTATETYPE)130
+#define D3DRENDERSTATE_WRAP3 (D3DRENDERSTATETYPE)131
+#define D3DRENDERSTATE_WRAP4 (D3DRENDERSTATETYPE)132
+#define D3DRENDERSTATE_WRAP5 (D3DRENDERSTATETYPE)133
+#define D3DRENDERSTATE_WRAP6 (D3DRENDERSTATETYPE)134
+#define D3DRENDERSTATE_WRAP7 (D3DRENDERSTATETYPE)135
+
+#define D3DRENDERSTATE_CLIPPING (D3DRENDERSTATETYPE)136
+#define D3DRENDERSTATE_LIGHTING (D3DRENDERSTATETYPE)137
+#define D3DRENDERSTATE_EXTENTS (D3DRENDERSTATETYPE)138
+#define D3DRENDERSTATE_AMBIENT (D3DRENDERSTATETYPE)139
+#define D3DRENDERSTATE_FOGVERTEXMODE (D3DRENDERSTATETYPE)140
+#define D3DRENDERSTATE_COLORVERTEX (D3DRENDERSTATETYPE)141
+#define D3DRENDERSTATE_LOCALVIEWER (D3DRENDERSTATETYPE)142
+#define D3DRENDERSTATE_NORMALIZENORMALS (D3DRENDERSTATETYPE)143
+#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144
+#define D3DRENDERSTATE_DIFFUSEMATERIALSOURCE (D3DRENDERSTATETYPE)145
+#define D3DRENDERSTATE_SPECULARMATERIALSOURCE (D3DRENDERSTATETYPE)146
+#define D3DRENDERSTATE_AMBIENTMATERIALSOURCE (D3DRENDERSTATETYPE)147
+#define D3DRENDERSTATE_EMISSIVEMATERIALSOURCE (D3DRENDERSTATETYPE)148
+#define D3DRENDERSTATE_VERTEXBLEND (D3DRENDERSTATETYPE)151
+#define D3DRENDERSTATE_CLIPPLANEENABLE (D3DRENDERSTATETYPE)152
+
+//
+// retired renderstates - not supported for DX7 interfaces
+//
+#define D3DRENDERSTATE_TEXTUREHANDLE (D3DRENDERSTATETYPE)1
+#define D3DRENDERSTATE_ANTIALIAS (D3DRENDERSTATETYPE)2
+#define D3DRENDERSTATE_TEXTUREADDRESS (D3DRENDERSTATETYPE)3
+#define D3DRENDERSTATE_WRAPU (D3DRENDERSTATETYPE)5
+#define D3DRENDERSTATE_WRAPV (D3DRENDERSTATETYPE)6
+#define D3DRENDERSTATE_MONOENABLE (D3DRENDERSTATETYPE)11
+#define D3DRENDERSTATE_ROP2 (D3DRENDERSTATETYPE)12
+#define D3DRENDERSTATE_PLANEMASK (D3DRENDERSTATETYPE)13
+#define D3DRENDERSTATE_TEXTUREMAG (D3DRENDERSTATETYPE)17
+#define D3DRENDERSTATE_TEXTUREMIN (D3DRENDERSTATETYPE)18
+#define D3DRENDERSTATE_TEXTUREMAPBLEND (D3DRENDERSTATETYPE)21
+#define D3DRENDERSTATE_SUBPIXEL (D3DRENDERSTATETYPE)31
+#define D3DRENDERSTATE_SUBPIXELX (D3DRENDERSTATETYPE)32
+#define D3DRENDERSTATE_STIPPLEENABLE (D3DRENDERSTATETYPE)39
+#define D3DRENDERSTATE_OLDALPHABLENDENABLE (D3DRENDERSTATETYPE)42
+#define D3DRENDERSTATE_BORDERCOLOR (D3DRENDERSTATETYPE)43
+#define D3DRENDERSTATE_TEXTUREADDRESSU (D3DRENDERSTATETYPE)44
+#define D3DRENDERSTATE_TEXTUREADDRESSV (D3DRENDERSTATETYPE)45
+#define D3DRENDERSTATE_MIPMAPLODBIAS (D3DRENDERSTATETYPE)46
+#define D3DRENDERSTATE_ANISOTROPY (D3DRENDERSTATETYPE)49
+#define D3DRENDERSTATE_FLUSHBATCH (D3DRENDERSTATETYPE)50
+#define D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT (D3DRENDERSTATETYPE)51
+#define D3DRENDERSTATE_STIPPLEPATTERN00 (D3DRENDERSTATETYPE)64
+#define D3DRENDERSTATE_STIPPLEPATTERN01 (D3DRENDERSTATETYPE)65
+#define D3DRENDERSTATE_STIPPLEPATTERN02 (D3DRENDERSTATETYPE)66
+#define D3DRENDERSTATE_STIPPLEPATTERN03 (D3DRENDERSTATETYPE)67
+#define D3DRENDERSTATE_STIPPLEPATTERN04 (D3DRENDERSTATETYPE)68
+#define D3DRENDERSTATE_STIPPLEPATTERN05 (D3DRENDERSTATETYPE)69
+#define D3DRENDERSTATE_STIPPLEPATTERN06 (D3DRENDERSTATETYPE)70
+#define D3DRENDERSTATE_STIPPLEPATTERN07 (D3DRENDERSTATETYPE)71
+#define D3DRENDERSTATE_STIPPLEPATTERN08 (D3DRENDERSTATETYPE)72
+#define D3DRENDERSTATE_STIPPLEPATTERN09 (D3DRENDERSTATETYPE)73
+#define D3DRENDERSTATE_STIPPLEPATTERN10 (D3DRENDERSTATETYPE)74
+#define D3DRENDERSTATE_STIPPLEPATTERN11 (D3DRENDERSTATETYPE)75
+#define D3DRENDERSTATE_STIPPLEPATTERN12 (D3DRENDERSTATETYPE)76
+#define D3DRENDERSTATE_STIPPLEPATTERN13 (D3DRENDERSTATETYPE)77
+#define D3DRENDERSTATE_STIPPLEPATTERN14 (D3DRENDERSTATETYPE)78
+#define D3DRENDERSTATE_STIPPLEPATTERN15 (D3DRENDERSTATETYPE)79
+#define D3DRENDERSTATE_STIPPLEPATTERN16 (D3DRENDERSTATETYPE)80
+#define D3DRENDERSTATE_STIPPLEPATTERN17 (D3DRENDERSTATETYPE)81
+#define D3DRENDERSTATE_STIPPLEPATTERN18 (D3DRENDERSTATETYPE)82
+#define D3DRENDERSTATE_STIPPLEPATTERN19 (D3DRENDERSTATETYPE)83
+#define D3DRENDERSTATE_STIPPLEPATTERN20 (D3DRENDERSTATETYPE)84
+#define D3DRENDERSTATE_STIPPLEPATTERN21 (D3DRENDERSTATETYPE)85
+#define D3DRENDERSTATE_STIPPLEPATTERN22 (D3DRENDERSTATETYPE)86
+#define D3DRENDERSTATE_STIPPLEPATTERN23 (D3DRENDERSTATETYPE)87
+#define D3DRENDERSTATE_STIPPLEPATTERN24 (D3DRENDERSTATETYPE)88
+#define D3DRENDERSTATE_STIPPLEPATTERN25 (D3DRENDERSTATETYPE)89
+#define D3DRENDERSTATE_STIPPLEPATTERN26 (D3DRENDERSTATETYPE)90
+#define D3DRENDERSTATE_STIPPLEPATTERN27 (D3DRENDERSTATETYPE)91
+#define D3DRENDERSTATE_STIPPLEPATTERN28 (D3DRENDERSTATETYPE)92
+#define D3DRENDERSTATE_STIPPLEPATTERN29 (D3DRENDERSTATETYPE)93
+#define D3DRENDERSTATE_STIPPLEPATTERN30 (D3DRENDERSTATETYPE)94
+#define D3DRENDERSTATE_STIPPLEPATTERN31 (D3DRENDERSTATETYPE)95
+
+//
+// retired renderstates - not supported for DX8 interfaces
+//
+#define D3DRENDERSTATE_COLORKEYENABLE (D3DRENDERSTATETYPE)41
+#define D3DRENDERSTATE_COLORKEYBLENDENABLE (D3DRENDERSTATETYPE)144
+
+//
+// retired renderstate names - the values are still used under new naming conventions
+//
+#define D3DRENDERSTATE_BLENDENABLE (D3DRENDERSTATETYPE)27
+#define D3DRENDERSTATE_FOGTABLESTART (D3DRENDERSTATETYPE)36
+#define D3DRENDERSTATE_FOGTABLEEND (D3DRENDERSTATETYPE)37
+#define D3DRENDERSTATE_FOGTABLEDENSITY (D3DRENDERSTATETYPE)38
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+// Values for material source
+typedef enum _D3DMATERIALCOLORSOURCE
+{
+ D3DMCS_MATERIAL = 0, // Color from material is used
+ D3DMCS_COLOR1 = 1, // Diffuse vertex color is used
+ D3DMCS_COLOR2 = 2, // Specular vertex color is used
+ D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
+} D3DMATERIALCOLORSOURCE;
+
+
+#if(DIRECT3D_VERSION >= 0x0500)
+// For back-compatibility with legacy compilations
+#define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+
+#if(DIRECT3D_VERSION >= 0x0600)
+
+// Bias to apply to the texture coordinate set to apply a wrap to.
+#define D3DRENDERSTATE_WRAPBIAS 128UL
+
+/* Flags to construct the WRAP render states */
+#define D3DWRAP_U 0x00000001L
+#define D3DWRAP_V 0x00000002L
+
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION >= 0x0700)
+
+/* Flags to construct the WRAP render states for 1D thru 4D texture coordinates */
+#define D3DWRAPCOORD_0 0x00000001L // same as D3DWRAP_U
+#define D3DWRAPCOORD_1 0x00000002L // same as D3DWRAP_V
+#define D3DWRAPCOORD_2 0x00000004L
+#define D3DWRAPCOORD_3 0x00000008L
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+#define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
+
+typedef struct _D3DSTATE {
+ union {
+#if(DIRECT3D_VERSION < 0x0800)
+ D3DTRANSFORMSTATETYPE dtstTransformStateType;
+#endif //(DIRECT3D_VERSION < 0x0800)
+ D3DLIGHTSTATETYPE dlstLightStateType;
+ D3DRENDERSTATETYPE drstRenderStateType;
+ };
+ union {
+ DWORD dwArg[1];
+ D3DVALUE dvArg[1];
+ };
+} D3DSTATE, *LPD3DSTATE;
+
+
+/*
+ * Operation used to load matrices
+ * hDstMat = hSrcMat
+ */
+typedef struct _D3DMATRIXLOAD {
+ D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */
+ D3DMATRIXHANDLE hSrcMatrix; /* Source matrix */
+} D3DMATRIXLOAD, *LPD3DMATRIXLOAD;
+
+/*
+ * Operation used to multiply matrices
+ * hDstMat = hSrcMat1 * hSrcMat2
+ */
+typedef struct _D3DMATRIXMULTIPLY {
+ D3DMATRIXHANDLE hDestMatrix; /* Destination matrix */
+ D3DMATRIXHANDLE hSrcMatrix1; /* First source matrix */
+ D3DMATRIXHANDLE hSrcMatrix2; /* Second source matrix */
+} D3DMATRIXMULTIPLY, *LPD3DMATRIXMULTIPLY;
+
+/*
+ * Operation used to transform and light vertices.
+ */
+typedef struct _D3DPROCESSVERTICES {
+ DWORD dwFlags; /* Do we transform or light or just copy? */
+ WORD wStart; /* Index to first vertex in source */
+ WORD wDest; /* Index to first vertex in local buffer */
+ DWORD dwCount; /* Number of vertices to be processed */
+ DWORD dwReserved; /* Must be zero */
+} D3DPROCESSVERTICES, *LPD3DPROCESSVERTICES;
+
+#define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L
+#define D3DPROCESSVERTICES_TRANSFORM 0x00000001L
+#define D3DPROCESSVERTICES_COPY 0x00000002L
+#define D3DPROCESSVERTICES_OPMASK 0x00000007L
+
+#define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L
+#define D3DPROCESSVERTICES_NOCOLOR 0x00000010L
+
+
+#if(DIRECT3D_VERSION >= 0x0600)
+
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+/*
+ * State enumerants for per-stage texture processing.
+ */
+typedef enum _D3DTEXTURESTAGESTATETYPE
+{
+ D3DTSS_COLOROP = 1, /* D3DTEXTUREOP - per-stage blending controls for color channels */
+ D3DTSS_COLORARG1 = 2, /* D3DTA_* (texture arg) */
+ D3DTSS_COLORARG2 = 3, /* D3DTA_* (texture arg) */
+ D3DTSS_ALPHAOP = 4, /* D3DTEXTUREOP - per-stage blending controls for alpha channel */
+ D3DTSS_ALPHAARG1 = 5, /* D3DTA_* (texture arg) */
+ D3DTSS_ALPHAARG2 = 6, /* D3DTA_* (texture arg) */
+ D3DTSS_BUMPENVMAT00 = 7, /* D3DVALUE (bump mapping matrix) */
+ D3DTSS_BUMPENVMAT01 = 8, /* D3DVALUE (bump mapping matrix) */
+ D3DTSS_BUMPENVMAT10 = 9, /* D3DVALUE (bump mapping matrix) */
+ D3DTSS_BUMPENVMAT11 = 10, /* D3DVALUE (bump mapping matrix) */
+ D3DTSS_TEXCOORDINDEX = 11, /* identifies which set of texture coordinates index this texture */
+ D3DTSS_ADDRESS = 12, /* D3DTEXTUREADDRESS for both coordinates */
+ D3DTSS_ADDRESSU = 13, /* D3DTEXTUREADDRESS for U coordinate */
+ D3DTSS_ADDRESSV = 14, /* D3DTEXTUREADDRESS for V coordinate */
+ D3DTSS_BORDERCOLOR = 15, /* D3DCOLOR */
+ D3DTSS_MAGFILTER = 16, /* D3DTEXTUREMAGFILTER filter to use for magnification */
+ D3DTSS_MINFILTER = 17, /* D3DTEXTUREMINFILTER filter to use for minification */
+ D3DTSS_MIPFILTER = 18, /* D3DTEXTUREMIPFILTER filter to use between mipmaps during minification */
+ D3DTSS_MIPMAPLODBIAS = 19, /* D3DVALUE Mipmap LOD bias */
+ D3DTSS_MAXMIPLEVEL = 20, /* DWORD 0..(n-1) LOD index of largest map to use (0 == largest) */
+ D3DTSS_MAXANISOTROPY = 21, /* DWORD maximum anisotropy */
+ D3DTSS_BUMPENVLSCALE = 22, /* D3DVALUE scale for bump map luminance */
+ D3DTSS_BUMPENVLOFFSET = 23, /* D3DVALUE offset for bump map luminance */
+#if(DIRECT3D_VERSION >= 0x0700)
+ D3DTSS_TEXTURETRANSFORMFLAGS = 24, /* D3DTEXTURETRANSFORMFLAGS controls texture transform */
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+ D3DTSS_FORCE_DWORD = 0x7fffffff, /* force 32-bit size enum */
+} D3DTEXTURESTAGESTATETYPE;
+
+#if(DIRECT3D_VERSION >= 0x0700)
+// Values, used with D3DTSS_TEXCOORDINDEX, to specify that the vertex data(position
+// and normal in the camera space) should be taken as texture coordinates
+// Low 16 bits are used to specify texture coordinate index, to take the WRAP mode from
+//
+#define D3DTSS_TCI_PASSTHRU 0x00000000
+#define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000
+#define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000
+#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+/*
+ * Enumerations for COLOROP and ALPHAOP texture blending operations set in
+ * texture processing stage controls in D3DRENDERSTATE.
+ */
+typedef enum _D3DTEXTUREOP
+{
+// Control
+ D3DTOP_DISABLE = 1, // disables stage
+ D3DTOP_SELECTARG1 = 2, // the default
+ D3DTOP_SELECTARG2 = 3,
+
+// Modulate
+ D3DTOP_MODULATE = 4, // multiply args together
+ D3DTOP_MODULATE2X = 5, // multiply and 1 bit
+ D3DTOP_MODULATE4X = 6, // multiply and 2 bits
+
+// Add
+ D3DTOP_ADD = 7, // add arguments together
+ D3DTOP_ADDSIGNED = 8, // add with -0.5 bias
+ D3DTOP_ADDSIGNED2X = 9, // as above but left 1 bit
+ D3DTOP_SUBTRACT = 10, // Arg1 - Arg2, with no saturation
+ D3DTOP_ADDSMOOTH = 11, // add 2 args, subtract product
+ // Arg1 + Arg2 - Arg1*Arg2
+ // = Arg1 + (1-Arg1)*Arg2
+
+// Linear alpha blend: Arg1*(Alpha) + Arg2*(1-Alpha)
+ D3DTOP_BLENDDIFFUSEALPHA = 12, // iterated alpha
+ D3DTOP_BLENDTEXTUREALPHA = 13, // texture alpha
+ D3DTOP_BLENDFACTORALPHA = 14, // alpha from D3DRENDERSTATE_TEXTUREFACTOR
+ // Linear alpha blend with pre-multiplied arg1 input: Arg1 + Arg2*(1-Alpha)
+ D3DTOP_BLENDTEXTUREALPHAPM = 15, // texture alpha
+ D3DTOP_BLENDCURRENTALPHA = 16, // by alpha of current color
+
+// Specular mapping
+ D3DTOP_PREMODULATE = 17, // modulate with next texture before use
+ D3DTOP_MODULATEALPHA_ADDCOLOR = 18, // Arg1.RGB + Arg1.A*Arg2.RGB
+ // COLOROP only
+ D3DTOP_MODULATECOLOR_ADDALPHA = 19, // Arg1.RGB*Arg2.RGB + Arg1.A
+ // COLOROP only
+ D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20, // (1-Arg1.A)*Arg2.RGB + Arg1.RGB
+ // COLOROP only
+ D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21, // (1-Arg1.RGB)*Arg2.RGB + Arg1.A
+ // COLOROP only
+
+// Bump mapping
+ D3DTOP_BUMPENVMAP = 22, // per pixel env map perturbation
+ D3DTOP_BUMPENVMAPLUMINANCE = 23, // with luminance channel
+ // This can do either diffuse or specular bump mapping with correct input.
+ // Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B)
+ // where each component has been scaled and offset to make it signed.
+ // The result is replicated into all four (including alpha) channels.
+ // This is a valid COLOROP only.
+ D3DTOP_DOTPRODUCT3 = 24,
+
+ D3DTOP_FORCE_DWORD = 0x7fffffff,
+} D3DTEXTUREOP;
+
+/*
+ * Values for COLORARG1,2 and ALPHAARG1,2 texture blending operations
+ * set in texture processing stage controls in D3DRENDERSTATE.
+ */
+#define D3DTA_SELECTMASK 0x0000000f // mask for arg selector
+#define D3DTA_DIFFUSE 0x00000000 // select diffuse color
+#define D3DTA_CURRENT 0x00000001 // select result of previous stage
+#define D3DTA_TEXTURE 0x00000002 // select texture color
+#define D3DTA_TFACTOR 0x00000003 // select RENDERSTATE_TEXTUREFACTOR
+#if(DIRECT3D_VERSION >= 0x0700)
+#define D3DTA_SPECULAR 0x00000004 // select specular color
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+#define D3DTA_COMPLEMENT 0x00000010 // take 1.0 - x
+#define D3DTA_ALPHAREPLICATE 0x00000020 // replicate alpha to color components
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+/*
+ * IDirect3DTexture2 State Filter Types
+ */
+typedef enum _D3DTEXTUREMAGFILTER
+{
+ D3DTFG_POINT = 1, // nearest
+ D3DTFG_LINEAR = 2, // linear interpolation
+ D3DTFG_FLATCUBIC = 3, // cubic
+ D3DTFG_GAUSSIANCUBIC = 4, // different cubic kernel
+ D3DTFG_ANISOTROPIC = 5, //
+#if(DIRECT3D_VERSION >= 0x0700)
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+ D3DTFG_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
+} D3DTEXTUREMAGFILTER;
+
+typedef enum _D3DTEXTUREMINFILTER
+{
+ D3DTFN_POINT = 1, // nearest
+ D3DTFN_LINEAR = 2, // linear interpolation
+ D3DTFN_ANISOTROPIC = 3, //
+ D3DTFN_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
+} D3DTEXTUREMINFILTER;
+
+typedef enum _D3DTEXTUREMIPFILTER
+{
+ D3DTFP_NONE = 1, // mipmapping disabled (use MAG filter)
+ D3DTFP_POINT = 2, // nearest
+ D3DTFP_LINEAR = 3, // linear interpolation
+ D3DTFP_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum
+} D3DTEXTUREMIPFILTER;
+
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+/*
+ * Triangle flags
+ */
+
+/*
+ * Tri strip and fan flags.
+ * START loads all three vertices
+ * EVEN and ODD load just v3 with even or odd culling
+ * START_FLAT contains a count from 0 to 29 that allows the
+ * whole strip or fan to be culled in one hit.
+ * e.g. for a quad len = 1
+ */
+#define D3DTRIFLAG_START 0x00000000L
+#define D3DTRIFLAG_STARTFLAT(len) (len) /* 0 < len < 30 */
+#define D3DTRIFLAG_ODD 0x0000001eL
+#define D3DTRIFLAG_EVEN 0x0000001fL
+
+/*
+ * Triangle edge flags
+ * enable edges for wireframe or antialiasing
+ */
+#define D3DTRIFLAG_EDGEENABLE1 0x00000100L /* v0-v1 edge */
+#define D3DTRIFLAG_EDGEENABLE2 0x00000200L /* v1-v2 edge */
+#define D3DTRIFLAG_EDGEENABLE3 0x00000400L /* v2-v0 edge */
+#define D3DTRIFLAG_EDGEENABLETRIANGLE \
+ (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
+
+/*
+ * Primitive structures and related defines. Vertex offsets are to types
+ * D3DVERTEX, D3DLVERTEX, or D3DTLVERTEX.
+ */
+
+/*
+ * Triangle list primitive structure
+ */
+typedef struct _D3DTRIANGLE {
+ union {
+ WORD v1; /* Vertex indices */
+ WORD wV1;
+ };
+ union {
+ WORD v2;
+ WORD wV2;
+ };
+ union {
+ WORD v3;
+ WORD wV3;
+ };
+ WORD wFlags; /* Edge (and other) flags */
+} D3DTRIANGLE, *LPD3DTRIANGLE;
+
+/*
+ * Line list structure.
+ * The instruction count defines the number of line segments.
+ */
+typedef struct _D3DLINE {
+ union {
+ WORD v1; /* Vertex indices */
+ WORD wV1;
+ };
+ union {
+ WORD v2;
+ WORD wV2;
+ };
+} D3DLINE, *LPD3DLINE;
+
+/*
+ * Span structure
+ * Spans join a list of points with the same y value.
+ * If the y value changes, a new span is started.
+ */
+typedef struct _D3DSPAN {
+ WORD wCount; /* Number of spans */
+ WORD wFirst; /* Index to first vertex */
+} D3DSPAN, *LPD3DSPAN;
+
+/*
+ * Point structure
+ */
+typedef struct _D3DPOINT {
+ WORD wCount; /* number of points */
+ WORD wFirst; /* index to first vertex */
+} D3DPOINT, *LPD3DPOINT;
+
+
+/*
+ * Forward branch structure.
+ * Mask is logically anded with the driver status mask
+ * if the result equals 'value', the branch is taken.
+ */
+typedef struct _D3DBRANCH {
+ DWORD dwMask; /* Bitmask against D3D status */
+ DWORD dwValue;
+ BOOL bNegate; /* TRUE to negate comparison */
+ DWORD dwOffset; /* How far to branch forward (0 for exit)*/
+} D3DBRANCH, *LPD3DBRANCH;
+
+/*
+ * Status used for set status instruction.
+ * The D3D status is initialised on device creation
+ * and is modified by all execute calls.
+ */
+typedef struct _D3DSTATUS {
+ DWORD dwFlags; /* Do we set extents or status */
+ DWORD dwStatus; /* D3D status */
+ D3DRECT drExtent;
+} D3DSTATUS, *LPD3DSTATUS;
+
+#define D3DSETSTATUS_STATUS 0x00000001L
+#define D3DSETSTATUS_EXTENTS 0x00000002L
+#define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
+
+#if(DIRECT3D_VERSION >= 0x0500)
+typedef struct _D3DCLIPSTATUS {
+ DWORD dwFlags; /* Do we set 2d extents, 3D extents or status */
+ DWORD dwStatus; /* Clip status */
+ float minx, maxx; /* X extents */
+ float miny, maxy; /* Y extents */
+ float minz, maxz; /* Z extents */
+} D3DCLIPSTATUS, *LPD3DCLIPSTATUS;
+
+#define D3DCLIPSTATUS_STATUS 0x00000001L
+#define D3DCLIPSTATUS_EXTENTS2 0x00000002L
+#define D3DCLIPSTATUS_EXTENTS3 0x00000004L
+
+#endif /* DIRECT3D_VERSION >= 0x0500 */
+/*
+ * Statistics structure
+ */
+typedef struct _D3DSTATS {
+ DWORD dwSize;
+ DWORD dwTrianglesDrawn;
+ DWORD dwLinesDrawn;
+ DWORD dwPointsDrawn;
+ DWORD dwSpansDrawn;
+ DWORD dwVerticesProcessed;
+} D3DSTATS, *LPD3DSTATS;
+
+/*
+ * Execute options.
+ * When calling using D3DEXECUTE_UNCLIPPED all the primitives
+ * inside the buffer must be contained within the viewport.
+ */
+#define D3DEXECUTE_CLIPPED 0x00000001l
+#define D3DEXECUTE_UNCLIPPED 0x00000002l
+
+typedef struct _D3DEXECUTEDATA {
+ DWORD dwSize;
+ DWORD dwVertexOffset;
+ DWORD dwVertexCount;
+ DWORD dwInstructionOffset;
+ DWORD dwInstructionLength;
+ DWORD dwHVertexOffset;
+ D3DSTATUS dsStatus; /* Status after execute */
+} D3DEXECUTEDATA, *LPD3DEXECUTEDATA;
+
+/*
+ * Palette flags.
+ * This are or'ed with the peFlags in the PALETTEENTRYs passed to DirectDraw.
+ */
+#define D3DPAL_FREE 0x00 /* Renderer may use this entry freely */
+#define D3DPAL_READONLY 0x40 /* Renderer may not set this entry */
+#define D3DPAL_RESERVED 0x80 /* Renderer may not use this entry */
+
+
+#if(DIRECT3D_VERSION >= 0x0600)
+
+typedef struct _D3DVERTEXBUFFERDESC {
+ DWORD dwSize;
+ DWORD dwCaps;
+ DWORD dwFVF;
+ DWORD dwNumVertices;
+} D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC;
+
+#define D3DVBCAPS_SYSTEMMEMORY 0x00000800l
+#define D3DVBCAPS_WRITEONLY 0x00010000l
+#define D3DVBCAPS_OPTIMIZED 0x80000000l
+#define D3DVBCAPS_DONOTCLIP 0x00000001l
+
+/* Vertex Operations for ProcessVertices */
+#define D3DVOP_LIGHT (1 << 10)
+#define D3DVOP_TRANSFORM (1 << 0)
+#define D3DVOP_CLIP (1 << 2)
+#define D3DVOP_EXTENTS (1 << 3)
+
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+/* The maximum number of vertices user can pass to any d3d
+ drawing function or to create vertex buffer with
+*/
+#define D3DMAXNUMVERTICES ((1<<16) - 1)
+/* The maximum number of primitives user can pass to any d3d
+ drawing function.
+*/
+#define D3DMAXNUMPRIMITIVES ((1<<16) - 1)
+
+#if(DIRECT3D_VERSION >= 0x0700)
+
+/* Bits for dwFlags in ProcessVertices call */
+#define D3DPV_DONOTCOPYDATA (1 << 0)
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+//-------------------------------------------------------------------
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+// Flexible vertex format bits
+//
+#define D3DFVF_RESERVED0 0x001
+#define D3DFVF_POSITION_MASK 0x00E
+#define D3DFVF_XYZ 0x002
+#define D3DFVF_XYZRHW 0x004
+#if(DIRECT3D_VERSION >= 0x0700)
+#define D3DFVF_XYZB1 0x006
+#define D3DFVF_XYZB2 0x008
+#define D3DFVF_XYZB3 0x00a
+#define D3DFVF_XYZB4 0x00c
+#define D3DFVF_XYZB5 0x00e
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+#define D3DFVF_NORMAL 0x010
+#define D3DFVF_RESERVED1 0x020
+#define D3DFVF_DIFFUSE 0x040
+#define D3DFVF_SPECULAR 0x080
+
+#define D3DFVF_TEXCOUNT_MASK 0xf00
+#define D3DFVF_TEXCOUNT_SHIFT 8
+#define D3DFVF_TEX0 0x000
+#define D3DFVF_TEX1 0x100
+#define D3DFVF_TEX2 0x200
+#define D3DFVF_TEX3 0x300
+#define D3DFVF_TEX4 0x400
+#define D3DFVF_TEX5 0x500
+#define D3DFVF_TEX6 0x600
+#define D3DFVF_TEX7 0x700
+#define D3DFVF_TEX8 0x800
+
+#define D3DFVF_RESERVED2 0xf000 // 4 reserved bits
+
+#else
+#define D3DFVF_RESERVED1 0x020
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+#define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
+#define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
+ D3DFVF_SPECULAR | D3DFVF_TEX1 )
+#define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
+ D3DFVF_TEX1 )
+
+
+typedef struct _D3DDP_PTRSTRIDE
+{
+ LPVOID lpvData;
+ DWORD dwStride;
+} D3DDP_PTRSTRIDE;
+
+#define D3DDP_MAXTEXCOORD 8
+
+typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA
+{
+ D3DDP_PTRSTRIDE position;
+ D3DDP_PTRSTRIDE normal;
+ D3DDP_PTRSTRIDE diffuse;
+ D3DDP_PTRSTRIDE specular;
+ D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD];
+} D3DDRAWPRIMITIVESTRIDEDDATA, *LPD3DDRAWPRIMITIVESTRIDEDDATA;
+//---------------------------------------------------------------------
+// ComputeSphereVisibility return values
+//
+#define D3DVIS_INSIDE_FRUSTUM 0
+#define D3DVIS_INTERSECT_FRUSTUM 1
+#define D3DVIS_OUTSIDE_FRUSTUM 2
+#define D3DVIS_INSIDE_LEFT 0
+#define D3DVIS_INTERSECT_LEFT (1 << 2)
+#define D3DVIS_OUTSIDE_LEFT (2 << 2)
+#define D3DVIS_INSIDE_RIGHT 0
+#define D3DVIS_INTERSECT_RIGHT (1 << 4)
+#define D3DVIS_OUTSIDE_RIGHT (2 << 4)
+#define D3DVIS_INSIDE_TOP 0
+#define D3DVIS_INTERSECT_TOP (1 << 6)
+#define D3DVIS_OUTSIDE_TOP (2 << 6)
+#define D3DVIS_INSIDE_BOTTOM 0
+#define D3DVIS_INTERSECT_BOTTOM (1 << 8)
+#define D3DVIS_OUTSIDE_BOTTOM (2 << 8)
+#define D3DVIS_INSIDE_NEAR 0
+#define D3DVIS_INTERSECT_NEAR (1 << 10)
+#define D3DVIS_OUTSIDE_NEAR (2 << 10)
+#define D3DVIS_INSIDE_FAR 0
+#define D3DVIS_INTERSECT_FAR (1 << 12)
+#define D3DVIS_OUTSIDE_FAR (2 << 12)
+
+#define D3DVIS_MASK_FRUSTUM (3 << 0)
+#define D3DVIS_MASK_LEFT (3 << 2)
+#define D3DVIS_MASK_RIGHT (3 << 4)
+#define D3DVIS_MASK_TOP (3 << 6)
+#define D3DVIS_MASK_BOTTOM (3 << 8)
+#define D3DVIS_MASK_NEAR (3 << 10)
+#define D3DVIS_MASK_FAR (3 << 12)
+
+#endif /* DIRECT3D_VERSION >= 0x0600 */
+
+#if(DIRECT3D_VERSION < 0x0800)
+
+#if(DIRECT3D_VERSION >= 0x0700)
+
+// To be used with GetInfo()
+#define D3DDEVINFOID_TEXTUREMANAGER 1
+#define D3DDEVINFOID_D3DTEXTUREMANAGER 2
+#define D3DDEVINFOID_TEXTURING 3
+
+typedef enum _D3DSTATEBLOCKTYPE
+{
+ D3DSBT_ALL = 1, // capture all state
+ D3DSBT_PIXELSTATE = 2, // capture pixel state
+ D3DSBT_VERTEXSTATE = 3, // capture vertex state
+ D3DSBT_FORCE_DWORD = 0xffffffff
+} D3DSTATEBLOCKTYPE;
+
+// The D3DVERTEXBLENDFLAGS type is used with D3DRENDERSTATE_VERTEXBLEND state.
+//
+typedef enum _D3DVERTEXBLENDFLAGS
+{
+ D3DVBLEND_DISABLE = 0, // Disable vertex blending
+ D3DVBLEND_1WEIGHT = 1, // blend between 2 matrices
+ D3DVBLEND_2WEIGHTS = 2, // blend between 3 matrices
+ D3DVBLEND_3WEIGHTS = 3, // blend between 4 matrices
+} D3DVERTEXBLENDFLAGS;
+
+typedef enum _D3DTEXTURETRANSFORMFLAGS {
+ D3DTTFF_DISABLE = 0, // texture coordinates are passed directly
+ D3DTTFF_COUNT1 = 1, // rasterizer should expect 1-D texture coords
+ D3DTTFF_COUNT2 = 2, // rasterizer should expect 2-D texture coords
+ D3DTTFF_COUNT3 = 3, // rasterizer should expect 3-D texture coords
+ D3DTTFF_COUNT4 = 4, // rasterizer should expect 4-D texture coords
+ D3DTTFF_PROJECTED = 256, // texcoords to be divided by COUNTth element
+ D3DTTFF_FORCE_DWORD = 0x7fffffff,
+} D3DTEXTURETRANSFORMFLAGS;
+
+// Macros to set texture coordinate format bits in the FVF id
+
+#define D3DFVF_TEXTUREFORMAT2 0 // Two floating point values
+#define D3DFVF_TEXTUREFORMAT1 3 // One floating point value
+#define D3DFVF_TEXTUREFORMAT3 1 // Three floating point values
+#define D3DFVF_TEXTUREFORMAT4 2 // Four floating point values
+
+#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
+#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
+#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
+#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
+
+
+#endif /* DIRECT3D_VERSION >= 0x0700 */
+
+#else
+//
+// legacy vertex blend names
+//
+#define D3DVBLEND_DISABLE (D3DVERTEXBLENDFLAGS)0
+#define D3DVBLEND_1WEIGHT (D3DVERTEXBLENDFLAGS)1
+#define D3DVBLEND_2WEIGHTS (D3DVERTEXBLENDFLAGS)2
+#define D3DVBLEND_3WEIGHTS (D3DVERTEXBLENDFLAGS)3
+
+#endif //(DIRECT3D_VERSION < 0x0800)
+
+#pragma pack()
+#pragma warning(pop)
+
+#endif /* _D3DTYPES_H_ */
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
+#pragma endregion
+
diff --git a/client/d3d/winapifamily.h b/client/d3d/winapifamily.h
new file mode 100644
index 0000000..0ec4d73
--- /dev/null
+++ b/client/d3d/winapifamily.h
@@ -0,0 +1,251 @@
+/*
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Module Name:
+
+ winapifamily.h
+
+Abstract:
+
+ Master include file for API family partitioning.
+
+*/
+
+#ifndef _INC_WINAPIFAMILY
+#define _INC_WINAPIFAMILY
+
+#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
+#if _MSC_VER >= 1200
+#pragma warning(push)
+#pragma warning(disable:4001) /* nonstandard extension 'single line comment' was used */
+#endif
+#pragma once
+#endif // defined(_MSC_VER) && !defined(MOFCOMP_PASS)
+
+#include
+
+/*
+ * When compiling C and C++ code using SDK header files, the development
+ * environment can specify a target platform by #define-ing the
+ * pre-processor symbol WINAPI_FAMILY to one of the following values.
+ * Each FAMILY value denotes an application family for which a different
+ * subset of the total set of header-file-defined APIs are available.
+ * Setting the WINAPI_FAMILY value will effectively hide from the
+ * editing and compilation environments the existence of APIs that
+ * are not applicable to the family of applications targeting a
+ * specific platform.
+ */
+
+/* In Windows 10, WINAPI_PARTITIONs will be used to add additional
+ * device specific APIs to a particular WINAPI_FAMILY.
+ * For example, when writing Windows Universal apps, specifying
+ * WINAPI_FAMILY_APP will hide phone APIs from compilation.
+ * However, specifying WINAPI_PARTITION_PHONE_APP=1 additionally, will
+ * unhide any API hidden behind the partition, to the compiler.
+
+ * The following partitions are currently defined:
+ * WINAPI_PARTITION_DESKTOP // usable for Desktop Win32 apps (but not store apps)
+ * WINAPI_PARTITION_APP // usable for Windows Universal store apps
+ * WINAPI_PARTITION_PC_APP // specific to Desktop-only store apps
+ * WINAPI_PARTITION_PHONE_APP // specific to Phone-only store apps
+ * WINAPI_PARTITION_SYSTEM // specific to System applications
+ * WINAPI_PARTITION_GAMES // specific to games and apps
+
+ * The following partitions are indirect partitions and defined in
+ * winpackagefamily.h. These partitions are related to package based
+ * partitions. For example, specifying WINAPI_PARTITION_SERVER=1 will light up
+ * any API hidden behind the package based partitions that are bound to
+ * WINAPI_PARTITION_SERVER, to the compiler.
+ * WINAPI_PARTITION_SERVER // specific to Server applications
+*/
+
+/*
+ * The WINAPI_FAMILY values of 0 and 1 are reserved to ensure that
+ * an error will occur if WINAPI_FAMILY is set to any
+ * WINAPI_PARTITION value (which must be 0 or 1, see below).
+ */
+#define WINAPI_FAMILY_PC_APP 2 /* Windows Store Applications */
+#define WINAPI_FAMILY_PHONE_APP 3 /* Windows Phone Applications */
+#define WINAPI_FAMILY_SYSTEM 4 /* Windows Drivers and Tools */
+#define WINAPI_FAMILY_SERVER 5 /* Windows Server Applications */
+#define WINAPI_FAMILY_GAMES 6 /* Windows Games and Applications */
+#define WINAPI_FAMILY_DESKTOP_APP 100 /* Windows Desktop Applications */
+/* The value of WINAPI_FAMILY_DESKTOP_APP may change in future SDKs. */
+/* Additional WINAPI_FAMILY values may be defined in future SDKs. */
+
+/*
+ * For compatibility with Windows 8 header files, the following
+ * synonym for WINAPI_FAMILY_PC_APP is temporarily #define'd.
+ * Use of this symbol should be considered deprecated.
+ */
+#define WINAPI_FAMILY_APP WINAPI_FAMILY_PC_APP
+
+/*
+ * If no WINAPI_FAMILY value is specified, then all APIs available to
+ * Windows desktop applications are exposed.
+ */
+#ifndef WINAPI_FAMILY
+#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
+#endif
+
+/*
+ * API PARTITONs are part of an indirection mechanism for mapping between
+ * individual APIs and the FAMILYs to which they apply.
+ * Each PARTITION is a category or subset of named APIs. PARTITIONs
+ * are permitted to have overlapping membership -- some single API
+ * might be part of more than one PARTITION. PARTITIONS are each #define-ed
+ * to be either 1 or 0 or depending on the platform at which the app is targeted.
+ */
+
+/*
+ * The mapping between families and partitions is summarized here.
+ * An X indicates that the given partition is active for the given
+ * platform/family.
+ *
+ * +---------------------------+
+ * | *Partition* |
+ * +---+---+---+---+---+---+---+
+ * | | | | | | | |
+ * | | | | | | | |
+ * | | | | P | | | |
+ * | | | | H | | | |
+ * | D | | | O | | | |
+ * | E | | P | N | S | S | |
+ * | S | | C | E | Y | E | G |
+ * | K | | _ | _ | S | R | A |
+ * | T | A | A | A | T | V | M |
+ * +-------------------------+----+ O | P | P | P | E | E | E |
+ * | *Platform/Family* \| P | P | P | P | M | R | S |
+ * +------------------------------+---+---+---+---+---+---+---+
+ * | WINAPI_FAMILY_DESKTOP_APP | X | X | X | | | | |
+ * +------------------------------+---+---+---+---+---+---+---+
+ * | WINAPI_FAMILY_PC_APP | | X | X | | | | |
+ * +------------------------------+---+---+---+---+---+---+---+
+ * | WINAPI_FAMILY_PHONE_APP | | X | | X | | | |
+ * +----------------------------- +---+---+---+---+---+---+---+
+ * | WINAPI_FAMILY_SYSTEM | | | | | X | | |
+ * +----------------------------- +---+---+---+---+---+---+---+
+ * | WINAPI_FAMILY_SERVER | | | | | X | X | |
+ * +------------------------------+---+---+---+---+---+---+---+
+ * | WINAPI_FAMILY_GAMES | | | | | | | X |
+ * +------------------------------+---+---+---+---+---+---+---+
+ *
+ * The table above is encoded in the following expressions,
+ * each of which evaluates to 1 or 0.
+ *
+ * Whenever a new family is added, all of these expressions
+ * need to be reconsidered.
+ */
+#if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP && \
+ WINAPI_FAMILY != WINAPI_FAMILY_PC_APP && \
+ WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP && \
+ WINAPI_FAMILY != WINAPI_FAMILY_SYSTEM && \
+ WINAPI_FAMILY != WINAPI_FAMILY_GAMES && \
+ WINAPI_FAMILY != WINAPI_FAMILY_SERVER
+#error Unknown WINAPI_FAMILY value. Was it defined in terms of a WINAPI_PARTITION_* value?
+#endif
+
+#ifndef WINAPI_PARTITION_DESKTOP
+#define WINAPI_PARTITION_DESKTOP (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_APP
+#define WINAPI_PARTITION_APP \
+ (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_PC_APP
+#define WINAPI_PARTITION_PC_APP \
+ (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP || \
+ WINAPI_FAMILY == WINAPI_FAMILY_PC_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_PHONE_APP
+#define WINAPI_PARTITION_PHONE_APP (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+#endif
+
+#ifndef WINAPI_PARTITION_GAMES
+#define WINAPI_PARTITION_GAMES \
+ (WINAPI_FAMILY == WINAPI_FAMILY_GAMES || \
+ WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+#endif
+
+/*
+ * SYSTEM is the only partition defined here.
+ * All other System based editions are defined as packages
+ * on top of the System partition.
+ * See winpackagefamily.h for packages level partitions
+ */
+#ifndef WINAPI_PARTITION_SYSTEM
+#define WINAPI_PARTITION_SYSTEM \
+ (WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM || \
+ WINAPI_FAMILY == WINAPI_FAMILY_SERVER)
+#endif
+
+/*
+ * For compatibility with Windows Phone 8 header files, the following
+ * synonym for WINAPI_PARTITION_PHONE_APP is temporarily #define'd.
+ * Use of this symbol should be regarded as deprecated.
+ */
+#define WINAPI_PARTITION_PHONE WINAPI_PARTITION_PHONE_APP
+
+/*
+ * Header files use the WINAPI_FAMILY_PARTITION macro to assign one or
+ * more declarations to some group of partitions. The macro chooses
+ * whether the preprocessor will emit or omit a sequence of declarations
+ * bracketed by an #if/#endif pair. All header file references to the
+ * WINAPI_PARTITION_* values should be in the form of occurrences of
+ * WINAPI_FAMILY_PARTITION(...).
+ *
+ * For example, the following usage of WINAPI_FAMILY_PARTITION identifies
+ * a sequence of declarations that are part of both the Windows Desktop
+ * Partition and the Windows-Phone-Specific Store Partition:
+ *
+ * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
+ * ...
+ * #endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_PHONE_APP)
+ *
+ * The comment on the closing #endif allow tools as well as people to find the
+ * matching #ifdef properly.
+ *
+ * Usages of WINAPI_FAMILY_PARTITION may be combined, when the partitition definitions are
+ * related. In particular one might use declarations like
+ *
+ * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ *
+ * or
+ *
+ * #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+ *
+ * Direct references to WINAPI_PARTITION_ values (eg #if !WINAPI_FAMILY_PARTITION_...)
+ * should not be used.
+ */
+#define WINAPI_FAMILY_PARTITION(Partitions) (Partitions)
+
+/*
+ * Macro used to #define or typedef a symbol used for selective deprecation
+ * of individual methods of a COM interfaces that are otherwise available
+ * for a given set of partitions.
+ */
+#define _WINAPI_DEPRECATED_DECLARATION __declspec(deprecated("This API cannot be used in the context of the caller's application type."))
+
+/*
+ * For compatibility with Windows 8 header files, the following
+ * symbol is temporarily conditionally #define'd. Additional symbols
+ * like this should be not defined in winapifamily.h, but rather should be
+ * introduced locally to the header files of the component that needs them.
+ */
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+# define APP_DEPRECATED_HRESULT HRESULT _WINAPI_DEPRECATED_DECLARATION
+#endif // WINAPIFAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+
+#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
+#if _MSC_VER >= 1200
+#pragma warning(pop)
+#endif
+#endif
+
+#endif /* !_INC_WINAPIFAMILY */
diff --git a/client/d3d/winpackagefamily.h b/client/d3d/winpackagefamily.h
new file mode 100644
index 0000000..ee691f9
--- /dev/null
+++ b/client/d3d/winpackagefamily.h
@@ -0,0 +1,91 @@
+/*
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Module Name:
+
+ winpackagefamily.h
+
+Abstract:
+
+ API family partitioning based on packages.
+
+*/
+
+#ifndef _INC_WINPACKAGEFAMILY
+#define _INC_WINPACKAGEFAMILY
+
+#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
+#if _MSC_VER >= 1200
+#pragma warning(push)
+#pragma warning(disable:4001) /* nonstandard extension 'single line comment' was used */
+#endif
+#pragma once
+#endif // defined(_MSC_VER) && !defined(MOFCOMP_PASS)
+
+#ifndef WINAPI_PARTITION_SERVER
+#define WINAPI_PARTITION_SERVER (WINAPI_FAMILY == WINAPI_FAMILY_SERVER)
+#endif
+
+/*
+ * PARTITIONS based on packages are each #undef'ed below, and then will be #define-ed
+ * to be either 1 or 0 or depending on the active WINAPI_FAMILY.
+ */
+#undef WINAPI_PARTITION_PKG_WINTRUST
+#undef WINAPI_PARTITION_PKG_WEBSERVICES
+#undef WINAPI_PARTITION_PKG_EVENTLOGSERVICE
+#undef WINAPI_PARTITION_PKG_VHD
+#undef WINAPI_PARTITION_PKG_PERFCOUNTER
+#undef WINAPI_PARTITION_PKG_SECURESTARTUP
+#undef WINAPI_PARTITION_PKG_REMOTEFS
+#undef WINAPI_PARTITION_PKG_BOOTABLESKU
+#undef WINAPI_PARTITION_PKG_CMDTOOLS
+#undef WINAPI_PARTITION_PKG_DISM
+#undef WINAPI_PARTITION_PKG_CORESETUP
+#undef WINAPI_PARTITION_PKG_APPRUNTIME
+#undef WINAPI_PARTITION_PKG_ESENT
+#undef WINAPI_PARTITION_PKG_WINMGMT
+#undef WINAPI_PARTITION_PKG_WNV
+#undef WINAPI_PARTITION_PKG_CLUSTER
+#undef WINAPI_PARTITION_PKG_VSS
+#undef WINAPI_PARTITION_PKG_TRAFFIC
+#undef WINAPI_PARTITION_PKG_ISCSI
+#undef WINAPI_PARTITION_PKG_STORAGE
+#undef WINAPI_PARTITION_PKG_MPSSVC
+#undef WINAPI_PARTITION_PKG_APPXDEPLOYMENT
+#undef WINAPI_PARTITION_PKG_WER
+
+/*
+ * PARTITIONS for feature packages. Each package might be active for one or more editions
+ */
+#define WINAPI_PARTITION_PKG_WINTRUST (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WEBSERVICES (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_EVENTLOGSERVICE (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_VHD (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_PERFCOUNTER (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_SECURESTARTUP (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_REMOTEFS (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_BOOTABLESKU (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_CMDTOOLS (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_DISM (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_CORESETUP (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_APPRUNTIME (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_ESENT (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WINMGMT (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WNV (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_CLUSTER (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_VSS (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_TRAFFIC (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_ISCSI (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_STORAGE (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_MPSSVC (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_APPXDEPLOYMENT (WINAPI_PARTITION_SERVER == 1)
+#define WINAPI_PARTITION_PKG_WER (WINAPI_PARTITION_SERVER == 1)
+
+#if defined(_MSC_VER) && !defined(MOFCOMP_PASS)
+#if _MSC_VER >= 1200
+#pragma warning(pop)
+#endif
+#endif
+
+#endif /* !_INC_WINPACKAGEFAMILY */
diff --git a/client/ghost_vs2015.vcxproj b/client/ghost_vs2015.vcxproj
index 4013bf7..bc82c27 100644
--- a/client/ghost_vs2015.vcxproj
+++ b/client/ghost_vs2015.vcxproj
@@ -43,12 +43,12 @@
$(Configuration)\ghost
- $(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
+ ./d3d;$(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
$(WindowsSDK_LibraryPath_x86);$(VLDPATH)\lib\Win32\;$(LibraryPath)
$(Configuration)\ghost
- $(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
+ ./d3d;$(WindowsSDK_IncludePath);$(VLDPATH)\include\;$(IncludePath)
$(WindowsSDK_LibraryPath_x86);$(VLDPATH)\lib\Win32\;$(LibraryPath)
diff --git a/common/commands.h b/common/commands.h
index 331c224..e460863 100644
--- a/common/commands.h
+++ b/common/commands.h
@@ -1,7 +1,7 @@
#pragma once
#include
-#include
+#include
#include
#ifndef _MAX_PATH
diff --git a/server/2015Remote/2015Remote.rc b/server/2015Remote/2015Remote.rc
index 887e05f..4af343d 100644
Binary files a/server/2015Remote/2015Remote.rc and b/server/2015Remote/2015Remote.rc differ
diff --git a/server/2015Remote/2015RemoteDlg.cpp b/server/2015Remote/2015RemoteDlg.cpp
index e005b1b..fba2886 100644
--- a/server/2015Remote/2015RemoteDlg.cpp
+++ b/server/2015Remote/2015RemoteDlg.cpp
@@ -839,7 +839,7 @@ VOID CMy2015RemoteDlg::SendSelectedCommand(PBYTE szBuffer, ULONG ulLength)
//Bar
VOID CMy2015RemoteDlg::OnAbout()
{
- MessageBox("Copyleft (c) FTU 2019", "");
+ MessageBox("Copyleft (c) FTU 2025", "");
}
//Menu
@@ -1386,7 +1386,7 @@ LRESULT CMy2015RemoteDlg::OnOpenVideoDialog(WPARAM wParam, LPARAM lParam)
BOOL CMy2015RemoteDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
- MessageBox("Copyleft (c) FTU 2019", "");
+ MessageBox("Copyleft (c) FTU 2025", "");
return TRUE;
}