]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
update DX headers to work with DP master
authorRudolf Polzer <divVerent@alientrap.org>
Sat, 11 Sep 2010 00:04:19 +0000 (02:04 +0200)
committerRudolf Polzer <divVerent@alientrap.org>
Sat, 11 Sep 2010 00:04:19 +0000 (02:04 +0200)
30 files changed:
misc/builddeps/dp.win32/include/_mingw_dxhelper.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d10.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d10.idl [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d10effect.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d10misc.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d10shader.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d8.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d8caps.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d8types.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d9.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d9caps.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3d9types.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dcaps.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dhal.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3drm.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3drmdef.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3drmobj.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dtypes.h
misc/builddeps/dp.win32/include/d3dvec.inl [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9core.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9effect.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9math.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9math.inl [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9mesh.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9shader.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9shape.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/d3dx9tex.h [new file with mode: 0644]
misc/builddeps/dp.win32/include/dsound.h

diff --git a/misc/builddeps/dp.win32/include/_mingw_dxhelper.h b/misc/builddeps/dp.win32/include/_mingw_dxhelper.h
new file mode 100644 (file)
index 0000000..e13408c
--- /dev/null
@@ -0,0 +1,102 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+
+#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
+#define NONAMELESSUNION                1
+#endif
+#if defined(NONAMELESSSTRUCT) && \
+   !defined(NONAMELESSUNION)
+#define NONAMELESSUNION                1
+#endif
+#if defined(NONAMELESSUNION)  && \
+   !defined(NONAMELESSSTRUCT)
+#define NONAMELESSSTRUCT       1
+#endif
+
+#ifndef __ANONYMOUS_DEFINED
+#define __ANONYMOUS_DEFINED
+#if defined(__GNUC__) || defined(__GNUG__)
+#define _ANONYMOUS_UNION       __extension__
+#define _ANONYMOUS_STRUCT      __extension__
+#else
+#define _ANONYMOUS_UNION
+#define _ANONYMOUS_STRUCT
+#endif
+#ifndef NONAMELESSUNION
+#define _UNION_NAME(x)
+#define _STRUCT_NAME(x)
+#else /* NONAMELESSUNION */
+#define _UNION_NAME(x)  x
+#define _STRUCT_NAME(x) x
+#endif
+#endif /* __ANONYMOUS_DEFINED */
+
+#ifndef DUMMYUNIONNAME
+# ifdef NONAMELESSUNION
+#  define DUMMYUNIONNAME  u
+#  define DUMMYUNIONNAME1 u1   /* Wine uses this variant */
+#  define DUMMYUNIONNAME2 u2
+#  define DUMMYUNIONNAME3 u3
+#  define DUMMYUNIONNAME4 u4
+#  define DUMMYUNIONNAME5 u5
+#  define DUMMYUNIONNAME6 u6
+#  define DUMMYUNIONNAME7 u7
+#  define DUMMYUNIONNAME8 u8
+#  define DUMMYUNIONNAME9 u9
+# else /* NONAMELESSUNION */
+#  define DUMMYUNIONNAME
+#  define DUMMYUNIONNAME1      /* Wine uses this variant */
+#  define DUMMYUNIONNAME2
+#  define DUMMYUNIONNAME3
+#  define DUMMYUNIONNAME4
+#  define DUMMYUNIONNAME5
+#  define DUMMYUNIONNAME6
+#  define DUMMYUNIONNAME7
+#  define DUMMYUNIONNAME8
+#  define DUMMYUNIONNAME9
+# endif
+#endif /* DUMMYUNIONNAME */
+
+#ifndef DUMMYSTRUCTNAME
+# ifdef NONAMELESSUNION
+#  define DUMMYSTRUCTNAME  s
+#  define DUMMYSTRUCTNAME1 s1  /* Wine uses this variant */
+#  define DUMMYSTRUCTNAME2 s2
+#  define DUMMYSTRUCTNAME3 s3
+#  define DUMMYSTRUCTNAME4 s4
+#  define DUMMYSTRUCTNAME5 s5
+# else
+#  define DUMMYSTRUCTNAME
+#  define DUMMYSTRUCTNAME1     /* Wine uses this variant */
+#  define DUMMYSTRUCTNAME2
+#  define DUMMYSTRUCTNAME3
+#  define DUMMYSTRUCTNAME4
+#  define DUMMYSTRUCTNAME5
+# endif
+#endif /* DUMMYSTRUCTNAME */
+
+/* These are for compatibility with the Wine source tree */
+
+#ifndef WINELIB_NAME_AW
+# ifdef __MINGW_NAME_AW
+#   define WINELIB_NAME_AW  __MINGW_NAME_AW
+# else
+#  ifdef UNICODE
+#   define WINELIB_NAME_AW(func) func##W
+#  else
+#   define WINELIB_NAME_AW(func) func##A
+#  endif
+# endif
+#endif /* WINELIB_NAME_AW */
+
+#ifndef DECL_WINELIB_TYPE_AW
+# ifdef __MINGW_TYPEDEF_AW
+#  define DECL_WINELIB_TYPE_AW  __MINGW_TYPEDEF_AW
+# else
+#  define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
+# endif
+#endif /* DECL_WINELIB_TYPE_AW */
+
diff --git a/misc/builddeps/dp.win32/include/d3d.h b/misc/builddeps/dp.win32/include/d3d.h
new file mode 100644 (file)
index 0000000..409be1b
--- /dev/null
@@ -0,0 +1,1531 @@
+/*
+ * Copyright (C) the Wine project
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D_H
+#define __WINE_D3D_H
+
+#include <stdlib.h>
+
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+#include <d3dtypes.h> /* must precede d3dcaps.h */
+#include <d3dcaps.h>
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(IID_IDirect3D,              0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56);
+DEFINE_GUID(IID_IDirect3D2,             0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a);
+DEFINE_GUID(IID_IDirect3D3,             0xbb223240,0xe72b,0x11d0,0xa9,0xb4,0x00,0xaa,0x00,0xc0,0x99,0x3e);
+DEFINE_GUID(IID_IDirect3D7,             0xf5049e77,0x4861,0x11d2,0xa4,0x07,0x00,0xa0,0xc9,0x06,0x29,0xa8);
+
+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);
+DEFINE_GUID(IID_IDirect3DRefDevice,     0x50936643,0x13e9,0x11d1,0x89,0xaa,0x00,0xa0,0xc9,0x05,0x41,0x29);
+DEFINE_GUID(IID_IDirect3DTnLHalDevice,  0xf5049e78,0x4861,0x11d2,0xa4,0x07,0x00,0xa0,0xc9,0x06,0x29,0xa8);
+DEFINE_GUID(IID_IDirect3DNullDevice,    0x8767df22,0xbacc,0x11d1,0x89,0x69,0x00,0xa0,0xc9,0x06,0x29,0xa8);
+
+DEFINE_GUID(IID_IDirect3DDevice,       0x64108800,0x957d,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
+DEFINE_GUID(IID_IDirect3DDevice2,      0x93281501,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
+DEFINE_GUID(IID_IDirect3DDevice3,       0xb0ab3b60,0x33d7,0x11d1,0xa9,0x81,0x00,0xc0,0x4f,0xd7,0xb1,0x74);
+DEFINE_GUID(IID_IDirect3DDevice7,       0xf5049e79,0x4861,0x11d2,0xa4,0x07,0x00,0xa0,0xc9,0x06,0x29,0xa8);
+
+DEFINE_GUID(IID_IDirect3DTexture,      0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56);
+DEFINE_GUID(IID_IDirect3DTexture2,     0x93281502,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
+
+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);
+DEFINE_GUID(IID_IDirect3DMaterial2,    0x93281503,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
+DEFINE_GUID(IID_IDirect3DMaterial3,     0xca9c46f4,0xd3c5,0x11d1,0xb7,0x5a,0x00,0x60,0x08,0x52,0xb3,0x12);
+
+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);
+DEFINE_GUID(IID_IDirect3DViewport2,    0x93281500,0x8CF8,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29);
+DEFINE_GUID(IID_IDirect3DViewport3,     0xb0ab3b61,0x33d7,0x11d1,0xa9,0x81,0x00,0xc0,0x4f,0xd7,0xb1,0x74);
+
+DEFINE_GUID(IID_IDirect3DVertexBuffer,  0x7a503555,0x4a83,0x11d1,0xa5,0xdb,0x00,0xa0,0xc9,0x03,0x67,0xf8);
+DEFINE_GUID(IID_IDirect3DVertexBuffer7, 0xf5049e7d,0x4861,0x11d2,0xa4,0x07,0x00,0xa0,0xc9,0x06,0x29,0xa8);
+
+
+typedef struct IDirect3D *LPDIRECT3D;
+typedef struct IDirect3D2 *LPDIRECT3D2;
+typedef struct IDirect3D3 *LPDIRECT3D3;
+typedef struct IDirect3D7 *LPDIRECT3D7;
+
+typedef struct IDirect3DLight *LPDIRECT3DLIGHT;
+
+typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;
+typedef struct IDirect3DDevice2 *LPDIRECT3DDEVICE2;
+typedef struct IDirect3DDevice3 *LPDIRECT3DDEVICE3;
+typedef struct IDirect3DDevice7 *LPDIRECT3DDEVICE7;
+
+typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;
+typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
+typedef struct IDirect3DViewport3 *LPDIRECT3DVIEWPORT3;
+
+typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;
+typedef struct IDirect3DMaterial2 *LPDIRECT3DMATERIAL2;
+typedef struct IDirect3DMaterial3 *LPDIRECT3DMATERIAL3;
+
+typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;
+typedef struct IDirect3DTexture2 *LPDIRECT3DTEXTURE2;
+
+typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;
+
+typedef struct IDirect3DVertexBuffer *LPDIRECT3DVERTEXBUFFER;
+typedef struct IDirect3DVertexBuffer7 *LPDIRECT3DVERTEXBUFFER7;
+
+/* ********************************************************************
+   Error Codes
+   ******************************************************************** */
+#define D3D_OK                          DD_OK
+#define D3DERR_BADMAJORVERSION          MAKE_DDHRESULT(700)
+#define D3DERR_BADMINORVERSION          MAKE_DDHRESULT(701)
+#define D3DERR_INVALID_DEVICE           MAKE_DDHRESULT(705)
+#define D3DERR_INITFAILED               MAKE_DDHRESULT(706)
+#define D3DERR_DEVICEAGGREGATED         MAKE_DDHRESULT(707)
+#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)
+#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)
+#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)
+#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)
+#define D3DERR_LIGHT_SET_FAILED         MAKE_DDHRESULT(750)
+#define D3DERR_LIGHTHASVIEWPORT         MAKE_DDHRESULT(751)
+#define D3DERR_LIGHTNOTINTHISVIEWPORT   MAKE_DDHRESULT(752)
+#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)
+#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)
+#define D3DERR_INVALIDVERTEXFORMAT     MAKE_DDHRESULT(2048)
+#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)
+
+#define D3DERR_INVALIDSTATEBLOCK       MAKE_DDHRESULT(2100)
+#define D3DERR_INBEGINSTATEBLOCK       MAKE_DDHRESULT(2101)
+#define D3DERR_NOTINBEGINSTATEBLOCK    MAKE_DDHRESULT(2102)
+
+/* ********************************************************************
+   Enums
+   ******************************************************************** */
+#define D3DNEXT_NEXT 0x01l
+#define D3DNEXT_HEAD 0x02l
+#define D3DNEXT_TAIL 0x04l
+
+#define D3DDP_WAIT               0x00000001l
+#define D3DDP_OUTOFORDER         0x00000002l
+#define D3DDP_DONOTCLIP          0x00000004l
+#define D3DDP_DONOTUPDATEEXTENTS 0x00000008l
+#define D3DDP_DONOTLIGHT         0x00000010l
+
+/* ********************************************************************
+   Types and structures
+   ******************************************************************** */
+typedef DWORD D3DVIEWPORTHANDLE, *LPD3DVIEWPORTHANDLE;
+
+
+/*****************************************************************************
+ * IDirect3D interface
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3D
+DECLARE_INTERFACE_(IDirect3D,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3D methods ***/
+    STDMETHOD(Initialize)(THIS_ REFIID riid) PURE;
+    STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback, LPVOID lpUserArg) PURE;
+    STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT *lplpDirect3DLight, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL *lplpDirect3DMaterial, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT *lplpD3DViewport, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH lpD3DDFS, LPD3DFINDDEVICERESULT lplpD3DDevice) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3D methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3D_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D_AddRef(p)             (p)->AddRef()
+#define IDirect3D_Release(p)            (p)->Release()
+/*** IDirect3D methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3D2 interface
+ */
+#define INTERFACE IDirect3D2
+DECLARE_INTERFACE_(IDirect3D2,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3D2 methods ***/
+    STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback, LPVOID lpUserArg) PURE;
+    STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT *lplpDirect3DLight, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL2 *lplpDirect3DMaterial2, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT2 *lplpD3DViewport2, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH lpD3DDFS, LPD3DFINDDEVICERESULT lpD3DFDR) PURE;
+    STDMETHOD(CreateDevice)(THIS_ REFCLSID rclsid, LPDIRECTDRAWSURFACE lpDDS, LPDIRECT3DDEVICE2 *lplpD3DDevice2) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3D2 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3D2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D2_AddRef(p)             (p)->AddRef()
+#define IDirect3D2_Release(p)            (p)->Release()
+/*** IDirect3D2 methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3D3 interface
+ */
+#define INTERFACE IDirect3D3
+DECLARE_INTERFACE_(IDirect3D3,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3D3 methods ***/
+    STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK lpEnumDevicesCallback, LPVOID lpUserArg) PURE;
+    STDMETHOD(CreateLight)(THIS_ LPDIRECT3DLIGHT *lplpDirect3DLight, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(CreateMaterial)(THIS_ LPDIRECT3DMATERIAL3 *lplpDirect3DMaterial3, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DVIEWPORT3 *lplpD3DViewport3, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH lpD3DDFS, LPD3DFINDDEVICERESULT lpD3DFDR) PURE;
+    STDMETHOD(CreateDevice)(THIS_ REFCLSID rclsid,LPDIRECTDRAWSURFACE4 lpDDS, LPDIRECT3DDEVICE3 *lplpD3DDevice3,LPUNKNOWN lpUnk) PURE;
+    STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC lpD3DVertBufDesc,LPDIRECT3DVERTEXBUFFER *lplpD3DVertBuf,DWORD dwFlags,LPUNKNOWN lpUnk) PURE;
+    STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID riidDevice,LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback,LPVOID lpContext) PURE;
+    STDMETHOD(EvictManagedTextures)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3D3 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3D3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D3_AddRef(p)             (p)->AddRef()
+#define IDirect3D3_Release(p)            (p)->Release()
+/*** IDirect3D3 methods ***/
+#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
+
+/*****************************************************************************
+ * IDirect3D7 interface
+ */
+#define INTERFACE IDirect3D7
+DECLARE_INTERFACE_(IDirect3D7,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3D7 methods ***/
+    STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK7 lpEnumDevicesCallback, LPVOID lpUserArg) PURE;
+    STDMETHOD(CreateDevice)(THIS_ REFCLSID rclsid,LPDIRECTDRAWSURFACE7 lpDDS, LPDIRECT3DDEVICE7 *lplpD3DDevice) PURE;
+    STDMETHOD(CreateVertexBuffer)(THIS_ LPD3DVERTEXBUFFERDESC lpD3DVertBufDesc,LPDIRECT3DVERTEXBUFFER7 *lplpD3DVertBuf,DWORD dwFlags) PURE;
+    STDMETHOD(EnumZBufferFormats)(THIS_ REFCLSID riidDevice,LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback,LPVOID lpContext) PURE;
+    STDMETHOD(EvictManagedTextures)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3D3 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3D7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D7_AddRef(p)             (p)->AddRef()
+#define IDirect3D7_Release(p)            (p)->Release()
+/*** IDirect3D3 methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DLight interface
+ */
+#define INTERFACE IDirect3DLight
+DECLARE_INTERFACE_(IDirect3DLight,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DLight methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3D lpDirect3D) PURE;
+    STDMETHOD(SetLight)(THIS_ LPD3DLIGHT lpLight) PURE;
+    STDMETHOD(GetLight)(THIS_ LPD3DLIGHT lpLight) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DLight methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DLight_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DLight_AddRef(p)             (p)->AddRef()
+#define IDirect3DLight_Release(p)            (p)->Release()
+/*** IDirect3DLight methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DMaterial interface
+ */
+#define INTERFACE IDirect3DMaterial
+DECLARE_INTERFACE_(IDirect3DMaterial,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DMaterial methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3D lpDirect3D) PURE;
+    STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL lpMat) PURE;
+    STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL lpMat) PURE;
+    STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE lpDirect3DDevice, LPD3DMATERIALHANDLE lpHandle) PURE;
+    STDMETHOD(Reserve)(THIS) PURE;
+    STDMETHOD(Unreserve)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DMaterial methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DMaterial_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DMaterial_AddRef(p)             (p)->AddRef()
+#define IDirect3DMaterial_Release(p)            (p)->Release()
+/*** IDirect3DMaterial methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DMaterial2 interface
+ */
+#define INTERFACE IDirect3DMaterial2
+DECLARE_INTERFACE_(IDirect3DMaterial2,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DMaterial2 methods ***/
+    STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL lpMat) PURE;
+    STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL lpMat) PURE;
+    STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2 lpDirect3DDevice2, LPD3DMATERIALHANDLE lpHandle) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DMaterial2 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DMaterial2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DMaterial2_AddRef(p)             (p)->AddRef()
+#define IDirect3DMaterial2_Release(p)            (p)->Release()
+/*** IDirect3DMaterial2 methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DMaterial3 interface
+ */
+#define INTERFACE IDirect3DMaterial3
+DECLARE_INTERFACE_(IDirect3DMaterial3,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DMaterial3 methods ***/
+    STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL lpMat) PURE;
+    STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL lpMat) PURE;
+    STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE3 lpDirect3DDevice3, LPD3DMATERIALHANDLE lpHandle) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DMaterial3 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DMaterial3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DMaterial3_AddRef(p)             (p)->AddRef()
+#define IDirect3DMaterial3_Release(p)            (p)->Release()
+/*** IDirect3DMaterial3 methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DTexture interface
+ */
+#define INTERFACE IDirect3DTexture
+DECLARE_INTERFACE_(IDirect3DTexture,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DTexture methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE lpDirect3DDevice, LPDIRECTDRAWSURFACE lpDDSurface) PURE;
+    STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE lpDirect3DDevice, LPD3DTEXTUREHANDLE  lpHandle) PURE;
+    STDMETHOD(PaletteChanged)(THIS_ DWORD dwStart, DWORD dwCount) PURE;
+    STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE lpD3DTexture) PURE;
+    STDMETHOD(Unload)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DTexture methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DTexture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DTexture_AddRef(p)             (p)->AddRef()
+#define IDirect3DTexture_Release(p)            (p)->Release()
+/*** IDirect3DTexture methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DTexture2 interface
+ */
+#define INTERFACE IDirect3DTexture2
+DECLARE_INTERFACE_(IDirect3DTexture2,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DTexture2 methods ***/
+    STDMETHOD(GetHandle)(THIS_ LPDIRECT3DDEVICE2 lpDirect3DDevice2, LPD3DTEXTUREHANDLE lpHandle) PURE;
+    STDMETHOD(PaletteChanged)(THIS_ DWORD dwStart, DWORD dwCount) PURE;
+    STDMETHOD(Load)(THIS_ LPDIRECT3DTEXTURE2 lpD3DTexture2) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DTexture2 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DTexture2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DTexture2_AddRef(p)             (p)->AddRef()
+#define IDirect3DTexture2_Release(p)            (p)->Release()
+/*** IDirect3DTexture2 methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DViewport interface
+ */
+#define INTERFACE IDirect3DViewport
+DECLARE_INTERFACE_(IDirect3DViewport,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DViewport methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3D lpDirect3D) PURE;
+    STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT lpData) PURE;
+    STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT lpData) PURE;
+    STDMETHOD(TransformVertices)(THIS_ DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffScreen) PURE;
+    STDMETHOD(LightElements)(THIS_ DWORD dwElementCount, LPD3DLIGHTDATA lpData) PURE;
+    STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE hMat) PURE;
+    STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid) PURE;
+    STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface) PURE;
+    STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *lplpDDSurface, LPBOOL lpValid) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags) PURE;
+    STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight) PURE;
+    STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight) PURE;
+    STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT *lplpDirect3DLight, DWORD dwFlags) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DViewport methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DViewport_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DViewport_AddRef(p)             (p)->AddRef()
+#define IDirect3DViewport_Release(p)            (p)->Release()
+/*** IDirect3DViewport methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DViewport2 interface
+ */
+#define INTERFACE IDirect3DViewport2
+DECLARE_INTERFACE_(IDirect3DViewport2,IDirect3DViewport)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DViewport methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3D lpDirect3D) PURE;
+    STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT lpData) PURE;
+    STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT lpData) PURE;
+    STDMETHOD(TransformVertices)(THIS_ DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffScreen) PURE;
+    STDMETHOD(LightElements)(THIS_ DWORD dwElementCount, LPD3DLIGHTDATA lpData) PURE;
+    STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE hMat) PURE;
+    STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid) PURE;
+    STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface) PURE;
+    STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *lplpDDSurface, LPBOOL lpValid) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags) PURE;
+    STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight) PURE;
+    STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight) PURE;
+    STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT *lplpDirect3DLight, DWORD dwFlags) PURE;
+    /*** IDirect3DViewport2 methods ***/
+    STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2 lpData) PURE;
+    STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2 lpData) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3Viewport methods ***/
+#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)
+/*** IDirect3DViewport2 methods ***/
+#define IDirect3DViewport2_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a)
+#define IDirect3DViewport2_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DViewport2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DViewport2_AddRef(p)             (p)->AddRef()
+#define IDirect3DViewport2_Release(p)            (p)->Release()
+/*** IDirect3Viewport methods ***/
+#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)
+/*** IDirect3DViewport2 methods ***/
+#define IDirect3DViewport2_GetViewport2(p,a) (p)->GetViewport2(a)
+#define IDirect3DViewport2_SetViewport2(p,a) (p)->SetViewport2(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DViewport3 interface
+ */
+#define INTERFACE IDirect3DViewport3
+DECLARE_INTERFACE_(IDirect3DViewport3,IDirect3DViewport2)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DViewport methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3D lpDirect3D) PURE;
+    STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT lpData) PURE;
+    STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT lpData) PURE;
+    STDMETHOD(TransformVertices)(THIS_ DWORD dwVertexCount, LPD3DTRANSFORMDATA lpData, DWORD dwFlags, LPDWORD lpOffScreen) PURE;
+    STDMETHOD(LightElements)(THIS_ DWORD dwElementCount, LPD3DLIGHTDATA lpData) PURE;
+    STDMETHOD(SetBackground)(THIS_ D3DMATERIALHANDLE hMat) PURE;
+    STDMETHOD(GetBackground)(THIS_ LPD3DMATERIALHANDLE lphMat, LPBOOL lpValid) PURE;
+    STDMETHOD(SetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface) PURE;
+    STDMETHOD(GetBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *lplpDDSurface, LPBOOL lpValid) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags) PURE;
+    STDMETHOD(AddLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight) PURE;
+    STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight) PURE;
+    STDMETHOD(NextLight)(THIS_ LPDIRECT3DLIGHT lpDirect3DLight, LPDIRECT3DLIGHT *lplpDirect3DLight, DWORD dwFlags) PURE;
+    /*** IDirect3DViewport2 methods ***/
+    STDMETHOD(GetViewport2)(THIS_ LPD3DVIEWPORT2 lpData) PURE;
+    STDMETHOD(SetViewport2)(THIS_ LPD3DVIEWPORT2 lpData) PURE;
+    /*** IDirect3DViewport3 methods ***/
+    STDMETHOD(SetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4 lpDDS) PURE;
+    STDMETHOD(GetBackgroundDepth2)(THIS_ LPDIRECTDRAWSURFACE4 *lplpDDS,LPBOOL lpValid) PURE;
+    STDMETHOD(Clear2)(THIS_ DWORD dwCount,LPD3DRECT lpRects,DWORD dwFlags,DWORD dwColor,D3DVALUE dvZ,DWORD dwStencil) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3Viewport methods ***/
+#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)
+/*** IDirect3DViewport2 methods ***/
+#define IDirect3DViewport3_GetViewport2(p,a) (p)->lpVtbl->GetViewport2(p,a)
+#define IDirect3DViewport3_SetViewport2(p,a) (p)->lpVtbl->SetViewport2(p,a)
+/*** IDirect3DViewport3 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DViewport3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DViewport3_AddRef(p)             (p)->AddRef()
+#define IDirect3DViewport3_Release(p)            (p)->Release()
+/*** IDirect3Viewport methods ***/
+#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)
+/*** IDirect3DViewport2 methods ***/
+#define IDirect3DViewport3_GetViewport2(p,a) (p)->GetViewport2(a)
+#define IDirect3DViewport3_SetViewport2(p,a) (p)->SetViewport2(a)
+/*** IDirect3DViewport3 methods ***/
+#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
+
+
+
+/*****************************************************************************
+ * IDirect3DExecuteBuffer interface
+ */
+#define INTERFACE IDirect3DExecuteBuffer
+DECLARE_INTERFACE_(IDirect3DExecuteBuffer,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DExecuteBuffer methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3DDEVICE lpDirect3DDevice, LPD3DEXECUTEBUFFERDESC lpDesc) PURE;
+    STDMETHOD(Lock)(THIS_ LPD3DEXECUTEBUFFERDESC lpDesc) PURE;
+    STDMETHOD(Unlock)(THIS) PURE;
+    STDMETHOD(SetExecuteData)(THIS_ LPD3DEXECUTEDATA lpData) PURE;
+    STDMETHOD(GetExecuteData)(THIS_ LPD3DEXECUTEDATA lpData) PURE;
+    STDMETHOD(Validate)(THIS_ LPDWORD lpdwOffset, LPD3DVALIDATECALLBACK lpFunc, LPVOID lpUserArg, DWORD dwReserved) PURE;
+    STDMETHOD(Optimize)(THIS_ DWORD dwDummy) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DExecuteBuffer methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DExecuteBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DExecuteBuffer_AddRef(p)             (p)->AddRef()
+#define IDirect3DExecuteBuffer_Release(p)            (p)->Release()
+/*** IDirect3DExecuteBuffer methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DDevice interface
+ */
+#define INTERFACE IDirect3DDevice
+DECLARE_INTERFACE_(IDirect3DDevice,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DDevice methods ***/
+    STDMETHOD(Initialize)(THIS_ LPDIRECT3D lpDirect3D, LPGUID lpGUID, LPD3DDEVICEDESC lpD3DDVDesc) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc) PURE;
+    STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE lpD3Dtex1, LPDIRECT3DTEXTURE lpD3DTex2) PURE;
+    STDMETHOD(CreateExecuteBuffer)(THIS_ LPD3DEXECUTEBUFFERDESC lpDesc, LPDIRECT3DEXECUTEBUFFER *lplpDirect3DExecuteBuffer, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(GetStats)(THIS_ LPD3DSTATS lpD3DStats) PURE;
+    STDMETHOD(Execute)(THIS_ LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags) PURE;
+    STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT lpDirect3DViewport) PURE;
+    STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT lpDirect3DViewport) PURE;
+    STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT lpDirect3DViewport, LPDIRECT3DVIEWPORT *lplpDirect3DViewport, DWORD dwFlags) PURE;
+    STDMETHOD(Pick)(THIS_ LPDIRECT3DEXECUTEBUFFER lpDirect3DExecuteBuffer, LPDIRECT3DVIEWPORT lpDirect3DViewport, DWORD dwFlags, LPD3DRECT lpRect) PURE;
+    STDMETHOD(GetPickRecords)(THIS_ LPDWORD lpCount, LPD3DPICKRECORD lpD3DPickRec) PURE;
+    STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc, LPVOID lpArg) PURE;
+    STDMETHOD(CreateMatrix)(THIS_ LPD3DMATRIXHANDLE lpD3DMatHandle) PURE;
+    STDMETHOD(SetMatrix)(THIS_ D3DMATRIXHANDLE D3DMatHandle, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(GetMatrix)(THIS_ D3DMATRIXHANDLE D3DMatHandle, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(DeleteMatrix)(THIS_ D3DMATRIXHANDLE D3DMatHandle) PURE;
+    STDMETHOD(BeginScene)(THIS) PURE;
+    STDMETHOD(EndScene)(THIS) PURE;
+    STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D *lplpDirect3D) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DDevice methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice_AddRef(p)             (p)->AddRef()
+#define IDirect3DDevice_Release(p)            (p)->Release()
+/*** IDirect3DDevice methods ***/
+#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
+
+
+/*****************************************************************************
+ * IDirect3DDevice2 interface
+ */
+#define INTERFACE IDirect3DDevice2
+DECLARE_INTERFACE_(IDirect3DDevice2,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DDevice2 methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc) PURE;
+    STDMETHOD(SwapTextureHandles)(THIS_ LPDIRECT3DTEXTURE2 lpD3DTex1, LPDIRECT3DTEXTURE2 lpD3DTex2) PURE;
+    STDMETHOD(GetStats)(THIS_ LPD3DSTATS lpD3DStats) PURE;
+    STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT2 lpDirect3DViewport2) PURE;
+    STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT2 lpDirect3DViewport2) PURE;
+    STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT2 lpDirect3DViewport2, LPDIRECT3DVIEWPORT2 *lplpDirect3DViewport2, DWORD dwFlags) PURE;
+    STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK lpD3DEnumTextureProc, LPVOID lpArg) PURE;
+    STDMETHOD(BeginScene)(THIS) PURE;
+    STDMETHOD(EndScene)(THIS) PURE;
+    STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D2 *lplpDirect3D2) PURE;
+    /*** DrawPrimitive API ***/
+    STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2 lpDirect3DViewport2) PURE;
+    STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT2 *lplpDirect3DViewport2) PURE;
+    STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE lpNewRenderTarget, DWORD dwFlags) PURE;
+    STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE *lplpRenderTarget) PURE;
+    STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE d3dpt,D3DVERTEXTYPE dwVertexTypeDesc,DWORD dwFlags) PURE;
+    STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType, D3DVERTEXTYPE d3dvtVertexType, LPVOID lpvVertices, DWORD dwNumVertices, DWORD dwFlags) PURE;
+    STDMETHOD(Vertex)(THIS_ LPVOID lpVertexType) PURE;
+    STDMETHOD(Index)(THIS_ WORD wVertexIndex) PURE;
+    STDMETHOD(End)(THIS_ DWORD dwFlags) PURE;
+    STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState) PURE;
+    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState) PURE;
+    STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState) PURE;
+    STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState) PURE;
+    STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType, D3DVERTEXTYPE d3dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, DWORD dwFlags) PURE;
+    STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType, D3DVERTEXTYPE d3dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, LPWORD dwIndices, DWORD dwIndexCount, DWORD dwFlags) PURE;
+    STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS lpD3DClipStatus) PURE;
+    STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS lpD3DClipStatus) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DDevice2 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice2_AddRef(p)             (p)->AddRef()
+#define IDirect3DDevice2_Release(p)            (p)->Release()
+/*** IDirect3DDevice2 methods ***/
+#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
+
+/*****************************************************************************
+ * IDirect3DDevice3 interface
+ */
+#define INTERFACE IDirect3DDevice3
+DECLARE_INTERFACE_(IDirect3DDevice3,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DDevice3 methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc) PURE;
+    STDMETHOD(GetStats)(THIS_ LPD3DSTATS lpD3DStats) PURE;
+    STDMETHOD(AddViewport)(THIS_ LPDIRECT3DVIEWPORT3 lpDirect3DViewport3) PURE;
+    STDMETHOD(DeleteViewport)(THIS_ LPDIRECT3DVIEWPORT3 lpDirect3DViewport3) PURE;
+    STDMETHOD(NextViewport)(THIS_ LPDIRECT3DVIEWPORT3 lpDirect3DViewport3, LPDIRECT3DVIEWPORT3 *lplpDirect3DViewport3, DWORD dwFlags) PURE;
+    STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc, LPVOID lpArg) PURE;
+    STDMETHOD(BeginScene)(THIS) PURE;
+    STDMETHOD(EndScene)(THIS) PURE;
+    STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D3 *lplpDirect3D3) PURE;
+    /*** DrawPrimitive API ***/
+    STDMETHOD(SetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3 lpDirect3DViewport3) PURE;
+    STDMETHOD(GetCurrentViewport)(THIS_ LPDIRECT3DVIEWPORT3 *lplpDirect3DViewport3) PURE;
+    STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4 lpNewRenderTarget, DWORD dwFlags) PURE;
+    STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE4 *lplpRenderTarget) PURE;
+    STDMETHOD(Begin)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,DWORD dwVertexTypeDesc, DWORD dwFlags) PURE;
+    STDMETHOD(BeginIndexed)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,DWORD d3dvtVertexType, LPVOID lpvVertices, DWORD dwNumVertices, DWORD dwFlags) PURE;
+    STDMETHOD(Vertex)(THIS_ LPVOID lpVertexType) PURE;
+    STDMETHOD(Index)(THIS_ WORD wVertexIndex) PURE;
+    STDMETHOD(End)(THIS_ DWORD dwFlags) PURE;
+    STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState) PURE;
+    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState) PURE;
+    STDMETHOD(GetLightState)(THIS_ D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState) PURE;
+    STDMETHOD(SetLightState)(THIS_ D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState) PURE;
+    STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD d3dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, DWORD dwFlags) PURE;
+    STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD d3dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, LPWORD dwIndices, DWORD dwIndexCount, DWORD dwFlags) PURE;
+    STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS lpD3DClipStatus) PURE;
+    STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS lpD3DClipStatus) PURE;
+    STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,DWORD dwVertexType,LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,DWORD dwVertexCount,DWORD dwFlags) PURE;
+    STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,DWORD dwVertexType,LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,DWORD dwVertexCount,LPWORD lpIndex,DWORD dwIndexCount,DWORD dwFlags) PURE;
+    STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf,DWORD dwStartVertex,DWORD dwNumVertices,DWORD dwFlags) PURE;
+    STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,LPDIRECT3DVERTEXBUFFER lpD3DVertexBuf,LPWORD lpwIndices,DWORD dwIndexCount,DWORD dwFlags) PURE;
+    STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR lpCenters,LPD3DVALUE lpRadii,DWORD dwNumSpheres,DWORD dwFlags,LPDWORD lpdwReturnValues) PURE;
+    STDMETHOD(GetTexture)(THIS_ DWORD dwStage,LPDIRECT3DTEXTURE2 *lplpTexture2) PURE;
+    STDMETHOD(SetTexture)(THIS_ DWORD dwStage,LPDIRECT3DTEXTURE2 lpTexture2) PURE;
+    STDMETHOD(GetTextureStageState)(THIS_ DWORD dwStage,D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,LPDWORD lpdwState) PURE;
+    STDMETHOD(SetTextureStageState)(THIS_ DWORD dwStage,D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,DWORD dwState) PURE;
+    STDMETHOD(ValidateDevice)(THIS_ LPDWORD lpdwPasses) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DDevice3 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DDevice3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice3_AddRef(p)             (p)->AddRef()
+#define IDirect3DDevice3_Release(p)            (p)->Release()
+/*** IDirect3DDevice3 methods ***/
+#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
+
+/*****************************************************************************
+ * IDirect3DDevice7 interface
+ */
+#define INTERFACE IDirect3DDevice7
+DECLARE_INTERFACE_(IDirect3DDevice7,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DDevice7 methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPD3DDEVICEDESC7 lpD3DHELDevDesc) PURE;
+    STDMETHOD(EnumTextureFormats)(THIS_ LPD3DENUMPIXELFORMATSCALLBACK lpD3DEnumPixelProc, LPVOID lpArg) PURE;
+    STDMETHOD(BeginScene)(THIS) PURE;
+    STDMETHOD(EndScene)(THIS) PURE;
+    STDMETHOD(GetDirect3D)(THIS_ LPDIRECT3D7 *lplpDirect3D3) PURE;
+    STDMETHOD(SetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7 lpNewRenderTarget,DWORD dwFlags) PURE;
+    STDMETHOD(GetRenderTarget)(THIS_ LPDIRECTDRAWSURFACE7 *lplpRenderTarget) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD dwCount,LPD3DRECT lpRects,DWORD dwFlags,D3DCOLOR dwColor,D3DVALUE dvZ,DWORD dwStencil) PURE;
+    STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(SetViewport)(THIS_ LPD3DVIEWPORT7 lpData) PURE;
+    STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE dtstTransformStateType,LPD3DMATRIX lpD3DMatrix) PURE;
+    STDMETHOD(GetViewport)(THIS_ LPD3DVIEWPORT7 lpData) PURE;
+    STDMETHOD(SetMaterial)(THIS_ LPD3DMATERIAL7 lpMat) PURE;
+    STDMETHOD(GetMaterial)(THIS_ LPD3DMATERIAL7 lpMat) PURE;
+    STDMETHOD(SetLight)(THIS_ DWORD dwLightIndex,LPD3DLIGHT7 lpLight) PURE;
+    STDMETHOD(GetLight)(THIS_ DWORD dwLightIndex,LPD3DLIGHT7 lpLight) PURE;
+    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState) PURE;
+    STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState) PURE;
+    STDMETHOD(BeginStateBlock)(THIS) PURE;
+    STDMETHOD(EndStateBlock)(THIS_ LPDWORD lpdwBlockHandle) PURE;
+    STDMETHOD(PreLoad)(THIS_ LPDIRECTDRAWSURFACE7 lpddsTexture) PURE;
+    STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD d3dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, DWORD dwFlags) PURE;
+    STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD d3dvtVertexType, LPVOID lpvVertices, DWORD dwVertexCount, LPWORD dwIndices, DWORD dwIndexCount, DWORD dwFlags) PURE;
+    STDMETHOD(SetClipStatus)(THIS_ LPD3DCLIPSTATUS lpD3DClipStatus) PURE;
+    STDMETHOD(GetClipStatus)(THIS_ LPD3DCLIPSTATUS lpD3DClipStatus) PURE;
+    STDMETHOD(DrawPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,DWORD dwVertexType,LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,DWORD dwVertexCount,DWORD dwFlags) PURE;
+    STDMETHOD(DrawIndexedPrimitiveStrided)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,DWORD dwVertexType,LPD3DDRAWPRIMITIVESTRIDEDDATA lpD3DDrawPrimStrideData,DWORD dwVertexCount,LPWORD lpIndex,DWORD dwIndexCount,DWORD dwFlags) PURE;
+    STDMETHOD(DrawPrimitiveVB)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf,DWORD dwStartVertex,DWORD dwNumVertices,DWORD dwFlags) PURE;
+    STDMETHOD(DrawIndexedPrimitiveVB)(THIS_ D3DPRIMITIVETYPE d3dptPrimitiveType,LPDIRECT3DVERTEXBUFFER7 lpD3DVertexBuf,DWORD dwStartVertex,DWORD dwNumVertices,LPWORD lpwIndices,DWORD dwIndexCount,DWORD dwFlags) PURE;
+    STDMETHOD(ComputeSphereVisibility)(THIS_ LPD3DVECTOR lpCenters,LPD3DVALUE lpRadii,DWORD dwNumSpheres,DWORD dwFlags,LPDWORD lpdwReturnValues) PURE;
+    STDMETHOD(GetTexture)(THIS_ DWORD dwStage,LPDIRECTDRAWSURFACE7 *lpTexture) PURE;
+    STDMETHOD(SetTexture)(THIS_ DWORD dwStage,LPDIRECTDRAWSURFACE7 lpTexture) PURE;
+    STDMETHOD(GetTextureStageState)(THIS_ DWORD dwStage,D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,LPDWORD lpdwState) PURE;
+    STDMETHOD(SetTextureStageState)(THIS_ DWORD dwStage,D3DTEXTURESTAGESTATETYPE d3dTexStageStateType,DWORD dwState) PURE;
+    STDMETHOD(ValidateDevice)(THIS_ LPDWORD lpdwPasses) PURE;
+    STDMETHOD(ApplyStateBlock)(THIS_ DWORD dwBlockHandle) PURE;
+    STDMETHOD(CaptureStateBlock)(THIS_ DWORD dwBlockHandle) PURE;
+    STDMETHOD(DeleteStateBlock)(THIS_ DWORD dwBlockHandle) PURE;
+    STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE d3dsbType,LPDWORD lpdwBlockHandle) PURE;
+    STDMETHOD(Load)(THIS_ LPDIRECTDRAWSURFACE7 lpDestTex,LPPOINT lpDestPoint,LPDIRECTDRAWSURFACE7 lpSrcTex,LPRECT lprcSrcRect,DWORD dwFlags) PURE;
+    STDMETHOD(LightEnable)(THIS_ DWORD dwLightIndex,BOOL bEnable) PURE;
+    STDMETHOD(GetLightEnable)(THIS_ DWORD dwLightIndex,BOOL *pbEnable) PURE;
+    STDMETHOD(SetClipPlane)(THIS_ DWORD dwIndex,D3DVALUE *pPlaneEquation) PURE;
+    STDMETHOD(GetClipPlane)(THIS_ DWORD dwIndex,D3DVALUE *pPlaneEquation) PURE;
+    STDMETHOD(GetInfo)(THIS_ DWORD dwDevInfoID,LPVOID pDevInfoStruct,DWORD dwSize) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DDevice7 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DDevice7_QueryInterface(p,a,b)                        (p)->QueryInterface(a,b)
+#define IDirect3DDevice7_AddRef(p)                                    (p)->AddRef()
+#define IDirect3DDevice7_Release(p)                                   (p)->Release()
+/*** IDirect3DDevice7 methods ***/
+#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
+
+
+
+/*****************************************************************************
+ * IDirect3DVertexBuffer interface
+ */
+#define INTERFACE IDirect3DVertexBuffer
+DECLARE_INTERFACE_(IDirect3DVertexBuffer,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DVertexBuffer methods ***/
+    STDMETHOD(Lock)(THIS_ DWORD dwFlags,LPVOID *lplpData,LPDWORD lpdwSize) PURE;
+    STDMETHOD(Unlock)(THIS) PURE;
+    STDMETHOD(ProcessVertices)(THIS_ DWORD dwVertexOp,DWORD dwDestIndex,DWORD dwCount,LPDIRECT3DVERTEXBUFFER lpSrcBuffer,DWORD dwSrcIndex,LPDIRECT3DDEVICE3 lpD3DDevice,DWORD dwFlags) PURE;
+    STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC lpD3DVertexBufferDesc) PURE;
+    STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE3  lpD3DDevice,DWORD dwFlags) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DVertexBuffer methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DVertexBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DVertexBuffer_AddRef(p)             (p)->AddRef()
+#define IDirect3DVertexBuffer_Release(p)            (p)->Release()
+/*** IDirect3DVertexBuffer methods ***/
+#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
+
+/*****************************************************************************
+ * IDirect3DVertexBuffer7 interface
+ */
+#define INTERFACE IDirect3DVertexBuffer7
+DECLARE_INTERFACE_(IDirect3DVertexBuffer7,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DVertexBuffer7 methods ***/
+    STDMETHOD(Lock)(THIS_ DWORD dwFlags,LPVOID *lplpData,LPDWORD lpdwSize) PURE;
+    STDMETHOD(Unlock)(THIS) PURE;
+    STDMETHOD(ProcessVertices)(THIS_ DWORD dwVertexOp,DWORD dwDestIndex,DWORD dwCount,LPDIRECT3DVERTEXBUFFER7 lpSrcBuffer,DWORD dwSrcIndex,LPDIRECT3DDEVICE7 lpD3DDevice,DWORD dwFlags) PURE;
+    STDMETHOD(GetVertexBufferDesc)(THIS_ LPD3DVERTEXBUFFERDESC lpD3DVertexBufferDesc) PURE;
+    STDMETHOD(Optimize)(THIS_ LPDIRECT3DDEVICE7  lpD3DDevice,DWORD dwFlags) PURE;
+    STDMETHOD(ProcessVerticesStrided)(THIS_ DWORD dwVertexOp,DWORD dwDestIndex,DWORD dwCount,LPD3DDRAWPRIMITIVESTRIDEDDATA lpStrideData,DWORD dwVertexTypeDesc,LPDIRECT3DDEVICE7 lpD3DDevice,DWORD dwFlags) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#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)
+/*** IDirect3DVertexBuffer7 methods ***/
+#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
+/*** IUnknown methods ***/
+#define IDirect3DVertexBuffer7_QueryInterface(p,a,b)                   (p)->QueryInterface(a,b)
+#define IDirect3DVertexBuffer7_AddRef(p)                               (p)->AddRef()
+#define IDirect3DVertexBuffer7_Release(p)                              (p)->Release()
+/*** IDirect3DVertexBuffer7 methods ***/
+#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 /* __WINE_D3D_H */
diff --git a/misc/builddeps/dp.win32/include/d3d10.h b/misc/builddeps/dp.win32/include/d3d10.h
new file mode 100644 (file)
index 0000000..dd6ea6c
--- /dev/null
@@ -0,0 +1,5603 @@
+/*** Autogenerated by WIDL 1.2-rc3 from d3d10.idl - Do not edit ***/
+
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifndef __WIDL_D3D10_H
+#define __WIDL_D3D10_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Headers for imported files */
+
+#include <oaidl.h>
+#include <ocidl.h>
+#include <dxgi.h>
+
+/* Forward declarations */
+
+#ifndef __ID3D10DeviceChild_FWD_DEFINED__
+#define __ID3D10DeviceChild_FWD_DEFINED__
+typedef interface ID3D10DeviceChild ID3D10DeviceChild;
+#endif
+
+#ifndef __ID3D10Resource_FWD_DEFINED__
+#define __ID3D10Resource_FWD_DEFINED__
+typedef interface ID3D10Resource ID3D10Resource;
+#endif
+
+#ifndef __ID3D10Buffer_FWD_DEFINED__
+#define __ID3D10Buffer_FWD_DEFINED__
+typedef interface ID3D10Buffer ID3D10Buffer;
+#endif
+
+#ifndef __ID3D10Texture1D_FWD_DEFINED__
+#define __ID3D10Texture1D_FWD_DEFINED__
+typedef interface ID3D10Texture1D ID3D10Texture1D;
+#endif
+
+#ifndef __ID3D10Texture2D_FWD_DEFINED__
+#define __ID3D10Texture2D_FWD_DEFINED__
+typedef interface ID3D10Texture2D ID3D10Texture2D;
+#endif
+
+#ifndef __ID3D10Texture3D_FWD_DEFINED__
+#define __ID3D10Texture3D_FWD_DEFINED__
+typedef interface ID3D10Texture3D ID3D10Texture3D;
+#endif
+
+#ifndef __ID3D10View_FWD_DEFINED__
+#define __ID3D10View_FWD_DEFINED__
+typedef interface ID3D10View ID3D10View;
+#endif
+
+#ifndef __ID3D10DepthStencilView_FWD_DEFINED__
+#define __ID3D10DepthStencilView_FWD_DEFINED__
+typedef interface ID3D10DepthStencilView ID3D10DepthStencilView;
+#endif
+
+#ifndef __ID3D10RenderTargetView_FWD_DEFINED__
+#define __ID3D10RenderTargetView_FWD_DEFINED__
+typedef interface ID3D10RenderTargetView ID3D10RenderTargetView;
+#endif
+
+#ifndef __ID3D10ShaderResourceView_FWD_DEFINED__
+#define __ID3D10ShaderResourceView_FWD_DEFINED__
+typedef interface ID3D10ShaderResourceView ID3D10ShaderResourceView;
+#endif
+
+#ifndef __ID3D10BlendState_FWD_DEFINED__
+#define __ID3D10BlendState_FWD_DEFINED__
+typedef interface ID3D10BlendState ID3D10BlendState;
+#endif
+
+#ifndef __ID3D10DepthStencilState_FWD_DEFINED__
+#define __ID3D10DepthStencilState_FWD_DEFINED__
+typedef interface ID3D10DepthStencilState ID3D10DepthStencilState;
+#endif
+
+#ifndef __ID3D10GeometryShader_FWD_DEFINED__
+#define __ID3D10GeometryShader_FWD_DEFINED__
+typedef interface ID3D10GeometryShader ID3D10GeometryShader;
+#endif
+
+#ifndef __ID3D10InputLayout_FWD_DEFINED__
+#define __ID3D10InputLayout_FWD_DEFINED__
+typedef interface ID3D10InputLayout ID3D10InputLayout;
+#endif
+
+#ifndef __ID3D10PixelShader_FWD_DEFINED__
+#define __ID3D10PixelShader_FWD_DEFINED__
+typedef interface ID3D10PixelShader ID3D10PixelShader;
+#endif
+
+#ifndef __ID3D10RasterizerState_FWD_DEFINED__
+#define __ID3D10RasterizerState_FWD_DEFINED__
+typedef interface ID3D10RasterizerState ID3D10RasterizerState;
+#endif
+
+#ifndef __ID3D10SamplerState_FWD_DEFINED__
+#define __ID3D10SamplerState_FWD_DEFINED__
+typedef interface ID3D10SamplerState ID3D10SamplerState;
+#endif
+
+#ifndef __ID3D10VertexShader_FWD_DEFINED__
+#define __ID3D10VertexShader_FWD_DEFINED__
+typedef interface ID3D10VertexShader ID3D10VertexShader;
+#endif
+
+#ifndef __ID3D10Asynchronous_FWD_DEFINED__
+#define __ID3D10Asynchronous_FWD_DEFINED__
+typedef interface ID3D10Asynchronous ID3D10Asynchronous;
+#endif
+
+#ifndef __ID3D10Counter_FWD_DEFINED__
+#define __ID3D10Counter_FWD_DEFINED__
+typedef interface ID3D10Counter ID3D10Counter;
+#endif
+
+#ifndef __ID3D10Query_FWD_DEFINED__
+#define __ID3D10Query_FWD_DEFINED__
+typedef interface ID3D10Query ID3D10Query;
+#endif
+
+#ifndef __ID3D10Predicate_FWD_DEFINED__
+#define __ID3D10Predicate_FWD_DEFINED__
+typedef interface ID3D10Predicate ID3D10Predicate;
+#endif
+
+#ifndef __ID3D10Device_FWD_DEFINED__
+#define __ID3D10Device_FWD_DEFINED__
+typedef interface ID3D10Device ID3D10Device;
+#endif
+
+#ifndef __ID3D10Multithread_FWD_DEFINED__
+#define __ID3D10Multithread_FWD_DEFINED__
+typedef interface ID3D10Multithread ID3D10Multithread;
+#endif
+
+
+#ifndef _D3D10_CONSTANTS
+#define _D3D10_CONSTANTS
+#define D3D10_DEFAULT_BLEND_FACTOR_ALPHA (1.00000000000000)
+
+#define D3D10_DEFAULT_BLEND_FACTOR_BLUE (1.00000000000000)
+
+#define D3D10_DEFAULT_BLEND_FACTOR_GREEN (1.00000000000000)
+
+#define D3D10_DEFAULT_BLEND_FACTOR_RED (1.00000000000000)
+
+#define D3D10_DEFAULT_BORDER_COLOR_COMPONENT (0.00000000000000)
+
+#define D3D10_DEFAULT_SLOPE_SCALED_DEPTH_BIAS (0.00000000000000)
+
+#define D3D10_DEFAULT_DEPTH_BIAS_CLAMP (0.00000000000000)
+
+#define D3D10_DEFAULT_MAX_ANISOTROPY (16.0000000000000)
+
+#define D3D10_DEFAULT_MIP_LOD_BIAS (0.00000000000000)
+
+#define D3D10_DEFAULT_VIEWPORT_MAX_DEPTH (0.00000000000000)
+
+#define D3D10_DEFAULT_VIEWPORT_MIN_DEPTH (0.00000000000000)
+
+#define D3D10_FLOAT16_FUSED_TOLERANCE_IN_ULP (0.600000000000000)
+
+#define D3D10_FLOAT32_MAX (3.40282346600000e+38)
+
+#define D3D10_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP (0.600000000000000)
+
+#define D3D10_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR (2.40000000000000)
+
+#define D3D10_FLOAT_TO_SRGB_EXPONENT_NUMERATOR (1.00000000000000)
+
+#define D3D10_FLOAT_TO_SRGB_OFFSET (0.0550000000000000)
+
+#define D3D10_FLOAT_TO_SRGB_SCALE_1 (12.9200000000000)
+
+#define D3D10_FLOAT_TO_SRGB_SCALE_2 (1.05500000000000)
+
+#define D3D10_FLOAT_TO_SRGB_THRESHOLD (0.00313080000000000)
+
+#define D3D10_FTOI_INSTRUCTION_MAX_INPUT (2147483647.99900)
+
+#define D3D10_FTOI_INSTRUCTION_MIN_INPUT (-2147483648.99900)
+
+#define D3D10_FTOU_INSTRUCTION_MAX_INPUT (4294967295.99900)
+
+#define D3D10_FTOU_INSTRUCTION_MIN_INPUT (0.00000000000000)
+
+#define D3D10_LINEAR_GAMMA (1.00000000000000)
+
+#define D3D10_MAX_BORDER_COLOR_COMPONENT (1.00000000000000)
+
+#define D3D10_MAX_DEPTH (1.00000000000000)
+
+#define D3D10_MAX_POSITION_VALUE (3.40282346600000e+34)
+
+#define D3D10_MIN_BORDER_COLOR_COMPONENT (0.00000000000000)
+
+#define D3D10_MIN_DEPTH (0.00000000000000)
+
+#define D3D10_MIP_LOD_BIAS_MAX (15.9900000000000)
+
+#define D3D10_MIP_LOD_BIAS_MIN (-16.0000000000000)
+
+#define D3D10_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT (0.500000000000000)
+
+#define D3D10_MULTISAMPLE_ANTIALIAS_LINE_WIDTH (1.40000000000000)
+
+#define D3D10_SRGB_GAMMA (2.20000000000000)
+
+#define D3D10_SRGB_TO_FLOAT_DENOMINATOR_1 (12.9200000000000)
+
+#define D3D10_SRGB_TO_FLOAT_DENOMINATOR_2 (1.05500000000000)
+
+#define D3D10_SRGB_TO_FLOAT_EXPONENT (2.40000000000000)
+
+#define D3D10_SRGB_TO_FLOAT_OFFSET (0.0550000000000000)
+
+#define D3D10_SRGB_TO_FLOAT_THRESHOLD (0.0404500000000000)
+
+#define D3D10_SRGB_TO_FLOAT_TOLERANCE_IN_ULP (0.500000000000000)
+
+#define D3D10_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT (0.00000000000000)
+
+#define D3D_SPEC_VERSION (1.05000500000000)
+
+#define D3D10_16BIT_INDEX_STRIP_CUT_VALUE (0xffff)
+
+#define D3D10_32BIT_INDEX_STRIP_CUT_VALUE (0xffffffff)
+
+#define D3D10_8BIT_INDEX_STRIP_CUT_VALUE (0xff)
+
+#define D3D10_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT (9)
+
+#define D3D10_CLIP_OR_CULL_DISTANCE_COUNT (8)
+
+#define D3D10_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT (2)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT (14)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS (4)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT (15)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS (4)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT (15)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST (1)
+
+#define D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS (1)
+
+#define D3D10_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT (64)
+
+#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS (4)
+
+#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT (1)
+
+#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST (1)
+
+#define D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS (1)
+
+#define D3D10_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS (1)
+
+#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT (128)
+
+#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST (1)
+
+#define D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS (1)
+
+#define D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT (128)
+
+#define D3D10_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS (1)
+
+#define D3D10_COMMONSHADER_SAMPLER_REGISTER_COUNT (16)
+
+#define D3D10_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST (1)
+
+#define D3D10_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS (1)
+
+#define D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT (16)
+
+#define D3D10_COMMONSHADER_SUBROUTINE_NESTING_LIMIT (32)
+
+#define D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENTS (4)
+
+#define D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_COMMONSHADER_TEMP_REGISTER_COUNT (4096)
+
+#define D3D10_COMMONSHADER_TEMP_REGISTER_READS_PER_INST (3)
+
+#define D3D10_COMMONSHADER_TEMP_REGISTER_READ_PORTS (3)
+
+#define D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX (10)
+
+#define D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN (-10)
+
+#define D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE (-8)
+
+#define D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE (7)
+
+#define D3D10_DEFAULT_DEPTH_BIAS (0)
+
+#define D3D10_DEFAULT_RENDER_TARGET_ARRAY_INDEX (0)
+
+#define D3D10_DEFAULT_SAMPLE_MASK (0xffffffff)
+
+#define D3D10_DEFAULT_SCISSOR_ENDX (0)
+
+#define D3D10_DEFAULT_SCISSOR_ENDY (0)
+
+#define D3D10_DEFAULT_SCISSOR_STARTX (0)
+
+#define D3D10_DEFAULT_SCISSOR_STARTY (0)
+
+#define D3D10_DEFAULT_STENCIL_READ_MASK (0xff)
+
+#define D3D10_DEFAULT_STENCIL_REFERENCE (0)
+
+#define D3D10_DEFAULT_STENCIL_WRITE_MASK (0xff)
+
+#define D3D10_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX (0)
+
+#define D3D10_DEFAULT_VIEWPORT_HEIGHT (0)
+
+#define D3D10_DEFAULT_VIEWPORT_TOPLEFTX (0)
+
+#define D3D10_DEFAULT_VIEWPORT_TOPLEFTY (0)
+
+#define D3D10_DEFAULT_VIEWPORT_WIDTH (0)
+
+#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS (1)
+
+#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_COUNT (1)
+
+#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST (2)
+
+#define D3D10_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS (1)
+
+#define D3D10_GS_INPUT_REGISTER_COMPONENTS (4)
+
+#define D3D10_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_GS_INPUT_REGISTER_COUNT (16)
+
+#define D3D10_GS_INPUT_REGISTER_READS_PER_INST (2)
+
+#define D3D10_GS_INPUT_REGISTER_READ_PORTS (1)
+
+#define D3D10_GS_INPUT_REGISTER_VERTICES (6)
+
+#define D3D10_GS_OUTPUT_ELEMENTS (32)
+
+#define D3D10_GS_OUTPUT_REGISTER_COMPONENTS (4)
+
+#define D3D10_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_GS_OUTPUT_REGISTER_COUNT (32)
+
+#define D3D10_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES (0)
+
+#define D3D10_IA_DEFAULT_PRIMITIVE_TOPOLOGY (0)
+
+#define D3D10_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES (0)
+
+#define D3D10_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT (1)
+
+#define D3D10_IA_INSTANCE_ID_BIT_COUNT (32)
+
+#define D3D10_IA_INTEGER_ARITHMETIC_BIT_COUNT (32)
+
+#define D3D10_IA_PRIMITIVE_ID_BIT_COUNT (32)
+
+#define D3D10_IA_VERTEX_ID_BIT_COUNT (32)
+
+#define D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT (16)
+
+#define D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS (64)
+
+#define D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT (16)
+
+#define D3D10_INTEGER_DIVIDE_BY_ZERO_QUOTIENT (0xffffffff)
+
+#define D3D10_INTEGER_DIVIDE_BY_ZERO_REMAINDER (0xffffffff)
+
+#define D3D10_MAX_MAXANISOTROPY (16)
+
+#define D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT (32)
+
+#define D3D10_MAX_TEXTURE_DIMENSION_2_TO_EXP (17)
+
+#define D3D10_MIN_MAXANISOTROPY (0)
+
+#define D3D10_MIP_LOD_FRACTIONAL_BIT_COUNT (6)
+
+#define D3D10_MIP_LOD_RANGE_BIT_COUNT (8)
+
+#define D3D10_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT (0)
+
+#define D3D10_PIXEL_ADDRESS_RANGE_BIT_COUNT (13)
+
+#define D3D10_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT (15)
+
+#define D3D10_PS_FRONTFACING_DEFAULT_VALUE (0xffffffff)
+
+#define D3D10_PS_FRONTFACING_FALSE_VALUE (0)
+
+#define D3D10_PS_FRONTFACING_TRUE_VALUE (0xffffffff)
+
+#define D3D10_PS_INPUT_REGISTER_COMPONENTS (4)
+
+#define D3D10_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_PS_INPUT_REGISTER_COUNT (32)
+
+#define D3D10_PS_INPUT_REGISTER_READS_PER_INST (2)
+
+#define D3D10_PS_INPUT_REGISTER_READ_PORTS (1)
+
+#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS (1)
+
+#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_PS_OUTPUT_DEPTH_REGISTER_COUNT (1)
+
+#define D3D10_PS_OUTPUT_REGISTER_COMPONENTS (4)
+
+#define D3D10_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_PS_OUTPUT_REGISTER_COUNT (8)
+
+#define D3D10_REQ_BLEND_OBJECT_COUNT_PER_CONTEXT (4096)
+
+#define D3D10_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP (27)
+
+#define D3D10_REQ_CONSTANT_BUFFER_ELEMENT_COUNT (4096)
+
+#define D3D10_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_CONTEXT (4096)
+
+#define D3D10_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP (32)
+
+#define D3D10_REQ_DRAW_VERTEX_COUNT_2_TO_EXP (32)
+
+#define D3D10_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION (8192)
+
+#define D3D10_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT (1024)
+
+#define D3D10_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT (4096)
+
+#define D3D10_REQ_MAXANISOTROPY (16)
+
+#define D3D10_REQ_MIP_LEVELS (14)
+
+#define D3D10_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES (2048)
+
+#define D3D10_REQ_RASTERIZER_OBJECT_COUNT_PER_CONTEXT (4096)
+
+#define D3D10_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH (8192)
+
+#define D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES (128)
+
+#define D3D10_REQ_RESOURCE_VIEW_COUNT_PER_CONTEXT_2_TO_EXP (20)
+
+#define D3D10_REQ_SAMPLER_OBJECT_COUNT_PER_CONTEXT (4096)
+
+#define D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION (512)
+
+#define D3D10_REQ_TEXTURE1D_U_DIMENSION (8192)
+
+#define D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION (512)
+
+#define D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION (8192)
+
+#define D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION (2048)
+
+#define D3D10_REQ_TEXTURECUBE_DIMENSION (8192)
+
+#define D3D10_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL (0)
+
+#define D3D10_SHADER_MAJOR_VERSION (4)
+
+#define D3D10_SHADER_MINOR_VERSION (0)
+
+#define D3D10_SHIFT_INSTRUCTION_PAD_VALUE (0)
+
+#define D3D10_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT (5)
+
+#define D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT (8)
+
+#define D3D10_SO_BUFFER_MAX_STRIDE_IN_BYTES (2048)
+
+#define D3D10_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES (256)
+
+#define D3D10_SO_BUFFER_SLOT_COUNT (4)
+
+#define D3D10_SO_DDI_REGISTER_INDEX_DENOTING_GAP (0xffffffff)
+
+#define D3D10_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER (1)
+
+#define D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT (64)
+
+#define D3D10_STANDARD_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_STANDARD_COMPONENT_BIT_COUNT_DOUBLED (64)
+
+#define D3D10_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE (4)
+
+#define D3D10_STANDARD_PIXEL_COMPONENT_COUNT (128)
+
+#define D3D10_STANDARD_PIXEL_ELEMENT_COUNT (32)
+
+#define D3D10_STANDARD_VECTOR_SIZE (4)
+
+#define D3D10_STANDARD_VERTEX_ELEMENT_COUNT (16)
+
+#define D3D10_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT (64)
+
+#define D3D10_SUBPIXEL_FRACTIONAL_BIT_COUNT (8)
+
+#define D3D10_SUBTEXEL_FRACTIONAL_BIT_COUNT (6)
+
+#define D3D10_TEXEL_ADDRESS_RANGE_BIT_COUNT (18)
+
+#define D3D10_UNBOUND_MEMORY_ACCESS_RESULT (0)
+
+#define D3D10_VIEWPORT_AND_SCISSORRECT_MAX_INDEX (15)
+
+#define D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE (16)
+
+#define D3D10_VIEWPORT_BOUNDS_MAX (16383)
+
+#define D3D10_VIEWPORT_BOUNDS_MIN (-16384)
+
+#define D3D10_VS_INPUT_REGISTER_COMPONENTS (4)
+
+#define D3D10_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_VS_INPUT_REGISTER_COUNT (16)
+
+#define D3D10_VS_INPUT_REGISTER_READS_PER_INST (2)
+
+#define D3D10_VS_INPUT_REGISTER_READ_PORTS (1)
+
+#define D3D10_VS_OUTPUT_REGISTER_COMPONENTS (4)
+
+#define D3D10_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT (32)
+
+#define D3D10_VS_OUTPUT_REGISTER_COUNT (16)
+
+#define D3D10_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT (10)
+
+#define D3D10_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP (25)
+
+#define D3D10_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP (25)
+
+#define D3D_MAJOR_VERSION (10)
+
+#define D3D_MINOR_VERSION (0)
+
+#define D3D_SPEC_DATE_DAY (8)
+
+#define D3D_SPEC_DATE_MONTH (8)
+
+#define D3D_SPEC_DATE_YEAR (2006)
+
+#endif
+#define D3D10_APPEND_ALIGNED_ELEMENT (0xffffffff)
+
+#define _FACD3D10 (0x87)
+
+#define _FACD3D10DEBUG (_FACD3D10 + 1)
+
+#define D3D10_FILTER_TYPE_MASK (0x3)
+
+#define D3D10_SDK_VERSION (29)
+
+#define MAKE_D3D10_HRESULT(code)                   MAKE_HRESULT( 1, _FACD3D10, code)
+#define MAKE_D3D10_STATUS(code)                    MAKE_HRESULT( 0, _FACD3D10, code)
+#define D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS  MAKE_D3D10_HRESULT(1)
+#define D3D10_ERROR_FILE_NOT_FOUND                 MAKE_D3D10_HRESULT(2)
+typedef enum D3D10_BLEND {
+    D3D10_BLEND_ZERO = 1,
+    D3D10_BLEND_ONE = 2,
+    D3D10_BLEND_SRC_COLOR = 3,
+    D3D10_BLEND_INV_SRC_COLOR = 4,
+    D3D10_BLEND_SRC_ALPHA = 5,
+    D3D10_BLEND_INV_SRC_ALPHA = 6,
+    D3D10_BLEND_DEST_ALPHA = 7,
+    D3D10_BLEND_INV_DEST_ALPHA = 8,
+    D3D10_BLEND_DEST_COLOR = 9,
+    D3D10_BLEND_INV_DEST_COLOR = 10,
+    D3D10_BLEND_SRC_ALPHA_SAT = 11,
+    D3D10_BLEND_BLEND_FACTOR = 14,
+    D3D10_BLEND_INV_BLEND_FACTOR = 15,
+    D3D10_BLEND_SRC1_COLOR = 16,
+    D3D10_BLEND_INV_SRC1_COLOR = 17,
+    D3D10_BLEND_SRC1_ALPHA = 18,
+    D3D10_BLEND_INV_SRC1_ALPHA = 19
+} D3D10_BLEND;
+typedef enum D3D10_BLEND_OP {
+    D3D10_BLEND_OP_ADD = 1,
+    D3D10_BLEND_OP_SUBTRACT = 2,
+    D3D10_BLEND_OP_REV_SUBTRACT = 3,
+    D3D10_BLEND_OP_MIN = 4,
+    D3D10_BLEND_OP_MAX = 5
+} D3D10_BLEND_OP;
+typedef struct D3D10_BLEND_DESC {
+    BOOL AlphaToCoverageEnable;
+    BOOL BlendEnable[8];
+    D3D10_BLEND SrcBlend;
+    D3D10_BLEND DestBlend;
+    D3D10_BLEND_OP BlendOp;
+    D3D10_BLEND SrcBlendAlpha;
+    D3D10_BLEND DestBlendAlpha;
+    D3D10_BLEND_OP BlendOpAlpha;
+    UINT8 RenderTargetWriteMask[8];
+} D3D10_BLEND_DESC;
+typedef enum D3D10_DEPTH_WRITE_MASK {
+    D3D10_DEPTH_WRITE_MASK_ZERO = 0,
+    D3D10_DEPTH_WRITE_MASK_ALL = 1
+} D3D10_DEPTH_WRITE_MASK;
+typedef enum D3D10_COMPARISON_FUNC {
+    D3D10_COMPARISON_NEVER = 1,
+    D3D10_COMPARISON_LESS = 2,
+    D3D10_COMPARISON_EQUAL = 3,
+    D3D10_COMPARISON_LESS_EQUAL = 4,
+    D3D10_COMPARISON_GREATER = 5,
+    D3D10_COMPARISON_NOT_EQUAL = 6,
+    D3D10_COMPARISON_GREATER_EQUAL = 7,
+    D3D10_COMPARISON_ALWAYS = 8
+} D3D10_COMPARISON_FUNC;
+typedef enum D3D10_STENCIL_OP {
+    D3D10_STENCIL_OP_KEEP = 1,
+    D3D10_STENCIL_OP_ZERO = 2,
+    D3D10_STENCIL_OP_REPLACE = 3,
+    D3D10_STENCIL_OP_INCR_SAT = 4,
+    D3D10_STENCIL_OP_DECR_SAT = 5,
+    D3D10_STENCIL_OP_INVERT = 6,
+    D3D10_STENCIL_OP_INCR = 7,
+    D3D10_STENCIL_OP_DECR = 8
+} D3D10_STENCIL_OP;
+typedef struct D3D10_DEPTH_STENCILOP_DESC {
+    D3D10_STENCIL_OP StencilFailOp;
+    D3D10_STENCIL_OP StencilDepthFailOp;
+    D3D10_STENCIL_OP StencilPassOp;
+    D3D10_COMPARISON_FUNC StencilFunc;
+} D3D10_DEPTH_STENCILOP_DESC;
+typedef struct D3D10_DEPTH_STENCIL_DESC {
+    BOOL DepthEnable;
+    D3D10_DEPTH_WRITE_MASK DepthWriteMask;
+    D3D10_COMPARISON_FUNC DepthFunc;
+    BOOL StencilEnable;
+    UINT8 StencilReadMask;
+    UINT8 StencilWriteMask;
+    D3D10_DEPTH_STENCILOP_DESC FrontFace;
+    D3D10_DEPTH_STENCILOP_DESC BackFace;
+} D3D10_DEPTH_STENCIL_DESC;
+typedef enum D3D10_FILL_MODE {
+    D3D10_FILL_WIREFRAME = 2,
+    D3D10_FILL_SOLID = 3
+} D3D10_FILL_MODE;
+typedef enum D3D10_CULL_MODE {
+    D3D10_CULL_NONE = 1,
+    D3D10_CULL_FRONT = 2,
+    D3D10_CULL_BACK = 3
+} D3D10_CULL_MODE;
+typedef struct D3D10_RASTERIZER_DESC {
+    D3D10_FILL_MODE FillMode;
+    D3D10_CULL_MODE CullMode;
+    BOOL FrontCounterClockwise;
+    INT DepthBias;
+    FLOAT DepthBiasClamp;
+    FLOAT SlopeScaledDepthBias;
+    BOOL DepthClipEnable;
+    BOOL ScissorEnable;
+    BOOL MultisampleEnable;
+    BOOL AntialiasedLineEnable;
+} D3D10_RASTERIZER_DESC;
+typedef enum D3D10_FILTER {
+    D3D10_FILTER_MIN_MAG_MIP_POINT = 0,
+    D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1,
+    D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
+    D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5,
+    D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10,
+    D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
+    D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14,
+    D3D10_FILTER_MIN_MAG_MIP_LINEAR = 0x15,
+    D3D10_FILTER_ANISOTROPIC = 0x55,
+    D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
+    D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
+    D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
+    D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
+    D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
+    D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
+    D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
+    D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
+    D3D10_FILTER_COMPARISON_ANISOTROPIC = 0xd5,
+    D3D10_FILTER_TEXT_1BIT = 0x80000000
+} D3D10_FILTER;
+typedef enum D3D10_TEXTURE_ADDRESS_MODE {
+    D3D10_TEXTURE_ADDRESS_WRAP = 1,
+    D3D10_TEXTURE_ADDRESS_MIRROR = 2,
+    D3D10_TEXTURE_ADDRESS_CLAMP = 3,
+    D3D10_TEXTURE_ADDRESS_BORDER = 4,
+    D3D10_TEXTURE_ADDRESS_MIRROR_ONCE = 5
+} D3D10_TEXTURE_ADDRESS_MODE;
+typedef struct D3D10_SAMPLER_DESC {
+    D3D10_FILTER Filter;
+    D3D10_TEXTURE_ADDRESS_MODE AddressU;
+    D3D10_TEXTURE_ADDRESS_MODE AddressV;
+    D3D10_TEXTURE_ADDRESS_MODE AddressW;
+    FLOAT MipLODBias;
+    UINT MaxAnisotropy;
+    D3D10_COMPARISON_FUNC ComparisonFunc;
+    FLOAT BorderColor[4];
+    FLOAT MinLOD;
+    FLOAT MaxLOD;
+} D3D10_SAMPLER_DESC;
+typedef enum D3D10_COUNTER {
+    D3D10_COUNTER_GPU_IDLE = 0,
+    D3D10_COUNTER_VERTEX_PROCESSING = 1,
+    D3D10_COUNTER_GEOMETRY_PROCESSING = 2,
+    D3D10_COUNTER_PIXEL_PROCESSING = 3,
+    D3D10_COUNTER_OTHER_GPU_PROCESSING = 4,
+    D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION = 5,
+    D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION = 6,
+    D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION = 7,
+    D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION = 8,
+    D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION = 9,
+    D3D10_COUNTER_VS_MEMORY_LIMITED = 10,
+    D3D10_COUNTER_VS_COMPUTATION_LIMITED = 11,
+    D3D10_COUNTER_GS_MEMORY_LIMITED = 12,
+    D3D10_COUNTER_GS_COMPUTATION_LIMITED = 13,
+    D3D10_COUNTER_PS_MEMORY_LIMITED = 14,
+    D3D10_COUNTER_PS_COMPUTATION_LIMITED = 15,
+    D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE = 16,
+    D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE = 17,
+    D3D10_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
+} D3D10_COUNTER;
+typedef struct D3D10_COUNTER_DESC {
+    D3D10_COUNTER Counter;
+    UINT MiscFlags;
+} D3D10_COUNTER_DESC;
+typedef enum D3D10_COUNTER_TYPE {
+    D3D10_COUNTER_TYPE_FLOAT32 = 0,
+    D3D10_COUNTER_TYPE_UINT16 = 1,
+    D3D10_COUNTER_TYPE_UINT32 = 2,
+    D3D10_COUNTER_TYPE_UINT64 = 3
+} D3D10_COUNTER_TYPE;
+typedef struct D3D10_COUNTER_INFO {
+    D3D10_COUNTER LastDeviceDependentCounter;
+    UINT NumSimultaneousCounters;
+    UINT8 NumDetectableParallelUnits;
+} D3D10_COUNTER_INFO;
+typedef enum D3D10_RESOURCE_DIMENSION {
+    D3D10_RESOURCE_DIMENSION_UNKNOWN = 0,
+    D3D10_RESOURCE_DIMENSION_BUFFER = 1,
+    D3D10_RESOURCE_DIMENSION_TEXTURE1D = 2,
+    D3D10_RESOURCE_DIMENSION_TEXTURE2D = 3,
+    D3D10_RESOURCE_DIMENSION_TEXTURE3D = 4
+} D3D10_RESOURCE_DIMENSION;
+typedef enum D3D10_USAGE {
+    D3D10_USAGE_DEFAULT = 0,
+    D3D10_USAGE_IMMUTABLE = 1,
+    D3D10_USAGE_DYNAMIC = 2,
+    D3D10_USAGE_STAGING = 3
+} D3D10_USAGE;
+typedef struct D3D10_BUFFER_DESC {
+    UINT ByteWidth;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_BUFFER_DESC;
+typedef enum D3D10_MAP {
+    D3D10_MAP_READ = 1,
+    D3D10_MAP_WRITE = 2,
+    D3D10_MAP_READ_WRITE = 3,
+    D3D10_MAP_WRITE_DISCARD = 4,
+    D3D10_MAP_WRITE_NO_OVERWRITE = 5
+} D3D10_MAP;
+typedef struct D3D10_TEXTURE1D_DESC {
+    UINT Width;
+    UINT MipLevels;
+    UINT ArraySize;
+    DXGI_FORMAT Format;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_TEXTURE1D_DESC;
+typedef struct D3D10_TEXTURE2D_DESC {
+    UINT Width;
+    UINT Height;
+    UINT MipLevels;
+    UINT ArraySize;
+    DXGI_FORMAT Format;
+    DXGI_SAMPLE_DESC SampleDesc;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_TEXTURE2D_DESC;
+typedef struct D3D10_TEXTURE3D_DESC {
+    UINT Width;
+    UINT Height;
+    UINT Depth;
+    UINT MipLevels;
+    DXGI_FORMAT Format;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_TEXTURE3D_DESC;
+typedef enum D3D10_DSV_DIMENSION {
+    D3D10_DSV_DIMENSION_UNKNOWN = 0,
+    D3D10_DSV_DIMENSION_TEXTURE1D = 1,
+    D3D10_DSV_DIMENSION_TEXTURE1DARRAY = 2,
+    D3D10_DSV_DIMENSION_TEXTURE2D = 3,
+    D3D10_DSV_DIMENSION_TEXTURE2DARRAY = 4,
+    D3D10_DSV_DIMENSION_TEXTURE2DMS = 5,
+    D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY = 6
+} D3D10_DSV_DIMENSION;
+typedef struct D3D10_TEX1D_DSV {
+    UINT MipSlice;
+} D3D10_TEX1D_DSV;
+typedef struct D3D10_TEX1D_ARRAY_DSV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX1D_ARRAY_DSV;
+typedef struct D3D10_TEX2D_DSV {
+    UINT MipSlice;
+} D3D10_TEX2D_DSV;
+typedef struct D3D10_TEX2D_ARRAY_DSV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2D_ARRAY_DSV;
+typedef struct D3D10_TEX2DMS_DSV {
+    UINT UnusedField_NothingToDefine;
+} D3D10_TEX2DMS_DSV;
+typedef struct D3D10_TEX2DMS_ARRAY_DSV {
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2DMS_ARRAY_DSV;
+typedef struct D3D10_DEPTH_STENCIL_VIEW_DESC {
+    DXGI_FORMAT Format;
+    D3D10_DSV_DIMENSION ViewDimension;
+    union {
+        D3D10_TEX1D_DSV Texture1D;
+        D3D10_TEX1D_ARRAY_DSV Texture1DArray;
+        D3D10_TEX2D_DSV Texture2D;
+        D3D10_TEX2D_ARRAY_DSV Texture2DArray;
+        D3D10_TEX2DMS_DSV Texture2DMS;
+        D3D10_TEX2DMS_ARRAY_DSV Texture2DMSArray;
+    } DUMMYUNIONNAME;
+} D3D10_DEPTH_STENCIL_VIEW_DESC;
+typedef enum D3D10_RTV_DIMENSION {
+    D3D10_RTV_DIMENSION_UNKNOWN = 0,
+    D3D10_RTV_DIMENSION_BUFFER = 1,
+    D3D10_RTV_DIMENSION_TEXTURE1D = 2,
+    D3D10_RTV_DIMENSION_TEXTURE1DARRAY = 3,
+    D3D10_RTV_DIMENSION_TEXTURE2D = 4,
+    D3D10_RTV_DIMENSION_TEXTURE2DARRAY = 5,
+    D3D10_RTV_DIMENSION_TEXTURE2DMS = 6,
+    D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY = 7,
+    D3D10_RTV_DIMENSION_TEXTURE3D = 8
+} D3D10_RTV_DIMENSION;
+typedef struct D3D10_BUFFER_RTV {
+    UINT ElementOffset;
+    UINT ElementWidth;
+} D3D10_BUFFER_RTV;
+typedef struct D3D10_TEX1D_RTV {
+    UINT MipSlice;
+} D3D10_TEX1D_RTV;
+typedef struct D3D10_TEX1D_ARRAY_RTV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX1D_ARRAY_RTV;
+typedef struct D3D10_TEX2D_RTV {
+    UINT MipSlice;
+} D3D10_TEX2D_RTV;
+typedef struct D3D10_TEX2D_ARRAY_RTV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2D_ARRAY_RTV;
+typedef struct D3D10_TEX2DMS_RTV {
+    UINT UnusedField_NothingToDefine;
+} D3D10_TEX2DMS_RTV;
+typedef struct D3D10_TEX2DMS_ARRAY_RTV {
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2DMS_ARRAY_RTV;
+typedef struct D3D10_TEX3D_RTV {
+    UINT MipSlice;
+    UINT FirstWSlice;
+    UINT WSize;
+} D3D10_TEX3D_RTV;
+typedef struct D3D10_RENDER_TARGET_VIEW_DESC {
+    DXGI_FORMAT Format;
+    D3D10_RTV_DIMENSION ViewDimension;
+    union {
+        D3D10_BUFFER_RTV Buffer;
+        D3D10_TEX1D_RTV Texture1D;
+        D3D10_TEX1D_ARRAY_RTV Texture1DArray;
+        D3D10_TEX2D_RTV Texture2D;
+        D3D10_TEX2D_ARRAY_RTV Texture2DArray;
+        D3D10_TEX2DMS_RTV Texture2DMS;
+        D3D10_TEX2DMS_ARRAY_RTV Texture2DMSArray;
+        D3D10_TEX3D_RTV Texture3D;
+    } DUMMYUNIONNAME;
+} D3D10_RENDER_TARGET_VIEW_DESC;
+typedef enum D3D10_SRV_DIMENSION {
+    D3D10_SRV_DIMENSION_UNKNOWN = 0,
+    D3D10_SRV_DIMENSION_BUFFER = 1,
+    D3D10_SRV_DIMENSION_TEXTURE1D = 2,
+    D3D10_SRV_DIMENSION_TEXTURE1DARRAY = 3,
+    D3D10_SRV_DIMENSION_TEXTURE2D = 4,
+    D3D10_SRV_DIMENSION_TEXTURE2DARRAY = 5,
+    D3D10_SRV_DIMENSION_TEXTURE2DMS = 6,
+    D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = 7,
+    D3D10_SRV_DIMENSION_TEXTURE3D = 8,
+    D3D10_SRV_DIMENSION_TEXTURECUBE = 9
+} D3D10_SRV_DIMENSION;
+typedef struct D3D10_BUFFER_SRV {
+    UINT ElementOffset;
+    UINT ElementWidth;
+} D3D10_BUFFER_SRV;
+typedef struct D3D10_TEX1D_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEX1D_SRV;
+typedef struct D3D10_TEX1D_ARRAY_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX1D_ARRAY_SRV;
+typedef struct D3D10_TEX2D_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEX2D_SRV;
+typedef struct D3D10_TEX2D_ARRAY_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2D_ARRAY_SRV;
+typedef struct D3D10_TEX2DMS_SRV {
+    UINT UnusedField_NothingToDefine;
+} D3D10_TEX2DMS_SRV;
+typedef struct D3D10_TEX2DMS_ARRAY_SRV {
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2DMS_ARRAY_SRV;
+typedef struct D3D10_TEX3D_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEX3D_SRV;
+typedef struct D3D10_TEXCUBE_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEXCUBE_SRV;
+typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC {
+    DXGI_FORMAT Format;
+    D3D10_SRV_DIMENSION ViewDimension;
+    union {
+        D3D10_BUFFER_SRV Buffer;
+        D3D10_TEX1D_SRV Texture1D;
+        D3D10_TEX1D_ARRAY_SRV Texture1DArray;
+        D3D10_TEX2D_SRV Texture2D;
+        D3D10_TEX2D_ARRAY_SRV Texture2DArray;
+        D3D10_TEX2DMS_SRV Texture2DMS;
+        D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray;
+        D3D10_TEX3D_SRV Texture3D;
+        D3D10_TEXCUBE_SRV TextureCube;
+    } DUMMYUNIONNAME;
+} D3D10_SHADER_RESOURCE_VIEW_DESC;
+typedef struct D3D10_BOX {
+    UINT left;
+    UINT top;
+    UINT front;
+    UINT right;
+    UINT bottom;
+    UINT back;
+} D3D10_BOX;
+typedef struct D3D10_SUBRESOURCE_DATA {
+    const void *pSysMem;
+    UINT SysMemPitch;
+    UINT SysMemSlicePitch;
+} D3D10_SUBRESOURCE_DATA;
+typedef struct D3D10_SO_DECLARATION_ENTRY {
+    LPCSTR SemanticName;
+    UINT SemanticIndex;
+    BYTE StartComponent;
+    BYTE ComponentCount;
+    BYTE OutputSlot;
+} D3D10_SO_DECLARATION_ENTRY;
+typedef enum D3D10_INPUT_CLASSIFICATION {
+    D3D10_INPUT_PER_VERTEX_DATA = 0,
+    D3D10_INPUT_PER_INSTANCE_DATA = 1
+} D3D10_INPUT_CLASSIFICATION;
+typedef struct D3D10_INPUT_ELEMENT_DESC {
+    LPCSTR SemanticName;
+    UINT SemanticIndex;
+    DXGI_FORMAT Format;
+    UINT InputSlot;
+    UINT AlignedByteOffset;
+    D3D10_INPUT_CLASSIFICATION InputSlotClass;
+    UINT InstanceDataStepRate;
+} D3D10_INPUT_ELEMENT_DESC;
+typedef enum D3D10_QUERY {
+    D3D10_QUERY_EVENT = 0,
+    D3D10_QUERY_OCCLUSION = 1,
+    D3D10_QUERY_TIMESTAMP = 2,
+    D3D10_QUERY_TIMESTAMP_DISJOINT = 3,
+    D3D10_QUERY_PIPELINE_STATISTICS = 4,
+    D3D10_QUERY_OCCLUSION_PREDICATE = 5,
+    D3D10_QUERY_SO_STATISTICS = 6,
+    D3D10_QUERY_SO_OVERFLOW_PREDICATE = 7
+} D3D10_QUERY;
+typedef struct D3D10_QUERY_DESC {
+    D3D10_QUERY Query;
+    UINT MiscFlags;
+} D3D10_QUERY_DESC;
+typedef enum D3D10_PRIMITIVE_TOPOLOGY {
+    D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
+    D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
+    D3D10_PRIMITIVE_TOPOLOGY_LINELIST = 2,
+    D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
+    D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
+    D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13
+} D3D10_PRIMITIVE_TOPOLOGY;
+typedef RECT D3D10_RECT;
+typedef struct D3D10_VIEWPORT {
+    INT TopLeftX;
+    INT TopLeftY;
+    UINT Width;
+    UINT Height;
+    FLOAT MinDepth;
+    FLOAT MaxDepth;
+} D3D10_VIEWPORT;
+typedef struct D3D10_MAPPED_TEXTURE2D {
+    void *pData;
+    UINT RowPitch;
+} D3D10_MAPPED_TEXTURE2D;
+typedef struct D3D10_MAPPED_TEXTURE3D {
+    void *pData;
+    UINT RowPitch;
+    UINT DepthPitch;
+} D3D10_MAPPED_TEXTURE3D;
+typedef enum D3D10_BIND_FLAG {
+    D3D10_BIND_VERTEX_BUFFER = 0x1,
+    D3D10_BIND_INDEX_BUFFER = 0x2,
+    D3D10_BIND_CONSTANT_BUFFER = 0x4,
+    D3D10_BIND_SHADER_RESOURCE = 0x8,
+    D3D10_BIND_STREAM_OUTPUT = 0x10,
+    D3D10_BIND_RENDER_TARGET = 0x20,
+    D3D10_BIND_DEPTH_STENCIL = 0x40
+} D3D10_BIND_FLAG;
+typedef enum D3D10_CPU_ACCESS_FLAG {
+    D3D10_CPU_ACCESS_WRITE = 0x10000,
+    D3D10_CPU_ACCESS_READ = 0x20000
+} D3D10_CPU_ACCESS_FLAG;
+typedef enum D3D10_RESOURCE_MISC_FLAG {
+    D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x1,
+    D3D10_RESOURCE_MISC_SHARED = 0x2,
+    D3D10_RESOURCE_MISC_TEXTURECUBE = 0x4
+} D3D10_RESOURCE_MISC_FLAG;
+typedef enum D3D10_MAP_FLAG {
+    D3D10_MAP_FLAG_DO_NOT_WAIT = 0x100000
+} D3D10_MAP_FLAG;
+typedef enum D3D10_CLEAR_FLAG {
+    D3D10_CLEAR_DEPTH = 0x1,
+    D3D10_CLEAR_STENCIL = 0x2
+} D3D10_CLEAR_FLAG;
+typedef enum D3D10_COLOR_WRITE_ENABLE {
+    D3D10_COLOR_WRITE_ENABLE_RED = 0x1,
+    D3D10_COLOR_WRITE_ENABLE_GREEN = 0x2,
+    D3D10_COLOR_WRITE_ENABLE_BLUE = 0x4,
+    D3D10_COLOR_WRITE_ENABLE_ALPHA = 0x8,
+    D3D10_COLOR_WRITE_ENABLE_ALL = ((D3D10_COLOR_WRITE_ENABLE_RED | D3D10_COLOR_WRITE_ENABLE_GREEN) | D3D10_COLOR_WRITE_ENABLE_BLUE) | D3D10_COLOR_WRITE_ENABLE_ALPHA
+} D3D10_COLOR_WRITE_ENABLE;
+typedef enum D3D10_TEXTURECUBE_FACE {
+    D3D10_TEXTURECUBE_FACE_POSITIVE_X = 0,
+    D3D10_TEXTURECUBE_FACE_NEGATIVE_X = 1,
+    D3D10_TEXTURECUBE_FACE_POSITIVE_Y = 2,
+    D3D10_TEXTURECUBE_FACE_NEGATIVE_Y = 3,
+    D3D10_TEXTURECUBE_FACE_POSITIVE_Z = 4,
+    D3D10_TEXTURECUBE_FACE_NEGATIVE_Z = 5
+} D3D10_TEXTURECUBE_FACE;
+typedef enum D3D10_ASYNC_GETDATA_FLAG {
+    D3D10_ASYNC_GETDATA_DONOTFLUSH = 0x1
+} D3D10_ASYNC_GETDATA_FLAG;
+typedef enum D3D10_FILTER_TYPE {
+    D3D10_FILTER_TYPE_POINT = 0,
+    D3D10_FILTER_TYPE_LINEAR = 1
+} D3D10_FILTER_TYPE;
+typedef enum D3D10_QUERY_MISC_FLAG {
+    D3D10_QUERY_MISC_PREDICATEHINT = 0x1
+} D3D10_QUERY_MISC_FLAG;
+typedef struct D3D10_QUERY_DATA_TIMESTAMP_DISJOINT {
+    UINT64 Frequency;
+    BOOL Disjoint;
+} D3D10_QUERY_DATA_TIMESTAMP_DISJOINT;
+typedef struct D3D10_QUERY_DATA_PIPELINE_STATISTICS {
+    UINT64 IAVertices;
+    UINT64 IAPrimitives;
+    UINT64 VSInvocations;
+    UINT64 GSInvocations;
+    UINT64 GSPrimitives;
+    UINT64 CInvocations;
+    UINT64 CPrimitives;
+    UINT64 PSInvocations;
+} D3D10_QUERY_DATA_PIPELINE_STATISTICS;
+typedef struct D3D10_QUERY_DATA_SO_STATISTICS {
+    UINT64 NumPrimitivesWritten;
+    UINT64 PrimitivesStorageNeeded;
+} D3D10_QUERY_DATA_SO_STATISTICS;
+typedef enum D3D10_CREATE_DEVICE_FLAG {
+    D3D10_CREATE_DEVICE_SINGLETHREADED = 0x1,
+    D3D10_CREATE_DEVICE_DEBUG = 0x2,
+    D3D10_CREATE_DEVICE_SWITCH_TO_REF = 0x4,
+    D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8
+} D3D10_CREATE_DEVICE_FLAG;
+#ifndef __ID3D10Device_FWD_DEFINED__
+#define __ID3D10Device_FWD_DEFINED__
+typedef interface ID3D10Device ID3D10Device;
+#endif
+
+/*****************************************************************************
+ * ID3D10DeviceChild interface
+ */
+#ifndef __ID3D10DeviceChild_INTERFACE_DEFINED__
+#define __ID3D10DeviceChild_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10DeviceChild, 0x9b7e4c00, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10DeviceChild : public IUnknown
+{
+    virtual void STDMETHODCALLTYPE GetDevice(
+        ID3D10Device **ppDevice) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
+        REFGUID guid,
+        const IUnknown *pData) = 0;
+
+};
+#else
+typedef struct ID3D10DeviceChildVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10DeviceChild* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10DeviceChild* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10DeviceChild* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10DeviceChild* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10DeviceChild* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10DeviceChild* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10DeviceChild* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    END_INTERFACE
+} ID3D10DeviceChildVtbl;
+interface ID3D10DeviceChild {
+    CONST_VTBL ID3D10DeviceChildVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10DeviceChild_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10DeviceChild_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10DeviceChild_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10DeviceChild_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10DeviceChild_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10DeviceChild_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10DeviceChild_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10DeviceChild_GetDevice_Proxy(
+    ID3D10DeviceChild* This,
+    ID3D10Device **ppDevice);
+void __RPC_STUB ID3D10DeviceChild_GetDevice_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10DeviceChild_GetPrivateData_Proxy(
+    ID3D10DeviceChild* This,
+    REFGUID guid,
+    UINT *pDataSize,
+    void *pData);
+void __RPC_STUB ID3D10DeviceChild_GetPrivateData_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10DeviceChild_SetPrivateData_Proxy(
+    ID3D10DeviceChild* This,
+    REFGUID guid,
+    UINT DataSize,
+    const void *pData);
+void __RPC_STUB ID3D10DeviceChild_SetPrivateData_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10DeviceChild_SetPrivateDataInterface_Proxy(
+    ID3D10DeviceChild* This,
+    REFGUID guid,
+    const IUnknown *pData);
+void __RPC_STUB ID3D10DeviceChild_SetPrivateDataInterface_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10DeviceChild_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Resource interface
+ */
+#ifndef __ID3D10Resource_INTERFACE_DEFINED__
+#define __ID3D10Resource_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Resource, 0x9b7e4c01, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Resource : public ID3D10DeviceChild
+{
+    virtual void STDMETHODCALLTYPE GetType(
+        D3D10_RESOURCE_DIMENSION *rType) = 0;
+
+    virtual void STDMETHODCALLTYPE SetEvictionPriority(
+        UINT EvictionPriority) = 0;
+
+    virtual UINT STDMETHODCALLTYPE GetEvictionPriority(
+        ) = 0;
+
+};
+#else
+typedef struct ID3D10ResourceVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Resource* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Resource* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Resource* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Resource* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Resource* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Resource* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Resource* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Resource methods ***/
+    void (STDMETHODCALLTYPE *GetType)(
+        ID3D10Resource* This,
+        D3D10_RESOURCE_DIMENSION *rType);
+
+    void (STDMETHODCALLTYPE *SetEvictionPriority)(
+        ID3D10Resource* This,
+        UINT EvictionPriority);
+
+    UINT (STDMETHODCALLTYPE *GetEvictionPriority)(
+        ID3D10Resource* This);
+
+    END_INTERFACE
+} ID3D10ResourceVtbl;
+interface ID3D10Resource {
+    CONST_VTBL ID3D10ResourceVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Resource_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Resource_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Resource_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Resource_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Resource_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Resource_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Resource_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Resource methods ***/
+#define ID3D10Resource_GetType(This,rType) (This)->lpVtbl->GetType(This,rType)
+#define ID3D10Resource_SetEvictionPriority(This,EvictionPriority) (This)->lpVtbl->SetEvictionPriority(This,EvictionPriority)
+#define ID3D10Resource_GetEvictionPriority(This) (This)->lpVtbl->GetEvictionPriority(This)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10Resource_GetType_Proxy(
+    ID3D10Resource* This,
+    D3D10_RESOURCE_DIMENSION *rType);
+void __RPC_STUB ID3D10Resource_GetType_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Resource_SetEvictionPriority_Proxy(
+    ID3D10Resource* This,
+    UINT EvictionPriority);
+void __RPC_STUB ID3D10Resource_SetEvictionPriority_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+UINT STDMETHODCALLTYPE ID3D10Resource_GetEvictionPriority_Proxy(
+    ID3D10Resource* This);
+void __RPC_STUB ID3D10Resource_GetEvictionPriority_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Resource_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Buffer interface
+ */
+#ifndef __ID3D10Buffer_INTERFACE_DEFINED__
+#define __ID3D10Buffer_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Buffer, 0x9b7e4c02, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Buffer : public ID3D10Resource
+{
+    virtual HRESULT STDMETHODCALLTYPE Map(
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        void **ppData) = 0;
+
+    virtual void STDMETHODCALLTYPE Unmap(
+        ) = 0;
+
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_BUFFER_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10BufferVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Buffer* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Buffer* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Buffer* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Buffer* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Buffer* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Buffer* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Buffer* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Resource methods ***/
+    void (STDMETHODCALLTYPE *GetType)(
+        ID3D10Buffer* This,
+        D3D10_RESOURCE_DIMENSION *rType);
+
+    void (STDMETHODCALLTYPE *SetEvictionPriority)(
+        ID3D10Buffer* This,
+        UINT EvictionPriority);
+
+    UINT (STDMETHODCALLTYPE *GetEvictionPriority)(
+        ID3D10Buffer* This);
+
+    /*** ID3D10Buffer methods ***/
+    HRESULT (STDMETHODCALLTYPE *Map)(
+        ID3D10Buffer* This,
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        void **ppData);
+
+    void (STDMETHODCALLTYPE *Unmap)(
+        ID3D10Buffer* This);
+
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10Buffer* This,
+        D3D10_BUFFER_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10BufferVtbl;
+interface ID3D10Buffer {
+    CONST_VTBL ID3D10BufferVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Buffer_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Buffer_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Buffer_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Buffer_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Buffer_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Buffer_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Buffer_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Resource methods ***/
+#define ID3D10Buffer_GetType(This,rType) (This)->lpVtbl->GetType(This,rType)
+#define ID3D10Buffer_SetEvictionPriority(This,EvictionPriority) (This)->lpVtbl->SetEvictionPriority(This,EvictionPriority)
+#define ID3D10Buffer_GetEvictionPriority(This) (This)->lpVtbl->GetEvictionPriority(This)
+/*** ID3D10Buffer methods ***/
+#define ID3D10Buffer_Map(This,MapType,MapFlags,ppData) (This)->lpVtbl->Map(This,MapType,MapFlags,ppData)
+#define ID3D10Buffer_Unmap(This) (This)->lpVtbl->Unmap(This)
+#define ID3D10Buffer_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ID3D10Buffer_Map_Proxy(
+    ID3D10Buffer* This,
+    D3D10_MAP MapType,
+    UINT MapFlags,
+    void **ppData);
+void __RPC_STUB ID3D10Buffer_Map_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Buffer_Unmap_Proxy(
+    ID3D10Buffer* This);
+void __RPC_STUB ID3D10Buffer_Unmap_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Buffer_GetDesc_Proxy(
+    ID3D10Buffer* This,
+    D3D10_BUFFER_DESC *pDesc);
+void __RPC_STUB ID3D10Buffer_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Buffer_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Texture1D interface
+ */
+#ifndef __ID3D10Texture1D_INTERFACE_DEFINED__
+#define __ID3D10Texture1D_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Texture1D, 0x9b7e4c03, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Texture1D : public ID3D10Resource
+{
+    virtual HRESULT STDMETHODCALLTYPE Map(
+        UINT Subresource,
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        void **ppData) = 0;
+
+    virtual void STDMETHODCALLTYPE Unmap(
+        UINT Subresource) = 0;
+
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_TEXTURE1D_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10Texture1DVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Texture1D* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Texture1D* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Texture1D* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Texture1D* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Texture1D* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Texture1D* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Texture1D* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Resource methods ***/
+    void (STDMETHODCALLTYPE *GetType)(
+        ID3D10Texture1D* This,
+        D3D10_RESOURCE_DIMENSION *rType);
+
+    void (STDMETHODCALLTYPE *SetEvictionPriority)(
+        ID3D10Texture1D* This,
+        UINT EvictionPriority);
+
+    UINT (STDMETHODCALLTYPE *GetEvictionPriority)(
+        ID3D10Texture1D* This);
+
+    /*** ID3D10Texture1D methods ***/
+    HRESULT (STDMETHODCALLTYPE *Map)(
+        ID3D10Texture1D* This,
+        UINT Subresource,
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        void **ppData);
+
+    void (STDMETHODCALLTYPE *Unmap)(
+        ID3D10Texture1D* This,
+        UINT Subresource);
+
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10Texture1D* This,
+        D3D10_TEXTURE1D_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10Texture1DVtbl;
+interface ID3D10Texture1D {
+    CONST_VTBL ID3D10Texture1DVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Texture1D_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Texture1D_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Texture1D_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Texture1D_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Texture1D_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Texture1D_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Texture1D_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Resource methods ***/
+#define ID3D10Texture1D_GetType(This,rType) (This)->lpVtbl->GetType(This,rType)
+#define ID3D10Texture1D_SetEvictionPriority(This,EvictionPriority) (This)->lpVtbl->SetEvictionPriority(This,EvictionPriority)
+#define ID3D10Texture1D_GetEvictionPriority(This) (This)->lpVtbl->GetEvictionPriority(This)
+/*** ID3D10Texture1D methods ***/
+#define ID3D10Texture1D_Map(This,Subresource,MapType,MapFlags,ppData) (This)->lpVtbl->Map(This,Subresource,MapType,MapFlags,ppData)
+#define ID3D10Texture1D_Unmap(This,Subresource) (This)->lpVtbl->Unmap(This,Subresource)
+#define ID3D10Texture1D_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ID3D10Texture1D_Map_Proxy(
+    ID3D10Texture1D* This,
+    UINT Subresource,
+    D3D10_MAP MapType,
+    UINT MapFlags,
+    void **ppData);
+void __RPC_STUB ID3D10Texture1D_Map_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Texture1D_Unmap_Proxy(
+    ID3D10Texture1D* This,
+    UINT Subresource);
+void __RPC_STUB ID3D10Texture1D_Unmap_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Texture1D_GetDesc_Proxy(
+    ID3D10Texture1D* This,
+    D3D10_TEXTURE1D_DESC *pDesc);
+void __RPC_STUB ID3D10Texture1D_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Texture1D_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Texture2D interface
+ */
+#ifndef __ID3D10Texture2D_INTERFACE_DEFINED__
+#define __ID3D10Texture2D_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Texture2D, 0x9b7e4c04, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Texture2D : public ID3D10Resource
+{
+    virtual HRESULT STDMETHODCALLTYPE Map(
+        UINT Subresource,
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        D3D10_MAPPED_TEXTURE2D *pMappedTex2D) = 0;
+
+    virtual void STDMETHODCALLTYPE Unmap(
+        UINT Subresource) = 0;
+
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_TEXTURE2D_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10Texture2DVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Texture2D* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Texture2D* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Texture2D* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Texture2D* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Texture2D* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Texture2D* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Texture2D* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Resource methods ***/
+    void (STDMETHODCALLTYPE *GetType)(
+        ID3D10Texture2D* This,
+        D3D10_RESOURCE_DIMENSION *rType);
+
+    void (STDMETHODCALLTYPE *SetEvictionPriority)(
+        ID3D10Texture2D* This,
+        UINT EvictionPriority);
+
+    UINT (STDMETHODCALLTYPE *GetEvictionPriority)(
+        ID3D10Texture2D* This);
+
+    /*** ID3D10Texture2D methods ***/
+    HRESULT (STDMETHODCALLTYPE *Map)(
+        ID3D10Texture2D* This,
+        UINT Subresource,
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        D3D10_MAPPED_TEXTURE2D *pMappedTex2D);
+
+    void (STDMETHODCALLTYPE *Unmap)(
+        ID3D10Texture2D* This,
+        UINT Subresource);
+
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10Texture2D* This,
+        D3D10_TEXTURE2D_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10Texture2DVtbl;
+interface ID3D10Texture2D {
+    CONST_VTBL ID3D10Texture2DVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Texture2D_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Texture2D_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Texture2D_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Texture2D_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Texture2D_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Texture2D_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Texture2D_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Resource methods ***/
+#define ID3D10Texture2D_GetType(This,rType) (This)->lpVtbl->GetType(This,rType)
+#define ID3D10Texture2D_SetEvictionPriority(This,EvictionPriority) (This)->lpVtbl->SetEvictionPriority(This,EvictionPriority)
+#define ID3D10Texture2D_GetEvictionPriority(This) (This)->lpVtbl->GetEvictionPriority(This)
+/*** ID3D10Texture2D methods ***/
+#define ID3D10Texture2D_Map(This,Subresource,MapType,MapFlags,pMappedTex2D) (This)->lpVtbl->Map(This,Subresource,MapType,MapFlags,pMappedTex2D)
+#define ID3D10Texture2D_Unmap(This,Subresource) (This)->lpVtbl->Unmap(This,Subresource)
+#define ID3D10Texture2D_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ID3D10Texture2D_Map_Proxy(
+    ID3D10Texture2D* This,
+    UINT Subresource,
+    D3D10_MAP MapType,
+    UINT MapFlags,
+    D3D10_MAPPED_TEXTURE2D *pMappedTex2D);
+void __RPC_STUB ID3D10Texture2D_Map_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Texture2D_Unmap_Proxy(
+    ID3D10Texture2D* This,
+    UINT Subresource);
+void __RPC_STUB ID3D10Texture2D_Unmap_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Texture2D_GetDesc_Proxy(
+    ID3D10Texture2D* This,
+    D3D10_TEXTURE2D_DESC *pDesc);
+void __RPC_STUB ID3D10Texture2D_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Texture2D_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Texture3D interface
+ */
+#ifndef __ID3D10Texture3D_INTERFACE_DEFINED__
+#define __ID3D10Texture3D_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Texture3D, 0x9b7e4c05, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Texture3D : public ID3D10Resource
+{
+    virtual HRESULT STDMETHODCALLTYPE Map(
+        UINT Subresource,
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        D3D10_MAPPED_TEXTURE3D *pMappedTex3D) = 0;
+
+    virtual void STDMETHODCALLTYPE Unmap(
+        UINT Subresource) = 0;
+
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_TEXTURE3D_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10Texture3DVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Texture3D* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Texture3D* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Texture3D* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Texture3D* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Texture3D* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Texture3D* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Texture3D* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Resource methods ***/
+    void (STDMETHODCALLTYPE *GetType)(
+        ID3D10Texture3D* This,
+        D3D10_RESOURCE_DIMENSION *rType);
+
+    void (STDMETHODCALLTYPE *SetEvictionPriority)(
+        ID3D10Texture3D* This,
+        UINT EvictionPriority);
+
+    UINT (STDMETHODCALLTYPE *GetEvictionPriority)(
+        ID3D10Texture3D* This);
+
+    /*** ID3D10Texture3D methods ***/
+    HRESULT (STDMETHODCALLTYPE *Map)(
+        ID3D10Texture3D* This,
+        UINT Subresource,
+        D3D10_MAP MapType,
+        UINT MapFlags,
+        D3D10_MAPPED_TEXTURE3D *pMappedTex3D);
+
+    void (STDMETHODCALLTYPE *Unmap)(
+        ID3D10Texture3D* This,
+        UINT Subresource);
+
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10Texture3D* This,
+        D3D10_TEXTURE3D_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10Texture3DVtbl;
+interface ID3D10Texture3D {
+    CONST_VTBL ID3D10Texture3DVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Texture3D_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Texture3D_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Texture3D_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Texture3D_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Texture3D_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Texture3D_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Texture3D_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Resource methods ***/
+#define ID3D10Texture3D_GetType(This,rType) (This)->lpVtbl->GetType(This,rType)
+#define ID3D10Texture3D_SetEvictionPriority(This,EvictionPriority) (This)->lpVtbl->SetEvictionPriority(This,EvictionPriority)
+#define ID3D10Texture3D_GetEvictionPriority(This) (This)->lpVtbl->GetEvictionPriority(This)
+/*** ID3D10Texture3D methods ***/
+#define ID3D10Texture3D_Map(This,Subresource,MapType,MapFlags,pMappedTex3D) (This)->lpVtbl->Map(This,Subresource,MapType,MapFlags,pMappedTex3D)
+#define ID3D10Texture3D_Unmap(This,Subresource) (This)->lpVtbl->Unmap(This,Subresource)
+#define ID3D10Texture3D_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+HRESULT STDMETHODCALLTYPE ID3D10Texture3D_Map_Proxy(
+    ID3D10Texture3D* This,
+    UINT Subresource,
+    D3D10_MAP MapType,
+    UINT MapFlags,
+    D3D10_MAPPED_TEXTURE3D *pMappedTex3D);
+void __RPC_STUB ID3D10Texture3D_Map_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Texture3D_Unmap_Proxy(
+    ID3D10Texture3D* This,
+    UINT Subresource);
+void __RPC_STUB ID3D10Texture3D_Unmap_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Texture3D_GetDesc_Proxy(
+    ID3D10Texture3D* This,
+    D3D10_TEXTURE3D_DESC *pDesc);
+void __RPC_STUB ID3D10Texture3D_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Texture3D_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10View interface
+ */
+#ifndef __ID3D10View_INTERFACE_DEFINED__
+#define __ID3D10View_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10View, 0xc902b03f, 0x60a7, 0x49ba, 0x99,0x36, 0x2a,0x3a,0xb3,0x7a,0x7e,0x33);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10View : public ID3D10DeviceChild
+{
+    virtual void STDMETHODCALLTYPE GetResource(
+        ID3D10Resource **ppResource) = 0;
+
+};
+#else
+typedef struct ID3D10ViewVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10View* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10View* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10View* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10View* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10View* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10View* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10View* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10View methods ***/
+    void (STDMETHODCALLTYPE *GetResource)(
+        ID3D10View* This,
+        ID3D10Resource **ppResource);
+
+    END_INTERFACE
+} ID3D10ViewVtbl;
+interface ID3D10View {
+    CONST_VTBL ID3D10ViewVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10View_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10View_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10View_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10View_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10View_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10View_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10View_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10View methods ***/
+#define ID3D10View_GetResource(This,ppResource) (This)->lpVtbl->GetResource(This,ppResource)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10View_GetResource_Proxy(
+    ID3D10View* This,
+    ID3D10Resource **ppResource);
+void __RPC_STUB ID3D10View_GetResource_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10View_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10DepthStencilView interface
+ */
+#ifndef __ID3D10DepthStencilView_INTERFACE_DEFINED__
+#define __ID3D10DepthStencilView_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10DepthStencilView, 0x9b7e4c09, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10DepthStencilView : public ID3D10View
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10DepthStencilViewVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10DepthStencilView* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10DepthStencilView* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10DepthStencilView* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10DepthStencilView* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10DepthStencilView* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10DepthStencilView* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10DepthStencilView* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10View methods ***/
+    void (STDMETHODCALLTYPE *GetResource)(
+        ID3D10DepthStencilView* This,
+        ID3D10Resource **ppResource);
+
+    /*** ID3D10DepthStencilView methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10DepthStencilView* This,
+        D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10DepthStencilViewVtbl;
+interface ID3D10DepthStencilView {
+    CONST_VTBL ID3D10DepthStencilViewVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10DepthStencilView_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10DepthStencilView_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10DepthStencilView_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10DepthStencilView_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10DepthStencilView_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10DepthStencilView_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10DepthStencilView_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10View methods ***/
+#define ID3D10DepthStencilView_GetResource(This,ppResource) (This)->lpVtbl->GetResource(This,ppResource)
+/*** ID3D10DepthStencilView methods ***/
+#define ID3D10DepthStencilView_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10DepthStencilView_GetDesc_Proxy(
+    ID3D10DepthStencilView* This,
+    D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc);
+void __RPC_STUB ID3D10DepthStencilView_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10DepthStencilView_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10RenderTargetView interface
+ */
+#ifndef __ID3D10RenderTargetView_INTERFACE_DEFINED__
+#define __ID3D10RenderTargetView_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10RenderTargetView, 0x9b7e4c08, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10RenderTargetView : public ID3D10View
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_RENDER_TARGET_VIEW_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10RenderTargetViewVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10RenderTargetView* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10RenderTargetView* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10RenderTargetView* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10RenderTargetView* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10RenderTargetView* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10RenderTargetView* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10RenderTargetView* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10View methods ***/
+    void (STDMETHODCALLTYPE *GetResource)(
+        ID3D10RenderTargetView* This,
+        ID3D10Resource **ppResource);
+
+    /*** ID3D10RenderTargetView methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10RenderTargetView* This,
+        D3D10_RENDER_TARGET_VIEW_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10RenderTargetViewVtbl;
+interface ID3D10RenderTargetView {
+    CONST_VTBL ID3D10RenderTargetViewVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10RenderTargetView_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10RenderTargetView_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10RenderTargetView_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10RenderTargetView_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10RenderTargetView_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10RenderTargetView_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10RenderTargetView_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10View methods ***/
+#define ID3D10RenderTargetView_GetResource(This,ppResource) (This)->lpVtbl->GetResource(This,ppResource)
+/*** ID3D10RenderTargetView methods ***/
+#define ID3D10RenderTargetView_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10RenderTargetView_GetDesc_Proxy(
+    ID3D10RenderTargetView* This,
+    D3D10_RENDER_TARGET_VIEW_DESC *pDesc);
+void __RPC_STUB ID3D10RenderTargetView_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10RenderTargetView_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10ShaderResourceView interface
+ */
+#ifndef __ID3D10ShaderResourceView_INTERFACE_DEFINED__
+#define __ID3D10ShaderResourceView_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10ShaderResourceView, 0x9b7e4c07, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10ShaderResourceView : public ID3D10View
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10ShaderResourceViewVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10ShaderResourceView* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10ShaderResourceView* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10ShaderResourceView* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10ShaderResourceView* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10ShaderResourceView* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10ShaderResourceView* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10ShaderResourceView* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10View methods ***/
+    void (STDMETHODCALLTYPE *GetResource)(
+        ID3D10ShaderResourceView* This,
+        ID3D10Resource **ppResource);
+
+    /*** ID3D10ShaderResourceView methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10ShaderResourceView* This,
+        D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10ShaderResourceViewVtbl;
+interface ID3D10ShaderResourceView {
+    CONST_VTBL ID3D10ShaderResourceViewVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10ShaderResourceView_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10ShaderResourceView_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10ShaderResourceView_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10ShaderResourceView_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10ShaderResourceView_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10ShaderResourceView_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10ShaderResourceView_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10View methods ***/
+#define ID3D10ShaderResourceView_GetResource(This,ppResource) (This)->lpVtbl->GetResource(This,ppResource)
+/*** ID3D10ShaderResourceView methods ***/
+#define ID3D10ShaderResourceView_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10ShaderResourceView_GetDesc_Proxy(
+    ID3D10ShaderResourceView* This,
+    D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc);
+void __RPC_STUB ID3D10ShaderResourceView_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10ShaderResourceView_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10BlendState interface
+ */
+#ifndef __ID3D10BlendState_INTERFACE_DEFINED__
+#define __ID3D10BlendState_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10BlendState, 0xedad8d19, 0x8a35, 0x4d6d, 0x85,0x66, 0x2e,0xa2,0x76,0xcd,0xe1,0x61);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10BlendState : public ID3D10DeviceChild
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_BLEND_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10BlendStateVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10BlendState* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10BlendState* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10BlendState* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10BlendState* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10BlendState* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10BlendState* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10BlendState* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10BlendState methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10BlendState* This,
+        D3D10_BLEND_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10BlendStateVtbl;
+interface ID3D10BlendState {
+    CONST_VTBL ID3D10BlendStateVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10BlendState_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10BlendState_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10BlendState_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10BlendState_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10BlendState_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10BlendState_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10BlendState_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10BlendState methods ***/
+#define ID3D10BlendState_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10BlendState_GetDesc_Proxy(
+    ID3D10BlendState* This,
+    D3D10_BLEND_DESC *pDesc);
+void __RPC_STUB ID3D10BlendState_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10BlendState_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10DepthStencilState interface
+ */
+#ifndef __ID3D10DepthStencilState_INTERFACE_DEFINED__
+#define __ID3D10DepthStencilState_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10DepthStencilState, 0x2b4b1cc8, 0xa4ad, 0x41f8, 0x83,0x22, 0xca,0x86,0xfc,0x3e,0xc6,0x75);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10DepthStencilState : public ID3D10DeviceChild
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_DEPTH_STENCIL_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10DepthStencilStateVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10DepthStencilState* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10DepthStencilState* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10DepthStencilState* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10DepthStencilState* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10DepthStencilState* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10DepthStencilState* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10DepthStencilState* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10DepthStencilState methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10DepthStencilState* This,
+        D3D10_DEPTH_STENCIL_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10DepthStencilStateVtbl;
+interface ID3D10DepthStencilState {
+    CONST_VTBL ID3D10DepthStencilStateVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10DepthStencilState_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10DepthStencilState_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10DepthStencilState_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10DepthStencilState_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10DepthStencilState_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10DepthStencilState_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10DepthStencilState_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10DepthStencilState methods ***/
+#define ID3D10DepthStencilState_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10DepthStencilState_GetDesc_Proxy(
+    ID3D10DepthStencilState* This,
+    D3D10_DEPTH_STENCIL_DESC *pDesc);
+void __RPC_STUB ID3D10DepthStencilState_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10DepthStencilState_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10GeometryShader interface
+ */
+#ifndef __ID3D10GeometryShader_INTERFACE_DEFINED__
+#define __ID3D10GeometryShader_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10GeometryShader, 0x6316be88, 0x54cd, 0x4040, 0xab,0x44, 0x20,0x46,0x1b,0xc8,0x1f,0x68);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10GeometryShader : public ID3D10DeviceChild
+{
+};
+#else
+typedef struct ID3D10GeometryShaderVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10GeometryShader* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10GeometryShader* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10GeometryShader* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10GeometryShader* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10GeometryShader* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10GeometryShader* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10GeometryShader* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    END_INTERFACE
+} ID3D10GeometryShaderVtbl;
+interface ID3D10GeometryShader {
+    CONST_VTBL ID3D10GeometryShaderVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10GeometryShader_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10GeometryShader_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10GeometryShader_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10GeometryShader_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10GeometryShader_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10GeometryShader_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10GeometryShader_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+#endif
+
+#endif
+
+
+#endif  /* __ID3D10GeometryShader_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10InputLayout interface
+ */
+#ifndef __ID3D10InputLayout_INTERFACE_DEFINED__
+#define __ID3D10InputLayout_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10InputLayout, 0x9b7e4c0b, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10InputLayout : public ID3D10DeviceChild
+{
+};
+#else
+typedef struct ID3D10InputLayoutVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10InputLayout* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10InputLayout* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10InputLayout* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10InputLayout* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10InputLayout* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10InputLayout* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10InputLayout* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    END_INTERFACE
+} ID3D10InputLayoutVtbl;
+interface ID3D10InputLayout {
+    CONST_VTBL ID3D10InputLayoutVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10InputLayout_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10InputLayout_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10InputLayout_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10InputLayout_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10InputLayout_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10InputLayout_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10InputLayout_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+#endif
+
+#endif
+
+
+#endif  /* __ID3D10InputLayout_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10PixelShader interface
+ */
+#ifndef __ID3D10PixelShader_INTERFACE_DEFINED__
+#define __ID3D10PixelShader_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10PixelShader, 0x4968b601, 0x9d00, 0x4cde, 0x83,0x46, 0x8e,0x7f,0x67,0x58,0x19,0xb6);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10PixelShader : public ID3D10DeviceChild
+{
+};
+#else
+typedef struct ID3D10PixelShaderVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10PixelShader* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10PixelShader* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10PixelShader* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10PixelShader* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10PixelShader* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10PixelShader* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10PixelShader* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    END_INTERFACE
+} ID3D10PixelShaderVtbl;
+interface ID3D10PixelShader {
+    CONST_VTBL ID3D10PixelShaderVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10PixelShader_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10PixelShader_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10PixelShader_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10PixelShader_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10PixelShader_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10PixelShader_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10PixelShader_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+#endif
+
+#endif
+
+
+#endif  /* __ID3D10PixelShader_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10RasterizerState interface
+ */
+#ifndef __ID3D10RasterizerState_INTERFACE_DEFINED__
+#define __ID3D10RasterizerState_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10RasterizerState, 0xa2a07292, 0x89af, 0x4345, 0xbe,0x2e, 0xc5,0x3d,0x9f,0xbb,0x6e,0x9f);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10RasterizerState : public ID3D10DeviceChild
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_RASTERIZER_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10RasterizerStateVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10RasterizerState* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10RasterizerState* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10RasterizerState* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10RasterizerState* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10RasterizerState* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10RasterizerState* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10RasterizerState* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10RasterizerState methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10RasterizerState* This,
+        D3D10_RASTERIZER_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10RasterizerStateVtbl;
+interface ID3D10RasterizerState {
+    CONST_VTBL ID3D10RasterizerStateVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10RasterizerState_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10RasterizerState_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10RasterizerState_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10RasterizerState_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10RasterizerState_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10RasterizerState_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10RasterizerState_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10RasterizerState methods ***/
+#define ID3D10RasterizerState_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10RasterizerState_GetDesc_Proxy(
+    ID3D10RasterizerState* This,
+    D3D10_RASTERIZER_DESC *pDesc);
+void __RPC_STUB ID3D10RasterizerState_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10RasterizerState_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10SamplerState interface
+ */
+#ifndef __ID3D10SamplerState_INTERFACE_DEFINED__
+#define __ID3D10SamplerState_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10SamplerState, 0x9b7e4c0c, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10SamplerState : public ID3D10DeviceChild
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_SAMPLER_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10SamplerStateVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10SamplerState* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10SamplerState* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10SamplerState* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10SamplerState* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10SamplerState* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10SamplerState* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10SamplerState* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10SamplerState methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10SamplerState* This,
+        D3D10_SAMPLER_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10SamplerStateVtbl;
+interface ID3D10SamplerState {
+    CONST_VTBL ID3D10SamplerStateVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10SamplerState_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10SamplerState_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10SamplerState_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10SamplerState_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10SamplerState_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10SamplerState_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10SamplerState_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10SamplerState methods ***/
+#define ID3D10SamplerState_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10SamplerState_GetDesc_Proxy(
+    ID3D10SamplerState* This,
+    D3D10_SAMPLER_DESC *pDesc);
+void __RPC_STUB ID3D10SamplerState_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10SamplerState_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10VertexShader interface
+ */
+#ifndef __ID3D10VertexShader_INTERFACE_DEFINED__
+#define __ID3D10VertexShader_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10VertexShader, 0x9b7e4c0a, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10VertexShader : public ID3D10DeviceChild
+{
+};
+#else
+typedef struct ID3D10VertexShaderVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10VertexShader* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10VertexShader* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10VertexShader* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10VertexShader* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10VertexShader* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10VertexShader* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10VertexShader* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    END_INTERFACE
+} ID3D10VertexShaderVtbl;
+interface ID3D10VertexShader {
+    CONST_VTBL ID3D10VertexShaderVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10VertexShader_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10VertexShader_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10VertexShader_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10VertexShader_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10VertexShader_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10VertexShader_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10VertexShader_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+#endif
+
+#endif
+
+
+#endif  /* __ID3D10VertexShader_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Asynchronous interface
+ */
+#ifndef __ID3D10Asynchronous_INTERFACE_DEFINED__
+#define __ID3D10Asynchronous_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Asynchronous, 0x9b7e4c0d, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Asynchronous : public ID3D10DeviceChild
+{
+    virtual void STDMETHODCALLTYPE Begin(
+        ) = 0;
+
+    virtual void STDMETHODCALLTYPE End(
+        ) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetData(
+        void *pData,
+        UINT DataSize,
+        UINT GetDataFlags) = 0;
+
+    virtual UINT STDMETHODCALLTYPE GetDataSize(
+        ) = 0;
+
+};
+#else
+typedef struct ID3D10AsynchronousVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Asynchronous* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Asynchronous* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Asynchronous* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Asynchronous* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Asynchronous* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Asynchronous* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Asynchronous* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Asynchronous methods ***/
+    void (STDMETHODCALLTYPE *Begin)(
+        ID3D10Asynchronous* This);
+
+    void (STDMETHODCALLTYPE *End)(
+        ID3D10Asynchronous* This);
+
+    HRESULT (STDMETHODCALLTYPE *GetData)(
+        ID3D10Asynchronous* This,
+        void *pData,
+        UINT DataSize,
+        UINT GetDataFlags);
+
+    UINT (STDMETHODCALLTYPE *GetDataSize)(
+        ID3D10Asynchronous* This);
+
+    END_INTERFACE
+} ID3D10AsynchronousVtbl;
+interface ID3D10Asynchronous {
+    CONST_VTBL ID3D10AsynchronousVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Asynchronous_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Asynchronous_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Asynchronous_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Asynchronous_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Asynchronous_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Asynchronous_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Asynchronous_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Asynchronous methods ***/
+#define ID3D10Asynchronous_Begin(This) (This)->lpVtbl->Begin(This)
+#define ID3D10Asynchronous_End(This) (This)->lpVtbl->End(This)
+#define ID3D10Asynchronous_GetData(This,pData,DataSize,GetDataFlags) (This)->lpVtbl->GetData(This,pData,DataSize,GetDataFlags)
+#define ID3D10Asynchronous_GetDataSize(This) (This)->lpVtbl->GetDataSize(This)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10Asynchronous_Begin_Proxy(
+    ID3D10Asynchronous* This);
+void __RPC_STUB ID3D10Asynchronous_Begin_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Asynchronous_End_Proxy(
+    ID3D10Asynchronous* This);
+void __RPC_STUB ID3D10Asynchronous_End_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Asynchronous_GetData_Proxy(
+    ID3D10Asynchronous* This,
+    void *pData,
+    UINT DataSize,
+    UINT GetDataFlags);
+void __RPC_STUB ID3D10Asynchronous_GetData_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+UINT STDMETHODCALLTYPE ID3D10Asynchronous_GetDataSize_Proxy(
+    ID3D10Asynchronous* This);
+void __RPC_STUB ID3D10Asynchronous_GetDataSize_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Asynchronous_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Counter interface
+ */
+#ifndef __ID3D10Counter_INTERFACE_DEFINED__
+#define __ID3D10Counter_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Counter, 0x9b7e4c11, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Counter : public ID3D10Asynchronous
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_COUNTER_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10CounterVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Counter* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Counter* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Counter* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Counter* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Counter* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Counter* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Counter* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Asynchronous methods ***/
+    void (STDMETHODCALLTYPE *Begin)(
+        ID3D10Counter* This);
+
+    void (STDMETHODCALLTYPE *End)(
+        ID3D10Counter* This);
+
+    HRESULT (STDMETHODCALLTYPE *GetData)(
+        ID3D10Counter* This,
+        void *pData,
+        UINT DataSize,
+        UINT GetDataFlags);
+
+    UINT (STDMETHODCALLTYPE *GetDataSize)(
+        ID3D10Counter* This);
+
+    /*** ID3D10Counter methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10Counter* This,
+        D3D10_COUNTER_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10CounterVtbl;
+interface ID3D10Counter {
+    CONST_VTBL ID3D10CounterVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Counter_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Counter_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Counter_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Counter_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Counter_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Counter_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Counter_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Asynchronous methods ***/
+#define ID3D10Counter_Begin(This) (This)->lpVtbl->Begin(This)
+#define ID3D10Counter_End(This) (This)->lpVtbl->End(This)
+#define ID3D10Counter_GetData(This,pData,DataSize,GetDataFlags) (This)->lpVtbl->GetData(This,pData,DataSize,GetDataFlags)
+#define ID3D10Counter_GetDataSize(This) (This)->lpVtbl->GetDataSize(This)
+/*** ID3D10Counter methods ***/
+#define ID3D10Counter_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10Counter_GetDesc_Proxy(
+    ID3D10Counter* This,
+    D3D10_COUNTER_DESC *pDesc);
+void __RPC_STUB ID3D10Counter_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Counter_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Query interface
+ */
+#ifndef __ID3D10Query_INTERFACE_DEFINED__
+#define __ID3D10Query_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Query, 0x9b7e4c0e, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Query : public ID3D10Asynchronous
+{
+    virtual void STDMETHODCALLTYPE GetDesc(
+        D3D10_QUERY_DESC *pDesc) = 0;
+
+};
+#else
+typedef struct ID3D10QueryVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Query* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Query* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Query* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Query* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Query* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Query* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Query* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Asynchronous methods ***/
+    void (STDMETHODCALLTYPE *Begin)(
+        ID3D10Query* This);
+
+    void (STDMETHODCALLTYPE *End)(
+        ID3D10Query* This);
+
+    HRESULT (STDMETHODCALLTYPE *GetData)(
+        ID3D10Query* This,
+        void *pData,
+        UINT DataSize,
+        UINT GetDataFlags);
+
+    UINT (STDMETHODCALLTYPE *GetDataSize)(
+        ID3D10Query* This);
+
+    /*** ID3D10Query methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10Query* This,
+        D3D10_QUERY_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10QueryVtbl;
+interface ID3D10Query {
+    CONST_VTBL ID3D10QueryVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Query_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Query_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Query_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Query_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Query_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Query_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Query_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Asynchronous methods ***/
+#define ID3D10Query_Begin(This) (This)->lpVtbl->Begin(This)
+#define ID3D10Query_End(This) (This)->lpVtbl->End(This)
+#define ID3D10Query_GetData(This,pData,DataSize,GetDataFlags) (This)->lpVtbl->GetData(This,pData,DataSize,GetDataFlags)
+#define ID3D10Query_GetDataSize(This) (This)->lpVtbl->GetDataSize(This)
+/*** ID3D10Query methods ***/
+#define ID3D10Query_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10Query_GetDesc_Proxy(
+    ID3D10Query* This,
+    D3D10_QUERY_DESC *pDesc);
+void __RPC_STUB ID3D10Query_GetDesc_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Query_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Predicate interface
+ */
+#ifndef __ID3D10Predicate_INTERFACE_DEFINED__
+#define __ID3D10Predicate_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Predicate, 0x9b7e4c10, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Predicate : public ID3D10Query
+{
+};
+#else
+typedef struct ID3D10PredicateVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Predicate* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Predicate* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Predicate* This);
+
+    /*** ID3D10DeviceChild methods ***/
+    void (STDMETHODCALLTYPE *GetDevice)(
+        ID3D10Predicate* This,
+        ID3D10Device **ppDevice);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Predicate* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Predicate* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Predicate* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    /*** ID3D10Asynchronous methods ***/
+    void (STDMETHODCALLTYPE *Begin)(
+        ID3D10Predicate* This);
+
+    void (STDMETHODCALLTYPE *End)(
+        ID3D10Predicate* This);
+
+    HRESULT (STDMETHODCALLTYPE *GetData)(
+        ID3D10Predicate* This,
+        void *pData,
+        UINT DataSize,
+        UINT GetDataFlags);
+
+    UINT (STDMETHODCALLTYPE *GetDataSize)(
+        ID3D10Predicate* This);
+
+    /*** ID3D10Query methods ***/
+    void (STDMETHODCALLTYPE *GetDesc)(
+        ID3D10Predicate* This,
+        D3D10_QUERY_DESC *pDesc);
+
+    END_INTERFACE
+} ID3D10PredicateVtbl;
+interface ID3D10Predicate {
+    CONST_VTBL ID3D10PredicateVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Predicate_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Predicate_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Predicate_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10DeviceChild methods ***/
+#define ID3D10Predicate_GetDevice(This,ppDevice) (This)->lpVtbl->GetDevice(This,ppDevice)
+#define ID3D10Predicate_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Predicate_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Predicate_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+/*** ID3D10Asynchronous methods ***/
+#define ID3D10Predicate_Begin(This) (This)->lpVtbl->Begin(This)
+#define ID3D10Predicate_End(This) (This)->lpVtbl->End(This)
+#define ID3D10Predicate_GetData(This,pData,DataSize,GetDataFlags) (This)->lpVtbl->GetData(This,pData,DataSize,GetDataFlags)
+#define ID3D10Predicate_GetDataSize(This) (This)->lpVtbl->GetDataSize(This)
+/*** ID3D10Query methods ***/
+#define ID3D10Predicate_GetDesc(This,pDesc) (This)->lpVtbl->GetDesc(This,pDesc)
+#endif
+
+#endif
+
+
+#endif  /* __ID3D10Predicate_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Device interface
+ */
+#ifndef __ID3D10Device_INTERFACE_DEFINED__
+#define __ID3D10Device_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Device, 0x9b7e4c0f, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Device : public IUnknown
+{
+    virtual void STDMETHODCALLTYPE VSSetConstantBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppConstantBuffers) = 0;
+
+    virtual void STDMETHODCALLTYPE PSSetShaderResources(
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
+
+    virtual void STDMETHODCALLTYPE PSSetShader(
+        ID3D10PixelShader *pPixelShader) = 0;
+
+    virtual void STDMETHODCALLTYPE PSSetSamplers(
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState *const *ppSamplers) = 0;
+
+    virtual void STDMETHODCALLTYPE VSSetShader(
+        ID3D10VertexShader *pVertexShader) = 0;
+
+    virtual void STDMETHODCALLTYPE DrawIndexed(
+        UINT IndexCount,
+        UINT StartIndexLocation,
+        INT BaseVertexLocation) = 0;
+
+    virtual void STDMETHODCALLTYPE Draw(
+        UINT VertexCount,
+        UINT StartVertexLocation) = 0;
+
+    virtual void STDMETHODCALLTYPE PSSetConstantBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppConstantBuffers) = 0;
+
+    virtual void STDMETHODCALLTYPE IASetInputLayout(
+        ID3D10InputLayout *pInputLayout) = 0;
+
+    virtual void STDMETHODCALLTYPE IASetVertexBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppVertexBuffers,
+        const UINT *pStrides,
+        const UINT *pOffsets) = 0;
+
+    virtual void STDMETHODCALLTYPE IASetIndexBuffer(
+        ID3D10Buffer *pIndexBuffer,
+        DXGI_FORMAT Format,
+        UINT Offset) = 0;
+
+    virtual void STDMETHODCALLTYPE DrawIndexedInstanced(
+        UINT IndexCountPerInstance,
+        UINT InstanceCount,
+        UINT StartIndexLocation,
+        INT BaseVertexLocation,
+        UINT StartInstanceLocation) = 0;
+
+    virtual void STDMETHODCALLTYPE DrawInstanced(
+        UINT VertexCountPerInstance,
+        UINT InstanceCount,
+        UINT StartVertexLocation,
+        UINT StartInstanceLocation) = 0;
+
+    virtual void STDMETHODCALLTYPE GSSetConstantBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppConstantBuffers) = 0;
+
+    virtual void STDMETHODCALLTYPE GSSetShader(
+        ID3D10GeometryShader *pShader) = 0;
+
+    virtual void STDMETHODCALLTYPE IASetPrimitiveTopology(
+        D3D10_PRIMITIVE_TOPOLOGY Topology) = 0;
+
+    virtual void STDMETHODCALLTYPE VSSetShaderResources(
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
+
+    virtual void STDMETHODCALLTYPE VSSetSamplers(
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState *const *ppSamplers) = 0;
+
+    virtual void STDMETHODCALLTYPE SetPredication(
+        ID3D10Predicate *pPredicate,
+        BOOL PredicateValue) = 0;
+
+    virtual void STDMETHODCALLTYPE GSSetShaderResources(
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView *const *ppShaderResourceViews) = 0;
+
+    virtual void STDMETHODCALLTYPE GSSetSamplers(
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState *const *ppSamplers) = 0;
+
+    virtual void STDMETHODCALLTYPE OMSetRenderTargets(
+        UINT NumViews,
+        ID3D10RenderTargetView *const *ppRenderTargetViews,
+        ID3D10DepthStencilView *pDepthStencilView) = 0;
+
+    virtual void STDMETHODCALLTYPE OMSetBlendState(
+        ID3D10BlendState *pBlendState,
+        const FLOAT BlendFactor[4],
+        UINT SampleMask) = 0;
+
+    virtual void STDMETHODCALLTYPE OMSetDepthStencilState(
+        ID3D10DepthStencilState *pDepthStencilState,
+        UINT StencilRef) = 0;
+
+    virtual void STDMETHODCALLTYPE SOSetTargets(
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppSOTargets,
+        const UINT *pOffsets) = 0;
+
+    virtual void STDMETHODCALLTYPE DrawAuto(
+        ) = 0;
+
+    virtual void STDMETHODCALLTYPE RSSetState(
+        ID3D10RasterizerState *pRasterizerState) = 0;
+
+    virtual void STDMETHODCALLTYPE RSSetViewports(
+        UINT NumViewports,
+        const D3D10_VIEWPORT *pViewports) = 0;
+
+    virtual void STDMETHODCALLTYPE RSSetScissorRects(
+        UINT NumRects,
+        const D3D10_RECT *pRects) = 0;
+
+    virtual void STDMETHODCALLTYPE CopySubresourceRegion(
+        ID3D10Resource *pDstResource,
+        UINT DstSubresource,
+        UINT DstX,
+        UINT DstY,
+        UINT DstZ,
+        ID3D10Resource *pSrcResource,
+        UINT SrcSubresource,
+        const D3D10_BOX *pSrcBox) = 0;
+
+    virtual void STDMETHODCALLTYPE CopyResource(
+        ID3D10Resource *pDstResource,
+        ID3D10Resource *pSrcResource) = 0;
+
+    virtual void STDMETHODCALLTYPE UpdateSubresource(
+        ID3D10Resource *pDstResource,
+        UINT DstSubresource,
+        const D3D10_BOX *pDstBox,
+        const void *pSrcData,
+        UINT SrcRowPitch,
+        UINT SrcDepthPitch) = 0;
+
+    virtual void STDMETHODCALLTYPE ClearRenderTargetView(
+        ID3D10RenderTargetView *pRenderTargetView,
+        const FLOAT ColorRGBA[4]) = 0;
+
+    virtual void STDMETHODCALLTYPE ClearDepthStencilView(
+        ID3D10DepthStencilView *pDepthStencilView,
+        UINT ClearFlags,
+        FLOAT Depth,
+        UINT8 Stencil) = 0;
+
+    virtual void STDMETHODCALLTYPE GenerateMips(
+        ID3D10ShaderResourceView *pShaderResourceView) = 0;
+
+    virtual void STDMETHODCALLTYPE ResolveSubresource(
+        ID3D10Resource *pDstResource,
+        UINT DstSubresource,
+        ID3D10Resource *pSrcResource,
+        UINT SrcSubresource,
+        DXGI_FORMAT Format) = 0;
+
+    virtual void STDMETHODCALLTYPE VSGetConstantBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppConstantBuffers) = 0;
+
+    virtual void STDMETHODCALLTYPE PSGetShaderResources(
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
+
+    virtual void STDMETHODCALLTYPE PSGetShader(
+        ID3D10PixelShader **ppPixelShader) = 0;
+
+    virtual void STDMETHODCALLTYPE PSGetSamplers(
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState **ppSamplers) = 0;
+
+    virtual void STDMETHODCALLTYPE VSGetShader(
+        ID3D10VertexShader **ppVertexShader) = 0;
+
+    virtual void STDMETHODCALLTYPE PSGetConstantBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppConstantBuffers) = 0;
+
+    virtual void STDMETHODCALLTYPE IAGetInputLayout(
+        ID3D10InputLayout **ppInputLayout) = 0;
+
+    virtual void STDMETHODCALLTYPE IAGetVertexBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppVertexBuffers,
+        UINT *pStrides,
+        UINT *pOffsets) = 0;
+
+    virtual void STDMETHODCALLTYPE IAGetIndexBuffer(
+        ID3D10Buffer **pIndexBuffer,
+        DXGI_FORMAT *Format,
+        UINT *Offset) = 0;
+
+    virtual void STDMETHODCALLTYPE GSGetConstantBuffers(
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppConstantBuffers) = 0;
+
+    virtual void STDMETHODCALLTYPE GSGetShader(
+        ID3D10GeometryShader **ppGeometryShader) = 0;
+
+    virtual void STDMETHODCALLTYPE IAGetPrimitiveTopology(
+        D3D10_PRIMITIVE_TOPOLOGY *pTopology) = 0;
+
+    virtual void STDMETHODCALLTYPE VSGetShaderResources(
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
+
+    virtual void STDMETHODCALLTYPE VSGetSamplers(
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState **ppSamplers) = 0;
+
+    virtual void STDMETHODCALLTYPE GetPredication(
+        ID3D10Predicate **ppPredicate,
+        BOOL *pPredicateValue) = 0;
+
+    virtual void STDMETHODCALLTYPE GSGetShaderResources(
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView **ppShaderResourceViews) = 0;
+
+    virtual void STDMETHODCALLTYPE GSGetSamplers(
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState **ppSamplers) = 0;
+
+    virtual void STDMETHODCALLTYPE OMGetRenderTargets(
+        UINT NumViews,
+        ID3D10RenderTargetView **ppRenderTargetViews,
+        ID3D10DepthStencilView **ppDepthStencilView) = 0;
+
+    virtual void STDMETHODCALLTYPE OMGetBlendState(
+        ID3D10BlendState **ppBlendState,
+        FLOAT BlendFactor[4],
+        UINT *pSampleMask) = 0;
+
+    virtual void STDMETHODCALLTYPE OMGetDepthStencilState(
+        ID3D10DepthStencilState **ppDepthStencilState,
+        UINT *pStencilRef) = 0;
+
+    virtual void STDMETHODCALLTYPE SOGetTargets(
+        UINT NumBuffers,
+        ID3D10Buffer **ppSOTargets,
+        UINT *pOffsets) = 0;
+
+    virtual void STDMETHODCALLTYPE RSGetState(
+        ID3D10RasterizerState **ppRasterizerState) = 0;
+
+    virtual void STDMETHODCALLTYPE RSGetViewports(
+        UINT *NumViewports,
+        D3D10_VIEWPORT *pViewports) = 0;
+
+    virtual void STDMETHODCALLTYPE RSGetScissorRects(
+        UINT *NumRects,
+        D3D10_RECT *pRects) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason(
+        ) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE SetExceptionMode(
+        UINT RaiseFlags) = 0;
+
+    virtual UINT STDMETHODCALLTYPE GetExceptionMode(
+        ) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetPrivateData(
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE SetPrivateData(
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface(
+        REFGUID guid,
+        const IUnknown *pData) = 0;
+
+    virtual void STDMETHODCALLTYPE ClearState(
+        ) = 0;
+
+    virtual void STDMETHODCALLTYPE Flush(
+        ) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateBuffer(
+        const D3D10_BUFFER_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Buffer **ppBuffer) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateTexture1D(
+        const D3D10_TEXTURE1D_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Texture1D **ppTexture1D) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateTexture2D(
+        const D3D10_TEXTURE2D_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Texture2D **ppTexture2D) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateTexture3D(
+        const D3D10_TEXTURE3D_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Texture3D **ppTexture3D) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateShaderResourceView(
+        ID3D10Resource *pResource,
+        const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
+        ID3D10ShaderResourceView **ppSRView) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateRenderTargetView(
+        ID3D10Resource *pResource,
+        const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
+        ID3D10RenderTargetView **ppRTView) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilView(
+        ID3D10Resource *pResource,
+        const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
+        ID3D10DepthStencilView **ppDepthStencilView) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateInputLayout(
+        const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
+        UINT NumElements,
+        const void *pShaderBytecodeWithInputSignature,
+        SIZE_T BytecodeLength,
+        ID3D10InputLayout **ppInputLayout) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateVertexShader(
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        ID3D10VertexShader **ppVertexShader) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateGeometryShader(
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        ID3D10GeometryShader **ppGeometryShader) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateGeometryShaderWithStreamOutput(
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
+        UINT NumEntries,
+        UINT OutputStreamStride,
+        ID3D10GeometryShader **ppGeometryShader) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreatePixelShader(
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        ID3D10PixelShader **ppPixelShader) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateBlendState(
+        const D3D10_BLEND_DESC *pBlendStateDesc,
+        ID3D10BlendState **ppBlendState) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateDepthStencilState(
+        const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+        ID3D10DepthStencilState **ppDepthStencilState) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateRasterizerState(
+        const D3D10_RASTERIZER_DESC *pRasterizerDesc,
+        ID3D10RasterizerState **ppRasterizerState) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateSamplerState(
+        const D3D10_SAMPLER_DESC *pSamplerDesc,
+        ID3D10SamplerState **ppSamplerState) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateQuery(
+        const D3D10_QUERY_DESC *pQueryDesc,
+        ID3D10Query **ppQuery) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreatePredicate(
+        const D3D10_QUERY_DESC *pPredicateDesc,
+        ID3D10Predicate **ppPredicate) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CreateCounter(
+        const D3D10_COUNTER_DESC *pCounterDesc,
+        ID3D10Counter **ppCounter) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CheckFormatSupport(
+        DXGI_FORMAT Format,
+        UINT *pFormatSupport) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CheckMultisampleQualityLevels(
+        DXGI_FORMAT Format,
+        UINT SampleCount,
+        UINT *pNumQualityLevels) = 0;
+
+    virtual void STDMETHODCALLTYPE CheckCounterInfo(
+        D3D10_COUNTER_INFO *pCounterInfo) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE CheckCounter(
+        const D3D10_COUNTER_DESC *pDesc,
+        D3D10_COUNTER_TYPE *pType,
+        UINT *pActiveCounters,
+        LPSTR szName,
+        UINT *pNameLength,
+        LPSTR szUnits,
+        UINT *pUnitsLength,
+        LPSTR szDescription,
+        UINT *pDescriptionLength) = 0;
+
+    virtual UINT STDMETHODCALLTYPE GetCreationFlags(
+        ) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE OpenSharedResource(
+        HANDLE hResource,
+        REFIID ReturnedInterface,
+        void **ppResource) = 0;
+
+    virtual void STDMETHODCALLTYPE SetTextFilterSize(
+        UINT Width,
+        UINT Height) = 0;
+
+    virtual void STDMETHODCALLTYPE GetTextFilterSize(
+        UINT *pWidth,
+        UINT *pHeight) = 0;
+
+};
+#else
+typedef struct ID3D10DeviceVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Device* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Device* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Device* This);
+
+    /*** ID3D10Device methods ***/
+    void (STDMETHODCALLTYPE *VSSetConstantBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppConstantBuffers);
+
+    void (STDMETHODCALLTYPE *PSSetShaderResources)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView *const *ppShaderResourceViews);
+
+    void (STDMETHODCALLTYPE *PSSetShader)(
+        ID3D10Device* This,
+        ID3D10PixelShader *pPixelShader);
+
+    void (STDMETHODCALLTYPE *PSSetSamplers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState *const *ppSamplers);
+
+    void (STDMETHODCALLTYPE *VSSetShader)(
+        ID3D10Device* This,
+        ID3D10VertexShader *pVertexShader);
+
+    void (STDMETHODCALLTYPE *DrawIndexed)(
+        ID3D10Device* This,
+        UINT IndexCount,
+        UINT StartIndexLocation,
+        INT BaseVertexLocation);
+
+    void (STDMETHODCALLTYPE *Draw)(
+        ID3D10Device* This,
+        UINT VertexCount,
+        UINT StartVertexLocation);
+
+    void (STDMETHODCALLTYPE *PSSetConstantBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppConstantBuffers);
+
+    void (STDMETHODCALLTYPE *IASetInputLayout)(
+        ID3D10Device* This,
+        ID3D10InputLayout *pInputLayout);
+
+    void (STDMETHODCALLTYPE *IASetVertexBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppVertexBuffers,
+        const UINT *pStrides,
+        const UINT *pOffsets);
+
+    void (STDMETHODCALLTYPE *IASetIndexBuffer)(
+        ID3D10Device* This,
+        ID3D10Buffer *pIndexBuffer,
+        DXGI_FORMAT Format,
+        UINT Offset);
+
+    void (STDMETHODCALLTYPE *DrawIndexedInstanced)(
+        ID3D10Device* This,
+        UINT IndexCountPerInstance,
+        UINT InstanceCount,
+        UINT StartIndexLocation,
+        INT BaseVertexLocation,
+        UINT StartInstanceLocation);
+
+    void (STDMETHODCALLTYPE *DrawInstanced)(
+        ID3D10Device* This,
+        UINT VertexCountPerInstance,
+        UINT InstanceCount,
+        UINT StartVertexLocation,
+        UINT StartInstanceLocation);
+
+    void (STDMETHODCALLTYPE *GSSetConstantBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppConstantBuffers);
+
+    void (STDMETHODCALLTYPE *GSSetShader)(
+        ID3D10Device* This,
+        ID3D10GeometryShader *pShader);
+
+    void (STDMETHODCALLTYPE *IASetPrimitiveTopology)(
+        ID3D10Device* This,
+        D3D10_PRIMITIVE_TOPOLOGY Topology);
+
+    void (STDMETHODCALLTYPE *VSSetShaderResources)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView *const *ppShaderResourceViews);
+
+    void (STDMETHODCALLTYPE *VSSetSamplers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState *const *ppSamplers);
+
+    void (STDMETHODCALLTYPE *SetPredication)(
+        ID3D10Device* This,
+        ID3D10Predicate *pPredicate,
+        BOOL PredicateValue);
+
+    void (STDMETHODCALLTYPE *GSSetShaderResources)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView *const *ppShaderResourceViews);
+
+    void (STDMETHODCALLTYPE *GSSetSamplers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState *const *ppSamplers);
+
+    void (STDMETHODCALLTYPE *OMSetRenderTargets)(
+        ID3D10Device* This,
+        UINT NumViews,
+        ID3D10RenderTargetView *const *ppRenderTargetViews,
+        ID3D10DepthStencilView *pDepthStencilView);
+
+    void (STDMETHODCALLTYPE *OMSetBlendState)(
+        ID3D10Device* This,
+        ID3D10BlendState *pBlendState,
+        const FLOAT BlendFactor[4],
+        UINT SampleMask);
+
+    void (STDMETHODCALLTYPE *OMSetDepthStencilState)(
+        ID3D10Device* This,
+        ID3D10DepthStencilState *pDepthStencilState,
+        UINT StencilRef);
+
+    void (STDMETHODCALLTYPE *SOSetTargets)(
+        ID3D10Device* This,
+        UINT NumBuffers,
+        ID3D10Buffer *const *ppSOTargets,
+        const UINT *pOffsets);
+
+    void (STDMETHODCALLTYPE *DrawAuto)(
+        ID3D10Device* This);
+
+    void (STDMETHODCALLTYPE *RSSetState)(
+        ID3D10Device* This,
+        ID3D10RasterizerState *pRasterizerState);
+
+    void (STDMETHODCALLTYPE *RSSetViewports)(
+        ID3D10Device* This,
+        UINT NumViewports,
+        const D3D10_VIEWPORT *pViewports);
+
+    void (STDMETHODCALLTYPE *RSSetScissorRects)(
+        ID3D10Device* This,
+        UINT NumRects,
+        const D3D10_RECT *pRects);
+
+    void (STDMETHODCALLTYPE *CopySubresourceRegion)(
+        ID3D10Device* This,
+        ID3D10Resource *pDstResource,
+        UINT DstSubresource,
+        UINT DstX,
+        UINT DstY,
+        UINT DstZ,
+        ID3D10Resource *pSrcResource,
+        UINT SrcSubresource,
+        const D3D10_BOX *pSrcBox);
+
+    void (STDMETHODCALLTYPE *CopyResource)(
+        ID3D10Device* This,
+        ID3D10Resource *pDstResource,
+        ID3D10Resource *pSrcResource);
+
+    void (STDMETHODCALLTYPE *UpdateSubresource)(
+        ID3D10Device* This,
+        ID3D10Resource *pDstResource,
+        UINT DstSubresource,
+        const D3D10_BOX *pDstBox,
+        const void *pSrcData,
+        UINT SrcRowPitch,
+        UINT SrcDepthPitch);
+
+    void (STDMETHODCALLTYPE *ClearRenderTargetView)(
+        ID3D10Device* This,
+        ID3D10RenderTargetView *pRenderTargetView,
+        const FLOAT ColorRGBA[4]);
+
+    void (STDMETHODCALLTYPE *ClearDepthStencilView)(
+        ID3D10Device* This,
+        ID3D10DepthStencilView *pDepthStencilView,
+        UINT ClearFlags,
+        FLOAT Depth,
+        UINT8 Stencil);
+
+    void (STDMETHODCALLTYPE *GenerateMips)(
+        ID3D10Device* This,
+        ID3D10ShaderResourceView *pShaderResourceView);
+
+    void (STDMETHODCALLTYPE *ResolveSubresource)(
+        ID3D10Device* This,
+        ID3D10Resource *pDstResource,
+        UINT DstSubresource,
+        ID3D10Resource *pSrcResource,
+        UINT SrcSubresource,
+        DXGI_FORMAT Format);
+
+    void (STDMETHODCALLTYPE *VSGetConstantBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppConstantBuffers);
+
+    void (STDMETHODCALLTYPE *PSGetShaderResources)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView **ppShaderResourceViews);
+
+    void (STDMETHODCALLTYPE *PSGetShader)(
+        ID3D10Device* This,
+        ID3D10PixelShader **ppPixelShader);
+
+    void (STDMETHODCALLTYPE *PSGetSamplers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState **ppSamplers);
+
+    void (STDMETHODCALLTYPE *VSGetShader)(
+        ID3D10Device* This,
+        ID3D10VertexShader **ppVertexShader);
+
+    void (STDMETHODCALLTYPE *PSGetConstantBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppConstantBuffers);
+
+    void (STDMETHODCALLTYPE *IAGetInputLayout)(
+        ID3D10Device* This,
+        ID3D10InputLayout **ppInputLayout);
+
+    void (STDMETHODCALLTYPE *IAGetVertexBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppVertexBuffers,
+        UINT *pStrides,
+        UINT *pOffsets);
+
+    void (STDMETHODCALLTYPE *IAGetIndexBuffer)(
+        ID3D10Device* This,
+        ID3D10Buffer **pIndexBuffer,
+        DXGI_FORMAT *Format,
+        UINT *Offset);
+
+    void (STDMETHODCALLTYPE *GSGetConstantBuffers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumBuffers,
+        ID3D10Buffer **ppConstantBuffers);
+
+    void (STDMETHODCALLTYPE *GSGetShader)(
+        ID3D10Device* This,
+        ID3D10GeometryShader **ppGeometryShader);
+
+    void (STDMETHODCALLTYPE *IAGetPrimitiveTopology)(
+        ID3D10Device* This,
+        D3D10_PRIMITIVE_TOPOLOGY *pTopology);
+
+    void (STDMETHODCALLTYPE *VSGetShaderResources)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView **ppShaderResourceViews);
+
+    void (STDMETHODCALLTYPE *VSGetSamplers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState **ppSamplers);
+
+    void (STDMETHODCALLTYPE *GetPredication)(
+        ID3D10Device* This,
+        ID3D10Predicate **ppPredicate,
+        BOOL *pPredicateValue);
+
+    void (STDMETHODCALLTYPE *GSGetShaderResources)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumViews,
+        ID3D10ShaderResourceView **ppShaderResourceViews);
+
+    void (STDMETHODCALLTYPE *GSGetSamplers)(
+        ID3D10Device* This,
+        UINT StartSlot,
+        UINT NumSamplers,
+        ID3D10SamplerState **ppSamplers);
+
+    void (STDMETHODCALLTYPE *OMGetRenderTargets)(
+        ID3D10Device* This,
+        UINT NumViews,
+        ID3D10RenderTargetView **ppRenderTargetViews,
+        ID3D10DepthStencilView **ppDepthStencilView);
+
+    void (STDMETHODCALLTYPE *OMGetBlendState)(
+        ID3D10Device* This,
+        ID3D10BlendState **ppBlendState,
+        FLOAT BlendFactor[4],
+        UINT *pSampleMask);
+
+    void (STDMETHODCALLTYPE *OMGetDepthStencilState)(
+        ID3D10Device* This,
+        ID3D10DepthStencilState **ppDepthStencilState,
+        UINT *pStencilRef);
+
+    void (STDMETHODCALLTYPE *SOGetTargets)(
+        ID3D10Device* This,
+        UINT NumBuffers,
+        ID3D10Buffer **ppSOTargets,
+        UINT *pOffsets);
+
+    void (STDMETHODCALLTYPE *RSGetState)(
+        ID3D10Device* This,
+        ID3D10RasterizerState **ppRasterizerState);
+
+    void (STDMETHODCALLTYPE *RSGetViewports)(
+        ID3D10Device* This,
+        UINT *NumViewports,
+        D3D10_VIEWPORT *pViewports);
+
+    void (STDMETHODCALLTYPE *RSGetScissorRects)(
+        ID3D10Device* This,
+        UINT *NumRects,
+        D3D10_RECT *pRects);
+
+    HRESULT (STDMETHODCALLTYPE *GetDeviceRemovedReason)(
+        ID3D10Device* This);
+
+    HRESULT (STDMETHODCALLTYPE *SetExceptionMode)(
+        ID3D10Device* This,
+        UINT RaiseFlags);
+
+    UINT (STDMETHODCALLTYPE *GetExceptionMode)(
+        ID3D10Device* This);
+
+    HRESULT (STDMETHODCALLTYPE *GetPrivateData)(
+        ID3D10Device* This,
+        REFGUID guid,
+        UINT *pDataSize,
+        void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateData)(
+        ID3D10Device* This,
+        REFGUID guid,
+        UINT DataSize,
+        const void *pData);
+
+    HRESULT (STDMETHODCALLTYPE *SetPrivateDataInterface)(
+        ID3D10Device* This,
+        REFGUID guid,
+        const IUnknown *pData);
+
+    void (STDMETHODCALLTYPE *ClearState)(
+        ID3D10Device* This);
+
+    void (STDMETHODCALLTYPE *Flush)(
+        ID3D10Device* This);
+
+    HRESULT (STDMETHODCALLTYPE *CreateBuffer)(
+        ID3D10Device* This,
+        const D3D10_BUFFER_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Buffer **ppBuffer);
+
+    HRESULT (STDMETHODCALLTYPE *CreateTexture1D)(
+        ID3D10Device* This,
+        const D3D10_TEXTURE1D_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Texture1D **ppTexture1D);
+
+    HRESULT (STDMETHODCALLTYPE *CreateTexture2D)(
+        ID3D10Device* This,
+        const D3D10_TEXTURE2D_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Texture2D **ppTexture2D);
+
+    HRESULT (STDMETHODCALLTYPE *CreateTexture3D)(
+        ID3D10Device* This,
+        const D3D10_TEXTURE3D_DESC *pDesc,
+        const D3D10_SUBRESOURCE_DATA *pInitialData,
+        ID3D10Texture3D **ppTexture3D);
+
+    HRESULT (STDMETHODCALLTYPE *CreateShaderResourceView)(
+        ID3D10Device* This,
+        ID3D10Resource *pResource,
+        const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
+        ID3D10ShaderResourceView **ppSRView);
+
+    HRESULT (STDMETHODCALLTYPE *CreateRenderTargetView)(
+        ID3D10Device* This,
+        ID3D10Resource *pResource,
+        const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
+        ID3D10RenderTargetView **ppRTView);
+
+    HRESULT (STDMETHODCALLTYPE *CreateDepthStencilView)(
+        ID3D10Device* This,
+        ID3D10Resource *pResource,
+        const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
+        ID3D10DepthStencilView **ppDepthStencilView);
+
+    HRESULT (STDMETHODCALLTYPE *CreateInputLayout)(
+        ID3D10Device* This,
+        const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
+        UINT NumElements,
+        const void *pShaderBytecodeWithInputSignature,
+        SIZE_T BytecodeLength,
+        ID3D10InputLayout **ppInputLayout);
+
+    HRESULT (STDMETHODCALLTYPE *CreateVertexShader)(
+        ID3D10Device* This,
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        ID3D10VertexShader **ppVertexShader);
+
+    HRESULT (STDMETHODCALLTYPE *CreateGeometryShader)(
+        ID3D10Device* This,
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        ID3D10GeometryShader **ppGeometryShader);
+
+    HRESULT (STDMETHODCALLTYPE *CreateGeometryShaderWithStreamOutput)(
+        ID3D10Device* This,
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
+        UINT NumEntries,
+        UINT OutputStreamStride,
+        ID3D10GeometryShader **ppGeometryShader);
+
+    HRESULT (STDMETHODCALLTYPE *CreatePixelShader)(
+        ID3D10Device* This,
+        const void *pShaderBytecode,
+        SIZE_T BytecodeLength,
+        ID3D10PixelShader **ppPixelShader);
+
+    HRESULT (STDMETHODCALLTYPE *CreateBlendState)(
+        ID3D10Device* This,
+        const D3D10_BLEND_DESC *pBlendStateDesc,
+        ID3D10BlendState **ppBlendState);
+
+    HRESULT (STDMETHODCALLTYPE *CreateDepthStencilState)(
+        ID3D10Device* This,
+        const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+        ID3D10DepthStencilState **ppDepthStencilState);
+
+    HRESULT (STDMETHODCALLTYPE *CreateRasterizerState)(
+        ID3D10Device* This,
+        const D3D10_RASTERIZER_DESC *pRasterizerDesc,
+        ID3D10RasterizerState **ppRasterizerState);
+
+    HRESULT (STDMETHODCALLTYPE *CreateSamplerState)(
+        ID3D10Device* This,
+        const D3D10_SAMPLER_DESC *pSamplerDesc,
+        ID3D10SamplerState **ppSamplerState);
+
+    HRESULT (STDMETHODCALLTYPE *CreateQuery)(
+        ID3D10Device* This,
+        const D3D10_QUERY_DESC *pQueryDesc,
+        ID3D10Query **ppQuery);
+
+    HRESULT (STDMETHODCALLTYPE *CreatePredicate)(
+        ID3D10Device* This,
+        const D3D10_QUERY_DESC *pPredicateDesc,
+        ID3D10Predicate **ppPredicate);
+
+    HRESULT (STDMETHODCALLTYPE *CreateCounter)(
+        ID3D10Device* This,
+        const D3D10_COUNTER_DESC *pCounterDesc,
+        ID3D10Counter **ppCounter);
+
+    HRESULT (STDMETHODCALLTYPE *CheckFormatSupport)(
+        ID3D10Device* This,
+        DXGI_FORMAT Format,
+        UINT *pFormatSupport);
+
+    HRESULT (STDMETHODCALLTYPE *CheckMultisampleQualityLevels)(
+        ID3D10Device* This,
+        DXGI_FORMAT Format,
+        UINT SampleCount,
+        UINT *pNumQualityLevels);
+
+    void (STDMETHODCALLTYPE *CheckCounterInfo)(
+        ID3D10Device* This,
+        D3D10_COUNTER_INFO *pCounterInfo);
+
+    HRESULT (STDMETHODCALLTYPE *CheckCounter)(
+        ID3D10Device* This,
+        const D3D10_COUNTER_DESC *pDesc,
+        D3D10_COUNTER_TYPE *pType,
+        UINT *pActiveCounters,
+        LPSTR szName,
+        UINT *pNameLength,
+        LPSTR szUnits,
+        UINT *pUnitsLength,
+        LPSTR szDescription,
+        UINT *pDescriptionLength);
+
+    UINT (STDMETHODCALLTYPE *GetCreationFlags)(
+        ID3D10Device* This);
+
+    HRESULT (STDMETHODCALLTYPE *OpenSharedResource)(
+        ID3D10Device* This,
+        HANDLE hResource,
+        REFIID ReturnedInterface,
+        void **ppResource);
+
+    void (STDMETHODCALLTYPE *SetTextFilterSize)(
+        ID3D10Device* This,
+        UINT Width,
+        UINT Height);
+
+    void (STDMETHODCALLTYPE *GetTextFilterSize)(
+        ID3D10Device* This,
+        UINT *pWidth,
+        UINT *pHeight);
+
+    END_INTERFACE
+} ID3D10DeviceVtbl;
+interface ID3D10Device {
+    CONST_VTBL ID3D10DeviceVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Device_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Device_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Device_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10Device methods ***/
+#define ID3D10Device_VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->VSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers)
+#define ID3D10Device_PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->PSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews)
+#define ID3D10Device_PSSetShader(This,pPixelShader) (This)->lpVtbl->PSSetShader(This,pPixelShader)
+#define ID3D10Device_PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->PSSetSamplers(This,StartSlot,NumSamplers,ppSamplers)
+#define ID3D10Device_VSSetShader(This,pVertexShader) (This)->lpVtbl->VSSetShader(This,pVertexShader)
+#define ID3D10Device_DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation) (This)->lpVtbl->DrawIndexed(This,IndexCount,StartIndexLocation,BaseVertexLocation)
+#define ID3D10Device_Draw(This,VertexCount,StartVertexLocation) (This)->lpVtbl->Draw(This,VertexCount,StartVertexLocation)
+#define ID3D10Device_PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->PSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers)
+#define ID3D10Device_IASetInputLayout(This,pInputLayout) (This)->lpVtbl->IASetInputLayout(This,pInputLayout)
+#define ID3D10Device_IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) (This)->lpVtbl->IASetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets)
+#define ID3D10Device_IASetIndexBuffer(This,pIndexBuffer,Format,Offset) (This)->lpVtbl->IASetIndexBuffer(This,pIndexBuffer,Format,Offset)
+#define ID3D10Device_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) (This)->lpVtbl->DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation)
+#define ID3D10Device_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) (This)->lpVtbl->DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation)
+#define ID3D10Device_GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->GSSetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers)
+#define ID3D10Device_GSSetShader(This,pShader) (This)->lpVtbl->GSSetShader(This,pShader)
+#define ID3D10Device_IASetPrimitiveTopology(This,Topology) (This)->lpVtbl->IASetPrimitiveTopology(This,Topology)
+#define ID3D10Device_VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->VSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews)
+#define ID3D10Device_VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->VSSetSamplers(This,StartSlot,NumSamplers,ppSamplers)
+#define ID3D10Device_SetPredication(This,pPredicate,PredicateValue) (This)->lpVtbl->SetPredication(This,pPredicate,PredicateValue)
+#define ID3D10Device_GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->GSSetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews)
+#define ID3D10Device_GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->GSSetSamplers(This,StartSlot,NumSamplers,ppSamplers)
+#define ID3D10Device_OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView) (This)->lpVtbl->OMSetRenderTargets(This,NumViews,ppRenderTargetViews,pDepthStencilView)
+#define ID3D10Device_OMSetBlendState(This,pBlendState,BlendFactor,SampleMask) (This)->lpVtbl->OMSetBlendState(This,pBlendState,BlendFactor,SampleMask)
+#define ID3D10Device_OMSetDepthStencilState(This,pDepthStencilState,StencilRef) (This)->lpVtbl->OMSetDepthStencilState(This,pDepthStencilState,StencilRef)
+#define ID3D10Device_SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets) (This)->lpVtbl->SOSetTargets(This,NumBuffers,ppSOTargets,pOffsets)
+#define ID3D10Device_DrawAuto(This) (This)->lpVtbl->DrawAuto(This)
+#define ID3D10Device_RSSetState(This,pRasterizerState) (This)->lpVtbl->RSSetState(This,pRasterizerState)
+#define ID3D10Device_RSSetViewports(This,NumViewports,pViewports) (This)->lpVtbl->RSSetViewports(This,NumViewports,pViewports)
+#define ID3D10Device_RSSetScissorRects(This,NumRects,pRects) (This)->lpVtbl->RSSetScissorRects(This,NumRects,pRects)
+#define ID3D10Device_CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox) (This)->lpVtbl->CopySubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,DstZ,pSrcResource,SrcSubresource,pSrcBox)
+#define ID3D10Device_CopyResource(This,pDstResource,pSrcResource) (This)->lpVtbl->CopyResource(This,pDstResource,pSrcResource)
+#define ID3D10Device_UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) (This)->lpVtbl->UpdateSubresource(This,pDstResource,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch)
+#define ID3D10Device_ClearRenderTargetView(This,pRenderTargetView,ColorRGBA) (This)->lpVtbl->ClearRenderTargetView(This,pRenderTargetView,ColorRGBA)
+#define ID3D10Device_ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil) (This)->lpVtbl->ClearDepthStencilView(This,pDepthStencilView,ClearFlags,Depth,Stencil)
+#define ID3D10Device_GenerateMips(This,pShaderResourceView) (This)->lpVtbl->GenerateMips(This,pShaderResourceView)
+#define ID3D10Device_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) (This)->lpVtbl->ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format)
+#define ID3D10Device_VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->VSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers)
+#define ID3D10Device_PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->PSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews)
+#define ID3D10Device_PSGetShader(This,ppPixelShader) (This)->lpVtbl->PSGetShader(This,ppPixelShader)
+#define ID3D10Device_PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->PSGetSamplers(This,StartSlot,NumSamplers,ppSamplers)
+#define ID3D10Device_VSGetShader(This,ppVertexShader) (This)->lpVtbl->VSGetShader(This,ppVertexShader)
+#define ID3D10Device_PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->PSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers)
+#define ID3D10Device_IAGetInputLayout(This,ppInputLayout) (This)->lpVtbl->IAGetInputLayout(This,ppInputLayout)
+#define ID3D10Device_IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets) (This)->lpVtbl->IAGetVertexBuffers(This,StartSlot,NumBuffers,ppVertexBuffers,pStrides,pOffsets)
+#define ID3D10Device_IAGetIndexBuffer(This,pIndexBuffer,Format,Offset) (This)->lpVtbl->IAGetIndexBuffer(This,pIndexBuffer,Format,Offset)
+#define ID3D10Device_GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers) (This)->lpVtbl->GSGetConstantBuffers(This,StartSlot,NumBuffers,ppConstantBuffers)
+#define ID3D10Device_GSGetShader(This,ppGeometryShader) (This)->lpVtbl->GSGetShader(This,ppGeometryShader)
+#define ID3D10Device_IAGetPrimitiveTopology(This,pTopology) (This)->lpVtbl->IAGetPrimitiveTopology(This,pTopology)
+#define ID3D10Device_VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->VSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews)
+#define ID3D10Device_VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->VSGetSamplers(This,StartSlot,NumSamplers,ppSamplers)
+#define ID3D10Device_GetPredication(This,ppPredicate,pPredicateValue) (This)->lpVtbl->GetPredication(This,ppPredicate,pPredicateValue)
+#define ID3D10Device_GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews) (This)->lpVtbl->GSGetShaderResources(This,StartSlot,NumViews,ppShaderResourceViews)
+#define ID3D10Device_GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers) (This)->lpVtbl->GSGetSamplers(This,StartSlot,NumSamplers,ppSamplers)
+#define ID3D10Device_OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView) (This)->lpVtbl->OMGetRenderTargets(This,NumViews,ppRenderTargetViews,ppDepthStencilView)
+#define ID3D10Device_OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask) (This)->lpVtbl->OMGetBlendState(This,ppBlendState,BlendFactor,pSampleMask)
+#define ID3D10Device_OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef) (This)->lpVtbl->OMGetDepthStencilState(This,ppDepthStencilState,pStencilRef)
+#define ID3D10Device_SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets) (This)->lpVtbl->SOGetTargets(This,NumBuffers,ppSOTargets,pOffsets)
+#define ID3D10Device_RSGetState(This,ppRasterizerState) (This)->lpVtbl->RSGetState(This,ppRasterizerState)
+#define ID3D10Device_RSGetViewports(This,NumViewports,pViewports) (This)->lpVtbl->RSGetViewports(This,NumViewports,pViewports)
+#define ID3D10Device_RSGetScissorRects(This,NumRects,pRects) (This)->lpVtbl->RSGetScissorRects(This,NumRects,pRects)
+#define ID3D10Device_GetDeviceRemovedReason(This) (This)->lpVtbl->GetDeviceRemovedReason(This)
+#define ID3D10Device_SetExceptionMode(This,RaiseFlags) (This)->lpVtbl->SetExceptionMode(This,RaiseFlags)
+#define ID3D10Device_GetExceptionMode(This) (This)->lpVtbl->GetExceptionMode(This)
+#define ID3D10Device_GetPrivateData(This,guid,pDataSize,pData) (This)->lpVtbl->GetPrivateData(This,guid,pDataSize,pData)
+#define ID3D10Device_SetPrivateData(This,guid,DataSize,pData) (This)->lpVtbl->SetPrivateData(This,guid,DataSize,pData)
+#define ID3D10Device_SetPrivateDataInterface(This,guid,pData) (This)->lpVtbl->SetPrivateDataInterface(This,guid,pData)
+#define ID3D10Device_ClearState(This) (This)->lpVtbl->ClearState(This)
+#define ID3D10Device_Flush(This) (This)->lpVtbl->Flush(This)
+#define ID3D10Device_CreateBuffer(This,pDesc,pInitialData,ppBuffer) (This)->lpVtbl->CreateBuffer(This,pDesc,pInitialData,ppBuffer)
+#define ID3D10Device_CreateTexture1D(This,pDesc,pInitialData,ppTexture1D) (This)->lpVtbl->CreateTexture1D(This,pDesc,pInitialData,ppTexture1D)
+#define ID3D10Device_CreateTexture2D(This,pDesc,pInitialData,ppTexture2D) (This)->lpVtbl->CreateTexture2D(This,pDesc,pInitialData,ppTexture2D)
+#define ID3D10Device_CreateTexture3D(This,pDesc,pInitialData,ppTexture3D) (This)->lpVtbl->CreateTexture3D(This,pDesc,pInitialData,ppTexture3D)
+#define ID3D10Device_CreateShaderResourceView(This,pResource,pDesc,ppSRView) (This)->lpVtbl->CreateShaderResourceView(This,pResource,pDesc,ppSRView)
+#define ID3D10Device_CreateRenderTargetView(This,pResource,pDesc,ppRTView) (This)->lpVtbl->CreateRenderTargetView(This,pResource,pDesc,ppRTView)
+#define ID3D10Device_CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView) (This)->lpVtbl->CreateDepthStencilView(This,pResource,pDesc,ppDepthStencilView)
+#define ID3D10Device_CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout) (This)->lpVtbl->CreateInputLayout(This,pInputElementDescs,NumElements,pShaderBytecodeWithInputSignature,BytecodeLength,ppInputLayout)
+#define ID3D10Device_CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader) (This)->lpVtbl->CreateVertexShader(This,pShaderBytecode,BytecodeLength,ppVertexShader)
+#define ID3D10Device_CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader) (This)->lpVtbl->CreateGeometryShader(This,pShaderBytecode,BytecodeLength,ppGeometryShader)
+#define ID3D10Device_CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader) (This)->lpVtbl->CreateGeometryShaderWithStreamOutput(This,pShaderBytecode,BytecodeLength,pSODeclaration,NumEntries,OutputStreamStride,ppGeometryShader)
+#define ID3D10Device_CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader) (This)->lpVtbl->CreatePixelShader(This,pShaderBytecode,BytecodeLength,ppPixelShader)
+#define ID3D10Device_CreateBlendState(This,pBlendStateDesc,ppBlendState) (This)->lpVtbl->CreateBlendState(This,pBlendStateDesc,ppBlendState)
+#define ID3D10Device_CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState) (This)->lpVtbl->CreateDepthStencilState(This,pDepthStencilDesc,ppDepthStencilState)
+#define ID3D10Device_CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState) (This)->lpVtbl->CreateRasterizerState(This,pRasterizerDesc,ppRasterizerState)
+#define ID3D10Device_CreateSamplerState(This,pSamplerDesc,ppSamplerState) (This)->lpVtbl->CreateSamplerState(This,pSamplerDesc,ppSamplerState)
+#define ID3D10Device_CreateQuery(This,pQueryDesc,ppQuery) (This)->lpVtbl->CreateQuery(This,pQueryDesc,ppQuery)
+#define ID3D10Device_CreatePredicate(This,pPredicateDesc,ppPredicate) (This)->lpVtbl->CreatePredicate(This,pPredicateDesc,ppPredicate)
+#define ID3D10Device_CreateCounter(This,pCounterDesc,ppCounter) (This)->lpVtbl->CreateCounter(This,pCounterDesc,ppCounter)
+#define ID3D10Device_CheckFormatSupport(This,Format,pFormatSupport) (This)->lpVtbl->CheckFormatSupport(This,Format,pFormatSupport)
+#define ID3D10Device_CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels) (This)->lpVtbl->CheckMultisampleQualityLevels(This,Format,SampleCount,pNumQualityLevels)
+#define ID3D10Device_CheckCounterInfo(This,pCounterInfo) (This)->lpVtbl->CheckCounterInfo(This,pCounterInfo)
+#define ID3D10Device_CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength) (This)->lpVtbl->CheckCounter(This,pDesc,pType,pActiveCounters,szName,pNameLength,szUnits,pUnitsLength,szDescription,pDescriptionLength)
+#define ID3D10Device_GetCreationFlags(This) (This)->lpVtbl->GetCreationFlags(This)
+#define ID3D10Device_OpenSharedResource(This,hResource,ReturnedInterface,ppResource) (This)->lpVtbl->OpenSharedResource(This,hResource,ReturnedInterface,ppResource)
+#define ID3D10Device_SetTextFilterSize(This,Width,Height) (This)->lpVtbl->SetTextFilterSize(This,Width,Height)
+#define ID3D10Device_GetTextFilterSize(This,pWidth,pHeight) (This)->lpVtbl->GetTextFilterSize(This,pWidth,pHeight)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10Device_VSSetConstantBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer *const *ppConstantBuffers);
+void __RPC_STUB ID3D10Device_VSSetConstantBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSSetShaderResources_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumViews,
+    ID3D10ShaderResourceView *const *ppShaderResourceViews);
+void __RPC_STUB ID3D10Device_PSSetShaderResources_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSSetShader_Proxy(
+    ID3D10Device* This,
+    ID3D10PixelShader *pPixelShader);
+void __RPC_STUB ID3D10Device_PSSetShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSSetSamplers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumSamplers,
+    ID3D10SamplerState *const *ppSamplers);
+void __RPC_STUB ID3D10Device_PSSetSamplers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_VSSetShader_Proxy(
+    ID3D10Device* This,
+    ID3D10VertexShader *pVertexShader);
+void __RPC_STUB ID3D10Device_VSSetShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_DrawIndexed_Proxy(
+    ID3D10Device* This,
+    UINT IndexCount,
+    UINT StartIndexLocation,
+    INT BaseVertexLocation);
+void __RPC_STUB ID3D10Device_DrawIndexed_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_Draw_Proxy(
+    ID3D10Device* This,
+    UINT VertexCount,
+    UINT StartVertexLocation);
+void __RPC_STUB ID3D10Device_Draw_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSSetConstantBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer *const *ppConstantBuffers);
+void __RPC_STUB ID3D10Device_PSSetConstantBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IASetInputLayout_Proxy(
+    ID3D10Device* This,
+    ID3D10InputLayout *pInputLayout);
+void __RPC_STUB ID3D10Device_IASetInputLayout_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IASetVertexBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer *const *ppVertexBuffers,
+    const UINT *pStrides,
+    const UINT *pOffsets);
+void __RPC_STUB ID3D10Device_IASetVertexBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IASetIndexBuffer_Proxy(
+    ID3D10Device* This,
+    ID3D10Buffer *pIndexBuffer,
+    DXGI_FORMAT Format,
+    UINT Offset);
+void __RPC_STUB ID3D10Device_IASetIndexBuffer_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_DrawIndexedInstanced_Proxy(
+    ID3D10Device* This,
+    UINT IndexCountPerInstance,
+    UINT InstanceCount,
+    UINT StartIndexLocation,
+    INT BaseVertexLocation,
+    UINT StartInstanceLocation);
+void __RPC_STUB ID3D10Device_DrawIndexedInstanced_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_DrawInstanced_Proxy(
+    ID3D10Device* This,
+    UINT VertexCountPerInstance,
+    UINT InstanceCount,
+    UINT StartVertexLocation,
+    UINT StartInstanceLocation);
+void __RPC_STUB ID3D10Device_DrawInstanced_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSSetConstantBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer *const *ppConstantBuffers);
+void __RPC_STUB ID3D10Device_GSSetConstantBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSSetShader_Proxy(
+    ID3D10Device* This,
+    ID3D10GeometryShader *pShader);
+void __RPC_STUB ID3D10Device_GSSetShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IASetPrimitiveTopology_Proxy(
+    ID3D10Device* This,
+    D3D10_PRIMITIVE_TOPOLOGY Topology);
+void __RPC_STUB ID3D10Device_IASetPrimitiveTopology_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_VSSetShaderResources_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumViews,
+    ID3D10ShaderResourceView *const *ppShaderResourceViews);
+void __RPC_STUB ID3D10Device_VSSetShaderResources_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_VSSetSamplers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumSamplers,
+    ID3D10SamplerState *const *ppSamplers);
+void __RPC_STUB ID3D10Device_VSSetSamplers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_SetPredication_Proxy(
+    ID3D10Device* This,
+    ID3D10Predicate *pPredicate,
+    BOOL PredicateValue);
+void __RPC_STUB ID3D10Device_SetPredication_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSSetShaderResources_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumViews,
+    ID3D10ShaderResourceView *const *ppShaderResourceViews);
+void __RPC_STUB ID3D10Device_GSSetShaderResources_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSSetSamplers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumSamplers,
+    ID3D10SamplerState *const *ppSamplers);
+void __RPC_STUB ID3D10Device_GSSetSamplers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_OMSetRenderTargets_Proxy(
+    ID3D10Device* This,
+    UINT NumViews,
+    ID3D10RenderTargetView *const *ppRenderTargetViews,
+    ID3D10DepthStencilView *pDepthStencilView);
+void __RPC_STUB ID3D10Device_OMSetRenderTargets_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_OMSetBlendState_Proxy(
+    ID3D10Device* This,
+    ID3D10BlendState *pBlendState,
+    const FLOAT BlendFactor[4],
+    UINT SampleMask);
+void __RPC_STUB ID3D10Device_OMSetBlendState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_OMSetDepthStencilState_Proxy(
+    ID3D10Device* This,
+    ID3D10DepthStencilState *pDepthStencilState,
+    UINT StencilRef);
+void __RPC_STUB ID3D10Device_OMSetDepthStencilState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_SOSetTargets_Proxy(
+    ID3D10Device* This,
+    UINT NumBuffers,
+    ID3D10Buffer *const *ppSOTargets,
+    const UINT *pOffsets);
+void __RPC_STUB ID3D10Device_SOSetTargets_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_DrawAuto_Proxy(
+    ID3D10Device* This);
+void __RPC_STUB ID3D10Device_DrawAuto_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_RSSetState_Proxy(
+    ID3D10Device* This,
+    ID3D10RasterizerState *pRasterizerState);
+void __RPC_STUB ID3D10Device_RSSetState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_RSSetViewports_Proxy(
+    ID3D10Device* This,
+    UINT NumViewports,
+    const D3D10_VIEWPORT *pViewports);
+void __RPC_STUB ID3D10Device_RSSetViewports_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_RSSetScissorRects_Proxy(
+    ID3D10Device* This,
+    UINT NumRects,
+    const D3D10_RECT *pRects);
+void __RPC_STUB ID3D10Device_RSSetScissorRects_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_CopySubresourceRegion_Proxy(
+    ID3D10Device* This,
+    ID3D10Resource *pDstResource,
+    UINT DstSubresource,
+    UINT DstX,
+    UINT DstY,
+    UINT DstZ,
+    ID3D10Resource *pSrcResource,
+    UINT SrcSubresource,
+    const D3D10_BOX *pSrcBox);
+void __RPC_STUB ID3D10Device_CopySubresourceRegion_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_CopyResource_Proxy(
+    ID3D10Device* This,
+    ID3D10Resource *pDstResource,
+    ID3D10Resource *pSrcResource);
+void __RPC_STUB ID3D10Device_CopyResource_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_UpdateSubresource_Proxy(
+    ID3D10Device* This,
+    ID3D10Resource *pDstResource,
+    UINT DstSubresource,
+    const D3D10_BOX *pDstBox,
+    const void *pSrcData,
+    UINT SrcRowPitch,
+    UINT SrcDepthPitch);
+void __RPC_STUB ID3D10Device_UpdateSubresource_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_ClearRenderTargetView_Proxy(
+    ID3D10Device* This,
+    ID3D10RenderTargetView *pRenderTargetView,
+    const FLOAT ColorRGBA[4]);
+void __RPC_STUB ID3D10Device_ClearRenderTargetView_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_ClearDepthStencilView_Proxy(
+    ID3D10Device* This,
+    ID3D10DepthStencilView *pDepthStencilView,
+    UINT ClearFlags,
+    FLOAT Depth,
+    UINT8 Stencil);
+void __RPC_STUB ID3D10Device_ClearDepthStencilView_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GenerateMips_Proxy(
+    ID3D10Device* This,
+    ID3D10ShaderResourceView *pShaderResourceView);
+void __RPC_STUB ID3D10Device_GenerateMips_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_ResolveSubresource_Proxy(
+    ID3D10Device* This,
+    ID3D10Resource *pDstResource,
+    UINT DstSubresource,
+    ID3D10Resource *pSrcResource,
+    UINT SrcSubresource,
+    DXGI_FORMAT Format);
+void __RPC_STUB ID3D10Device_ResolveSubresource_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_VSGetConstantBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer **ppConstantBuffers);
+void __RPC_STUB ID3D10Device_VSGetConstantBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSGetShaderResources_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumViews,
+    ID3D10ShaderResourceView **ppShaderResourceViews);
+void __RPC_STUB ID3D10Device_PSGetShaderResources_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSGetShader_Proxy(
+    ID3D10Device* This,
+    ID3D10PixelShader **ppPixelShader);
+void __RPC_STUB ID3D10Device_PSGetShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSGetSamplers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumSamplers,
+    ID3D10SamplerState **ppSamplers);
+void __RPC_STUB ID3D10Device_PSGetSamplers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_VSGetShader_Proxy(
+    ID3D10Device* This,
+    ID3D10VertexShader **ppVertexShader);
+void __RPC_STUB ID3D10Device_VSGetShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_PSGetConstantBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer **ppConstantBuffers);
+void __RPC_STUB ID3D10Device_PSGetConstantBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IAGetInputLayout_Proxy(
+    ID3D10Device* This,
+    ID3D10InputLayout **ppInputLayout);
+void __RPC_STUB ID3D10Device_IAGetInputLayout_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IAGetVertexBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer **ppVertexBuffers,
+    UINT *pStrides,
+    UINT *pOffsets);
+void __RPC_STUB ID3D10Device_IAGetVertexBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IAGetIndexBuffer_Proxy(
+    ID3D10Device* This,
+    ID3D10Buffer **pIndexBuffer,
+    DXGI_FORMAT *Format,
+    UINT *Offset);
+void __RPC_STUB ID3D10Device_IAGetIndexBuffer_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSGetConstantBuffers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumBuffers,
+    ID3D10Buffer **ppConstantBuffers);
+void __RPC_STUB ID3D10Device_GSGetConstantBuffers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSGetShader_Proxy(
+    ID3D10Device* This,
+    ID3D10GeometryShader **ppGeometryShader);
+void __RPC_STUB ID3D10Device_GSGetShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_IAGetPrimitiveTopology_Proxy(
+    ID3D10Device* This,
+    D3D10_PRIMITIVE_TOPOLOGY *pTopology);
+void __RPC_STUB ID3D10Device_IAGetPrimitiveTopology_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_VSGetShaderResources_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumViews,
+    ID3D10ShaderResourceView **ppShaderResourceViews);
+void __RPC_STUB ID3D10Device_VSGetShaderResources_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_VSGetSamplers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumSamplers,
+    ID3D10SamplerState **ppSamplers);
+void __RPC_STUB ID3D10Device_VSGetSamplers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GetPredication_Proxy(
+    ID3D10Device* This,
+    ID3D10Predicate **ppPredicate,
+    BOOL *pPredicateValue);
+void __RPC_STUB ID3D10Device_GetPredication_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSGetShaderResources_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumViews,
+    ID3D10ShaderResourceView **ppShaderResourceViews);
+void __RPC_STUB ID3D10Device_GSGetShaderResources_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GSGetSamplers_Proxy(
+    ID3D10Device* This,
+    UINT StartSlot,
+    UINT NumSamplers,
+    ID3D10SamplerState **ppSamplers);
+void __RPC_STUB ID3D10Device_GSGetSamplers_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_OMGetRenderTargets_Proxy(
+    ID3D10Device* This,
+    UINT NumViews,
+    ID3D10RenderTargetView **ppRenderTargetViews,
+    ID3D10DepthStencilView **ppDepthStencilView);
+void __RPC_STUB ID3D10Device_OMGetRenderTargets_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_OMGetBlendState_Proxy(
+    ID3D10Device* This,
+    ID3D10BlendState **ppBlendState,
+    FLOAT BlendFactor[4],
+    UINT *pSampleMask);
+void __RPC_STUB ID3D10Device_OMGetBlendState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_OMGetDepthStencilState_Proxy(
+    ID3D10Device* This,
+    ID3D10DepthStencilState **ppDepthStencilState,
+    UINT *pStencilRef);
+void __RPC_STUB ID3D10Device_OMGetDepthStencilState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_SOGetTargets_Proxy(
+    ID3D10Device* This,
+    UINT NumBuffers,
+    ID3D10Buffer **ppSOTargets,
+    UINT *pOffsets);
+void __RPC_STUB ID3D10Device_SOGetTargets_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_RSGetState_Proxy(
+    ID3D10Device* This,
+    ID3D10RasterizerState **ppRasterizerState);
+void __RPC_STUB ID3D10Device_RSGetState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_RSGetViewports_Proxy(
+    ID3D10Device* This,
+    UINT *NumViewports,
+    D3D10_VIEWPORT *pViewports);
+void __RPC_STUB ID3D10Device_RSGetViewports_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_RSGetScissorRects_Proxy(
+    ID3D10Device* This,
+    UINT *NumRects,
+    D3D10_RECT *pRects);
+void __RPC_STUB ID3D10Device_RSGetScissorRects_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_GetDeviceRemovedReason_Proxy(
+    ID3D10Device* This);
+void __RPC_STUB ID3D10Device_GetDeviceRemovedReason_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_SetExceptionMode_Proxy(
+    ID3D10Device* This,
+    UINT RaiseFlags);
+void __RPC_STUB ID3D10Device_SetExceptionMode_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+UINT STDMETHODCALLTYPE ID3D10Device_GetExceptionMode_Proxy(
+    ID3D10Device* This);
+void __RPC_STUB ID3D10Device_GetExceptionMode_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_GetPrivateData_Proxy(
+    ID3D10Device* This,
+    REFGUID guid,
+    UINT *pDataSize,
+    void *pData);
+void __RPC_STUB ID3D10Device_GetPrivateData_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_SetPrivateData_Proxy(
+    ID3D10Device* This,
+    REFGUID guid,
+    UINT DataSize,
+    const void *pData);
+void __RPC_STUB ID3D10Device_SetPrivateData_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_SetPrivateDataInterface_Proxy(
+    ID3D10Device* This,
+    REFGUID guid,
+    const IUnknown *pData);
+void __RPC_STUB ID3D10Device_SetPrivateDataInterface_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_ClearState_Proxy(
+    ID3D10Device* This);
+void __RPC_STUB ID3D10Device_ClearState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_Flush_Proxy(
+    ID3D10Device* This);
+void __RPC_STUB ID3D10Device_Flush_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateBuffer_Proxy(
+    ID3D10Device* This,
+    const D3D10_BUFFER_DESC *pDesc,
+    const D3D10_SUBRESOURCE_DATA *pInitialData,
+    ID3D10Buffer **ppBuffer);
+void __RPC_STUB ID3D10Device_CreateBuffer_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateTexture1D_Proxy(
+    ID3D10Device* This,
+    const D3D10_TEXTURE1D_DESC *pDesc,
+    const D3D10_SUBRESOURCE_DATA *pInitialData,
+    ID3D10Texture1D **ppTexture1D);
+void __RPC_STUB ID3D10Device_CreateTexture1D_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateTexture2D_Proxy(
+    ID3D10Device* This,
+    const D3D10_TEXTURE2D_DESC *pDesc,
+    const D3D10_SUBRESOURCE_DATA *pInitialData,
+    ID3D10Texture2D **ppTexture2D);
+void __RPC_STUB ID3D10Device_CreateTexture2D_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateTexture3D_Proxy(
+    ID3D10Device* This,
+    const D3D10_TEXTURE3D_DESC *pDesc,
+    const D3D10_SUBRESOURCE_DATA *pInitialData,
+    ID3D10Texture3D **ppTexture3D);
+void __RPC_STUB ID3D10Device_CreateTexture3D_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateShaderResourceView_Proxy(
+    ID3D10Device* This,
+    ID3D10Resource *pResource,
+    const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
+    ID3D10ShaderResourceView **ppSRView);
+void __RPC_STUB ID3D10Device_CreateShaderResourceView_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateRenderTargetView_Proxy(
+    ID3D10Device* This,
+    ID3D10Resource *pResource,
+    const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
+    ID3D10RenderTargetView **ppRTView);
+void __RPC_STUB ID3D10Device_CreateRenderTargetView_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateDepthStencilView_Proxy(
+    ID3D10Device* This,
+    ID3D10Resource *pResource,
+    const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
+    ID3D10DepthStencilView **ppDepthStencilView);
+void __RPC_STUB ID3D10Device_CreateDepthStencilView_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateInputLayout_Proxy(
+    ID3D10Device* This,
+    const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
+    UINT NumElements,
+    const void *pShaderBytecodeWithInputSignature,
+    SIZE_T BytecodeLength,
+    ID3D10InputLayout **ppInputLayout);
+void __RPC_STUB ID3D10Device_CreateInputLayout_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateVertexShader_Proxy(
+    ID3D10Device* This,
+    const void *pShaderBytecode,
+    SIZE_T BytecodeLength,
+    ID3D10VertexShader **ppVertexShader);
+void __RPC_STUB ID3D10Device_CreateVertexShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateGeometryShader_Proxy(
+    ID3D10Device* This,
+    const void *pShaderBytecode,
+    SIZE_T BytecodeLength,
+    ID3D10GeometryShader **ppGeometryShader);
+void __RPC_STUB ID3D10Device_CreateGeometryShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateGeometryShaderWithStreamOutput_Proxy(
+    ID3D10Device* This,
+    const void *pShaderBytecode,
+    SIZE_T BytecodeLength,
+    const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
+    UINT NumEntries,
+    UINT OutputStreamStride,
+    ID3D10GeometryShader **ppGeometryShader);
+void __RPC_STUB ID3D10Device_CreateGeometryShaderWithStreamOutput_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreatePixelShader_Proxy(
+    ID3D10Device* This,
+    const void *pShaderBytecode,
+    SIZE_T BytecodeLength,
+    ID3D10PixelShader **ppPixelShader);
+void __RPC_STUB ID3D10Device_CreatePixelShader_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateBlendState_Proxy(
+    ID3D10Device* This,
+    const D3D10_BLEND_DESC *pBlendStateDesc,
+    ID3D10BlendState **ppBlendState);
+void __RPC_STUB ID3D10Device_CreateBlendState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateDepthStencilState_Proxy(
+    ID3D10Device* This,
+    const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+    ID3D10DepthStencilState **ppDepthStencilState);
+void __RPC_STUB ID3D10Device_CreateDepthStencilState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateRasterizerState_Proxy(
+    ID3D10Device* This,
+    const D3D10_RASTERIZER_DESC *pRasterizerDesc,
+    ID3D10RasterizerState **ppRasterizerState);
+void __RPC_STUB ID3D10Device_CreateRasterizerState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateSamplerState_Proxy(
+    ID3D10Device* This,
+    const D3D10_SAMPLER_DESC *pSamplerDesc,
+    ID3D10SamplerState **ppSamplerState);
+void __RPC_STUB ID3D10Device_CreateSamplerState_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateQuery_Proxy(
+    ID3D10Device* This,
+    const D3D10_QUERY_DESC *pQueryDesc,
+    ID3D10Query **ppQuery);
+void __RPC_STUB ID3D10Device_CreateQuery_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreatePredicate_Proxy(
+    ID3D10Device* This,
+    const D3D10_QUERY_DESC *pPredicateDesc,
+    ID3D10Predicate **ppPredicate);
+void __RPC_STUB ID3D10Device_CreatePredicate_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CreateCounter_Proxy(
+    ID3D10Device* This,
+    const D3D10_COUNTER_DESC *pCounterDesc,
+    ID3D10Counter **ppCounter);
+void __RPC_STUB ID3D10Device_CreateCounter_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CheckFormatSupport_Proxy(
+    ID3D10Device* This,
+    DXGI_FORMAT Format,
+    UINT *pFormatSupport);
+void __RPC_STUB ID3D10Device_CheckFormatSupport_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CheckMultisampleQualityLevels_Proxy(
+    ID3D10Device* This,
+    DXGI_FORMAT Format,
+    UINT SampleCount,
+    UINT *pNumQualityLevels);
+void __RPC_STUB ID3D10Device_CheckMultisampleQualityLevels_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_CheckCounterInfo_Proxy(
+    ID3D10Device* This,
+    D3D10_COUNTER_INFO *pCounterInfo);
+void __RPC_STUB ID3D10Device_CheckCounterInfo_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_CheckCounter_Proxy(
+    ID3D10Device* This,
+    const D3D10_COUNTER_DESC *pDesc,
+    D3D10_COUNTER_TYPE *pType,
+    UINT *pActiveCounters,
+    LPSTR szName,
+    UINT *pNameLength,
+    LPSTR szUnits,
+    UINT *pUnitsLength,
+    LPSTR szDescription,
+    UINT *pDescriptionLength);
+void __RPC_STUB ID3D10Device_CheckCounter_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+UINT STDMETHODCALLTYPE ID3D10Device_GetCreationFlags_Proxy(
+    ID3D10Device* This);
+void __RPC_STUB ID3D10Device_GetCreationFlags_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT STDMETHODCALLTYPE ID3D10Device_OpenSharedResource_Proxy(
+    ID3D10Device* This,
+    HANDLE hResource,
+    REFIID ReturnedInterface,
+    void **ppResource);
+void __RPC_STUB ID3D10Device_OpenSharedResource_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_SetTextFilterSize_Proxy(
+    ID3D10Device* This,
+    UINT Width,
+    UINT Height);
+void __RPC_STUB ID3D10Device_SetTextFilterSize_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Device_GetTextFilterSize_Proxy(
+    ID3D10Device* This,
+    UINT *pWidth,
+    UINT *pHeight);
+void __RPC_STUB ID3D10Device_GetTextFilterSize_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Device_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ID3D10Multithread interface
+ */
+#ifndef __ID3D10Multithread_INTERFACE_DEFINED__
+#define __ID3D10Multithread_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ID3D10Multithread, 0x9b7e4e00, 0x342c, 0x4106, 0xa1,0x9f, 0x4f,0x27,0x04,0xf6,0x89,0xf0);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+interface ID3D10Multithread : public IUnknown
+{
+    virtual void STDMETHODCALLTYPE Enter(
+        ) = 0;
+
+    virtual void STDMETHODCALLTYPE Leave(
+        ) = 0;
+
+    virtual BOOL STDMETHODCALLTYPE SetMultithreadProtected(
+        BOOL bMTProtect) = 0;
+
+    virtual BOOL STDMETHODCALLTYPE GetMultithreadProtected(
+        ) = 0;
+
+};
+#else
+typedef struct ID3D10MultithreadVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ID3D10Multithread* This,
+        REFIID riid,
+        void **ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ID3D10Multithread* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ID3D10Multithread* This);
+
+    /*** ID3D10Multithread methods ***/
+    void (STDMETHODCALLTYPE *Enter)(
+        ID3D10Multithread* This);
+
+    void (STDMETHODCALLTYPE *Leave)(
+        ID3D10Multithread* This);
+
+    BOOL (STDMETHODCALLTYPE *SetMultithreadProtected)(
+        ID3D10Multithread* This,
+        BOOL bMTProtect);
+
+    BOOL (STDMETHODCALLTYPE *GetMultithreadProtected)(
+        ID3D10Multithread* This);
+
+    END_INTERFACE
+} ID3D10MultithreadVtbl;
+interface ID3D10Multithread {
+    CONST_VTBL ID3D10MultithreadVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ID3D10Multithread_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ID3D10Multithread_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ID3D10Multithread_Release(This) (This)->lpVtbl->Release(This)
+/*** ID3D10Multithread methods ***/
+#define ID3D10Multithread_Enter(This) (This)->lpVtbl->Enter(This)
+#define ID3D10Multithread_Leave(This) (This)->lpVtbl->Leave(This)
+#define ID3D10Multithread_SetMultithreadProtected(This,bMTProtect) (This)->lpVtbl->SetMultithreadProtected(This,bMTProtect)
+#define ID3D10Multithread_GetMultithreadProtected(This) (This)->lpVtbl->GetMultithreadProtected(This)
+#endif
+
+#endif
+
+void STDMETHODCALLTYPE ID3D10Multithread_Enter_Proxy(
+    ID3D10Multithread* This);
+void __RPC_STUB ID3D10Multithread_Enter_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+void STDMETHODCALLTYPE ID3D10Multithread_Leave_Proxy(
+    ID3D10Multithread* This);
+void __RPC_STUB ID3D10Multithread_Leave_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+BOOL STDMETHODCALLTYPE ID3D10Multithread_SetMultithreadProtected_Proxy(
+    ID3D10Multithread* This,
+    BOOL bMTProtect);
+void __RPC_STUB ID3D10Multithread_SetMultithreadProtected_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+BOOL STDMETHODCALLTYPE ID3D10Multithread_GetMultithreadProtected_Proxy(
+    ID3D10Multithread* This);
+void __RPC_STUB ID3D10Multithread_GetMultithreadProtected_Stub(
+    IRpcStubBuffer* This,
+    IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ID3D10Multithread_INTERFACE_DEFINED__ */
+
+#include "d3d10misc.h"
+#include "d3d10shader.h"
+#include "d3d10effect.h"
+/* Begin additional prototypes for all interfaces */
+
+
+/* End additional prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WIDL_D3D10_H */
diff --git a/misc/builddeps/dp.win32/include/d3d10.idl b/misc/builddeps/dp.win32/include/d3d10.idl
new file mode 100644 (file)
index 0000000..6205917
--- /dev/null
@@ -0,0 +1,1539 @@
+/*
+ * Copyright 2007 Andras Kovacs
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+import "oaidl.idl";
+import "ocidl.idl";
+import "dxgi.idl";
+
+cpp_quote("#ifndef _D3D10_CONSTANTS")
+cpp_quote("#define _D3D10_CONSTANTS")
+const float D3D10_DEFAULT_BLEND_FACTOR_ALPHA                                            = 1.0;
+const float D3D10_DEFAULT_BLEND_FACTOR_BLUE                                             = 1.0;
+const float D3D10_DEFAULT_BLEND_FACTOR_GREEN                                            = 1.0;
+const float D3D10_DEFAULT_BLEND_FACTOR_RED                                              = 1.0;
+const float D3D10_DEFAULT_BORDER_COLOR_COMPONENT                                        = 0.0;
+const float D3D10_DEFAULT_SLOPE_SCALED_DEPTH_BIAS                                       = 0.0;
+const float D3D10_DEFAULT_DEPTH_BIAS_CLAMP                                              = 0.0;
+const float D3D10_DEFAULT_MAX_ANISOTROPY                                                = 16.0;
+const float D3D10_DEFAULT_MIP_LOD_BIAS                                                  = 0.0;
+const float D3D10_DEFAULT_VIEWPORT_MAX_DEPTH                                            = 0.0;
+const float D3D10_DEFAULT_VIEWPORT_MIN_DEPTH                                            = 0.0;
+const float D3D10_FLOAT16_FUSED_TOLERANCE_IN_ULP                                        = 0.6;
+const float D3D10_FLOAT32_MAX                                                           = 3.402823466e+38;
+const float D3D10_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP                                   = 0.6;
+const float D3D10_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR                                    = 2.4;
+const float D3D10_FLOAT_TO_SRGB_EXPONENT_NUMERATOR                                      = 1.0;
+const float D3D10_FLOAT_TO_SRGB_OFFSET                                                  = 0.055;
+const float D3D10_FLOAT_TO_SRGB_SCALE_1                                                 = 12.92;
+const float D3D10_FLOAT_TO_SRGB_SCALE_2                                                 = 1.055;
+const float D3D10_FLOAT_TO_SRGB_THRESHOLD                                               = 0.0031308;
+const float D3D10_FTOI_INSTRUCTION_MAX_INPUT                                            = 2147483647.999;
+const float D3D10_FTOI_INSTRUCTION_MIN_INPUT                                            = -2147483648.999;
+const float D3D10_FTOU_INSTRUCTION_MAX_INPUT                                            = 4294967295.999;
+const float D3D10_FTOU_INSTRUCTION_MIN_INPUT                                            = 0.0;
+const float D3D10_LINEAR_GAMMA                                                          = 1.0;
+const float D3D10_MAX_BORDER_COLOR_COMPONENT                                            = 1.0;
+const float D3D10_MAX_DEPTH                                                             = 1.0;
+const float D3D10_MAX_POSITION_VALUE                                                    = 3.402823466e+34;
+const float D3D10_MIN_BORDER_COLOR_COMPONENT                                            = 0.0;
+const float D3D10_MIN_DEPTH                                                             = 0.0;
+const float D3D10_MIP_LOD_BIAS_MAX                                                      = 15.99;
+const float D3D10_MIP_LOD_BIAS_MIN                                                      = -16.0;
+const float D3D10_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT                                  = 0.5;
+const float D3D10_MULTISAMPLE_ANTIALIAS_LINE_WIDTH                                      = 1.4;
+const float D3D10_SRGB_GAMMA                                                            = 2.2;
+const float D3D10_SRGB_TO_FLOAT_DENOMINATOR_1                                           = 12.92;
+const float D3D10_SRGB_TO_FLOAT_DENOMINATOR_2                                           = 1.055;
+const float D3D10_SRGB_TO_FLOAT_EXPONENT                                                = 2.4;
+const float D3D10_SRGB_TO_FLOAT_OFFSET                                                  = 0.055;
+const float D3D10_SRGB_TO_FLOAT_THRESHOLD                                               = 0.04045;
+const float D3D10_SRGB_TO_FLOAT_TOLERANCE_IN_ULP                                        = 0.5;
+const float D3D10_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT                           = 0.0;
+const float D3D_SPEC_VERSION                                                            = 1.050005;
+const unsigned int D3D10_16BIT_INDEX_STRIP_CUT_VALUE                                    = 0xffff;
+const unsigned int D3D10_32BIT_INDEX_STRIP_CUT_VALUE                                    = 0xffffffff;
+const unsigned int D3D10_8BIT_INDEX_STRIP_CUT_VALUE                                     = 0xff;
+const unsigned int D3D10_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT                             = 9;
+const unsigned int D3D10_CLIP_OR_CULL_DISTANCE_COUNT                                    = 8;
+const unsigned int D3D10_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT                            = 2;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT                    = 14;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS                        = 4;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT               = 32;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT                     = 15;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS               = 4;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT                    = 15;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST           = 1;
+const unsigned int D3D10_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS               = 1;
+const unsigned int D3D10_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT                         = 64;
+const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS     = 4;
+const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT          = 1;
+const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST = 1;
+const unsigned int D3D10_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS     = 1;
+const unsigned int D3D10_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT               = 32;
+const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS                = 1;
+const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT                     = 128;
+const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST            = 1;
+const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS                = 1;
+const unsigned int D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT                         = 128;
+const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS                       = 1;
+const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_COUNT                            = 16;
+const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST                   = 1;
+const unsigned int D3D10_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS                       = 1;
+const unsigned int D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT                                = 16;
+const unsigned int D3D10_COMMONSHADER_SUBROUTINE_NESTING_LIMIT                          = 32;
+const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENTS                          = 4;
+const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT                 = 32;
+const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_COUNT                               = 4096;
+const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_READS_PER_INST                      = 3;
+const unsigned int D3D10_COMMONSHADER_TEMP_REGISTER_READ_PORTS                          = 3;
+const unsigned int D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX                      = 10;
+const int D3D10_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN                               = -10;
+const int D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE                                  = -8;
+const unsigned int D3D10_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE                         = 7;
+const unsigned int D3D10_DEFAULT_DEPTH_BIAS                                             = 0;
+const unsigned int D3D10_DEFAULT_RENDER_TARGET_ARRAY_INDEX                              = 0;
+const unsigned int D3D10_DEFAULT_SAMPLE_MASK                                            = 0xffffffff;
+const unsigned int D3D10_DEFAULT_SCISSOR_ENDX                                           = 0;
+const unsigned int D3D10_DEFAULT_SCISSOR_ENDY                                           = 0;
+const unsigned int D3D10_DEFAULT_SCISSOR_STARTX                                         = 0;
+const unsigned int D3D10_DEFAULT_SCISSOR_STARTY                                         = 0;
+const unsigned int D3D10_DEFAULT_STENCIL_READ_MASK                                      = 0xff;
+const unsigned int D3D10_DEFAULT_STENCIL_REFERENCE                                      = 0;
+const unsigned int D3D10_DEFAULT_STENCIL_WRITE_MASK                                     = 0xff;
+const unsigned int D3D10_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX                         = 0;
+const unsigned int D3D10_DEFAULT_VIEWPORT_HEIGHT                                        = 0;
+const unsigned int D3D10_DEFAULT_VIEWPORT_TOPLEFTX                                      = 0;
+const unsigned int D3D10_DEFAULT_VIEWPORT_TOPLEFTY                                      = 0;
+const unsigned int D3D10_DEFAULT_VIEWPORT_WIDTH                                         = 0;
+const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS                        = 1;
+const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT               = 32;
+const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_COUNT                             = 1;
+const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST                    = 2;
+const unsigned int D3D10_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS                        = 1;
+const unsigned int D3D10_GS_INPUT_REGISTER_COMPONENTS                                   = 4;
+const unsigned int D3D10_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT                          =32;
+const unsigned int D3D10_GS_INPUT_REGISTER_COUNT                                        = 16;
+const unsigned int D3D10_GS_INPUT_REGISTER_READS_PER_INST                               = 2;
+const unsigned int D3D10_GS_INPUT_REGISTER_READ_PORTS                                   = 1;
+const unsigned int D3D10_GS_INPUT_REGISTER_VERTICES                                     = 6;
+const unsigned int D3D10_GS_OUTPUT_ELEMENTS                                             = 32;
+const unsigned int D3D10_GS_OUTPUT_REGISTER_COMPONENTS                                  = 4;
+const unsigned int D3D10_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT                         = 32;
+const unsigned int D3D10_GS_OUTPUT_REGISTER_COUNT                                       = 32;
+const unsigned int D3D10_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES                        = 0;
+const unsigned int D3D10_IA_DEFAULT_PRIMITIVE_TOPOLOGY                                  = 0;
+const unsigned int D3D10_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES                       = 0;
+const unsigned int D3D10_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT                             = 1;
+const unsigned int D3D10_IA_INSTANCE_ID_BIT_COUNT                                       = 32;
+const unsigned int D3D10_IA_INTEGER_ARITHMETIC_BIT_COUNT                                = 32;
+const unsigned int D3D10_IA_PRIMITIVE_ID_BIT_COUNT                                      = 32;
+const unsigned int D3D10_IA_VERTEX_ID_BIT_COUNT                                         = 32;
+const unsigned int D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT                            = 16;
+const unsigned int D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS                  = 64;
+const unsigned int D3D10_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT                        = 16;
+const unsigned int D3D10_INTEGER_DIVIDE_BY_ZERO_QUOTIENT                                = 0xffffffff;
+const unsigned int D3D10_INTEGER_DIVIDE_BY_ZERO_REMAINDER                               = 0xffffffff;
+const unsigned int D3D10_MAX_MAXANISOTROPY                                              = 16;
+const unsigned int D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT                                   = 32;
+const unsigned int D3D10_MAX_TEXTURE_DIMENSION_2_TO_EXP                                 = 17;
+const unsigned int D3D10_MIN_MAXANISOTROPY                                              = 0;
+const unsigned int D3D10_MIP_LOD_FRACTIONAL_BIT_COUNT                                   = 6;
+const unsigned int D3D10_MIP_LOD_RANGE_BIT_COUNT                                        = 8;
+const unsigned int D3D10_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT                     = 0;
+const unsigned int D3D10_PIXEL_ADDRESS_RANGE_BIT_COUNT                                  = 13;
+const unsigned int D3D10_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT                      = 15;
+const unsigned int D3D10_PS_FRONTFACING_DEFAULT_VALUE                                   = 0xffffffff;
+const unsigned int D3D10_PS_FRONTFACING_FALSE_VALUE                                     = 0;
+const unsigned int D3D10_PS_FRONTFACING_TRUE_VALUE                                      = 0xffffffff;
+const unsigned int D3D10_PS_INPUT_REGISTER_COMPONENTS                                   = 4;
+const unsigned int D3D10_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT                          = 32;
+const unsigned int D3D10_PS_INPUT_REGISTER_COUNT                                        = 32;
+const unsigned int D3D10_PS_INPUT_REGISTER_READS_PER_INST                               = 2;
+const unsigned int D3D10_PS_INPUT_REGISTER_READ_PORTS                                   = 1;
+const unsigned int D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS                            = 1;
+const unsigned int D3D10_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT                   = 32;
+const unsigned int D3D10_PS_OUTPUT_DEPTH_REGISTER_COUNT                                 = 1;
+const unsigned int D3D10_PS_OUTPUT_REGISTER_COMPONENTS                                  = 4;
+const unsigned int D3D10_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT                         = 32;
+const unsigned int D3D10_PS_OUTPUT_REGISTER_COUNT                                       = 8;
+const unsigned int D3D10_REQ_BLEND_OBJECT_COUNT_PER_CONTEXT                             = 4096;
+const unsigned int D3D10_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP                       = 27;
+const unsigned int D3D10_REQ_CONSTANT_BUFFER_ELEMENT_COUNT                              = 4096;
+const unsigned int D3D10_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_CONTEXT                     = 4096;
+const unsigned int D3D10_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP                           = 32;
+const unsigned int D3D10_REQ_DRAW_VERTEX_COUNT_2_TO_EXP                                 = 32;
+const unsigned int D3D10_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION                = 8192;
+const unsigned int D3D10_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT                 = 1024;
+const unsigned int D3D10_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT                    = 4096;
+const unsigned int D3D10_REQ_MAXANISOTROPY                                              = 16;
+const unsigned int D3D10_REQ_MIP_LEVELS                                                 = 14;
+const unsigned int D3D10_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES                      = 2048;
+const unsigned int D3D10_REQ_RASTERIZER_OBJECT_COUNT_PER_CONTEXT                        = 4096;
+const unsigned int D3D10_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH                              = 8192;
+const unsigned int D3D10_REQ_RESOURCE_SIZE_IN_MEGABYTES                                 = 128;
+const unsigned int D3D10_REQ_RESOURCE_VIEW_COUNT_PER_CONTEXT_2_TO_EXP                   = 20;
+const unsigned int D3D10_REQ_SAMPLER_OBJECT_COUNT_PER_CONTEXT                           = 4096;
+const unsigned int D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION                             = 512;
+const unsigned int D3D10_REQ_TEXTURE1D_U_DIMENSION                                      = 8192;
+const unsigned int D3D10_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION                             = 512;
+const unsigned int D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION                                 = 8192;
+const unsigned int D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION                               = 2048;
+const unsigned int D3D10_REQ_TEXTURECUBE_DIMENSION                                      = 8192;
+const unsigned int D3D10_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL                   = 0;
+const unsigned int D3D10_SHADER_MAJOR_VERSION                                           = 4;
+const unsigned int D3D10_SHADER_MINOR_VERSION                                           = 0;
+const unsigned int D3D10_SHIFT_INSTRUCTION_PAD_VALUE                                    = 0;
+const unsigned int D3D10_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT                        = 5;
+const unsigned int D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT                               = 8;
+const unsigned int D3D10_SO_BUFFER_MAX_STRIDE_IN_BYTES                                  = 2048;
+const unsigned int D3D10_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES                            = 256;
+const unsigned int D3D10_SO_BUFFER_SLOT_COUNT                                           = 4;
+const unsigned int D3D10_SO_DDI_REGISTER_INDEX_DENOTING_GAP                             = 0xffffffff;
+const unsigned int D3D10_SO_MULTIPLE_BUFFER_ELEMENTS_PER_BUFFER                         = 1;
+const unsigned int D3D10_SO_SINGLE_BUFFER_COMPONENT_LIMIT                               = 64;
+const unsigned int D3D10_STANDARD_COMPONENT_BIT_COUNT                                   = 32;
+const unsigned int D3D10_STANDARD_COMPONENT_BIT_COUNT_DOUBLED                           = 64;
+const unsigned int D3D10_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE               = 4;
+const unsigned int D3D10_STANDARD_PIXEL_COMPONENT_COUNT                                 = 128;
+const unsigned int D3D10_STANDARD_PIXEL_ELEMENT_COUNT                                   = 32;
+const unsigned int D3D10_STANDARD_VECTOR_SIZE                                           = 4;
+const unsigned int D3D10_STANDARD_VERTEX_ELEMENT_COUNT                                  = 16;
+const unsigned int D3D10_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT                          = 64;
+const unsigned int D3D10_SUBPIXEL_FRACTIONAL_BIT_COUNT                                  = 8;
+const unsigned int D3D10_SUBTEXEL_FRACTIONAL_BIT_COUNT                                  = 6;
+const unsigned int D3D10_TEXEL_ADDRESS_RANGE_BIT_COUNT                                  = 18;
+const unsigned int D3D10_UNBOUND_MEMORY_ACCESS_RESULT                                   = 0;
+const unsigned int D3D10_VIEWPORT_AND_SCISSORRECT_MAX_INDEX                             = 15;
+const unsigned int D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE             = 16;
+const unsigned int D3D10_VIEWPORT_BOUNDS_MAX                                            = 16383;
+const int D3D10_VIEWPORT_BOUNDS_MIN                                                     = -16384;
+const unsigned int D3D10_VS_INPUT_REGISTER_COMPONENTS                                   = 4;
+const unsigned int D3D10_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT                          = 32;
+const unsigned int D3D10_VS_INPUT_REGISTER_COUNT                                        = 16;
+const unsigned int D3D10_VS_INPUT_REGISTER_READS_PER_INST                               = 2;
+const unsigned int D3D10_VS_INPUT_REGISTER_READ_PORTS                                   = 1;
+const unsigned int D3D10_VS_OUTPUT_REGISTER_COMPONENTS                                  = 4;
+const unsigned int D3D10_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT                         = 32;
+const unsigned int D3D10_VS_OUTPUT_REGISTER_COUNT                                       = 16;
+const unsigned int D3D10_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT                          = 10;
+const unsigned int D3D10_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP                          = 25;
+const unsigned int D3D10_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP                                = 25;
+const unsigned int D3D_MAJOR_VERSION                                                    = 10;
+const unsigned int D3D_MINOR_VERSION                                                    = 0;
+const unsigned int D3D_SPEC_DATE_DAY                                                    = 8;
+const unsigned int D3D_SPEC_DATE_MONTH                                                  = 8;
+const unsigned int D3D_SPEC_DATE_YEAR                                                   = 2006;
+cpp_quote("#endif")
+
+const unsigned int D3D10_APPEND_ALIGNED_ELEMENT                                         = 0xffffffff;
+const unsigned int _FACD3D10                                                            = 0x87;
+const unsigned int _FACD3D10DEBUG                                                       = _FACD3D10 + 1;
+const unsigned int D3D10_FILTER_TYPE_MASK                                               = 0x3;
+const unsigned int D3D10_SDK_VERSION                                                    = 29;
+
+cpp_quote("#define MAKE_D3D10_HRESULT(code)                   MAKE_HRESULT( 1, _FACD3D10, code)")
+cpp_quote("#define MAKE_D3D10_STATUS(code)                    MAKE_HRESULT( 0, _FACD3D10, code)")
+cpp_quote("#define D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS  MAKE_D3D10_HRESULT(1)")
+cpp_quote("#define D3D10_ERROR_FILE_NOT_FOUND                 MAKE_D3D10_HRESULT(2)")
+
+typedef enum D3D10_BLEND {
+    D3D10_BLEND_ZERO             = 1,
+    D3D10_BLEND_ONE              = 2,
+    D3D10_BLEND_SRC_COLOR        = 3,
+    D3D10_BLEND_INV_SRC_COLOR    = 4,
+    D3D10_BLEND_SRC_ALPHA        = 5,
+    D3D10_BLEND_INV_SRC_ALPHA    = 6,
+    D3D10_BLEND_DEST_ALPHA       = 7,
+    D3D10_BLEND_INV_DEST_ALPHA   = 8,
+    D3D10_BLEND_DEST_COLOR       = 9,
+    D3D10_BLEND_INV_DEST_COLOR   = 10,
+    D3D10_BLEND_SRC_ALPHA_SAT    = 11,
+    D3D10_BLEND_BLEND_FACTOR     = 14,
+    D3D10_BLEND_INV_BLEND_FACTOR = 15,
+    D3D10_BLEND_SRC1_COLOR       = 16,
+    D3D10_BLEND_INV_SRC1_COLOR   = 17,
+    D3D10_BLEND_SRC1_ALPHA       = 18,
+    D3D10_BLEND_INV_SRC1_ALPHA   = 19
+} D3D10_BLEND;
+
+typedef enum D3D10_BLEND_OP {
+    D3D10_BLEND_OP_ADD = 1,
+    D3D10_BLEND_OP_SUBTRACT,
+    D3D10_BLEND_OP_REV_SUBTRACT,
+    D3D10_BLEND_OP_MIN,
+    D3D10_BLEND_OP_MAX,
+} D3D10_BLEND_OP;
+
+typedef struct D3D10_BLEND_DESC {
+    BOOL AlphaToCoverageEnable;
+    BOOL BlendEnable[8];
+    D3D10_BLEND SrcBlend;
+    D3D10_BLEND DestBlend;
+    D3D10_BLEND_OP BlendOp;
+    D3D10_BLEND SrcBlendAlpha;
+    D3D10_BLEND DestBlendAlpha;
+    D3D10_BLEND_OP BlendOpAlpha;
+    UINT8 RenderTargetWriteMask[8];
+} D3D10_BLEND_DESC;
+
+typedef enum D3D10_DEPTH_WRITE_MASK {
+    D3D10_DEPTH_WRITE_MASK_ZERO,
+    D3D10_DEPTH_WRITE_MASK_ALL,
+} D3D10_DEPTH_WRITE_MASK;
+
+typedef enum D3D10_COMPARISON_FUNC {
+    D3D10_COMPARISON_NEVER = 1,
+    D3D10_COMPARISON_LESS,
+    D3D10_COMPARISON_EQUAL,
+    D3D10_COMPARISON_LESS_EQUAL,
+    D3D10_COMPARISON_GREATER,
+    D3D10_COMPARISON_NOT_EQUAL,
+    D3D10_COMPARISON_GREATER_EQUAL,
+    D3D10_COMPARISON_ALWAYS,
+} D3D10_COMPARISON_FUNC;
+
+typedef enum D3D10_STENCIL_OP {
+    D3D10_STENCIL_OP_KEEP = 1,
+    D3D10_STENCIL_OP_ZERO,
+    D3D10_STENCIL_OP_REPLACE,
+    D3D10_STENCIL_OP_INCR_SAT,
+    D3D10_STENCIL_OP_DECR_SAT,
+    D3D10_STENCIL_OP_INVERT,
+    D3D10_STENCIL_OP_INCR,
+    D3D10_STENCIL_OP_DECR,
+} D3D10_STENCIL_OP;
+
+typedef struct D3D10_DEPTH_STENCILOP_DESC {
+    D3D10_STENCIL_OP StencilFailOp;
+    D3D10_STENCIL_OP StencilDepthFailOp;
+    D3D10_STENCIL_OP StencilPassOp;
+    D3D10_COMPARISON_FUNC StencilFunc;
+} D3D10_DEPTH_STENCILOP_DESC;
+
+typedef struct D3D10_DEPTH_STENCIL_DESC {
+    BOOL DepthEnable;
+    D3D10_DEPTH_WRITE_MASK DepthWriteMask;
+    D3D10_COMPARISON_FUNC DepthFunc;
+    BOOL StencilEnable;
+    UINT8 StencilReadMask;
+    UINT8 StencilWriteMask;
+    D3D10_DEPTH_STENCILOP_DESC FrontFace;
+    D3D10_DEPTH_STENCILOP_DESC BackFace;
+} D3D10_DEPTH_STENCIL_DESC;
+
+typedef enum D3D10_FILL_MODE {
+    D3D10_FILL_WIREFRAME = 2,
+    D3D10_FILL_SOLID,
+} D3D10_FILL_MODE;
+
+typedef enum D3D10_CULL_MODE {
+    D3D10_CULL_NONE = 1,
+    D3D10_CULL_FRONT,
+    D3D10_CULL_BACK,
+} D3D10_CULL_MODE;
+
+typedef struct D3D10_RASTERIZER_DESC {
+    D3D10_FILL_MODE FillMode;
+    D3D10_CULL_MODE CullMode;
+    BOOL FrontCounterClockwise;
+    INT DepthBias;
+    FLOAT DepthBiasClamp;
+    FLOAT SlopeScaledDepthBias;
+    BOOL DepthClipEnable;
+    BOOL ScissorEnable;
+    BOOL MultisampleEnable;
+    BOOL AntialiasedLineEnable;
+} D3D10_RASTERIZER_DESC;
+
+typedef enum D3D10_FILTER {
+    D3D10_FILTER_MIN_MAG_MIP_POINT                          = 0,
+    D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR                   = 0x1,
+    D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT             = 0x4,
+    D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR                   = 0x5,
+    D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT                   = 0x10,
+    D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR            = 0x11,
+    D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT                   = 0x14,
+    D3D10_FILTER_MIN_MAG_MIP_LINEAR                         = 0x15,
+    D3D10_FILTER_ANISOTROPIC                                = 0x55,
+    D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT               = 0x80,
+    D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR        = 0x81,
+    D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT  = 0x84,
+    D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR        = 0x85,
+    D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT        = 0x90,
+    D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
+    D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT        = 0x94,
+    D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR              = 0x95,
+    D3D10_FILTER_COMPARISON_ANISOTROPIC                     = 0xd5,
+    D3D10_FILTER_TEXT_1BIT                                  = 0x80000000
+} D3D10_FILTER;
+
+typedef enum D3D10_TEXTURE_ADDRESS_MODE {
+    D3D10_TEXTURE_ADDRESS_WRAP = 1,
+    D3D10_TEXTURE_ADDRESS_MIRROR,
+    D3D10_TEXTURE_ADDRESS_CLAMP,
+    D3D10_TEXTURE_ADDRESS_BORDER,
+    D3D10_TEXTURE_ADDRESS_MIRROR_ONCE,
+} D3D10_TEXTURE_ADDRESS_MODE;
+
+typedef struct D3D10_SAMPLER_DESC {
+    D3D10_FILTER Filter;
+    D3D10_TEXTURE_ADDRESS_MODE AddressU;
+    D3D10_TEXTURE_ADDRESS_MODE AddressV;
+    D3D10_TEXTURE_ADDRESS_MODE AddressW;
+    FLOAT MipLODBias;
+    UINT MaxAnisotropy;
+    D3D10_COMPARISON_FUNC ComparisonFunc;
+    FLOAT BorderColor[4];
+    FLOAT MinLOD;
+    FLOAT MaxLOD;
+} D3D10_SAMPLER_DESC;
+
+typedef enum D3D10_COUNTER {
+    D3D10_COUNTER_GPU_IDLE,
+    D3D10_COUNTER_VERTEX_PROCESSING,
+    D3D10_COUNTER_GEOMETRY_PROCESSING,
+    D3D10_COUNTER_PIXEL_PROCESSING,
+    D3D10_COUNTER_OTHER_GPU_PROCESSING,
+    D3D10_COUNTER_HOST_ADAPTER_BANDWIDTH_UTILIZATION,
+    D3D10_COUNTER_LOCAL_VIDMEM_BANDWIDTH_UTILIZATION,
+    D3D10_COUNTER_VERTEX_THROUGHPUT_UTILIZATION,
+    D3D10_COUNTER_TRIANGLE_SETUP_THROUGHPUT_UTILIZATION,
+    D3D10_COUNTER_FILLRATE_THROUGHPUT_UTILIZATION,
+    D3D10_COUNTER_VS_MEMORY_LIMITED,
+    D3D10_COUNTER_VS_COMPUTATION_LIMITED,
+    D3D10_COUNTER_GS_MEMORY_LIMITED,
+    D3D10_COUNTER_GS_COMPUTATION_LIMITED,
+    D3D10_COUNTER_PS_MEMORY_LIMITED,
+    D3D10_COUNTER_PS_COMPUTATION_LIMITED,
+    D3D10_COUNTER_POST_TRANSFORM_CACHE_HIT_RATE,
+    D3D10_COUNTER_TEXTURE_CACHE_HIT_RATE,
+    D3D10_COUNTER_DEVICE_DEPENDENT_0 = 0x40000000
+} D3D10_COUNTER;
+
+typedef struct D3D10_COUNTER_DESC {
+    D3D10_COUNTER Counter;
+    UINT MiscFlags;
+} D3D10_COUNTER_DESC;
+
+typedef enum D3D10_COUNTER_TYPE {
+    D3D10_COUNTER_TYPE_FLOAT32,
+    D3D10_COUNTER_TYPE_UINT16,
+    D3D10_COUNTER_TYPE_UINT32,
+    D3D10_COUNTER_TYPE_UINT64,
+} D3D10_COUNTER_TYPE;
+
+typedef struct D3D10_COUNTER_INFO {
+    D3D10_COUNTER LastDeviceDependentCounter;
+    UINT NumSimultaneousCounters;
+    UINT8 NumDetectableParallelUnits;
+} D3D10_COUNTER_INFO;
+
+typedef enum D3D10_RESOURCE_DIMENSION {
+    D3D10_RESOURCE_DIMENSION_UNKNOWN,
+    D3D10_RESOURCE_DIMENSION_BUFFER,
+    D3D10_RESOURCE_DIMENSION_TEXTURE1D,
+    D3D10_RESOURCE_DIMENSION_TEXTURE2D,
+    D3D10_RESOURCE_DIMENSION_TEXTURE3D,
+} D3D10_RESOURCE_DIMENSION;
+
+typedef enum D3D10_USAGE {
+    D3D10_USAGE_DEFAULT,
+    D3D10_USAGE_IMMUTABLE,
+    D3D10_USAGE_DYNAMIC,
+    D3D10_USAGE_STAGING,
+} D3D10_USAGE;
+
+typedef struct D3D10_BUFFER_DESC {
+    UINT ByteWidth;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_BUFFER_DESC;
+
+typedef enum D3D10_MAP {
+    D3D10_MAP_READ = 1,
+    D3D10_MAP_WRITE,
+    D3D10_MAP_READ_WRITE,
+    D3D10_MAP_WRITE_DISCARD,
+    D3D10_MAP_WRITE_NO_OVERWRITE,
+} D3D10_MAP;
+
+typedef struct D3D10_TEXTURE1D_DESC {
+    UINT Width;
+    UINT MipLevels;
+    UINT ArraySize;
+    DXGI_FORMAT Format;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_TEXTURE1D_DESC;
+
+typedef struct D3D10_TEXTURE2D_DESC {
+    UINT Width;
+    UINT Height;
+    UINT MipLevels;
+    UINT ArraySize;
+    DXGI_FORMAT Format;
+    DXGI_SAMPLE_DESC SampleDesc;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_TEXTURE2D_DESC;
+
+typedef struct D3D10_TEXTURE3D_DESC {
+    UINT Width;
+    UINT Height;
+    UINT Depth;
+    UINT MipLevels;
+    DXGI_FORMAT Format;
+    D3D10_USAGE Usage;
+    UINT BindFlags;
+    UINT CPUAccessFlags;
+    UINT MiscFlags;
+} D3D10_TEXTURE3D_DESC;
+
+typedef enum D3D10_DSV_DIMENSION
+{
+    D3D10_DSV_DIMENSION_UNKNOWN,
+    D3D10_DSV_DIMENSION_TEXTURE1D,
+    D3D10_DSV_DIMENSION_TEXTURE1DARRAY,
+    D3D10_DSV_DIMENSION_TEXTURE2D,
+    D3D10_DSV_DIMENSION_TEXTURE2DARRAY,
+    D3D10_DSV_DIMENSION_TEXTURE2DMS,
+    D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY,
+} D3D10_DSV_DIMENSION;
+
+typedef struct D3D10_TEX1D_DSV {
+    UINT MipSlice;
+} D3D10_TEX1D_DSV;
+
+typedef struct D3D10_TEX1D_ARRAY_DSV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX1D_ARRAY_DSV;
+
+typedef struct D3D10_TEX2D_DSV {
+    UINT MipSlice;
+} D3D10_TEX2D_DSV;
+
+typedef struct D3D10_TEX2D_ARRAY_DSV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2D_ARRAY_DSV;
+
+typedef struct D3D10_TEX2DMS_DSV {
+    UINT UnusedField_NothingToDefine;
+} D3D10_TEX2DMS_DSV;
+
+typedef struct D3D10_TEX2DMS_ARRAY_DSV {
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2DMS_ARRAY_DSV;
+
+typedef struct D3D10_DEPTH_STENCIL_VIEW_DESC {
+    DXGI_FORMAT Format;
+    D3D10_DSV_DIMENSION ViewDimension;
+    union {
+        D3D10_TEX1D_DSV Texture1D;
+        D3D10_TEX1D_ARRAY_DSV Texture1DArray;
+        D3D10_TEX2D_DSV Texture2D;
+        D3D10_TEX2D_ARRAY_DSV Texture2DArray;
+        D3D10_TEX2DMS_DSV Texture2DMS;
+        D3D10_TEX2DMS_ARRAY_DSV Texture2DMSArray;
+    } DUMMYUNIONNAME;
+} D3D10_DEPTH_STENCIL_VIEW_DESC;
+
+typedef enum D3D10_RTV_DIMENSION {
+    D3D10_RTV_DIMENSION_UNKNOWN,
+    D3D10_RTV_DIMENSION_BUFFER,
+    D3D10_RTV_DIMENSION_TEXTURE1D,
+    D3D10_RTV_DIMENSION_TEXTURE1DARRAY,
+    D3D10_RTV_DIMENSION_TEXTURE2D,
+    D3D10_RTV_DIMENSION_TEXTURE2DARRAY,
+    D3D10_RTV_DIMENSION_TEXTURE2DMS,
+    D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY,
+    D3D10_RTV_DIMENSION_TEXTURE3D,
+} D3D10_RTV_DIMENSION;
+
+typedef struct D3D10_BUFFER_RTV {
+    UINT ElementOffset;
+    UINT ElementWidth;
+} D3D10_BUFFER_RTV;
+
+typedef struct D3D10_TEX1D_RTV {
+    UINT MipSlice;
+} D3D10_TEX1D_RTV;
+
+typedef struct D3D10_TEX1D_ARRAY_RTV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX1D_ARRAY_RTV;
+
+typedef struct D3D10_TEX2D_RTV {
+    UINT MipSlice;
+} D3D10_TEX2D_RTV;
+
+typedef struct D3D10_TEX2D_ARRAY_RTV {
+    UINT MipSlice;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2D_ARRAY_RTV;
+
+typedef struct D3D10_TEX2DMS_RTV {
+    UINT UnusedField_NothingToDefine;
+} D3D10_TEX2DMS_RTV;
+
+typedef struct D3D10_TEX2DMS_ARRAY_RTV {
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2DMS_ARRAY_RTV;
+
+typedef struct D3D10_TEX3D_RTV {
+    UINT MipSlice;
+    UINT FirstWSlice;
+    UINT WSize;
+} D3D10_TEX3D_RTV;
+
+typedef struct D3D10_RENDER_TARGET_VIEW_DESC {
+    DXGI_FORMAT Format;
+    D3D10_RTV_DIMENSION ViewDimension;
+    union {
+        D3D10_BUFFER_RTV Buffer;
+        D3D10_TEX1D_RTV Texture1D;
+        D3D10_TEX1D_ARRAY_RTV Texture1DArray;
+        D3D10_TEX2D_RTV Texture2D;
+        D3D10_TEX2D_ARRAY_RTV Texture2DArray;
+        D3D10_TEX2DMS_RTV Texture2DMS;
+        D3D10_TEX2DMS_ARRAY_RTV Texture2DMSArray;
+        D3D10_TEX3D_RTV Texture3D;
+    } DUMMYUNIONNAME;
+} D3D10_RENDER_TARGET_VIEW_DESC;
+
+typedef enum D3D10_SRV_DIMENSION {
+    D3D10_SRV_DIMENSION_UNKNOWN,
+    D3D10_SRV_DIMENSION_BUFFER,
+    D3D10_SRV_DIMENSION_TEXTURE1D,
+    D3D10_SRV_DIMENSION_TEXTURE1DARRAY,
+    D3D10_SRV_DIMENSION_TEXTURE2D,
+    D3D10_SRV_DIMENSION_TEXTURE2DARRAY,
+    D3D10_SRV_DIMENSION_TEXTURE2DMS,
+    D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY,
+    D3D10_SRV_DIMENSION_TEXTURE3D,
+    D3D10_SRV_DIMENSION_TEXTURECUBE,
+} D3D10_SRV_DIMENSION;
+
+typedef struct D3D10_BUFFER_SRV {
+    UINT ElementOffset;
+    UINT ElementWidth;
+} D3D10_BUFFER_SRV;
+
+typedef struct D3D10_TEX1D_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEX1D_SRV;
+
+typedef struct D3D10_TEX1D_ARRAY_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX1D_ARRAY_SRV;
+
+typedef struct D3D10_TEX2D_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEX2D_SRV;
+
+typedef struct D3D10_TEX2D_ARRAY_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2D_ARRAY_SRV;
+
+typedef struct D3D10_TEX2DMS_SRV {
+    UINT UnusedField_NothingToDefine;
+} D3D10_TEX2DMS_SRV;
+
+typedef struct D3D10_TEX2DMS_ARRAY_SRV {
+    UINT FirstArraySlice;
+    UINT ArraySize;
+} D3D10_TEX2DMS_ARRAY_SRV;
+
+typedef struct D3D10_TEX3D_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEX3D_SRV;
+
+typedef struct D3D10_TEXCUBE_SRV {
+    UINT MostDetailedMip;
+    UINT MipLevels;
+} D3D10_TEXCUBE_SRV;
+
+typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC {
+    DXGI_FORMAT Format;
+    D3D10_SRV_DIMENSION ViewDimension;
+    union {
+        D3D10_BUFFER_SRV Buffer;
+        D3D10_TEX1D_SRV Texture1D;
+        D3D10_TEX1D_ARRAY_SRV Texture1DArray;
+        D3D10_TEX2D_SRV Texture2D;
+        D3D10_TEX2D_ARRAY_SRV Texture2DArray;
+        D3D10_TEX2DMS_SRV Texture2DMS;
+        D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray;
+        D3D10_TEX3D_SRV Texture3D;
+        D3D10_TEXCUBE_SRV TextureCube;
+    } DUMMYUNIONNAME;
+} D3D10_SHADER_RESOURCE_VIEW_DESC;
+
+typedef struct D3D10_BOX {
+    UINT left;
+    UINT top;
+    UINT front;
+    UINT right;
+    UINT bottom;
+    UINT back;
+} D3D10_BOX;
+
+typedef struct D3D10_SUBRESOURCE_DATA {
+    const void *pSysMem;
+    UINT SysMemPitch;
+    UINT SysMemSlicePitch;
+} D3D10_SUBRESOURCE_DATA;
+
+typedef struct D3D10_SO_DECLARATION_ENTRY {
+    LPCSTR SemanticName;
+    UINT SemanticIndex;
+    BYTE StartComponent;
+    BYTE ComponentCount;
+    BYTE OutputSlot;
+} D3D10_SO_DECLARATION_ENTRY;
+
+typedef enum D3D10_INPUT_CLASSIFICATION {
+    D3D10_INPUT_PER_VERTEX_DATA,
+    D3D10_INPUT_PER_INSTANCE_DATA,
+} D3D10_INPUT_CLASSIFICATION;
+
+typedef struct D3D10_INPUT_ELEMENT_DESC {
+    LPCSTR SemanticName;
+    UINT SemanticIndex;
+    DXGI_FORMAT Format;
+    UINT InputSlot;
+    UINT AlignedByteOffset;
+    D3D10_INPUT_CLASSIFICATION InputSlotClass;
+    UINT InstanceDataStepRate;
+} D3D10_INPUT_ELEMENT_DESC;
+
+typedef enum D3D10_QUERY {
+    D3D10_QUERY_EVENT,
+    D3D10_QUERY_OCCLUSION,
+    D3D10_QUERY_TIMESTAMP,
+    D3D10_QUERY_TIMESTAMP_DISJOINT,
+    D3D10_QUERY_PIPELINE_STATISTICS,
+    D3D10_QUERY_OCCLUSION_PREDICATE,
+    D3D10_QUERY_SO_STATISTICS,
+    D3D10_QUERY_SO_OVERFLOW_PREDICATE,
+} D3D10_QUERY;
+
+typedef struct D3D10_QUERY_DESC {
+    D3D10_QUERY Query;
+    UINT MiscFlags;
+} D3D10_QUERY_DESC;
+
+typedef enum D3D10_PRIMITIVE_TOPOLOGY {
+    D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED         = 0,
+    D3D10_PRIMITIVE_TOPOLOGY_POINTLIST         = 1,
+    D3D10_PRIMITIVE_TOPOLOGY_LINELIST          = 2,
+    D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP         = 3,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST      = 4,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP     = 5,
+    D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ      = 10,
+    D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ     = 11,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ  = 12,
+    D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13
+} D3D10_PRIMITIVE_TOPOLOGY;
+
+typedef RECT D3D10_RECT;
+
+typedef struct D3D10_VIEWPORT {
+    INT TopLeftX;
+    INT TopLeftY;
+    UINT Width;
+    UINT Height;
+    FLOAT MinDepth;
+    FLOAT MaxDepth;
+} D3D10_VIEWPORT;
+
+typedef struct D3D10_MAPPED_TEXTURE2D {
+    void *pData;
+    UINT RowPitch;
+} D3D10_MAPPED_TEXTURE2D;
+
+typedef struct D3D10_MAPPED_TEXTURE3D {
+    void *pData;
+    UINT RowPitch;
+    UINT DepthPitch;
+} D3D10_MAPPED_TEXTURE3D;
+
+typedef enum D3D10_BIND_FLAG {
+    D3D10_BIND_VERTEX_BUFFER   = 0x1,
+    D3D10_BIND_INDEX_BUFFER    = 0x2,
+    D3D10_BIND_CONSTANT_BUFFER = 0x4,
+    D3D10_BIND_SHADER_RESOURCE = 0x8,
+    D3D10_BIND_STREAM_OUTPUT   = 0x10,
+    D3D10_BIND_RENDER_TARGET   = 0x20,
+    D3D10_BIND_DEPTH_STENCIL   = 0x40
+} D3D10_BIND_FLAG;
+
+typedef enum D3D10_CPU_ACCESS_FLAG {
+    D3D10_CPU_ACCESS_WRITE = 0x10000,
+    D3D10_CPU_ACCESS_READ  = 0x20000
+} D3D10_CPU_ACCESS_FLAG;
+
+typedef enum D3D10_RESOURCE_MISC_FLAG {
+    D3D10_RESOURCE_MISC_GENERATE_MIPS = 0x1,
+    D3D10_RESOURCE_MISC_SHARED        = 0x2,
+    D3D10_RESOURCE_MISC_TEXTURECUBE   = 0x4
+} D3D10_RESOURCE_MISC_FLAG;
+
+typedef enum D3D10_MAP_FLAG {
+    D3D10_MAP_FLAG_DO_NOT_WAIT = 0x100000,
+} D3D10_MAP_FLAG;
+
+typedef enum D3D10_CLEAR_FLAG {
+    D3D10_CLEAR_DEPTH   = 0x1,
+    D3D10_CLEAR_STENCIL = 0x2
+} D3D10_CLEAR_FLAG;
+
+typedef enum D3D10_COLOR_WRITE_ENABLE {
+    D3D10_COLOR_WRITE_ENABLE_RED   = 0x1,
+    D3D10_COLOR_WRITE_ENABLE_GREEN = 0x2,
+    D3D10_COLOR_WRITE_ENABLE_BLUE  = 0x4,
+    D3D10_COLOR_WRITE_ENABLE_ALPHA = 0x8,
+    D3D10_COLOR_WRITE_ENABLE_ALL   = (D3D10_COLOR_WRITE_ENABLE_RED  | D3D10_COLOR_WRITE_ENABLE_GREEN |
+                                      D3D10_COLOR_WRITE_ENABLE_BLUE | D3D10_COLOR_WRITE_ENABLE_ALPHA)
+} D3D10_COLOR_WRITE_ENABLE;
+
+typedef enum D3D10_TEXTURECUBE_FACE {
+    D3D10_TEXTURECUBE_FACE_POSITIVE_X,
+    D3D10_TEXTURECUBE_FACE_NEGATIVE_X,
+    D3D10_TEXTURECUBE_FACE_POSITIVE_Y,
+    D3D10_TEXTURECUBE_FACE_NEGATIVE_Y,
+    D3D10_TEXTURECUBE_FACE_POSITIVE_Z,
+    D3D10_TEXTURECUBE_FACE_NEGATIVE_Z,
+} D3D10_TEXTURECUBE_FACE;
+
+typedef enum D3D10_ASYNC_GETDATA_FLAG {
+    D3D10_ASYNC_GETDATA_DONOTFLUSH = 0x1,
+} D3D10_ASYNC_GETDATA_FLAG;
+
+typedef enum D3D10_FILTER_TYPE {
+    D3D10_FILTER_TYPE_POINT,
+    D3D10_FILTER_TYPE_LINEAR
+} D3D10_FILTER_TYPE;
+
+typedef enum D3D10_QUERY_MISC_FLAG {
+    D3D10_QUERY_MISC_PREDICATEHINT = 0x1
+} D3D10_QUERY_MISC_FLAG;
+
+typedef struct D3D10_QUERY_DATA_TIMESTAMP_DISJOINT {
+    UINT64 Frequency;
+    BOOL Disjoint;
+} D3D10_QUERY_DATA_TIMESTAMP_DISJOINT;
+
+typedef struct D3D10_QUERY_DATA_PIPELINE_STATISTICS {
+    UINT64 IAVertices;
+    UINT64 IAPrimitives;
+    UINT64 VSInvocations;
+    UINT64 GSInvocations;
+    UINT64 GSPrimitives;
+    UINT64 CInvocations;
+    UINT64 CPrimitives;
+    UINT64 PSInvocations;
+} D3D10_QUERY_DATA_PIPELINE_STATISTICS;
+
+typedef struct D3D10_QUERY_DATA_SO_STATISTICS {
+    UINT64 NumPrimitivesWritten;
+    UINT64 PrimitivesStorageNeeded;
+} D3D10_QUERY_DATA_SO_STATISTICS;
+
+typedef enum D3D10_CREATE_DEVICE_FLAG {
+    D3D10_CREATE_DEVICE_SINGLETHREADED                           = 0x1,
+    D3D10_CREATE_DEVICE_DEBUG                                    = 0x2,
+    D3D10_CREATE_DEVICE_SWITCH_TO_REF                            = 0x4,
+    D3D10_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS = 0x8
+} D3D10_CREATE_DEVICE_FLAG;
+
+/* Core */
+
+interface ID3D10Device;
+
+[
+    object,
+    local,
+    uuid(9b7e4c00-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10DeviceChild : IUnknown
+{
+        void GetDevice(
+            [out] ID3D10Device **ppDevice);
+        HRESULT GetPrivateData(
+            [in] REFGUID guid,
+            [in, out] UINT *pDataSize,
+            [out] void *pData);
+        HRESULT SetPrivateData(
+            [in] REFGUID guid,
+            [in] UINT DataSize,
+            [in] const void *pData);
+        HRESULT SetPrivateDataInterface(
+            [in] REFGUID guid,
+            [in] const IUnknown *pData);
+}
+
+/* Resource */
+
+[
+    object,
+    local,
+    uuid(9b7e4c01-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Resource : ID3D10DeviceChild
+{
+        void GetType(
+            [out] D3D10_RESOURCE_DIMENSION *rType);
+        void SetEvictionPriority(
+            [in] UINT EvictionPriority);
+        UINT GetEvictionPriority();
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c02-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Buffer : ID3D10Resource
+{
+        HRESULT Map(
+            [in] D3D10_MAP MapType,
+            [in] UINT MapFlags,
+            [out] void **ppData);
+        void Unmap();
+        void GetDesc(
+            [out] D3D10_BUFFER_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c03-342c-4106-a19f-4f2704f689F0)
+]
+interface ID3D10Texture1D : ID3D10Resource
+{
+        HRESULT Map(
+            [in] UINT Subresource,
+            [in] D3D10_MAP MapType,
+            [in] UINT MapFlags,
+            [out] void **ppData);
+        void Unmap(
+            [in] UINT Subresource);
+        void GetDesc(
+            [out] D3D10_TEXTURE1D_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c04-342c-4106-a19f-4f2704f689F0)
+]
+interface ID3D10Texture2D : ID3D10Resource
+{
+        HRESULT Map(
+            [in] UINT Subresource,
+            [in] D3D10_MAP MapType,
+            [in] UINT MapFlags,
+            [out] D3D10_MAPPED_TEXTURE2D *pMappedTex2D);
+        void Unmap(
+            [in] UINT Subresource);
+        void GetDesc(
+            [out] D3D10_TEXTURE2D_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c05-342c-4106-a19f-4f2704f689F0)
+]
+interface ID3D10Texture3D : ID3D10Resource
+{
+        HRESULT Map(
+            [in] UINT Subresource,
+            [in] D3D10_MAP MapType,
+            [in] UINT MapFlags,
+            [out] D3D10_MAPPED_TEXTURE3D *pMappedTex3D);
+        void Unmap(
+            [in] UINT Subresource);
+        void GetDesc(
+            [out] D3D10_TEXTURE3D_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(c902b03f-60a7-49ba-9936-2a3ab37a7e33)
+]
+interface ID3D10View : ID3D10DeviceChild
+{
+        void GetResource(
+            [out] ID3D10Resource **ppResource);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c09-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10DepthStencilView : ID3D10View
+{
+        void GetDesc(
+            [out] D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc);
+}
+
+
+[
+    object,
+    local,
+    uuid(9b7e4c08-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10RenderTargetView : ID3D10View
+{
+        void GetDesc(
+            [out] D3D10_RENDER_TARGET_VIEW_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c07-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10ShaderResourceView  : ID3D10View
+{
+        void GetDesc(
+            [out] D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc);
+}
+
+/* Resource End */
+
+[
+    object,
+    local,
+    uuid(edad8d19-8a35-4d6d-8566-2ea276cde161)
+]
+interface ID3D10BlendState : ID3D10DeviceChild
+{
+    void GetDesc(
+            [out] D3D10_BLEND_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(2b4b1cc8-a4ad-41f8-8322-ca86fc3ec675)
+]
+interface ID3D10DepthStencilState : ID3D10DeviceChild
+{
+    void GetDesc(
+            [out] D3D10_DEPTH_STENCIL_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(6316be88-54cd-4040-ab44-20461bc81f68)
+]
+interface ID3D10GeometryShader  : ID3D10DeviceChild
+{
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c0b-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10InputLayout  : ID3D10DeviceChild
+{
+}
+
+[
+    object,
+    local,
+    uuid(4968b601-9d00-4cde-8346-8e7f675819b6)
+]
+interface ID3D10PixelShader  : ID3D10DeviceChild
+{
+}
+
+[
+    object,
+    local,
+    uuid(a2a07292-89af-4345-be2e-c53d9fbb6e9f)
+]
+interface ID3D10RasterizerState  : ID3D10DeviceChild
+{
+    void GetDesc(
+            [out] D3D10_RASTERIZER_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c0c-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10SamplerState  : ID3D10DeviceChild
+{
+    void GetDesc(
+            [out] D3D10_SAMPLER_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c0a-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10VertexShader  : ID3D10DeviceChild
+{
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c0d-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Asynchronous  : ID3D10DeviceChild
+{
+    void Begin();
+    void End();
+    HRESULT GetData(
+            [out] void *pData,
+            [in] UINT DataSize,
+            [in] UINT GetDataFlags);
+    UINT GetDataSize();
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c11-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Counter  : ID3D10Asynchronous
+{
+    void GetDesc(
+            [out] D3D10_COUNTER_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4C0e-342C-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Query : ID3D10Asynchronous
+{
+    void GetDesc(
+            [out] D3D10_QUERY_DESC *pDesc);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c10-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Predicate : ID3D10Query
+{
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4c0f-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Device : IUnknown
+{
+        void VSSetConstantBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [in] ID3D10Buffer *const *ppConstantBuffers);
+        void PSSetShaderResources(
+            [in] UINT StartSlot,
+            [in] UINT NumViews,
+            [in] ID3D10ShaderResourceView *const *ppShaderResourceViews);
+        void PSSetShader(
+            [in] ID3D10PixelShader *pPixelShader);
+        void PSSetSamplers(
+            [in] UINT StartSlot,
+            [in] UINT NumSamplers,
+            [in]ID3D10SamplerState *const *ppSamplers);
+        void VSSetShader(
+            [in] ID3D10VertexShader *pVertexShader);
+        void DrawIndexed(
+            [in] UINT IndexCount,
+            [in] UINT StartIndexLocation,
+            [in] INT BaseVertexLocation);
+        void Draw(
+            [in] UINT VertexCount,
+            [in] UINT StartVertexLocation);
+        void PSSetConstantBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [in] ID3D10Buffer *const *ppConstantBuffers);
+        void IASetInputLayout(
+            [in] ID3D10InputLayout *pInputLayout);
+        void IASetVertexBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [in] ID3D10Buffer *const *ppVertexBuffers,
+            [in] const UINT *pStrides,
+            [in] const UINT *pOffsets);
+        void IASetIndexBuffer(
+            [in] ID3D10Buffer *pIndexBuffer,
+            [in] DXGI_FORMAT Format,
+            [in] UINT Offset);
+        void DrawIndexedInstanced(
+            [in] UINT IndexCountPerInstance,
+            [in] UINT InstanceCount,
+            [in] UINT StartIndexLocation,
+            [in] INT BaseVertexLocation,
+            [in] UINT StartInstanceLocation);
+        void DrawInstanced(
+            [in] UINT VertexCountPerInstance,
+            [in] UINT InstanceCount,
+            [in] UINT StartVertexLocation,
+            [in] UINT StartInstanceLocation);
+        void GSSetConstantBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [in] ID3D10Buffer *const *ppConstantBuffers);
+        void GSSetShader(
+            [in] ID3D10GeometryShader *pShader);
+        void IASetPrimitiveTopology(
+            [in] D3D10_PRIMITIVE_TOPOLOGY Topology);
+        void VSSetShaderResources(
+            [in] UINT StartSlot,
+            [in] UINT NumViews,
+            [in] ID3D10ShaderResourceView *const *ppShaderResourceViews);
+        void VSSetSamplers(
+            [in] UINT StartSlot,
+            [in] UINT NumSamplers,
+            [in] ID3D10SamplerState *const *ppSamplers);
+        void SetPredication(
+            [in] ID3D10Predicate *pPredicate,
+            [in] BOOL PredicateValue);
+        void GSSetShaderResources(
+            [in] UINT StartSlot,
+            [in] UINT NumViews,
+            [in] ID3D10ShaderResourceView * const *ppShaderResourceViews);
+        void GSSetSamplers(
+            [in] UINT StartSlot,
+            [in] UINT NumSamplers,
+            [in] ID3D10SamplerState *const *ppSamplers);
+        void OMSetRenderTargets(
+            [in] UINT NumViews,
+            [in] ID3D10RenderTargetView *const *ppRenderTargetViews,
+            [in] ID3D10DepthStencilView *pDepthStencilView);
+        void OMSetBlendState(
+            [in] ID3D10BlendState *pBlendState,
+            [in] const FLOAT BlendFactor[4],
+            [in] UINT SampleMask);
+        void OMSetDepthStencilState(
+            [in] ID3D10DepthStencilState *pDepthStencilState,
+            [in] UINT StencilRef);
+        void SOSetTargets(
+            [in] UINT NumBuffers,
+            [in] ID3D10Buffer *const *ppSOTargets,
+            [in] const UINT *pOffsets);
+        void DrawAuto();
+        void RSSetState(
+            [in] ID3D10RasterizerState *pRasterizerState);
+        void RSSetViewports(
+            [in] UINT NumViewports,
+            [in] const D3D10_VIEWPORT *pViewports);
+        void RSSetScissorRects(
+            [in] UINT NumRects,
+            [in] const D3D10_RECT *pRects);
+        void CopySubresourceRegion(
+            [in] ID3D10Resource *pDstResource,
+            [in] UINT DstSubresource,
+            [in] UINT DstX,
+            [in] UINT DstY,
+            [in] UINT DstZ,
+            [in] ID3D10Resource *pSrcResource,
+            [in] UINT SrcSubresource,
+            [in] const D3D10_BOX *pSrcBox);
+        void CopyResource(
+            [in] ID3D10Resource *pDstResource,
+            [in] ID3D10Resource *pSrcResource);
+        void UpdateSubresource(
+            [in] ID3D10Resource *pDstResource,
+            [in] UINT DstSubresource,
+            [in] const D3D10_BOX *pDstBox,
+            [in] const void *pSrcData,
+            [in] UINT SrcRowPitch,
+            [in] UINT SrcDepthPitch);
+        void ClearRenderTargetView(
+            [in] ID3D10RenderTargetView *pRenderTargetView,
+            [in] const FLOAT ColorRGBA[4]);
+        void ClearDepthStencilView(
+            [in] ID3D10DepthStencilView *pDepthStencilView,
+            [in] UINT ClearFlags,
+            [in] FLOAT Depth,
+            [in] UINT8 Stencil);
+        void GenerateMips(
+            [in] ID3D10ShaderResourceView *pShaderResourceView);
+        void ResolveSubresource(
+            [in] ID3D10Resource *pDstResource,
+            [in] UINT DstSubresource,
+            [in] ID3D10Resource *pSrcResource,
+            [in] UINT SrcSubresource,
+            [in] DXGI_FORMAT Format);
+        void VSGetConstantBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [out] ID3D10Buffer **ppConstantBuffers);
+        void PSGetShaderResources(
+            [in] UINT StartSlot,
+            [in] UINT NumViews,
+            [out] ID3D10ShaderResourceView **ppShaderResourceViews);
+        void PSGetShader(
+            [out] ID3D10PixelShader **ppPixelShader);
+        void PSGetSamplers(
+            [in] UINT StartSlot,
+            [in] UINT NumSamplers,
+            [out] ID3D10SamplerState **ppSamplers);
+        void VSGetShader(
+            [out] ID3D10VertexShader **ppVertexShader);
+        void PSGetConstantBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [out] ID3D10Buffer **ppConstantBuffers);
+        void IAGetInputLayout(
+            [out] ID3D10InputLayout **ppInputLayout);
+        void IAGetVertexBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [out] ID3D10Buffer **ppVertexBuffers,
+            [out] UINT *pStrides,
+            [out] UINT *pOffsets);
+        void IAGetIndexBuffer(
+            [out] ID3D10Buffer **pIndexBuffer,
+            [out] DXGI_FORMAT *Format,
+            [out] UINT *Offset);
+        void GSGetConstantBuffers(
+            [in] UINT StartSlot,
+            [in] UINT NumBuffers,
+            [out] ID3D10Buffer **ppConstantBuffers);
+        void GSGetShader(
+            [out] ID3D10GeometryShader **ppGeometryShader);
+        void IAGetPrimitiveTopology(
+            [out] D3D10_PRIMITIVE_TOPOLOGY *pTopology);
+        void VSGetShaderResources(
+            [in] UINT StartSlot,
+            [in] UINT NumViews,
+            [out] ID3D10ShaderResourceView **ppShaderResourceViews);
+        void VSGetSamplers(
+            [in] UINT StartSlot,
+            [in] UINT NumSamplers,
+            [out] ID3D10SamplerState **ppSamplers);
+        void GetPredication(
+            [out] ID3D10Predicate **ppPredicate,
+            [out] BOOL *pPredicateValue);
+        void GSGetShaderResources(
+            [in] UINT StartSlot,
+            [in] UINT NumViews,
+            [out] ID3D10ShaderResourceView **ppShaderResourceViews);
+        void GSGetSamplers(
+            [in] UINT StartSlot,
+            [in] UINT NumSamplers,
+            [out] ID3D10SamplerState **ppSamplers);
+        void OMGetRenderTargets(
+            [in] UINT NumViews,
+            [out] ID3D10RenderTargetView **ppRenderTargetViews,
+            [out] ID3D10DepthStencilView **ppDepthStencilView);
+        void OMGetBlendState(
+            [out] ID3D10BlendState **ppBlendState,
+            [out] FLOAT BlendFactor[4],
+            [out] UINT *pSampleMask);
+        void OMGetDepthStencilState(
+            [out] ID3D10DepthStencilState **ppDepthStencilState,
+            [out] UINT *pStencilRef);
+        void SOGetTargets(
+            [in] UINT NumBuffers,
+            [out] ID3D10Buffer **ppSOTargets,
+            [out] UINT *pOffsets);
+        void RSGetState(
+            [out] ID3D10RasterizerState **ppRasterizerState);
+        void RSGetViewports(
+            [in, out] UINT *NumViewports,
+            [out] D3D10_VIEWPORT *pViewports);
+        void RSGetScissorRects(
+            [in, out] UINT *NumRects,
+            [out] D3D10_RECT *pRects);
+        HRESULT GetDeviceRemovedReason();
+        HRESULT SetExceptionMode(
+            [in] UINT RaiseFlags);
+        UINT GetExceptionMode();
+        HRESULT GetPrivateData(
+            [in] REFGUID guid,
+            [in, out] UINT *pDataSize,
+            [out] void *pData);
+        HRESULT SetPrivateData(
+            [in] REFGUID guid,
+            [in] UINT DataSize,
+            [in] const void *pData);
+        HRESULT SetPrivateDataInterface(
+            [in] REFGUID guid,
+            [in] const IUnknown *pData);
+        void ClearState();
+        void Flush();
+        HRESULT CreateBuffer(
+            [in] const D3D10_BUFFER_DESC *pDesc,
+            [in] const D3D10_SUBRESOURCE_DATA *pInitialData,
+            [out] ID3D10Buffer **ppBuffer);
+        HRESULT CreateTexture1D(
+            [in] const D3D10_TEXTURE1D_DESC *pDesc,
+            [in] const D3D10_SUBRESOURCE_DATA *pInitialData,
+            [out] ID3D10Texture1D **ppTexture1D);
+        HRESULT CreateTexture2D(
+            [in] const D3D10_TEXTURE2D_DESC *pDesc,
+            [in] const D3D10_SUBRESOURCE_DATA *pInitialData,
+            [out] ID3D10Texture2D **ppTexture2D);
+        HRESULT CreateTexture3D(
+            [in] const D3D10_TEXTURE3D_DESC *pDesc,
+            [in] const D3D10_SUBRESOURCE_DATA *pInitialData,
+            [out] ID3D10Texture3D **ppTexture3D);
+        HRESULT CreateShaderResourceView(
+            [in] ID3D10Resource *pResource,
+            [in] const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
+            [out] ID3D10ShaderResourceView **ppSRView);
+        HRESULT CreateRenderTargetView(
+            [in] ID3D10Resource *pResource,
+            [in] const D3D10_RENDER_TARGET_VIEW_DESC *pDesc,
+            [out] ID3D10RenderTargetView **ppRTView);
+        HRESULT CreateDepthStencilView(
+            [in] ID3D10Resource *pResource,
+            [in] const D3D10_DEPTH_STENCIL_VIEW_DESC *pDesc,
+            [out] ID3D10DepthStencilView **ppDepthStencilView);
+        HRESULT CreateInputLayout(
+            [in] const D3D10_INPUT_ELEMENT_DESC *pInputElementDescs,
+            [in] UINT NumElements,
+            [in] const void *pShaderBytecodeWithInputSignature,
+            [in] SIZE_T BytecodeLength,
+            [out] ID3D10InputLayout **ppInputLayout);
+        HRESULT CreateVertexShader(
+            [in] const void *pShaderBytecode,
+            [in] SIZE_T BytecodeLength,
+            [out] ID3D10VertexShader **ppVertexShader);
+        HRESULT CreateGeometryShader(
+            [in] const void *pShaderBytecode,
+            [in] SIZE_T BytecodeLength,
+            [out] ID3D10GeometryShader **ppGeometryShader);
+        HRESULT CreateGeometryShaderWithStreamOutput(
+            [in] const void *pShaderBytecode,
+            [in] SIZE_T BytecodeLength,
+            [in] const D3D10_SO_DECLARATION_ENTRY *pSODeclaration,
+            [in] UINT NumEntries,
+            [in] UINT OutputStreamStride,
+            [out] ID3D10GeometryShader **ppGeometryShader);
+        HRESULT CreatePixelShader(
+            [in] const void *pShaderBytecode,
+            [in] SIZE_T BytecodeLength,
+            [out] ID3D10PixelShader **ppPixelShader);
+        HRESULT CreateBlendState(
+            [in] const D3D10_BLEND_DESC *pBlendStateDesc,
+            [out] ID3D10BlendState **ppBlendState);
+        HRESULT CreateDepthStencilState(
+            [in] const D3D10_DEPTH_STENCIL_DESC *pDepthStencilDesc,
+            [out] ID3D10DepthStencilState **ppDepthStencilState);
+        HRESULT CreateRasterizerState(
+            [in] const D3D10_RASTERIZER_DESC *pRasterizerDesc,
+            [out] ID3D10RasterizerState **ppRasterizerState);
+        HRESULT CreateSamplerState(
+            [in] const D3D10_SAMPLER_DESC *pSamplerDesc,
+            [out] ID3D10SamplerState **ppSamplerState);
+        HRESULT CreateQuery(
+            [in] const D3D10_QUERY_DESC *pQueryDesc,
+            [out] ID3D10Query **ppQuery);
+        HRESULT CreatePredicate(
+            [in] const D3D10_QUERY_DESC *pPredicateDesc,
+            [out] ID3D10Predicate **ppPredicate);
+        HRESULT CreateCounter(
+            [in] const D3D10_COUNTER_DESC *pCounterDesc,
+            [out] ID3D10Counter **ppCounter);
+        HRESULT CheckFormatSupport(
+            [in] DXGI_FORMAT Format,
+            [out] UINT *pFormatSupport);
+        HRESULT CheckMultisampleQualityLevels(
+            [in] DXGI_FORMAT Format,
+            [in] UINT SampleCount,
+            [out] UINT *pNumQualityLevels);
+        void CheckCounterInfo(
+            [out] D3D10_COUNTER_INFO *pCounterInfo);
+        HRESULT CheckCounter(
+            [in] const D3D10_COUNTER_DESC *pDesc,
+            [out] D3D10_COUNTER_TYPE *pType,
+            [out] UINT *pActiveCounters,
+            [out] LPSTR szName,
+            [in, out] UINT *pNameLength,
+            [out] LPSTR szUnits,
+            [in, out] UINT *pUnitsLength,
+            [out] LPSTR szDescription,
+            [in, out] UINT *pDescriptionLength);
+        UINT GetCreationFlags();
+        HRESULT OpenSharedResource(
+            [in] HANDLE hResource,
+            [in] REFIID ReturnedInterface,
+            [out] void **ppResource);
+        void SetTextFilterSize(
+            [in] UINT Width,
+            [in] UINT Height);
+        void GetTextFilterSize(
+            [out] UINT *pWidth,
+            [out] UINT *pHeight);
+}
+
+[
+    object,
+    local,
+    uuid(9b7e4e00-342c-4106-a19f-4f2704f689f0)
+]
+interface ID3D10Multithread : IUnknown
+{
+        void Enter();
+        void Leave();
+        BOOL SetMultithreadProtected(
+            [in] BOOL bMTProtect);
+        BOOL GetMultithreadProtected();
+}
+
+cpp_quote("#include \"d3d10misc.h\"")
+cpp_quote("#include \"d3d10shader.h\"")
+cpp_quote("#include \"d3d10effect.h\"")
+/* TODO: Include "d310sdklayers.h" as soon as it exists */
diff --git a/misc/builddeps/dp.win32/include/d3d10effect.h b/misc/builddeps/dp.win32/include/d3d10effect.h
new file mode 100644 (file)
index 0000000..e020583
--- /dev/null
@@ -0,0 +1,788 @@
+/*
+ * Copyright 2009 Henri Verbeet for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#ifndef __WINE_D3D10EFFECT_H
+#define __WINE_D3D10EFFECT_H
+
+#include "d3d10.h"
+
+#define D3D10_EFFECT_VARIABLE_POOLED                0x1
+#define D3D10_EFFECT_VARIABLE_ANNOTATION            0x2
+#define D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT   0x4
+
+#ifndef D3D10_BYTES_FROM_BITS
+#define D3D10_BYTES_FROM_BITS(x) (((x) + 7) >> 3)
+#endif
+
+typedef struct _D3D10_EFFECT_TYPE_DESC
+{
+    LPCSTR TypeName;
+    D3D10_SHADER_VARIABLE_CLASS Class;
+    D3D10_SHADER_VARIABLE_TYPE Type;
+    UINT Elements;
+    UINT Members;
+    UINT Rows;
+    UINT Columns;
+    UINT PackedSize;
+    UINT UnpackedSize;
+    UINT Stride;
+} D3D10_EFFECT_TYPE_DESC;
+
+typedef struct _D3D10_EFFECT_VARIABLE_DESC
+{
+    LPCSTR Name;
+    LPCSTR Semantic;
+    UINT Flags;
+    UINT Annotations;
+    UINT BufferOffset;
+    UINT ExplicitBindPoint;
+} D3D10_EFFECT_VARIABLE_DESC;
+
+typedef struct _D3D10_TECHNIQUE_DESC
+{
+    LPCSTR Name;
+    UINT Passes;
+    UINT Annotations;
+} D3D10_TECHNIQUE_DESC;
+
+typedef struct _D3D10_STATE_BLOCK_MASK
+{
+    BYTE VS;
+    BYTE VSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
+    BYTE VSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
+    BYTE VSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
+    BYTE GS;
+    BYTE GSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
+    BYTE GSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
+    BYTE GSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
+    BYTE PS;
+    BYTE PSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
+    BYTE PSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
+    BYTE PSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
+    BYTE IAVertexBuffers[D3D10_BYTES_FROM_BITS(D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT)];
+    BYTE IAIndexBuffer;
+    BYTE IAInputLayout;
+    BYTE IAPrimitiveTopology;
+    BYTE OMRenderTargets;
+    BYTE OMDepthStencilState;
+    BYTE OMBlendState;
+    BYTE RSViewports;
+    BYTE RSScissorRects;
+    BYTE RSRasterizerState;
+    BYTE SOBuffers;
+    BYTE Predication;
+} D3D10_STATE_BLOCK_MASK;
+
+typedef struct _D3D10_EFFECT_DESC
+{
+    BOOL IsChildEffect;
+    UINT ConstantBuffers;
+    UINT SharedConstantBuffers;
+    UINT GlobalVariables;
+    UINT SharedGlobalVariables;
+    UINT Techniques;
+} D3D10_EFFECT_DESC;
+
+typedef struct _D3D10_EFFECT_SHADER_DESC
+{
+    const BYTE *pInputSignature;
+    BOOL IsInline;
+    const BYTE *pBytecode;
+    UINT BytecodeLength;
+    LPCSTR SODecl;
+    UINT NumInputSignatureEntries;
+    UINT NumOutputSignatureEntries;
+} D3D10_EFFECT_SHADER_DESC;
+
+typedef struct _D3D10_PASS_DESC
+{
+    LPCSTR Name;
+    UINT Annotations;
+    BYTE *pIAInputSignature;
+    SIZE_T IAInputSignatureSize;
+    UINT StencilRef;
+    UINT SampleMask;
+    FLOAT BlendFactor[4];
+} D3D10_PASS_DESC;
+
+typedef struct _D3D10_PASS_SHADER_DESC
+{
+    struct ID3D10EffectShaderVariable *pShaderVariable;
+    UINT ShaderIndex;
+} D3D10_PASS_SHADER_DESC;
+
+DEFINE_GUID(IID_ID3D10EffectType, 0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x00, 0x18, 0x0b, 0x9b, 0x88, 0xfd);
+
+#define INTERFACE ID3D10EffectType
+DECLARE_INTERFACE(ID3D10EffectType)
+{
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_TYPE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(LPCSTR, GetMemberName)(THIS_ UINT index) PURE;
+    STDMETHOD_(LPCSTR, GetMemberSemantic)(THIS_ UINT index) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectVariable, 0xae897105, 0x00e6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b);
+
+#define INTERFACE ID3D10EffectVariable
+DECLARE_INTERFACE(ID3D10EffectVariable)
+{
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectConstantBuffer, 0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3);
+
+#define INTERFACE ID3D10EffectConstantBuffer
+DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectConstantBuffer methods */
+    STDMETHOD(SetConstantBuffer)(THIS_ ID3D10Buffer *buffer) PURE;
+    STDMETHOD(GetConstantBuffer)(THIS_ ID3D10Buffer **buffer) PURE;
+    STDMETHOD(SetTextureBuffer)(THIS_ ID3D10ShaderResourceView *view) PURE;
+    STDMETHOD(GetTextureBuffer)(THIS_ ID3D10ShaderResourceView **view) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectScalarVariable, 0x00e48f7b, 0xd2c8, 0x49e8, 0xa8, 0x6c, 0x02, 0x2d, 0xee, 0x53, 0x43, 0x1f);
+
+#define INTERFACE ID3D10EffectScalarVariable
+DECLARE_INTERFACE_(ID3D10EffectScalarVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectScalarVariable methods */
+    STDMETHOD(SetFloat)(THIS_ float value) PURE;
+    STDMETHOD(GetFloat)(THIS_ float *value) PURE;
+    STDMETHOD(SetFloatArray)(THIS_ float *values, UINT offset, UINT count) PURE;
+    STDMETHOD(GetFloatArray)(THIS_ float *values, UINT offset, UINT count) PURE;
+    STDMETHOD(SetInt)(THIS_ int value) PURE;
+    STDMETHOD(GetInt)(THIS_ int *value) PURE;
+    STDMETHOD(SetIntArray)(THIS_ int *values, UINT offset, UINT count) PURE;
+    STDMETHOD(GetIntArray)(THIS_ int *values, UINT offset, UINT count) PURE;
+    STDMETHOD(SetBool)(THIS_ BOOL value) PURE;
+    STDMETHOD(GetBool)(THIS_ BOOL *value) PURE;
+    STDMETHOD(SetBoolArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
+    STDMETHOD(GetBoolArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectVectorVariable, 0x62b98c44, 0x1f82, 0x4c67, 0xbc, 0xd0, 0x72, 0xcf, 0x8f, 0x21, 0x7e, 0x81);
+
+#define INTERFACE ID3D10EffectVectorVariable
+DECLARE_INTERFACE_(ID3D10EffectVectorVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectVectorVariable methods */
+    STDMETHOD(SetBoolVector)(THIS_ BOOL *value) PURE;
+    STDMETHOD(SetIntVector)(THIS_ int *value) PURE;
+    STDMETHOD(SetFloatVector)(THIS_ float *value) PURE;
+    STDMETHOD(GetBoolVector)(THIS_ BOOL *value) PURE;
+    STDMETHOD(GetIntVector)(THIS_ int *value) PURE;
+    STDMETHOD(GetFloatVector)(THIS_ float *value) PURE;
+    STDMETHOD(SetBoolVectorArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
+    STDMETHOD(SetIntVectorArray)(THIS_ int *values, UINT offset, UINT count) PURE;
+    STDMETHOD(SetFloatVectorArray)(THIS_ float *values, UINT offset, UINT count) PURE;
+    STDMETHOD(GetBoolVectorArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
+    STDMETHOD(GetIntVectorArray)(THIS_ int *values, UINT offset, UINT count) PURE;
+    STDMETHOD(GetFloatVectorArray)(THIS_ float *values, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectMatrixVariable, 0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0);
+
+#define INTERFACE ID3D10EffectMatrixVariable
+DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectMatrixVariable methods */
+    STDMETHOD(SetMatrix)(THIS_ float *data) PURE;
+    STDMETHOD(GetMatrix)(THIS_ float *data) PURE;
+    STDMETHOD(SetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE;
+    STDMETHOD(SetMatrixTranspose)(THIS_ float *data) PURE;
+    STDMETHOD(GetMatrixTranspose)(THIS_ float *data) PURE;
+    STDMETHOD(SetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectStringVariable, 0x71417501, 0x8df9, 0x4e0a, 0xa7, 0x8a, 0x25, 0x5f, 0x97, 0x56, 0xba, 0xff);
+
+#define INTERFACE ID3D10EffectStringVariable
+DECLARE_INTERFACE_(ID3D10EffectStringVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectStringVariable methods */
+    STDMETHOD(GetString)(THIS_ LPCSTR *str) PURE;
+    STDMETHOD(GetStringArray)(THIS_ LPCSTR *strs, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectShaderResourceVariable,
+        0xc0a7157b, 0xd872, 0x4b1d, 0x80, 0x73, 0xef, 0xc2, 0xac, 0xd4, 0xb1, 0xfc);
+
+#define INTERFACE ID3D10EffectShaderResourceVariable
+DECLARE_INTERFACE_(ID3D10EffectShaderResourceVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectShaderResourceVariable methods */
+    STDMETHOD(SetResource)(THIS_ ID3D10ShaderResourceView *resource) PURE;
+    STDMETHOD(GetResource)(THIS_ ID3D10ShaderResourceView **resource) PURE;
+    STDMETHOD(SetResourceArray)(THIS_ ID3D10ShaderResourceView **resources, UINT offset, UINT count) PURE;
+    STDMETHOD(GetResourceArray)(THIS_ ID3D10ShaderResourceView **resources, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectRenderTargetViewVariable,
+        0x28ca0cc3, 0xc2c9, 0x40bb, 0xb5, 0x7f, 0x67, 0xb7, 0x37, 0x12, 0x2b, 0x17);
+
+#define INTERFACE ID3D10EffectRenderTargetViewVariable
+DECLARE_INTERFACE_(ID3D10EffectRenderTargetViewVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectRenderTargetViewVariable methods */
+    STDMETHOD(SetRenderTarget)(THIS_ ID3D10RenderTargetView *view) PURE;
+    STDMETHOD(GetRenderTarget)(THIS_ ID3D10RenderTargetView **view) PURE;
+    STDMETHOD(SetRenderTargetArray)(THIS_ ID3D10RenderTargetView **views, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRenderTargetArray)(THIS_ ID3D10RenderTargetView **views, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectDepthStencilViewVariable,
+        0x3e02c918, 0xcc79, 0x4985, 0xb6, 0x22, 0x2d, 0x92, 0xad, 0x70, 0x16, 0x23);
+
+#define INTERFACE ID3D10EffectDepthStencilViewVariable
+DECLARE_INTERFACE_(ID3D10EffectDepthStencilViewVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectDepthStencilViewVariable methods */
+    STDMETHOD(SetDepthStencil)(THIS_ ID3D10DepthStencilView *view) PURE;
+    STDMETHOD(GetDepthStencil)(THIS_ ID3D10DepthStencilView **view) PURE;
+    STDMETHOD(SetDepthStencilArray)(THIS_ ID3D10DepthStencilView **views, UINT offset, UINT count) PURE;
+    STDMETHOD(GetDepthStencilArray)(THIS_ ID3D10DepthStencilView **views, UINT offset, UINT count) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectShaderVariable, 0x80849279, 0xc799, 0x4797, 0x8c, 0x33, 0x04, 0x07, 0xa0, 0x7d, 0x9e, 0x06);
+
+#define INTERFACE ID3D10EffectShaderVariable
+DECLARE_INTERFACE_(ID3D10EffectShaderVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectShaderVariable methods */
+    STDMETHOD(GetShaderDesc)(THIS_ UINT index, D3D10_EFFECT_SHADER_DESC *desc) PURE;
+    STDMETHOD(GetVertexShader)(THIS_ UINT index, ID3D10VertexShader **shader) PURE;
+    STDMETHOD(GetGeometryShader)(THIS_ UINT index, ID3D10GeometryShader **shader) PURE;
+    STDMETHOD(GetPixelShader)(THIS_ UINT index, ID3D10PixelShader **shader) PURE;
+    STDMETHOD(GetInputSignatureElementDesc)(THIS_ UINT shader_index, UINT element_index,
+            D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
+    STDMETHOD(GetOutputSignatureElementDesc)(THIS_ UINT shader_index, UINT element_index,
+            D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectBlendVariable, 0x1fcd2294, 0xdf6d, 0x4eae, 0x86, 0xb3, 0x0e, 0x91, 0x60, 0xcf, 0xb0, 0x7b);
+
+#define INTERFACE ID3D10EffectBlendVariable
+DECLARE_INTERFACE_(ID3D10EffectBlendVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectBlendVariable methods */
+    STDMETHOD(GetBlendState)(THIS_ UINT index, ID3D10BlendState **blend_state) PURE;
+    STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_BLEND_DESC *desc) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectDepthStencilVariable,
+        0xaf482368, 0x330a, 0x46a5, 0x9a, 0x5c, 0x01, 0xc7, 0x1a, 0xf2, 0x4c, 0x8d);
+
+#define INTERFACE ID3D10EffectDepthStencilVariable
+DECLARE_INTERFACE_(ID3D10EffectDepthStencilVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectDepthStencilVariable methods */
+    STDMETHOD(GetDepthStencilState)(THIS_ UINT index, ID3D10DepthStencilState **depth_stencil_state) PURE;
+    STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_DEPTH_STENCIL_DESC *desc) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectRasterizerVariable,
+        0x21af9f0e, 0x4d94, 0x4ea9, 0x97, 0x85, 0x2c, 0xb7, 0x6b, 0x8c, 0x0b, 0x34);
+
+#define INTERFACE ID3D10EffectRasterizerVariable
+DECLARE_INTERFACE_(ID3D10EffectRasterizerVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectRasterizerVariable methods */
+    STDMETHOD(GetRasterizerState)(THIS_ UINT index, ID3D10RasterizerState **rasterizer_state) PURE;
+    STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_RASTERIZER_DESC *desc) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectSamplerVariable,
+        0x6530d5c7, 0x07e9, 0x4271, 0xa4, 0x18, 0xe7, 0xce, 0x4b, 0xd1, 0xe4, 0x80);
+
+#define INTERFACE ID3D10EffectSamplerVariable
+DECLARE_INTERFACE_(ID3D10EffectSamplerVariable, ID3D10EffectVariable)
+{
+    /* ID3D10EffectVariable methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
+    STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
+    STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
+    /* ID3D10EffectSamplerVariable methods */
+    STDMETHOD(GetSampler)(THIS_ UINT index, ID3D10SamplerState **sampler) PURE;
+    STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_SAMPLER_DESC *desc) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectTechnique, 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75);
+
+#define INTERFACE ID3D10EffectTechnique
+DECLARE_INTERFACE(ID3D10EffectTechnique)
+{
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_TECHNIQUE_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectPass *, GetPassByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectPass *, GetPassByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *mask) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10Effect, 0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0x0d, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7);
+
+#define INTERFACE ID3D10Effect
+DECLARE_INTERFACE_(ID3D10Effect, IUnknown)
+{
+    /* IUnknown methods */
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /* ID3D10Effect methods */
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD_(BOOL, IsPool)(THIS) PURE;
+    STDMETHOD(GetDevice)(THIS_ ID3D10Device **device) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetVariableBySemantic)(THIS_ LPCSTR semantic) PURE;
+    STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD(Optimize)(THIS) PURE;
+    STDMETHOD_(BOOL, IsOptimized)(THIS) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectPool, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
+
+#define INTERFACE ID3D10EffectPool
+DECLARE_INTERFACE_(ID3D10EffectPool, IUnknown)
+{
+    /* IUnknown methods */
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /* ID3D10EffectPool methods */
+    STDMETHOD_(struct ID3D10Effect *, AsEffect)(THIS) PURE;
+};
+#undef INTERFACE
+
+DEFINE_GUID(IID_ID3D10EffectPass, 0x5cfbeb89, 0x1a06, 0x46e0, 0xb2, 0x82, 0xe3, 0xf9, 0xbf, 0xa3, 0x6a, 0x54);
+
+#define INTERFACE ID3D10EffectPass
+DECLARE_INTERFACE(ID3D10EffectPass)
+{
+    STDMETHOD_(BOOL, IsValid)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3D10_PASS_DESC *desc) PURE;
+    STDMETHOD(GetVertexShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
+    STDMETHOD(GetGeometryShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
+    STDMETHOD(GetPixelShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
+    STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD(Apply)(THIS_ UINT flags) PURE;
+    STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *mask) PURE;
+};
+#undef INTERFACE
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT flags,
+        ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_D3D10EFFECT_H */
diff --git a/misc/builddeps/dp.win32/include/d3d10misc.h b/misc/builddeps/dp.win32/include/d3d10misc.h
new file mode 100644 (file)
index 0000000..58a6d26
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2008 Henri Verbeet for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __D3D10MISC_H__
+#define __D3D10MISC_H__
+
+#include "d3d10.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum D3D10_DRIVER_TYPE {
+    D3D10_DRIVER_TYPE_HARDWARE  = 0,
+    D3D10_DRIVER_TYPE_REFERENCE = 1,
+    D3D10_DRIVER_TYPE_NULL      = 2,
+    D3D10_DRIVER_TYPE_SOFTWARE  = 3,
+} D3D10_DRIVER_TYPE;
+
+HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
+        HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
+
+HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
+        HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
+        IDXGISwapChain **swapchain, ID3D10Device **device);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __D3D10MISC_H__ */
diff --git a/misc/builddeps/dp.win32/include/d3d10shader.h b/misc/builddeps/dp.win32/include/d3d10shader.h
new file mode 100644 (file)
index 0000000..99b123c
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2009 Henri Verbeet for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#ifndef __WINE_D3D10SHADER_H
+#define __WINE_D3D10SHADER_H
+
+#include "d3d10.h"
+
+#define D3D10_SHADER_DEBUG                          0x0001
+#define D3D10_SHADER_SKIP_VALIDATION                0x0002
+#define D3D10_SHADER_SKIP_OPTIMIZATION              0x0004
+#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR          0x0008
+#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR       0x0010
+#define D3D10_SHADER_PARTIAL_PRECISION              0x0020
+#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT       0x0040
+#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT       0x0080
+#define D3D10_SHADER_NO_PRESHADER                   0x0100
+#define D3D10_SHADER_AVOID_FLOW_CONTROL             0x0200
+#define D3D10_SHADER_PREFER_FLOW_CONTROL            0x0400
+#define D3D10_SHADER_ENABLE_STRICTNESS              0x0800
+#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000
+#define D3D10_SHADER_IEEE_STRICTNESS                0x2000
+
+typedef enum _D3D10_SHADER_VARIABLE_CLASS
+{
+    D3D10_SVC_SCALAR,
+    D3D10_SVC_VECTOR,
+    D3D10_SVC_MATRIX_ROWS,
+    D3D10_SVC_MATRIX_COLUMNS,
+    D3D10_SVC_OBJECT,
+    D3D10_SVC_STRUCT,
+    D3D10_SVC_FORCE_DWORD = 0x7fffffff
+} D3D10_SHADER_VARIABLE_CLASS, *LPD3D10_SHADER_VARIABLE_CLASS;
+
+typedef enum _D3D10_SHADER_VARIABLE_TYPE
+{
+    D3D10_SVT_VOID = 0,
+    D3D10_SVT_BOOL = 1,
+    D3D10_SVT_INT = 2,
+    D3D10_SVT_FLOAT = 3,
+    D3D10_SVT_STRING = 4,
+    D3D10_SVT_TEXTURE = 5,
+    D3D10_SVT_TEXTURE1D = 6,
+    D3D10_SVT_TEXTURE2D = 7,
+    D3D10_SVT_TEXTURE3D = 8,
+    D3D10_SVT_TEXTURECUBE = 9,
+    D3D10_SVT_SAMPLER = 10,
+    D3D10_SVT_PIXELSHADER = 15,
+    D3D10_SVT_VERTEXSHADER = 16,
+    D3D10_SVT_UINT = 19,
+    D3D10_SVT_UINT8 = 20,
+    D3D10_SVT_GEOMETRYSHADER = 21,
+    D3D10_SVT_RASTERIZER = 22,
+    D3D10_SVT_DEPTHSTENCIL = 23,
+    D3D10_SVT_BLEND = 24,
+    D3D10_SVT_BUFFER = 25,
+    D3D10_SVT_CBUFFER = 26,
+    D3D10_SVT_TBUFFER = 27,
+    D3D10_SVT_TEXTURE1DARRAY = 28,
+    D3D10_SVT_TEXTURE2DARRAY = 29,
+    D3D10_SVT_RENDERTARGETVIEW = 30,
+    D3D10_SVT_DEPTHSTENCILVIEW = 31,
+    D3D10_SVT_TEXTURE2DMS = 32,
+    D3D10_SVT_TEXTURE2DMSARRAY = 33,
+    D3D10_SVT_TEXTURECUBEARRAY = 34,
+    D3D10_SVT_FORCE_DWORD = 0x7fffffff
+} D3D10_SHADER_VARIABLE_TYPE, *LPD3D10_SHADER_VARIABLE_TYPE;
+
+typedef enum D3D10_CBUFFER_TYPE
+{
+    D3D10_CT_CBUFFER = 0,
+    D3D10_CT_TBUFFER = 1
+} D3D10_CBUFFER_TYPE, *LPD3D10_CBUFFER_TYPE;
+
+typedef enum D3D10_NAME
+{
+    D3D10_NAME_UNDEFINED = 0,
+    D3D10_NAME_POSITION = 1,
+    D3D10_NAME_CLIP_DISTANCE = 2,
+    D3D10_NAME_CULL_DISTANCE = 3,
+    D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = 4,
+    D3D10_NAME_VIEWPORT_ARRAY_INDEX = 5,
+    D3D10_NAME_VERTEX_ID = 6,
+    D3D10_NAME_PRIMITIVE_ID = 7,
+    D3D10_NAME_INSTANCE_ID = 8,
+    D3D10_NAME_IS_FRONT_FACE = 9,
+    D3D10_NAME_SAMPLE_INDEX = 10,
+    D3D10_NAME_TARGET = 64,
+    D3D10_NAME_DEPTH = 65,
+} D3D10_NAME;
+
+typedef enum D3D10_REGISTER_COMPONENT_TYPE
+{
+    D3D10_REGISTER_COMPONENT_UNKNOWN = 0,
+    D3D10_REGISTER_COMPONENT_UINT32 = 1,
+    D3D10_REGISTER_COMPONENT_SINT32 = 2,
+    D3D10_REGISTER_COMPONENT_FLOAT32 = 3,
+} D3D10_REGISTER_COMPONENT_TYPE;
+
+typedef struct _D3D10_SHADER_MACRO
+{
+    LPCSTR Name;
+    LPCSTR Definition;
+} D3D10_SHADER_MACRO, *LPD3D10_SHADER_MACRO;
+
+typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
+{
+    LPCSTR SemanticName;
+    UINT SemanticIndex;
+    UINT Register;
+    D3D10_NAME SystemValueType;
+    D3D10_REGISTER_COMPONENT_TYPE ComponentType;
+    BYTE Mask;
+    BYTE ReadWriteMask;
+} D3D10_SIGNATURE_PARAMETER_DESC;
+
+LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device);
+LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *device);
+LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device);
+
+#endif /* __WINE_D3D10SHADER_H */
diff --git a/misc/builddeps/dp.win32/include/d3d8.h b/misc/builddeps/dp.win32/include/d3d8.h
new file mode 100644 (file)
index 0000000..46e0812
--- /dev/null
@@ -0,0 +1,1145 @@
+/*
+ * Copyright (C) 2002 Jason Edmeades
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D8_H
+#define __WINE_D3D8_H
+
+#ifndef DIRECT3D_VERSION
+#define DIRECT3D_VERSION  0x0800
+#endif
+
+#include <stdlib.h>
+
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+
+#ifndef __WINESRC__
+# include <windows.h>
+#endif
+
+#include <d3d8types.h>
+#include <d3d8caps.h>
+
+/*****************************************************************************
+ * Behavior Flags for IDirect3D8::CreateDevice
+ */
+#define D3DCREATE_FPU_PRESERVE                  0x00000002L
+#define D3DCREATE_MULTITHREADED                 0x00000004L
+#define D3DCREATE_PUREDEVICE                    0x00000010L
+#define D3DCREATE_SOFTWARE_VERTEXPROCESSING     0x00000020L
+#define D3DCREATE_HARDWARE_VERTEXPROCESSING     0x00000040L
+#define D3DCREATE_MIXED_VERTEXPROCESSING        0x00000080L
+
+/*****************************************************************************
+ * Flags for SetPrivateData
+ */
+#define D3DSPD_IUNKNOWN                         0x00000001L
+
+/*****************************************************************************
+ * #defines and error codes
+ */
+#define D3D_SDK_VERSION              220
+#define D3DADAPTER_DEFAULT           0
+#define D3DENUM_NO_WHQL_LEVEL        2
+
+#define _FACD3D  0x876
+#define MAKE_D3DHRESULT( code )  MAKE_HRESULT( 1, _FACD3D, code )
+
+/*
+ * Direct3D Errors
+ */
+#define D3D_OK                                  S_OK
+#define D3DERR_WRONGTEXTUREFORMAT               MAKE_D3DHRESULT(2072)
+#define D3DERR_UNSUPPORTEDCOLOROPERATION        MAKE_D3DHRESULT(2073)
+#define D3DERR_UNSUPPORTEDCOLORARG              MAKE_D3DHRESULT(2074)
+#define D3DERR_UNSUPPORTEDALPHAOPERATION        MAKE_D3DHRESULT(2075)
+#define D3DERR_UNSUPPORTEDALPHAARG              MAKE_D3DHRESULT(2076)
+#define D3DERR_TOOMANYOPERATIONS                MAKE_D3DHRESULT(2077)
+#define D3DERR_CONFLICTINGTEXTUREFILTER         MAKE_D3DHRESULT(2078)
+#define D3DERR_UNSUPPORTEDFACTORVALUE           MAKE_D3DHRESULT(2079)
+#define D3DERR_CONFLICTINGRENDERSTATE           MAKE_D3DHRESULT(2081)
+#define D3DERR_UNSUPPORTEDTEXTUREFILTER         MAKE_D3DHRESULT(2082)
+#define D3DERR_CONFLICTINGTEXTUREPALETTE        MAKE_D3DHRESULT(2086)
+#define D3DERR_DRIVERINTERNALERROR              MAKE_D3DHRESULT(2087)
+
+#define D3DERR_NOTFOUND                         MAKE_D3DHRESULT(2150)
+#define D3DERR_MOREDATA                         MAKE_D3DHRESULT(2151)
+#define D3DERR_DEVICELOST                       MAKE_D3DHRESULT(2152)
+#define D3DERR_DEVICENOTRESET                   MAKE_D3DHRESULT(2153)
+#define D3DERR_NOTAVAILABLE                     MAKE_D3DHRESULT(2154)
+#define D3DERR_OUTOFVIDEOMEMORY                 MAKE_D3DHRESULT(380)
+#define D3DERR_INVALIDDEVICE                    MAKE_D3DHRESULT(2155)
+#define D3DERR_INVALIDCALL                      MAKE_D3DHRESULT(2156)
+#define D3DERR_DRIVERINVALIDCALL                MAKE_D3DHRESULT(2157)
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(IID_IDirect3D8,              0x1DD9E8DA,0x1C77,0x4D40,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x12);
+typedef struct IDirect3D8 *LPDIRECT3D8;
+
+DEFINE_GUID(IID_IDirect3DDevice8,        0x7385E5DF,0x8FE8,0x41D5,0x86,0xB6,0xD7,0xB4,0x85,0x47,0xB6,0xCF);
+typedef struct IDirect3DDevice8 *LPDIRECT3DDEVICE8;
+
+DEFINE_GUID(IID_IDirect3DResource8,      0x1B36BB7B,0x09B7,0x410A,0xB4,0x45,0x7D,0x14,0x30,0xD7,0xB3,0x3F);
+typedef struct IDirect3DResource8 *LPDIRECT3DRESOURCE8, *PDIRECT3DRESOURCE8;
+
+DEFINE_GUID(IID_IDirect3DVertexBuffer8,  0x8AEEEAC7,0x05F9,0x44D4,0xB5,0x91,0x00,0x0B,0x0D,0xF1,0xCB,0x95);
+typedef struct IDirect3DVertexBuffer8 *LPDIRECT3DVERTEXBUFFER8, *PDIRECT3DVERTEXBUFFER8;
+
+DEFINE_GUID(IID_IDirect3DVolume8,        0xBD7349F5,0x14F1,0x42E4,0x9C,0x79,0x97,0x23,0x80,0xDB,0x40,0xC0);
+typedef struct IDirect3DVolume8 *LPDIRECT3DVOLUME8, *PDIRECT3DVOLUME8;
+
+DEFINE_GUID(IID_IDirect3DSwapChain8,     0x928C088B,0x76B9,0x4C6B,0xA5,0x36,0xA5,0x90,0x85,0x38,0x76,0xCD);
+typedef struct IDirect3DSwapChain8 *LPDIRECT3DSWAPCHAIN8, *PDIRECT3DSWAPCHAIN8;
+
+DEFINE_GUID(IID_IDirect3DSurface8,       0xB96EEBCA,0xB326,0x4EA5,0x88,0x2F,0x2F,0xF5,0xBA,0xE0,0x21,0xDD);
+typedef struct IDirect3DSurface8 *LPDIRECT3DSURFACE8, *PDIRECT3DSURFACE8;
+
+DEFINE_GUID(IID_IDirect3DIndexBuffer8,   0x0E689C9A,0x053D,0x44A0,0x9D,0x92,0xDB,0x0E,0x3D,0x75,0x0F,0x86);
+typedef struct IDirect3DIndexBuffer8 *LPDIRECT3DINDEXBUFFER8, *PDIRECT3DINDEXBUFFER8;
+
+DEFINE_GUID(IID_IDirect3DBaseTexture8,   0xB4211CFA,0x51B9,0x4A9F,0xAB,0x78,0xDB,0x99,0xB2,0xBB,0x67,0x8E);
+typedef struct IDirect3DBaseTexture8 *LPDIRECT3DBASETEXTURE8, *PDIRECT3DBASETEXTURE8;
+
+DEFINE_GUID(IID_IDirect3DTexture8,       0xE4CDD575,0x2866,0x4F01,0xB1,0x2E,0x7E,0xEC,0xE1,0xEC,0x93,0x58);
+typedef struct IDirect3DTexture8 *LPDIRECT3DTEXTURE8, *PDIRECT3DTEXTURE8;
+
+DEFINE_GUID(IID_IDirect3DCubeTexture8,   0x3EE5B968,0x2ACA,0x4C34,0x8B,0xB5,0x7E,0x0C,0x3D,0x19,0xB7,0x50);
+typedef struct IDirect3DCubeTexture8 *LPDIRECT3DCUBETEXTURE8, *PDIRECT3DCUBETEXTURE8;
+
+DEFINE_GUID(IID_IDirect3DVolumeTexture8, 0x4B8AAAFA,0x140F,0x42BA,0x91,0x31,0x59,0x7E,0xAF,0xAA,0x2E,0xAD);
+typedef struct IDirect3DVolumeTexture8 *LPDIRECT3DVOLUMETEXTURE8, *PDIRECT3DVOLUMETEXTURE8;
+
+/*****************************************************************************
+ * IDirect3D8 interface
+ */
+#define INTERFACE IDirect3D8
+DECLARE_INTERFACE_(IDirect3D8,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3D8 methods ***/
+    STDMETHOD(RegisterSoftwareDevice)(THIS_ void * pInitializeFunction) PURE;
+    STDMETHOD_(UINT,GetAdapterCount             )(THIS) PURE;
+    STDMETHOD(GetAdapterIdentifier)(THIS_ UINT  Adapter, DWORD  Flags, D3DADAPTER_IDENTIFIER8 * pIdentifier) PURE;
+    STDMETHOD_(UINT,GetAdapterModeCount)(THIS_ UINT  Adapter) PURE;
+    STDMETHOD(EnumAdapterModes)(THIS_ UINT  Adapter, UINT  Mode, D3DDISPLAYMODE * pMode) PURE;
+    STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT  Adapter, D3DDISPLAYMODE * pMode) PURE;
+    STDMETHOD(CheckDeviceType)(THIS_ UINT  Adapter, D3DDEVTYPE  CheckType, D3DFORMAT  DisplayFormat, D3DFORMAT  BackBufferFormat, BOOL  Windowed) PURE;
+    STDMETHOD(CheckDeviceFormat)(THIS_ UINT  Adapter, D3DDEVTYPE  DeviceType, D3DFORMAT  AdapterFormat, DWORD  Usage, D3DRESOURCETYPE  RType, D3DFORMAT  CheckFormat) PURE;
+    STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT  Adapter, D3DDEVTYPE  DeviceType, D3DFORMAT  SurfaceFormat, BOOL  Windowed, D3DMULTISAMPLE_TYPE  MultiSampleType) PURE;
+    STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT  Adapter, D3DDEVTYPE  DeviceType, D3DFORMAT  AdapterFormat, D3DFORMAT  RenderTargetFormat, D3DFORMAT  DepthStencilFormat) PURE;
+    STDMETHOD(GetDeviceCaps)(THIS_ UINT  Adapter, D3DDEVTYPE  DeviceType, D3DCAPS8 * pCaps) PURE;
+    STDMETHOD_(HMONITOR,GetAdapterMonitor)(THIS_ UINT  Adapter) PURE;
+    STDMETHOD(CreateDevice)(THIS_ UINT  Adapter, D3DDEVTYPE  DeviceType,HWND  hFocusWindow, DWORD  BehaviorFlags, D3DPRESENT_PARAMETERS * pPresentationParameters, struct IDirect3DDevice8 ** ppReturnedDeviceInterface) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3D8_QueryInterface(p,a,b)                    (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3D8_AddRef(p)                                (p)->lpVtbl->AddRef(p)
+#define IDirect3D8_Release(p)                               (p)->lpVtbl->Release(p)
+/*** IDirect3D8 methods ***/
+#define IDirect3D8_RegisterSoftwareDevice(p,a)              (p)->lpVtbl->RegisterSoftwareDevice(p,a)
+#define IDirect3D8_GetAdapterCount(p)                       (p)->lpVtbl->GetAdapterCount(p)
+#define IDirect3D8_GetAdapterIdentifier(p,a,b,c)            (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
+#define IDirect3D8_GetAdapterModeCount(p,a)                 (p)->lpVtbl->GetAdapterModeCount(p,a)
+#define IDirect3D8_EnumAdapterModes(p,a,b,c)                (p)->lpVtbl->EnumAdapterModes(p,a,b,c)
+#define IDirect3D8_GetAdapterDisplayMode(p,a,b)             (p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
+#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e)             (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e)
+#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f)         (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f)
+#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e)  (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e)
+#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e)      (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e)
+#define IDirect3D8_GetDeviceCaps(p,a,b,c)                   (p)->lpVtbl->GetDeviceCaps(p,a,b,c)
+#define IDirect3D8_GetAdapterMonitor(p,a)                   (p)->lpVtbl->GetAdapterMonitor(p,a)
+#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f)              (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f)
+#else
+/*** IUnknown methods ***/
+#define IDirect3D8_QueryInterface(p,a,b)                    (p)->QueryInterface(a,b)
+#define IDirect3D8_AddRef(p)                                (p)->AddRef()
+#define IDirect3D8_Release(p)                               (p)->Release()
+/*** IDirect3D8 methods ***/
+#define IDirect3D8_RegisterSoftwareDevice(p,a)              (p)->RegisterSoftwareDevice(a)
+#define IDirect3D8_GetAdapterCount(p)                       (p)->GetAdapterCount()
+#define IDirect3D8_GetAdapterIdentifier(p,a,b,c)            (p)->GetAdapterIdentifier(a,b,c)
+#define IDirect3D8_GetAdapterModeCount(p,a)                 (p)->GetAdapterModeCount(a)
+#define IDirect3D8_EnumAdapterModes(p,a,b,c)                (p)->EnumAdapterModes(a,b,c)
+#define IDirect3D8_GetAdapterDisplayMode(p,a,b)             (p)->GetAdapterDisplayMode(a,b)
+#define IDirect3D8_CheckDeviceType(p,a,b,c,d,e)             (p)->CheckDeviceType(a,b,c,d,e)
+#define IDirect3D8_CheckDeviceFormat(p,a,b,c,d,e,f)         (p)->CheckDeviceFormat(a,b,c,d,e,f)
+#define IDirect3D8_CheckDeviceMultiSampleType(p,a,b,c,d,e)  (p)->CheckDeviceMultiSampleType(a,b,c,d,e)
+#define IDirect3D8_CheckDepthStencilMatch(p,a,b,c,d,e)      (p)->CheckDepthStencilMatch(a,b,c,d,e)
+#define IDirect3D8_GetDeviceCaps(p,a,b,c)                   (p)->GetDeviceCaps(a,b,c)
+#define IDirect3D8_GetAdapterMonitor(p,a)                   (p)->GetAdapterMonitor(a)
+#define IDirect3D8_CreateDevice(p,a,b,c,d,e,f)              (p)->CreateDevice(a,b,c,d,e,f)
+#endif
+
+/*****************************************************************************
+ * IDirect3DVolume8 interface
+ */
+#define INTERFACE IDirect3DVolume8
+DECLARE_INTERFACE_(IDirect3DVolume8,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DVolume8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid,CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID   refguid,void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD(GetContainer)(THIS_ REFIID  riid, void ** ppContainer) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC * pDesc) PURE;
+    STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX * pBox, DWORD  Flags) PURE;
+    STDMETHOD(UnlockBox)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVolume8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVolume8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DVolume8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DVolume8 methods ***/
+#define IDirect3DVolume8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DVolume8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DVolume8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DVolume8_GetContainer(p,a,b)          (p)->lpVtbl->GetContainer(p,a,b)
+#define IDirect3DVolume8_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#define IDirect3DVolume8_LockBox(p,a,b,c)             (p)->lpVtbl->LockBox(p,a,b,c)
+#define IDirect3DVolume8_UnlockBox(p)                 (p)->lpVtbl->UnlockBox(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVolume8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DVolume8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DVolume8_Release(p)                   (p)->Release()
+/*** IDirect3DVolume8 methods ***/
+#define IDirect3DVolume8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DVolume8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DVolume8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DVolume8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DVolume8_GetContainer(p,a,b)          (p)->GetContainer(a,b)
+#define IDirect3DVolume8_GetDesc(p,a)                 (p)->GetDesc(a)
+#define IDirect3DVolume8_LockBox(p,a,b,c)             (p)->LockBox(a,b,c)
+#define IDirect3DVolume8_UnlockBox(p)                 (p)->UnlockBox()
+#endif
+
+/*****************************************************************************
+ * IDirect3DSwapChain8 interface
+ */
+#define INTERFACE IDirect3DSwapChain8
+DECLARE_INTERFACE_(IDirect3DSwapChain8,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DSwapChain8 methods ***/
+    STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect, CONST RECT * pDestRect, HWND  hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE;
+    STDMETHOD(GetBackBuffer)(THIS_ UINT  BackBuffer, D3DBACKBUFFER_TYPE  Type, struct IDirect3DSurface8 ** ppBackBuffer) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DSwapChain8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DSwapChain8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DSwapChain8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DSwapChain8 methods ***/
+#define IDirect3DSwapChain8_Present(p,a,b,c)             (p)->lpVtbl->Present(p,a,b,c)
+#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c)       (p)->lpVtbl->GetBackBuffer(p,a,b,c)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DSwapChain8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DSwapChain8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DSwapChain8_Release(p)                   (p)->Release()
+/*** IDirect3DSwapChain8 methods ***/
+#define IDirect3DSwapChain8_Present(p,a,b,c)             (p)->Present(a,b,c)
+#define IDirect3DSwapChain8_GetBackBuffer(p,a,b,c)       (p)->GetBackBuffer(a,b,c)
+#endif
+
+/*****************************************************************************
+ * IDirect3DSurface8 interface
+ */
+#define INTERFACE IDirect3DSurface8
+DECLARE_INTERFACE_(IDirect3DSurface8,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DSurface8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid,CONST void * pData,DWORD  SizeOfData,DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid,void * pData,DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD(GetContainer)(THIS_ REFIID  riid, void ** ppContainer) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC * pDesc) PURE;
+    STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT * pLockedRect, CONST RECT * pRect,DWORD  Flags) PURE;
+    STDMETHOD(UnlockRect)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DSurface8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DSurface8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DSurface8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DSurface8 methods ***/
+#define IDirect3DSurface8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DSurface8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DSurface8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DSurface8_GetContainer(p,a,b)          (p)->lpVtbl->GetContainer(p,a,b)
+#define IDirect3DSurface8_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#define IDirect3DSurface8_LockRect(p,a,b,c)            (p)->lpVtbl->LockRect(p,a,b,c)
+#define IDirect3DSurface8_UnlockRect(p)                (p)->lpVtbl->UnlockRect(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DSurface8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DSurface8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DSurface8_Release(p)                   (p)->Release()
+/*** IDirect3DSurface8 methods ***/
+#define IDirect3DSurface8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DSurface8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DSurface8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DSurface8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DSurface8_GetContainer(p,a,b)          (p)->GetContainer(a,b)
+#define IDirect3DSurface8_GetDesc(p,a)                 (p)->GetDesc(a)
+#define IDirect3DSurface8_LockRect(p,a,b,c)            (p)->LockRect(a,b,c)
+#define IDirect3DSurface8_UnlockRect(p)                (p)->UnlockRect()
+#endif
+
+/*****************************************************************************
+ * IDirect3DResource8 interface
+ */
+#define INTERFACE IDirect3DResource8
+DECLARE_INTERFACE_(IDirect3DResource8,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
+    STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
+    STDMETHOD_(void,PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE,GetType)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DResource8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DResource8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DResource8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DResource8 methods ***/
+#define IDirect3DResource8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DResource8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DResource8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DResource8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DResource8_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DResource8_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DResource8_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DResource8_GetType(p)                   (p)->lpVtbl->GetType(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DResource8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DResource8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DResource8_Release(p)                   (p)->Release()
+/*** IDirect3DResource8 methods ***/
+#define IDirect3DResource8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DResource8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DResource8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DResource8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DResource8_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DResource8_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DResource8_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DResource8_GetType(p)                   (p)->GetType()
+#endif
+
+/*****************************************************************************
+ * IDirect3DVertexBuffer8 interface
+ */
+#define INTERFACE IDirect3DVertexBuffer8
+DECLARE_INTERFACE_(IDirect3DVertexBuffer8,IDirect3DResource8)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
+    STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
+    STDMETHOD_(void,PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE,GetType)(THIS) PURE;
+    /*** IDirect3DVertexBuffer8 methods ***/
+    STDMETHOD(Lock)(THIS_ UINT  OffsetToLock, UINT  SizeToLock, BYTE ** ppbData, DWORD  Flags) PURE;
+    STDMETHOD(Unlock)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC  * pDesc) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVertexBuffer8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVertexBuffer8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DVertexBuffer8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DVertexBuffer8 methods: IDirect3DResource8 ***/
+#define IDirect3DVertexBuffer8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DVertexBuffer8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DVertexBuffer8_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DVertexBuffer8_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DVertexBuffer8_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DVertexBuffer8_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DVertexBuffer8 methods ***/
+#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirect3DVertexBuffer8_Unlock(p)                    (p)->lpVtbl->Unlock(p)
+#define IDirect3DVertexBuffer8_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVertexBuffer8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DVertexBuffer8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DVertexBuffer8_Release(p)                   (p)->Release()
+/*** IDirect3DVertexBuffer8 methods: IDirect3DResource8 ***/
+#define IDirect3DVertexBuffer8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DVertexBuffer8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DVertexBuffer8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DVertexBuffer8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DVertexBuffer8_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DVertexBuffer8_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DVertexBuffer8_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DVertexBuffer8_GetType(p)                   (p)->GetType()
+/*** IDirect3DVertexBuffer8 methods ***/
+#define IDirect3DVertexBuffer8_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirect3DVertexBuffer8_Unlock(p)                    (p)->Unlock()
+#define IDirect3DVertexBuffer8_GetDesc(p,a)                 (p)->GetDesc(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DIndexBuffer8 interface
+ */
+#define INTERFACE IDirect3DIndexBuffer8
+DECLARE_INTERFACE_(IDirect3DIndexBuffer8,IDirect3DResource8)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
+    STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
+    STDMETHOD_(void,PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE,GetType)(THIS) PURE;
+    /*** IDirect3DIndexBuffer8 methods ***/
+    STDMETHOD(Lock)(THIS_ UINT  OffsetToLock, UINT  SizeToLock, BYTE ** ppbData, DWORD  Flags) PURE;
+    STDMETHOD(Unlock)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC * pDesc) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DIndexBuffer8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DIndexBuffer8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DIndexBuffer8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DIndexBuffer8 methods: IDirect3DResource8 ***/
+#define IDirect3DIndexBuffer8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DIndexBuffer8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DIndexBuffer8_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DIndexBuffer8_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DIndexBuffer8_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DIndexBuffer8_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DIndexBuffer8 methods ***/
+#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirect3DIndexBuffer8_Unlock(p)                    (p)->lpVtbl->Unlock(p)
+#define IDirect3DIndexBuffer8_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DIndexBuffer8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DIndexBuffer8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DIndexBuffer8_Release(p)                   (p)->Release()
+/*** IDirect3DIndexBuffer8 methods: IDirect3DResource8 ***/
+#define IDirect3DIndexBuffer8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DIndexBuffer8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DIndexBuffer8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DIndexBuffer8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DIndexBuffer8_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DIndexBuffer8_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DIndexBuffer8_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DIndexBuffer8_GetType(p)                   (p)->GetType()
+/*** IDirect3DIndexBuffer8 methods ***/
+#define IDirect3DIndexBuffer8_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirect3DIndexBuffer8_Unlock(p)                    (p)->Unlock()
+#define IDirect3DIndexBuffer8_GetDesc(p,a)                 (p)->GetDesc(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DBaseTexture8 interface
+ */
+#define INTERFACE IDirect3DBaseTexture8
+DECLARE_INTERFACE_(IDirect3DBaseTexture8,IDirect3DResource8)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
+    STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
+    STDMETHOD_(void,PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE,GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture8 methods ***/
+    STDMETHOD_(DWORD,SetLOD)(THIS_ DWORD  LODNew) PURE;
+    STDMETHOD_(DWORD,GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD,GetLevelCount)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DBaseTexture8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DBaseTexture8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DBaseTexture8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DBaseTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DBaseTexture8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DBaseTexture8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DBaseTexture8_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DBaseTexture8_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DBaseTexture8_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DBaseTexture8_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DBaseTexture8 methods ***/
+#define IDirect3DBaseTexture8_SetLOD(p,a)                  (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DBaseTexture8_GetLOD(p)                    (p)->lpVtbl->GetLOD(p)
+#define IDirect3DBaseTexture8_GetLevelCount(p)             (p)->lpVtbl->GetLevelCount(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DBaseTexture8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DBaseTexture8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DBaseTexture8_Release(p)                   (p)->Release()
+/*** IDirect3DBaseTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DBaseTexture8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DBaseTexture8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DBaseTexture8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DBaseTexture8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DBaseTexture8_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DBaseTexture8_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DBaseTexture8_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DBaseTexture8_GetType(p)                   (p)->GetType()
+/*** IDirect3DBaseTexture8 methods ***/
+#define IDirect3DBaseTexture8_SetLOD(p,a)                  (p)->SetLOD(a)
+#define IDirect3DBaseTexture8_GetLOD(p)                    (p)->GetLOD()
+#define IDirect3DBaseTexture8_GetLevelCount(p)             (p)->GetLevelCount()
+#endif
+
+/*****************************************************************************
+ * IDirect3DCubeTexture8 interface
+ */
+#define INTERFACE IDirect3DCubeTexture8
+DECLARE_INTERFACE_(IDirect3DCubeTexture8,IDirect3DBaseTexture8)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
+    STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
+    STDMETHOD_(void,PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE,GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture8 methods ***/
+    STDMETHOD_(DWORD,SetLOD)(THIS_ DWORD  LODNew) PURE;
+    STDMETHOD_(DWORD,GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD,GetLevelCount)(THIS) PURE;
+    /*** IDirect3DCubeTexture8 methods ***/
+    STDMETHOD(GetLevelDesc)(THIS_ UINT  Level,D3DSURFACE_DESC * pDesc) PURE;
+    STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES  FaceType,UINT  Level,IDirect3DSurface8 ** ppCubeMapSurface) PURE;
+    STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES  FaceType,UINT  Level,D3DLOCKED_RECT * pLockedRect,CONST RECT * pRect,DWORD  Flags) PURE;
+    STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES  FaceType,UINT  Level) PURE;
+    STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES  FaceType,CONST RECT * pDirtyRect) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DCubeTexture8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DCubeTexture8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DCubeTexture8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DCubeTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DCubeTexture8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DCubeTexture8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DCubeTexture8_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DCubeTexture8_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DCubeTexture8_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DCubeTexture8_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DCubeTexture8 methods: IDirect3DBaseTexture8 ***/
+#define IDirect3DCubeTexture8_SetLOD(p,a)                  (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DCubeTexture8_GetLOD(p)                    (p)->lpVtbl->GetLOD(p)
+#define IDirect3DCubeTexture8_GetLevelCount(p)             (p)->lpVtbl->GetLevelCount(p)
+/*** IDirect3DCubeTexture8 methods ***/
+#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b)          (p)->lpVtbl->GetLevelDesc(p,a,b)
+#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c)   (p)->lpVtbl->GetCubeMapSurface(p,a,b,c)
+#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e)        (p)->lpVtbl->LockRect(p,a,b,c,d,e)
+#define IDirect3DCubeTexture8_UnlockRect(p,a,b)            (p)->lpVtbl->UnlockRect(p,a,b)
+#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b)          (p)->lpVtbl->AddDirtyRect(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DCubeTexture8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DCubeTexture8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DCubeTexture8_Release(p)                   (p)->Release()
+/*** IDirect3DCubeTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DCubeTexture8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DCubeTexture8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DCubeTexture8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DCubeTexture8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DCubeTexture8_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DCubeTexture8_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DCubeTexture8_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DCubeTexture8_GetType(p)                   (p)->GetType()
+/*** IDirect3DCubeTexture8 methods: IDirect3DBaseTexture8 ***/
+#define IDirect3DCubeTexture8_SetLOD(p,a)                  (p)->SetLOD(a)
+#define IDirect3DCubeTexture8_GetLOD(p)                    (p)->GetLOD()
+#define IDirect3DCubeTexture8_GetLevelCount(p)             (p)->GetLevelCount()
+/*** IDirect3DCubeTexture8 methods ***/
+#define IDirect3DCubeTexture8_GetLevelDesc(p,a,b)          (p)->GetLevelDesc(a,b)
+#define IDirect3DCubeTexture8_GetCubeMapSurface(p,a,b,c)   (p)->GetCubeMapSurface(a,b,c)
+#define IDirect3DCubeTexture8_LockRect(p,a,b,c,d,e)        (p)->LockRect(a,b,c,d,e)
+#define IDirect3DCubeTexture8_UnlockRect(p,a,b)            (p)->UnlockRect(a,b)
+#define IDirect3DCubeTexture8_AddDirtyRect(p,a,b)          (p)->AddDirtyRect(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DTexture8 interface
+ */
+#define INTERFACE IDirect3DTexture8
+DECLARE_INTERFACE_(IDirect3DTexture8,IDirect3DBaseTexture8)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
+    STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
+    STDMETHOD_(void,PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE,GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture8 methods ***/
+    STDMETHOD_(DWORD,SetLOD)(THIS_ DWORD  LODNew) PURE;
+    STDMETHOD_(DWORD,GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD,GetLevelCount)(THIS) PURE;
+    /*** IDirect3DTexture8 methods ***/
+    STDMETHOD(GetLevelDesc)(THIS_ UINT  Level,D3DSURFACE_DESC * pDesc) PURE;
+    STDMETHOD(GetSurfaceLevel)(THIS_ UINT  Level,IDirect3DSurface8 ** ppSurfaceLevel) PURE;
+    STDMETHOD(LockRect)(THIS_ UINT  Level,D3DLOCKED_RECT * pLockedRect,CONST RECT * pRect,DWORD  Flags) PURE;
+    STDMETHOD(UnlockRect)(THIS_ UINT  Level) PURE;
+    STDMETHOD(AddDirtyRect)(THIS_ CONST RECT * pDirtyRect) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DTexture8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DTexture8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DTexture8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DTexture8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DTexture8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DTexture8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DTexture8_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DTexture8_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DTexture8_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DTexture8_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DTexture8 methods: IDirect3DBaseTexture8 ***/
+#define IDirect3DTexture8_SetLOD(p,a)                  (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DTexture8_GetLOD(p)                    (p)->lpVtbl->GetLOD(p)
+#define IDirect3DTexture8_GetLevelCount(p)             (p)->lpVtbl->GetLevelCount(p)
+/*** IDirect3DTexture8 methods ***/
+#define IDirect3DTexture8_GetLevelDesc(p,a,b)          (p)->lpVtbl->GetLevelDesc(p,a,b)
+#define IDirect3DTexture8_GetSurfaceLevel(p,a,b)       (p)->lpVtbl->GetSurfaceLevel(p,a,b)
+#define IDirect3DTexture8_LockRect(p,a,b,c,d)          (p)->lpVtbl->LockRect(p,a,b,c,d)
+#define IDirect3DTexture8_UnlockRect(p,a)              (p)->lpVtbl->UnlockRect(p,a)
+#define IDirect3DTexture8_AddDirtyRect(p,a)            (p)->lpVtbl->AddDirtyRect(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DTexture8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DTexture8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DTexture8_Release(p)                   (p)->Release()
+/*** IDirect3DTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DTexture8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DTexture8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DTexture8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DTexture8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DTexture8_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DTexture8_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DTexture8_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DTexture8_GetType(p)                   (p)->GetType()
+/*** IDirect3DTexture8 methods: IDirect3DBaseTexture8 ***/
+#define IDirect3DTexture8_SetLOD(p,a)                  (p)->SetLOD(a)
+#define IDirect3DTexture8_GetLOD(p)                    (p)->GetLOD()
+#define IDirect3DTexture8_GetLevelCount(p)             (p)->GetLevelCount()
+/*** IDirect3DTexture8 methods ***/
+#define IDirect3DTexture8_GetLevelDesc(p,a,b)          (p)->GetLevelDesc(a,b)
+#define IDirect3DTexture8_GetSurfaceLevel(p,a,b)       (p)->GetSurfaceLevel(a,b)
+#define IDirect3DTexture8_LockRect(p,a,b,c,d)          (p)->LockRect(a,b,c,d)
+#define IDirect3DTexture8_UnlockRect(p,a)              (p)->UnlockRect(a)
+#define IDirect3DTexture8_AddDirtyRect(p,a)            (p)->AddDirtyRect(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DVolumeTexture8 interface
+ */
+#define INTERFACE IDirect3DVolumeTexture8
+DECLARE_INTERFACE_(IDirect3DVolumeTexture8,IDirect3DBaseTexture8)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource8 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice8 ** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID  refguid, CONST void * pData, DWORD  SizeOfData, DWORD  Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID  refguid, void * pData, DWORD * pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID  refguid) PURE;
+    STDMETHOD_(DWORD,SetPriority)(THIS_ DWORD  PriorityNew) PURE;
+    STDMETHOD_(DWORD,GetPriority)(THIS) PURE;
+    STDMETHOD_(void,PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE,GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture8 methods ***/
+    STDMETHOD_(DWORD,SetLOD)(THIS_ DWORD  LODNew) PURE;
+    STDMETHOD_(DWORD,GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD,GetLevelCount)(THIS) PURE;
+    /*** IDirect3DVolumeTexture8 methods ***/
+    STDMETHOD(GetLevelDesc)(THIS_ UINT  Level,D3DVOLUME_DESC * pDesc) PURE;
+    STDMETHOD(GetVolumeLevel)(THIS_ UINT  Level,IDirect3DVolume8 ** ppVolumeLevel) PURE;
+    STDMETHOD(LockBox)(THIS_ UINT  Level,D3DLOCKED_BOX * pLockedVolume,CONST D3DBOX * pBox,DWORD  Flags) PURE;
+    STDMETHOD(UnlockBox)(THIS_ UINT  Level) PURE;
+    STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX * pDirtyBox) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVolumeTexture8_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVolumeTexture8_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DVolumeTexture8_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DVolumeTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DVolumeTexture8_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DVolumeTexture8_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DVolumeTexture8_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DVolumeTexture8_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DVolumeTexture8_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DVolumeTexture8_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DVolumeTexture8 methods: IDirect3DBaseTexture8 ***/
+#define IDirect3DVolumeTexture8_SetLOD(p,a)                  (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DVolumeTexture8_GetLOD(p)                    (p)->lpVtbl->GetLOD(p)
+#define IDirect3DVolumeTexture8_GetLevelCount(p)             (p)->lpVtbl->GetLevelCount(p)
+/*** IDirect3DVolumeTexture8 methods ***/
+#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b)          (p)->lpVtbl->GetLevelDesc(p,a,b)
+#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b)        (p)->lpVtbl->GetVolumeLevel(p,a,b)
+#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d)           (p)->lpVtbl->LockBox(p,a,b,c,d)
+#define IDirect3DVolumeTexture8_UnlockBox(p,a)               (p)->lpVtbl->UnlockBox(p,a)
+#define IDirect3DVolumeTexture8_AddDirtyBox(p,a)             (p)->lpVtbl->AddDirtyBox(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVolumeTexture8_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DVolumeTexture8_AddRef(p)                    (p)->AddRef()
+#define IDirect3DVolumeTexture8_Release(p)                   (p)->Release()
+/*** IDirect3DVolumeTexture8 methods: IDirect3DResource8 ***/
+#define IDirect3DVolumeTexture8_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DVolumeTexture8_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DVolumeTexture8_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DVolumeTexture8_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DVolumeTexture8_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DVolumeTexture8_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DVolumeTexture8_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DVolumeTexture8_GetType(p)                   (p)->GetType()
+/*** IDirect3DVolumeTexture8 methods: IDirect3DBaseTexture8 ***/
+#define IDirect3DVolumeTexture8_SetLOD(p,a)                  (p)->SetLOD(a)
+#define IDirect3DVolumeTexture8_GetLOD(p)                    (p)->GetLOD()
+#define IDirect3DVolumeTexture8_GetLevelCount(p)             (p)->GetLevelCount()
+/*** IDirect3DVolumeTexture8 methods ***/
+#define IDirect3DVolumeTexture8_GetLevelDesc(p,a,b)          (p)->GetLevelDesc(a,b)
+#define IDirect3DVolumeTexture8_GetVolumeLevel(p,a,b)        (p)->GetVolumeLevel(a,b)
+#define IDirect3DVolumeTexture8_LockBox(p,a,b,c,d)           (p)->LockBox(a,b,c,d)
+#define IDirect3DVolumeTexture8_UnlockBox(p,a)               (p)->UnlockBox(a)
+#define IDirect3DVolumeTexture8_AddDirtyBox(p,a)             (p)->AddDirtyBox(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DDevice8 interface
+ */
+#define INTERFACE IDirect3DDevice8
+DECLARE_INTERFACE_(IDirect3DDevice8,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DDevice8 methods ***/
+    STDMETHOD(TestCooperativeLevel)(THIS) PURE;
+    STDMETHOD_(UINT,GetAvailableTextureMem)(THIS) PURE;
+    STDMETHOD(ResourceManagerDiscardBytes)(THIS_ DWORD  Bytes) PURE;
+    STDMETHOD(GetDirect3D)(THIS_ IDirect3D8 ** ppD3D8) PURE;
+    STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS8 * pCaps) PURE;
+    STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE * pMode) PURE;
+    STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS  * pParameters) PURE;
+    STDMETHOD(SetCursorProperties)(THIS_ UINT  XHotSpot, UINT  YHotSpot, IDirect3DSurface8 * pCursorBitmap) PURE;
+    STDMETHOD_(void,SetCursorPosition)(THIS_ UINT  XScreenSpace, UINT  YScreenSpace,DWORD  Flags) PURE;
+    STDMETHOD_(BOOL,ShowCursor)(THIS_ BOOL  bShow) PURE;
+    STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS * pPresentationParameters, IDirect3DSwapChain8 ** pSwapChain) PURE;
+    STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS * pPresentationParameters) PURE;
+    STDMETHOD(Present)(THIS_ CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND  hDestWindowOverride,CONST RGNDATA * pDirtyRegion) PURE;
+    STDMETHOD(GetBackBuffer)(THIS_ UINT  BackBuffer,D3DBACKBUFFER_TYPE  Type,IDirect3DSurface8 ** ppBackBuffer) PURE;
+    STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS * pRasterStatus) PURE;
+    STDMETHOD_(void,SetGammaRamp)(THIS_ DWORD  Flags,CONST D3DGAMMARAMP * pRamp) PURE;
+    STDMETHOD_(void,GetGammaRamp)(THIS_ D3DGAMMARAMP * pRamp) PURE;
+    STDMETHOD(CreateTexture)(THIS_ UINT  Width,UINT  Height,UINT  Levels,DWORD  Usage,D3DFORMAT  Format,D3DPOOL  Pool,IDirect3DTexture8 ** ppTexture) PURE;
+    STDMETHOD(CreateVolumeTexture)(THIS_ UINT  Width,UINT  Height,UINT  Depth,UINT  Levels,DWORD  Usage,D3DFORMAT  Format,D3DPOOL  Pool,IDirect3DVolumeTexture8 ** ppVolumeTexture) PURE;
+    STDMETHOD(CreateCubeTexture)(THIS_ UINT  EdgeLength,UINT  Levels,DWORD  Usage,D3DFORMAT  Format,D3DPOOL  Pool,IDirect3DCubeTexture8 ** ppCubeTexture) PURE;
+    STDMETHOD(CreateVertexBuffer)(THIS_ UINT  Length,DWORD  Usage,DWORD  FVF,D3DPOOL  Pool,IDirect3DVertexBuffer8 ** ppVertexBuffer) PURE;
+    STDMETHOD(CreateIndexBuffer)(THIS_ UINT  Length,DWORD  Usage,D3DFORMAT  Format,D3DPOOL  Pool,IDirect3DIndexBuffer8 ** ppIndexBuffer) PURE;
+    STDMETHOD(CreateRenderTarget)(THIS_ UINT  Width,UINT  Height,D3DFORMAT  Format,D3DMULTISAMPLE_TYPE  MultiSample,BOOL  Lockable,IDirect3DSurface8 ** ppSurface) PURE;
+    STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT  Width,UINT  Height,D3DFORMAT  Format,D3DMULTISAMPLE_TYPE  MultiSample,IDirect3DSurface8 ** ppSurface) PURE;
+    STDMETHOD(CreateImageSurface)(THIS_ UINT  Width,UINT  Height,D3DFORMAT  Format,IDirect3DSurface8 ** ppSurface) PURE;
+    STDMETHOD(CopyRects)(THIS_ IDirect3DSurface8 * pSourceSurface,CONST RECT * pSourceRectsArray,UINT  cRects,IDirect3DSurface8 * pDestinationSurface,CONST POINT * pDestPointsArray) PURE;
+    STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture8 * pSourceTexture,IDirect3DBaseTexture8 * pDestinationTexture) PURE;
+    STDMETHOD(GetFrontBuffer)(THIS_ IDirect3DSurface8 * pDestSurface) PURE;
+    STDMETHOD(SetRenderTarget)(THIS_ IDirect3DSurface8 * pRenderTarget,IDirect3DSurface8 * pNewZStencil) PURE;
+    STDMETHOD(GetRenderTarget)(THIS_ IDirect3DSurface8 ** ppRenderTarget) PURE;
+    STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface8 ** ppZStencilSurface) PURE;
+    STDMETHOD(BeginScene)(THIS) PURE;
+    STDMETHOD(EndScene)(THIS) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD  Count,CONST D3DRECT * pRects,DWORD  Flags,D3DCOLOR  Color,float  Z,DWORD  Stencil) PURE;
+    STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE  State,CONST D3DMATRIX * pMatrix) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE  State,D3DMATRIX * pMatrix) PURE;
+    STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE  State, CONST D3DMATRIX * pMatrix) PURE;
+    STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT8 * pViewport) PURE;
+    STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT8 * pViewport) PURE;
+    STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL8 * pMaterial) PURE;
+    STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL8 *pMaterial) PURE;
+    STDMETHOD(SetLight)(THIS_ DWORD  Index,CONST D3DLIGHT8 * pLight) PURE;
+    STDMETHOD(GetLight)(THIS_ DWORD  Index,D3DLIGHT8 * pLight) PURE;
+    STDMETHOD(LightEnable)(THIS_ DWORD  Index,BOOL  Enable) PURE;
+    STDMETHOD(GetLightEnable)(THIS_ DWORD  Index,BOOL * pEnable) PURE;
+    STDMETHOD(SetClipPlane)(THIS_ DWORD  Index,CONST float * pPlane) PURE;
+    STDMETHOD(GetClipPlane)(THIS_ DWORD  Index,float * pPlane) PURE;
+    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE  State,DWORD  Value) PURE;
+    STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE  State,DWORD * pValue) PURE;
+    STDMETHOD(BeginStateBlock)(THIS) PURE;
+    STDMETHOD(EndStateBlock)(THIS_ DWORD * pToken) PURE;
+    STDMETHOD(ApplyStateBlock)(THIS_ DWORD  Token) PURE;
+    STDMETHOD(CaptureStateBlock)(THIS_ DWORD  Token) PURE;
+    STDMETHOD(DeleteStateBlock)(THIS_ DWORD  Token) PURE;
+    STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE  Type,DWORD * pToken) PURE;
+    STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS8 * pClipStatus) PURE;
+    STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS8 * pClipStatus) PURE;
+    STDMETHOD(GetTexture)(THIS_ DWORD  Stage,IDirect3DBaseTexture8 ** ppTexture) PURE;
+    STDMETHOD(SetTexture)(THIS_ DWORD  Stage,IDirect3DBaseTexture8 * pTexture) PURE;
+    STDMETHOD(GetTextureStageState)(THIS_ DWORD  Stage,D3DTEXTURESTAGESTATETYPE  Type,DWORD * pValue) PURE;
+    STDMETHOD(SetTextureStageState)(THIS_ DWORD  Stage,D3DTEXTURESTAGESTATETYPE  Type,DWORD  Value) PURE;
+    STDMETHOD(ValidateDevice)(THIS_ DWORD * pNumPasses) PURE;
+    STDMETHOD(GetInfo)(THIS_ DWORD  DevInfoID,void * pDevInfoStruct,DWORD  DevInfoStructSize) PURE;
+    STDMETHOD(SetPaletteEntries)(THIS_ UINT  PaletteNumber,CONST PALETTEENTRY * pEntries) PURE;
+    STDMETHOD(GetPaletteEntries)(THIS_ UINT  PaletteNumber,PALETTEENTRY * pEntries) PURE;
+    STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT  PaletteNumber) PURE;
+    STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT  * PaletteNumber) PURE;
+    STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,UINT  StartVertex,UINT  PrimitiveCount) PURE;
+    STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,UINT  minIndex,UINT  NumVertices,UINT  startIndex,UINT  primCount) PURE;
+    STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,UINT  PrimitiveCount,CONST void * pVertexStreamZeroData,UINT  VertexStreamZeroStride) PURE;
+    STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE  PrimitiveType,UINT  MinVertexIndex,UINT  NumVertexIndices,UINT  PrimitiveCount,CONST void * pIndexData,D3DFORMAT  IndexDataFormat,CONST void * pVertexStreamZeroData,UINT  VertexStreamZeroStride) PURE;
+    STDMETHOD(ProcessVertices)(THIS_ UINT  SrcStartIndex,UINT  DestIndex,UINT  VertexCount,IDirect3DVertexBuffer8 * pDestBuffer,DWORD  Flags) PURE;
+    STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD * pDeclaration,CONST DWORD * pFunction,DWORD * pHandle,DWORD  Usage) PURE;
+    STDMETHOD(SetVertexShader)(THIS_ DWORD  Handle) PURE;
+    STDMETHOD(GetVertexShader)(THIS_ DWORD * pHandle) PURE;
+    STDMETHOD(DeleteVertexShader)(THIS_ DWORD  Handle) PURE;
+    STDMETHOD(SetVertexShaderConstant)(THIS_ DWORD  Register,CONST void * pConstantData,DWORD  ConstantCount) PURE;
+    STDMETHOD(GetVertexShaderConstant)(THIS_ DWORD  Register,void * pConstantData,DWORD  ConstantCount) PURE;
+    STDMETHOD(GetVertexShaderDeclaration)(THIS_ DWORD  Handle,void * pData,DWORD * pSizeOfData) PURE;
+    STDMETHOD(GetVertexShaderFunction)(THIS_ DWORD  Handle,void * pData,DWORD * pSizeOfData) PURE;
+    STDMETHOD(SetStreamSource)(THIS_ UINT  StreamNumber,IDirect3DVertexBuffer8 * pStreamData,UINT  Stride) PURE;
+    STDMETHOD(GetStreamSource)(THIS_ UINT  StreamNumber,IDirect3DVertexBuffer8 ** ppStreamData,UINT * pStride) PURE;
+    STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer8 * pIndexData,UINT  BaseVertexIndex) PURE;
+    STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer8 ** ppIndexData,UINT * pBaseVertexIndex) PURE;
+    STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD * pFunction,DWORD * pHandle) PURE;
+    STDMETHOD(SetPixelShader)(THIS_ DWORD  Handle) PURE;
+    STDMETHOD(GetPixelShader)(THIS_ DWORD * pHandle) PURE;
+    STDMETHOD(DeletePixelShader)(THIS_ DWORD  Handle) PURE;
+    STDMETHOD(SetPixelShaderConstant)(THIS_ DWORD  Register,CONST void * pConstantData,DWORD  ConstantCount) PURE;
+    STDMETHOD(GetPixelShaderConstant)(THIS_ DWORD  Register,void * pConstantData,DWORD  ConstantCount) PURE;
+    STDMETHOD(GetPixelShaderFunction)(THIS_ DWORD  Handle,void * pData,DWORD * pSizeOfData) PURE;
+    STDMETHOD(DrawRectPatch)(THIS_ UINT  Handle,CONST float * pNumSegs,CONST D3DRECTPATCH_INFO * pRectPatchInfo) PURE;
+    STDMETHOD(DrawTriPatch)(THIS_ UINT  Handle,CONST float * pNumSegs,CONST D3DTRIPATCH_INFO * pTriPatchInfo) PURE;
+    STDMETHOD(DeletePatch)(THIS_ UINT  Handle) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DDevice8_QueryInterface(p,a,b)                     (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DDevice8_AddRef(p)                                 (p)->lpVtbl->AddRef(p)
+#define IDirect3DDevice8_Release(p)                                (p)->lpVtbl->Release(p)
+/*** IDirect3DDevice8 methods ***/
+#define IDirect3DDevice8_TestCooperativeLevel(p)                   (p)->lpVtbl->TestCooperativeLevel(p)
+#define IDirect3DDevice8_GetAvailableTextureMem(p)                 (p)->lpVtbl->GetAvailableTextureMem(p)
+#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a)          (p)->lpVtbl->ResourceManagerDiscardBytes(p,a)
+#define IDirect3DDevice8_GetDirect3D(p,a)                          (p)->lpVtbl->GetDirect3D(p,a)
+#define IDirect3DDevice8_GetDeviceCaps(p,a)                        (p)->lpVtbl->GetDeviceCaps(p,a)
+#define IDirect3DDevice8_GetDisplayMode(p,a)                       (p)->lpVtbl->GetDisplayMode(p,a)
+#define IDirect3DDevice8_GetCreationParameters(p,a)                (p)->lpVtbl->GetCreationParameters(p,a)
+#define IDirect3DDevice8_SetCursorProperties(p,a,b,c)              (p)->lpVtbl->SetCursorProperties(p,a,b,c)
+#define IDirect3DDevice8_SetCursorPosition(p,a,b,c)                (p)->lpVtbl->SetCursorPosition(p,a,b,c)
+#define IDirect3DDevice8_ShowCursor(p,a)                           (p)->lpVtbl->ShowCursor(p,a)
+#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b)          (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b)
+#define IDirect3DDevice8_Reset(p,a)                                (p)->lpVtbl->Reset(p,a)
+#define IDirect3DDevice8_Present(p,a,b,c,d)                        (p)->lpVtbl->Present(p,a,b,c,d)
+#define IDirect3DDevice8_GetBackBuffer(p,a,b,c)                    (p)->lpVtbl->GetBackBuffer(p,a,b,c)
+#define IDirect3DDevice8_GetRasterStatus(p,a)                      (p)->lpVtbl->GetRasterStatus(p,a)
+#define IDirect3DDevice8_SetGammaRamp(p,a,b)                       (p)->lpVtbl->SetGammaRamp(p,a,b)
+#define IDirect3DDevice8_GetGammaRamp(p,a)                         (p)->lpVtbl->GetGammaRamp(p,a)
+#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g)            (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h)    (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f)          (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f)
+#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e)           (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e)
+#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e)            (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e)
+#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f)         (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f)
+#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e)    (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e)
+#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d)             (p)->lpVtbl->CreateImageSurface(p,a,b,c,d)
+#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e)                    (p)->lpVtbl->CopyRects(p,a,b,c,d,e)
+#define IDirect3DDevice8_UpdateTexture(p,a,b)                      (p)->lpVtbl->UpdateTexture(p,a,b)
+#define IDirect3DDevice8_GetFrontBuffer(p,a)                       (p)->lpVtbl->GetFrontBuffer(p,a)
+#define IDirect3DDevice8_SetRenderTarget(p,a,b)                    (p)->lpVtbl->SetRenderTarget(p,a,b)
+#define IDirect3DDevice8_GetRenderTarget(p,a)                      (p)->lpVtbl->GetRenderTarget(p,a)
+#define IDirect3DDevice8_GetDepthStencilSurface(p,a)               (p)->lpVtbl->GetDepthStencilSurface(p,a)
+#define IDirect3DDevice8_BeginScene(p)                             (p)->lpVtbl->BeginScene(p)
+#define IDirect3DDevice8_EndScene(p)                               (p)->lpVtbl->EndScene(p)
+#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f)                      (p)->lpVtbl->Clear(p,a,b,c,d,e,f)
+#define IDirect3DDevice8_SetTransform(p,a,b)                       (p)->lpVtbl->SetTransform(p,a,b)
+#define IDirect3DDevice8_GetTransform(p,a,b)                       (p)->lpVtbl->GetTransform(p,a,b)
+#define IDirect3DDevice8_MultiplyTransform(p,a,b)                  (p)->lpVtbl->MultiplyTransform(p,a,b)
+#define IDirect3DDevice8_SetViewport(p,a)                          (p)->lpVtbl->SetViewport(p,a)
+#define IDirect3DDevice8_GetViewport(p,a)                          (p)->lpVtbl->GetViewport(p,a)
+#define IDirect3DDevice8_SetMaterial(p,a)                          (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DDevice8_GetMaterial(p,a)                          (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DDevice8_SetLight(p,a,b)                           (p)->lpVtbl->SetLight(p,a,b)
+#define IDirect3DDevice8_GetLight(p,a,b)                           (p)->lpVtbl->GetLight(p,a,b)
+#define IDirect3DDevice8_LightEnable(p,a,b)                        (p)->lpVtbl->LightEnable(p,a,b)
+#define IDirect3DDevice8_GetLightEnable(p,a,b)                     (p)->lpVtbl->GetLightEnable(p,a,b)
+#define IDirect3DDevice8_SetClipPlane(p,a,b)                       (p)->lpVtbl->SetClipPlane(p,a,b)
+#define IDirect3DDevice8_GetClipPlane(p,a,b)                       (p)->lpVtbl->GetClipPlane(p,a,b)
+#define IDirect3DDevice8_SetRenderState(p,a,b)                     (p)->lpVtbl->SetRenderState(p,a,b)
+#define IDirect3DDevice8_GetRenderState(p,a,b)                     (p)->lpVtbl->GetRenderState(p,a,b)
+#define IDirect3DDevice8_BeginStateBlock(p)                        (p)->lpVtbl->BeginStateBlock(p)
+#define IDirect3DDevice8_EndStateBlock(p,a)                        (p)->lpVtbl->EndStateBlock(p,a)
+#define IDirect3DDevice8_ApplyStateBlock(p,a)                      (p)->lpVtbl->ApplyStateBlock(p,a)
+#define IDirect3DDevice8_CaptureStateBlock(p,a)                    (p)->lpVtbl->CaptureStateBlock(p,a)
+#define IDirect3DDevice8_DeleteStateBlock(p,a)                     (p)->lpVtbl->DeleteStateBlock(p,a)
+#define IDirect3DDevice8_CreateStateBlock(p,a,b)                   (p)->lpVtbl->CreateStateBlock(p,a,b)
+#define IDirect3DDevice8_SetClipStatus(p,a)                        (p)->lpVtbl->SetClipStatus(p,a)
+#define IDirect3DDevice8_GetClipStatus(p,a)                        (p)->lpVtbl->GetClipStatus(p,a)
+#define IDirect3DDevice8_GetTexture(p,a,b)                         (p)->lpVtbl->GetTexture(p,a,b)
+#define IDirect3DDevice8_SetTexture(p,a,b)                         (p)->lpVtbl->SetTexture(p,a,b)
+#define IDirect3DDevice8_GetTextureStageState(p,a,b,c)             (p)->lpVtbl->GetTextureStageState(p,a,b,c)
+#define IDirect3DDevice8_SetTextureStageState(p,a,b,c)             (p)->lpVtbl->SetTextureStageState(p,a,b,c)
+#define IDirect3DDevice8_ValidateDevice(p,a)                       (p)->lpVtbl->ValidateDevice(p,a)
+#define IDirect3DDevice8_GetInfo(p,a,b,c)                          (p)->lpVtbl->GetInfo(p,a,b,c)
+#define IDirect3DDevice8_SetPaletteEntries(p,a,b)                  (p)->lpVtbl->SetPaletteEntries(p,a,b)
+#define IDirect3DDevice8_GetPaletteEntries(p,a,b)                  (p)->lpVtbl->GetPaletteEntries(p,a,b)
+#define IDirect3DDevice8_SetCurrentTexturePalette(p,a)             (p)->lpVtbl->SetCurrentTexturePalette(p,a)
+#define IDirect3DDevice8_GetCurrentTexturePalette(p,a)             (p)->lpVtbl->GetCurrentTexturePalette(p,a)
+#define IDirect3DDevice8_DrawPrimitive(p,a,b,c)                    (p)->lpVtbl->DrawPrimitive(p,a,b,c)
+#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e)         (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e)
+#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d)                (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d)
+#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e)              (p)->lpVtbl->processVertices(p,a,b,c,d,e)
+#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d)             (p)->lpVtbl->CreateVertexShader(p,a,b,c,d)
+#define IDirect3DDevice8_SetVertexShader(p,a)                      (p)->lpVtbl->SetVertexShader(p,a)
+#define IDirect3DDevice8_GetVertexShader(p,a)                      (p)->lpVtbl->GetVertexShader(p,a)
+#define IDirect3DDevice8_DeleteVertexShader(p,a)                   (p)->lpVtbl->DeleteVertexShader(p,a)
+#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c)          (p)->lpVtbl->SetVertexShaderConstant(p,a,b,c)
+#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c)          (p)->lpVtbl->GetVertexShaderConstant(p,a,b,c)
+#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c)       (p)->lpVtbl->GetVertexShaderDeclaration(p,a,b,c)
+#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c)          (p)->lpVtbl->GetVertexShaderFunction(p,a,b,c)
+#define IDirect3DDevice8_SetStreamSource(p,a,b,c)                  (p)->lpVtbl->SetStreamSource(p,a,b,c)
+#define IDirect3DDevice8_GetStreamSource(p,a,b,c)                  (p)->lpVtbl->GetStreamSource(p,a,b,c)
+#define IDirect3DDevice8_SetIndices(p,a,b)                         (p)->lpVtbl->SetIndices(p,a,b)
+#define IDirect3DDevice8_GetIndices(p,a,b)                         (p)->lpVtbl->GetIndices(p,a,b)
+#define IDirect3DDevice8_CreatePixelShader(p,a,b)                  (p)->lpVtbl->CreatePixelShader(p,a,b)
+#define IDirect3DDevice8_SetPixelShader(p,a)                       (p)->lpVtbl->SetPixelShader(p,a)
+#define IDirect3DDevice8_GetPixelShader(p,a)                       (p)->lpVtbl->GetPixelShader(p,a)
+#define IDirect3DDevice8_DeletePixelShader(p,a)                    (p)->lpVtbl->DeletePixelShader(p,a)
+#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c)           (p)->lpVtbl->SetPixelShaderConstant(p,a,b,c)
+#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c)           (p)->lpVtbl->GetPixelShaderConstant(p,a,b,c)
+#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c)           (p)->lpVtbl->GetPixelShaderFunction(p,a,b,c)
+#define IDirect3DDevice8_DrawRectPatch(p,a,b,c)                    (p)->lpVtbl->DrawRectPatch(p,a,b,c)
+#define IDirect3DDevice8_DrawTriPatch(p,a,b,c)                     (p)->lpVtbl->DrawTriPatch(p,a,b,c)
+#define IDirect3DDevice8_DeletePatch(p,a)                          (p)->lpVtbl->DeletePatch(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DDevice8_QueryInterface(p,a,b)                     (p)->QueryInterface(a,b)
+#define IDirect3DDevice8_AddRef(p)                                 (p)->AddRef()
+#define IDirect3DDevice8_Release(p)                                (p)->Release()
+/*** IDirect3DDevice8 methods ***/
+#define IDirect3DDevice8_TestCooperativeLevel(p)                   (p)->TestCooperativeLevel()
+#define IDirect3DDevice8_GetAvailableTextureMem(p)                 (p)->GetAvailableTextureMem()
+#define IDirect3DDevice8_ResourceManagerDiscardBytes(p,a)          (p)->ResourceManagerDiscardBytes(a)
+#define IDirect3DDevice8_GetDirect3D(p,a)                          (p)->GetDirect3D(a)
+#define IDirect3DDevice8_GetDeviceCaps(p,a)                        (p)->GetDeviceCaps(a)
+#define IDirect3DDevice8_GetDisplayMode(p,a)                       (p)->GetDisplayMode(a)
+#define IDirect3DDevice8_GetCreationParameters(p,a)                (p)->GetCreationParameters(a)
+#define IDirect3DDevice8_SetCursorProperties(p,a,b,c)              (p)->SetCursorProperties(a,b,c)
+#define IDirect3DDevice8_SetCursorPosition(p,a,b,c)                (p)->SetCursorPosition(a,b,c)
+#define IDirect3DDevice8_ShowCursor(p,a)                           (p)->ShowCursor(a)
+#define IDirect3DDevice8_CreateAdditionalSwapChain(p,a,b)          (p)->CreateAdditionalSwapChain(a,b)
+#define IDirect3DDevice8_Reset(p,a)                                (p)->Reset(a)
+#define IDirect3DDevice8_Present(p,a,b,c,d)                        (p)->Present(a,b,c,d)
+#define IDirect3DDevice8_GetBackBuffer(p,a,b,c)                    (p)->GetBackBuffer(a,b,c)
+#define IDirect3DDevice8_GetRasterStatus(p,a)                      (p)->GetRasterStatus(a)
+#define IDirect3DDevice8_SetGammaRamp(p,a,b)                       (p)->SetGammaRamp(a,b)
+#define IDirect3DDevice8_GetGammaRamp(p,a)                         (p)->GetGammaRamp(a)
+#define IDirect3DDevice8_CreateTexture(p,a,b,c,d,e,f,g)            (p)->CreateTexture(a,b,c,d,e,f,g)
+#define IDirect3DDevice8_CreateVolumeTexture(p,a,b,c,d,e,f,g,h)    (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice8_CreateCubeTexture(p,a,b,c,d,e,f)          (p)->CreateCubeTexture(a,b,c,d,e,f)
+#define IDirect3DDevice8_CreateVertexBuffer(p,a,b,c,d,e)           (p)->CreateVertexBuffer(a,b,c,d,e)
+#define IDirect3DDevice8_CreateIndexBuffer(p,a,b,c,d,e)            (p)->CreateIndexBuffer(a,b,c,d,e)
+#define IDirect3DDevice8_CreateRenderTarget(p,a,b,c,d,e,f)         (p)->CreateRenderTarget(a,b,c,d,e,f)
+#define IDirect3DDevice8_CreateDepthStencilSurface(p,a,b,c,d,e)    (p)->CreateDepthStencilSurface(a,b,c,d,e)
+#define IDirect3DDevice8_CreateImageSurface(p,a,b,c,d)             (p)->CreateImageSurface(a,b,c,d)
+#define IDirect3DDevice8_CopyRects(p,a,b,c,d,e)                    (p)->CopyRects(a,b,c,d,e)
+#define IDirect3DDevice8_UpdateTexture(p,a,b)                      (p)->UpdateTexture(a,b)
+#define IDirect3DDevice8_GetFrontBuffer(p,a)                       (p)->GetFrontBuffer(a)
+#define IDirect3DDevice8_SetRenderTarget(p,a,b)                    (p)->SetRenderTarget(a,b)
+#define IDirect3DDevice8_GetRenderTarget(p,a)                      (p)->GetRenderTarget(a)
+#define IDirect3DDevice8_GetDepthStencilSurface(p,a)               (p)->GetDepthStencilSurface(a)
+#define IDirect3DDevice8_BeginScene(p)                             (p)->BeginScene()
+#define IDirect3DDevice8_EndScene(p)                               (p)->EndScene()
+#define IDirect3DDevice8_Clear(p,a,b,c,d,e,f)                      (p)->Clear(a,b,c,d,e,f)
+#define IDirect3DDevice8_SetTransform(p,a,b)                       (p)->SetTransform(a,b)
+#define IDirect3DDevice8_GetTransform(p,a,b)                       (p)->GetTransform(a,b)
+#define IDirect3DDevice8_MultiplyTransform(p,a,b)                  (p)->MultiplyTransform(a,b)
+#define IDirect3DDevice8_SetViewport(p,a)                          (p)->SetViewport(a)
+#define IDirect3DDevice8_GetViewport(p,a)                          (p)->GetViewport(a)
+#define IDirect3DDevice8_SetMaterial(p,a)                          (p)->SetMaterial(a)
+#define IDirect3DDevice8_GetMaterial(p,a)                          (p)->GetMaterial(a)
+#define IDirect3DDevice8_SetLight(p,a,b)                           (p)->SetLight(a,b)
+#define IDirect3DDevice8_GetLight(p,a,b)                           (p)->GetLight(a,b)
+#define IDirect3DDevice8_LightEnable(p,a,b)                        (p)->LightEnable(a,b)
+#define IDirect3DDevice8_GetLightEnable(p,a,b)                     (p)->GetLightEnable(a,b)
+#define IDirect3DDevice8_SetClipPlane(p,a,b)                       (p)->SetClipPlane(a,b)
+#define IDirect3DDevice8_GetClipPlane(p,a,b)                       (p)->GetClipPlane(a,b)
+#define IDirect3DDevice8_SetRenderState(p,a,b)                     (p)->SetRenderState(a,b)
+#define IDirect3DDevice8_GetRenderState(p,a,b)                     (p)->GetRenderState(a,b)
+#define IDirect3DDevice8_BeginStateBlock(p)                        (p)->BeginStateBlock()
+#define IDirect3DDevice8_EndStateBlock(p,a)                        (p)->EndStateBlock(a)
+#define IDirect3DDevice8_ApplyStateBlock(p,a)                      (p)->ApplyStateBlock(a)
+#define IDirect3DDevice8_CaptureStateBlock(p,a)                    (p)->CaptureStateBlock(a)
+#define IDirect3DDevice8_DeleteStateBlock(p,a)                     (p)->DeleteStateBlock(a)
+#define IDirect3DDevice8_CreateStateBlock(p,a,b)                   (p)->CreateStateBlock(a,b)
+#define IDirect3DDevice8_SetClipStatus(p,a)                        (p)->SetClipStatus(a)
+#define IDirect3DDevice8_GetClipStatus(p,a)                        (p)->GetClipStatus(a)
+#define IDirect3DDevice8_GetTexture(p,a,b)                         (p)->GetTexture(a,b)
+#define IDirect3DDevice8_SetTexture(p,a,b)                         (p)->SetTexture(a,b)
+#define IDirect3DDevice8_GetTextureStageState(p,a,b,c)             (p)->GetTextureStageState(a,b,c)
+#define IDirect3DDevice8_SetTextureStageState(p,a,b,c)             (p)->SetTextureStageState(a,b,c)
+#define IDirect3DDevice8_ValidateDevice(p,a)                       (p)->ValidateDevice(a)
+#define IDirect3DDevice8_GetInfo(p,a,b,c)                          (p)->GetInfo(a,b,c)
+#define IDirect3DDevice8_SetPaletteEntries(p,a,b)                  (p)->SetPaletteEntries(a,b)
+#define IDirect3DDevice8_GetPaletteEntries(p,a,b)                  (p)->GetPaletteEntries(a,b)
+#define IDirect3DDevice8_SetCurrentTexturePalette(p,a)             (p)->SetCurrentTexturePalette(a)
+#define IDirect3DDevice8_GetCurrentTexturePalette(p,a)             (p)->GetCurrentTexturePalette(a)
+#define IDirect3DDevice8_DrawPrimitive(p,a,b,c)                    (p)->DrawPrimitive(a,b,c)
+#define IDirect3DDevice8_DrawIndexedPrimitive(p,a,b,c,d,e)         (p)->DrawIndexedPrimitive(a,b,c,d,e)
+#define IDirect3DDevice8_DrawPrimitiveUP(p,a,b,c,d)                (p)->DrawPrimitiveUP(a,b,c,d)
+#define IDirect3DDevice8_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h) (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice8_ProcessVertices(p,a,b,c,d,e)              (p)->processVertices(a,b,c,d,e)
+#define IDirect3DDevice8_CreateVertexShader(p,a,b,c,d)             (p)->CreateVertexShader(a,b,c,d)
+#define IDirect3DDevice8_SetVertexShader(p,a)                      (p)->SetVertexShader(a)
+#define IDirect3DDevice8_GetVertexShader(p,a)                      (p)->GetVertexShader(a)
+#define IDirect3DDevice8_DeleteVertexShader(p,a)                   (p)->DeleteVertexShader(a)
+#define IDirect3DDevice8_SetVertexShaderConstant(p,a,b,c)          (p)->SetVertexShaderConstant(a,b,c)
+#define IDirect3DDevice8_GetVertexShaderConstant(p,a,b,c)          (p)->GetVertexShaderConstant(a,b,c)
+#define IDirect3DDevice8_GetVertexShaderDeclaration(p,a,b,c)       (p)->GetVertexShaderDeclaration(a,b,c)
+#define IDirect3DDevice8_GetVertexShaderFunction(p,a,b,c)          (p)->GetVertexShaderFunction(a,b,c)
+#define IDirect3DDevice8_SetStreamSource(p,a,b,c)                  (p)->SetStreamSource(a,b,c)
+#define IDirect3DDevice8_GetStreamSource(p,a,b,c)                  (p)->GetStreamSource(a,b,c)
+#define IDirect3DDevice8_SetIndices(p,a,b)                         (p)->SetIndices(a,b)
+#define IDirect3DDevice8_GetIndices(p,a,b)                         (p)->GetIndices(a,b)
+#define IDirect3DDevice8_CreatePixelShader(p,a,b)                  (p)->CreatePixelShader(a,b)
+#define IDirect3DDevice8_SetPixelShader(p,a)                       (p)->SetPixelShader(a)
+#define IDirect3DDevice8_GetPixelShader(p,a)                       (p)->GetPixelShader(a)
+#define IDirect3DDevice8_DeletePixelShader(p,a)                    (p)->DeletePixelShader(a)
+#define IDirect3DDevice8_SetPixelShaderConstant(p,a,b,c)           (p)->SetPixelShaderConstant(a,b,c)
+#define IDirect3DDevice8_GetPixelShaderConstant(p,a,b,c)           (p)->GetPixelShaderConstant(a,b,c)
+#define IDirect3DDevice8_GetPixelShaderFunction(p,a,b,c)           (p)->GetPixelShaderFunction(a,b,c)
+#define IDirect3DDevice8_DrawRectPatch(p,a,b,c)                    (p)->DrawRectPatch(a,b,c)
+#define IDirect3DDevice8_DrawTriPatch(p,a,b,c)                     (p)->DrawTriPatch(a,b,c)
+#define IDirect3DDevice8_DeletePatch(p,a)                          (p)->DeletePatch(a)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif  /* defined(__cplusplus) */
+
+/* Define the main entrypoint as well */
+IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
+#endif /* __WINE_D3D8_H */
diff --git a/misc/builddeps/dp.win32/include/d3d8caps.h b/misc/builddeps/dp.win32/include/d3d8caps.h
new file mode 100644 (file)
index 0000000..019d346
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * Copyright (C) 2002 Jason Edmeades
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D8CAPS_H
+#define __WINE_D3D8CAPS_H
+
+/*
+ * Definitions
+ */
+
+#define D3DCAPS_READ_SCANLINE 0x20000
+
+#define D3DCURSORCAPS_COLOR   1
+#define D3DCURSORCAPS_LOWRES  2
+
+#define D3DDEVCAPS_EXECUTESYSTEMMEMORY     0x0000010
+#define D3DDEVCAPS_EXECUTEVIDEOMEMORY      0x0000020
+#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY    0x0000040
+#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY     0x0000080
+#define D3DDEVCAPS_TEXTURESYSTEMMEMORY     0x0000100
+#define D3DDEVCAPS_TEXTUREVIDEOMEMORY      0x0000200
+#define D3DDEVCAPS_DRAWPRIMTLVERTEX        0x0000400
+#define D3DDEVCAPS_CANRENDERAFTERFLIP      0x0000800
+#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM   0x0001000
+#define D3DDEVCAPS_DRAWPRIMITIVES2         0x0002000
+#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x0004000
+#define D3DDEVCAPS_DRAWPRIMITIVES2EX       0x0008000
+#define D3DDEVCAPS_HWTRANSFORMANDLIGHT     0x0010000
+#define D3DDEVCAPS_CANBLTSYSTONONLOCAL     0x0020000
+#define D3DDEVCAPS_HWRASTERIZATION         0x0080000
+#define D3DDEVCAPS_PUREDEVICE              0x0100000
+#define D3DDEVCAPS_QUINTICRTPATCHES        0x0200000
+#define D3DDEVCAPS_RTPATCHES               0x0400000
+#define D3DDEVCAPS_RTPATCHHANDLEZERO       0x0800000
+#define D3DDEVCAPS_NPATCHES                0x1000000
+
+#define D3DFVFCAPS_TEXCOORDCOUNTMASK  0x00FFFF
+#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x080000
+#define D3DFVFCAPS_PSIZE              0x100000
+
+#define D3DLINECAPS_TEXTURE           0x01
+#define D3DLINECAPS_ZTEST             0x02
+#define D3DLINECAPS_BLEND             0x04
+#define D3DLINECAPS_ALPHACMP          0x08
+#define D3DLINECAPS_FOG               0x10
+
+#define D3DPBLENDCAPS_ZERO            0x0001
+#define D3DPBLENDCAPS_ONE             0x0002
+#define D3DPBLENDCAPS_SRCCOLOR        0x0004
+#define D3DPBLENDCAPS_INVSRCCOLOR     0x0008
+#define D3DPBLENDCAPS_SRCALPHA        0x0010
+#define D3DPBLENDCAPS_INVSRCALPHA     0x0020
+#define D3DPBLENDCAPS_DESTALPHA       0x0040
+#define D3DPBLENDCAPS_INVDESTALPHA    0x0080
+#define D3DPBLENDCAPS_DESTCOLOR       0x0100
+#define D3DPBLENDCAPS_INVDESTCOLOR    0x0200
+#define D3DPBLENDCAPS_SRCALPHASAT     0x0400
+#define D3DPBLENDCAPS_BOTHSRCALPHA    0x0800
+#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x1000
+
+#define D3DPCMPCAPS_NEVER        0x01
+#define D3DPCMPCAPS_LESS         0x02
+#define D3DPCMPCAPS_EQUAL        0x04
+#define D3DPCMPCAPS_LESSEQUAL    0x08
+#define D3DPCMPCAPS_GREATER      0x10
+#define D3DPCMPCAPS_NOTEQUAL     0x20
+#define D3DPCMPCAPS_GREATEREQUAL 0x40
+#define D3DPCMPCAPS_ALWAYS       0x80
+
+#define D3DPMISCCAPS_MASKZ                 0x0002
+#define D3DPMISCCAPS_LINEPATTERNREP        0x0004
+#define D3DPMISCCAPS_CULLNONE              0x0010
+#define D3DPMISCCAPS_CULLCW                0x0020
+#define D3DPMISCCAPS_CULLCCW               0x0040
+#define D3DPMISCCAPS_COLORWRITEENABLE      0x0080
+#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS 0x0100
+#define D3DPMISCCAPS_CLIPTLVERTS           0x0200
+#define D3DPMISCCAPS_TSSARGTEMP            0x0400
+#define D3DPMISCCAPS_BLENDOP               0x0800
+
+#define D3DPRASTERCAPS_DITHER                     0x00000001
+#define D3DPRASTERCAPS_PAT                        0x00000008
+#define D3DPRASTERCAPS_ZTEST                      0x00000010
+#define D3DPRASTERCAPS_FOGVERTEX                  0x00000080
+#define D3DPRASTERCAPS_FOGTABLE                   0x00000100
+#define D3DPRASTERCAPS_ANTIALIASEDGES             0x00001000
+#define D3DPRASTERCAPS_MIPMAPLODBIAS              0x00002000
+#define D3DPRASTERCAPS_ZBIAS                      0x00004000
+#define D3DPRASTERCAPS_ZBUFFERLESSHSR             0x00008000
+#define D3DPRASTERCAPS_FOGRANGE                   0x00010000
+#define D3DPRASTERCAPS_ANISOTROPY                 0x00020000
+#define D3DPRASTERCAPS_WBUFFER                    0x00040000
+#define D3DPRASTERCAPS_WFOG                       0x00100000
+#define D3DPRASTERCAPS_ZFOG                       0x00200000
+#define D3DPRASTERCAPS_COLORPERSPECTIVE           0x00400000
+#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE      0x00800000
+
+#define D3DPRESENT_INTERVAL_DEFAULT               0x00000000
+#define D3DPRESENT_INTERVAL_ONE                   0x00000001
+#define D3DPRESENT_INTERVAL_TWO                   0x00000002
+#define D3DPRESENT_INTERVAL_THREE                 0x00000004
+#define D3DPRESENT_INTERVAL_FOUR                  0x00000008
+#define D3DPRESENT_INTERVAL_IMMEDIATE             0x80000000
+
+#define D3DPSHADECAPS_COLORGOURAUDRGB             0x00008
+#define D3DPSHADECAPS_SPECULARGOURAUDRGB          0x00200
+#define D3DPSHADECAPS_ALPHAGOURAUDBLEND           0x04000
+#define D3DPSHADECAPS_FOGGOURAUD                  0x80000
+
+#define D3DPTADDRESSCAPS_WRAP                     0x01
+#define D3DPTADDRESSCAPS_MIRROR                   0x02
+#define D3DPTADDRESSCAPS_CLAMP                    0x04
+#define D3DPTADDRESSCAPS_BORDER                   0x08
+#define D3DPTADDRESSCAPS_INDEPENDENTUV            0x10
+#define D3DPTADDRESSCAPS_MIRRORONCE               0x20
+
+#define D3DPTEXTURECAPS_PERSPECTIVE              0x00001
+#define D3DPTEXTURECAPS_POW2                     0x00002
+#define D3DPTEXTURECAPS_ALPHA                    0x00004
+#define D3DPTEXTURECAPS_SQUAREONLY               0x00020
+#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00040
+#define D3DPTEXTURECAPS_ALPHAPALETTE             0x00080
+#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL       0x00100
+#define D3DPTEXTURECAPS_PROJECTED                0x00400
+#define D3DPTEXTURECAPS_CUBEMAP                  0x00800
+#define D3DPTEXTURECAPS_VOLUMEMAP                0x02000
+#define D3DPTEXTURECAPS_MIPMAP                   0x04000
+#define D3DPTEXTURECAPS_MIPVOLUMEMAP             0x08000
+#define D3DPTEXTURECAPS_MIPCUBEMAP               0x10000
+#define D3DPTEXTURECAPS_CUBEMAP_POW2             0x20000
+#define D3DPTEXTURECAPS_VOLUMEMAP_POW2           0x40000
+
+#define D3DPTFILTERCAPS_MINFPOINT                0x00000100
+#define D3DPTFILTERCAPS_MINFLINEAR               0x00000200
+#define D3DPTFILTERCAPS_MINFANISOTROPIC          0x00000400
+#define D3DPTFILTERCAPS_MIPFPOINT                0x00010000
+#define D3DPTFILTERCAPS_MIPFLINEAR               0x00020000
+#define D3DPTFILTERCAPS_MAGFPOINT                0x01000000
+#define D3DPTFILTERCAPS_MAGFLINEAR               0x02000000
+#define D3DPTFILTERCAPS_MAGFANISOTROPIC          0x04000000
+#define D3DPTFILTERCAPS_MAGFAFLATCUBIC           0x08000000
+#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC        0x10000000
+
+#define D3DSTENCILCAPS_KEEP                      0x01
+#define D3DSTENCILCAPS_ZERO                      0x02
+#define D3DSTENCILCAPS_REPLACE                   0x04
+#define D3DSTENCILCAPS_INCRSAT                   0x08
+#define D3DSTENCILCAPS_DECRSAT                   0x10
+#define D3DSTENCILCAPS_INVERT                    0x20
+#define D3DSTENCILCAPS_INCR                      0x40
+#define D3DSTENCILCAPS_DECR                      0x80
+
+#define D3DTEXOPCAPS_DISABLE                     0x0000001
+#define D3DTEXOPCAPS_SELECTARG1                  0x0000002
+#define D3DTEXOPCAPS_SELECTARG2                  0x0000004
+#define D3DTEXOPCAPS_MODULATE                    0x0000008
+#define D3DTEXOPCAPS_MODULATE2X                  0x0000010
+#define D3DTEXOPCAPS_MODULATE4X                  0x0000020
+#define D3DTEXOPCAPS_ADD                         0x0000040
+#define D3DTEXOPCAPS_ADDSIGNED                   0x0000080
+#define D3DTEXOPCAPS_ADDSIGNED2X                 0x0000100
+#define D3DTEXOPCAPS_SUBTRACT                    0x0000200
+#define D3DTEXOPCAPS_ADDSMOOTH                   0x0000400
+#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA           0x0000800
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHA           0x0001000
+#define D3DTEXOPCAPS_BLENDFACTORALPHA            0x0002000
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM         0x0004000
+#define D3DTEXOPCAPS_BLENDCURRENTALPHA           0x0008000
+#define D3DTEXOPCAPS_PREMODULATE                 0x0010000
+#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR      0x0020000
+#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA      0x0040000
+#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR   0x0080000
+#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA   0x0100000
+#define D3DTEXOPCAPS_BUMPENVMAP                  0x0200000
+#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE         0x0400000
+#define D3DTEXOPCAPS_DOTPRODUCT3                 0x0800000
+#define D3DTEXOPCAPS_MULTIPLYADD                 0x1000000
+#define D3DTEXOPCAPS_LERP                        0x2000000
+
+#define D3DVTXPCAPS_TEXGEN                       0x01
+#define D3DVTXPCAPS_MATERIALSOURCE7              0x02
+#define D3DVTXPCAPS_DIRECTIONALLIGHTS            0x08
+#define D3DVTXPCAPS_POSITIONALLIGHTS             0x10
+#define D3DVTXPCAPS_LOCALVIEWER                  0x20
+#define D3DVTXPCAPS_TWEENING                     0x40
+
+#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD  0x00000020
+#define D3DCAPS3_RESERVED                          0x8000001f
+
+#define D3DCAPS2_CANCALIBRATEGAMMA                 0x0100000
+#define D3DCAPS2_CANRENDERWINDOWED                 0x0080000
+#define D3DCAPS2_CANMANAGERESOURCE                 0x10000000
+#define D3DCAPS2_DYNAMICTEXTURES                   0x20000000
+#define D3DCAPS2_FULLSCREENGAMMA                   0x0020000
+#define D3DCAPS2_NO2DDURING3DSCENE                 0x0000002
+#define D3DCAPS2_RESERVED                          0x2000000
+
+/*
+ * The d3dcaps8 structure
+ */
+typedef struct _D3DCAPS8 {
+    D3DDEVTYPE          DeviceType;
+    UINT                AdapterOrdinal;
+
+    DWORD               Caps;
+    DWORD               Caps2;
+    DWORD               Caps3;
+    DWORD               PresentationIntervals;
+
+    DWORD               CursorCaps;
+
+    DWORD               DevCaps;
+
+    DWORD               PrimitiveMiscCaps;
+    DWORD               RasterCaps;
+    DWORD               ZCmpCaps;
+    DWORD               SrcBlendCaps;
+    DWORD               DestBlendCaps;
+    DWORD               AlphaCmpCaps;
+    DWORD               ShadeCaps;
+    DWORD               TextureCaps;
+    DWORD               TextureFilterCaps;
+    DWORD               CubeTextureFilterCaps;
+    DWORD               VolumeTextureFilterCaps;
+    DWORD               TextureAddressCaps;
+    DWORD               VolumeTextureAddressCaps;
+
+    DWORD               LineCaps;
+
+    DWORD               MaxTextureWidth, MaxTextureHeight;
+    DWORD               MaxVolumeExtent;
+
+    DWORD               MaxTextureRepeat;
+    DWORD               MaxTextureAspectRatio;
+    DWORD               MaxAnisotropy;
+    float               MaxVertexW;
+
+    float               GuardBandLeft;
+    float               GuardBandTop;
+    float               GuardBandRight;
+    float               GuardBandBottom;
+
+    float               ExtentsAdjust;
+    DWORD               StencilCaps;
+
+    DWORD               FVFCaps;
+    DWORD               TextureOpCaps;
+    DWORD               MaxTextureBlendStages;
+    DWORD               MaxSimultaneousTextures;
+
+    DWORD               VertexProcessingCaps;
+    DWORD               MaxActiveLights;
+    DWORD               MaxUserClipPlanes;
+    DWORD               MaxVertexBlendMatrices;
+    DWORD               MaxVertexBlendMatrixIndex;
+
+    float               MaxPointSize;
+
+    DWORD               MaxPrimitiveCount;
+    DWORD               MaxVertexIndex;
+    DWORD               MaxStreams;
+    DWORD               MaxStreamStride;
+
+    DWORD               VertexShaderVersion;
+    DWORD               MaxVertexShaderConst;
+
+    DWORD               PixelShaderVersion;
+    float               MaxPixelShaderValue;
+} D3DCAPS8;
+
+#endif  /* __WINE_D3D8CAPS_H */
diff --git a/misc/builddeps/dp.win32/include/d3d8types.h b/misc/builddeps/dp.win32/include/d3d8types.h
new file mode 100644 (file)
index 0000000..7c24b73
--- /dev/null
@@ -0,0 +1,1221 @@
+/*
+ * Copyright (C) 2002 Jason Edmeades
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D8TYPES_H
+#define __WINE_D3D8TYPES_H
+
+#include <_mingw_dxhelper.h>
+
+/*****************************************************************************
+ * Direct 3D v8 #defines
+ */
+
+#ifndef D3DCLEAR_TARGET
+#define D3DCLEAR_TARGET   1
+#endif
+#ifndef D3DCLEAR_ZBUFFER
+#define D3DCLEAR_ZBUFFER  2
+#endif
+#ifndef D3DCLEAR_STENCIL
+#define D3DCLEAR_STENCIL  4
+#endif
+
+#define D3DCLIPPLANE0 (1 << 0)
+#define D3DCLIPPLANE1 (1 << 1)
+#define D3DCLIPPLANE2 (1 << 2)
+#define D3DCLIPPLANE3 (1 << 3)
+#define D3DCLIPPLANE4 (1 << 4)
+#define D3DCLIPPLANE5 (1 << 5)
+
+#define D3DCOLOR_ARGB(a,r,g,b)        ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
+#define D3DCOLOR_COLORVALUE(r,g,b,a)  D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
+#define D3DCOLOR_RGBA(r,g,b,a)        D3DCOLOR_ARGB(a,r,g,b)
+#define D3DCOLOR_XRGB(r,g,b)          D3DCOLOR_ARGB(0xff,r,g,b)
+
+#define D3DCS_LEFT                 0x001
+#define D3DCS_RIGHT                0x002
+#define D3DCS_TOP                  0x004
+#define D3DCS_BOTTOM               0x008
+#define D3DCS_FRONT                0x010
+#define D3DCS_BACK                 0x020
+#define D3DCS_PLANE0               0x040
+#define D3DCS_PLANE1               0x080
+#define D3DCS_PLANE2               0x100
+#define D3DCS_PLANE3               0x200
+#define D3DCS_PLANE4               0x400
+#define D3DCS_PLANE5               0x800
+#define D3DCS_ALL                  0xFFF
+
+#define D3DFVF_TEXTUREFORMAT1 3
+#define D3DFVF_TEXTUREFORMAT2 0
+#define D3DFVF_TEXTUREFORMAT3 1
+#define D3DFVF_TEXTUREFORMAT4 2
+#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
+#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
+#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
+#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
+
+#define D3DLOCK_READONLY           0x0010
+#define D3DLOCK_NOSYSLOCK          0x0800
+#define D3DLOCK_NOOVERWRITE        0x1000
+#define D3DLOCK_DISCARD            0x2000
+#define D3DLOCK_NO_DIRTY_UPDATE    0x8000
+
+#define D3DMAXUSERCLIPPLANES       32
+
+#define D3DRENDERSTATE_WRAPBIAS    0x80
+
+#define D3DTSS_TCI_PASSTHRU                       0x00000
+#define D3DTSS_TCI_CAMERASPACENORMAL              0x10000
+#define D3DTSS_TCI_CAMERASPACEPOSITION            0x20000
+#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR    0x30000
+
+
+#define D3DTS_WORLD  D3DTS_WORLDMATRIX(0)
+#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
+#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
+#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
+#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
+
+#define D3DUSAGE_RENDERTARGET       0x01
+#define D3DUSAGE_DEPTHSTENCIL       0x02
+#define D3DUSAGE_WRITEONLY          0x08
+#define D3DUSAGE_SOFTWAREPROCESSING 0x10
+#define D3DUSAGE_DONOTCLIP          0x20
+#define D3DUSAGE_POINTS             0x40
+#define D3DUSAGE_RTPATCHES          0x80
+#define D3DUSAGE_NPATCHES           0x100
+#define D3DUSAGE_DYNAMIC            0x200
+
+#define D3DWRAP_U        1
+#define D3DWRAP_V        2
+#define D3DWRAP_W        4
+#define D3DWRAPCOORD_0   1
+#define D3DWRAPCOORD_1   2
+#define D3DWRAPCOORD_2   4
+#define D3DWRAPCOORD_3   8
+
+#define MAX_DEVICE_IDENTIFIER_STRING        512
+
+#define D3DFVF_RESERVED0           0x0001
+#define D3DFVF_POSITION_MASK       0x000E
+#define D3DFVF_XYZ                 0x0002
+#define D3DFVF_XYZRHW              0x0004
+#define D3DFVF_XYZB1               0x0006
+#define D3DFVF_XYZB2               0x0008
+#define D3DFVF_XYZB3               0x000a
+#define D3DFVF_XYZB4               0x000c
+#define D3DFVF_XYZB5               0x000e
+#define D3DFVF_NORMAL              0x0010
+#define D3DFVF_PSIZE               0x0020
+#define D3DFVF_DIFFUSE             0x0040
+#define D3DFVF_SPECULAR            0x0080
+#define D3DFVF_TEXCOUNT_MASK       0x0f00
+#define D3DFVF_TEXCOUNT_SHIFT           8
+#define D3DFVF_TEX0                0x0000
+#define D3DFVF_TEX1                0x0100
+#define D3DFVF_TEX2                0x0200
+#define D3DFVF_TEX3                0x0300
+#define D3DFVF_TEX4                0x0400
+#define D3DFVF_TEX5                0x0500
+#define D3DFVF_TEX6                0x0600
+#define D3DFVF_TEX7                0x0700
+#define D3DFVF_TEX8                0x0800
+#define D3DFVF_LASTBETA_UBYTE4     0x1000
+#define D3DFVF_RESERVED2           0xE000
+
+#define D3DTA_SELECTMASK        0x0000000f
+#define D3DTA_DIFFUSE           0x00000000
+#define D3DTA_CURRENT           0x00000001
+#define D3DTA_TEXTURE           0x00000002
+#define D3DTA_TFACTOR           0x00000003
+#define D3DTA_SPECULAR          0x00000004
+#define D3DTA_COMPLEMENT        0x00000010
+#define D3DTA_ALPHAREPLICATE    0x00000020
+#define D3DTA_TEMP              0x00000005
+
+#define D3DCOLORWRITEENABLE_RED   (1L<<0)   
+#define D3DCOLORWRITEENABLE_GREEN (1L<<1)
+#define D3DCOLORWRITEENABLE_BLUE  (1L<<2)
+#define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
+
+
+#ifndef MAKEFOURCC
+#define MAKEFOURCC(ch0, ch1, ch2, ch3)  \
+    ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |  \
+    ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
+#endif /* MAKEFOURCC */
+
+
+/**************************** 
+ * Vertex Shaders Declaration
+ */
+
+typedef enum _D3DVSD_TOKENTYPE {
+  D3DVSD_TOKEN_NOP         = 0,
+  D3DVSD_TOKEN_STREAM      = 1,
+  D3DVSD_TOKEN_STREAMDATA  = 2,
+  D3DVSD_TOKEN_TESSELLATOR = 3,
+  D3DVSD_TOKEN_CONSTMEM    = 4,
+  D3DVSD_TOKEN_EXT         = 5,
+  /* RESERVED              = 6 */
+  D3DVSD_TOKEN_END         = 7,
+  D3DVSD_FORCE_DWORD       = 0x7FFFFFFF
+} D3DVSD_TOKENTYPE;
+
+/** input registers for vertex shaders functions */
+/*
+#define D3DVSDE_POSITION      0
+#define D3DVSDE_BLENDWEIGHT   1
+#define D3DVSDE_BLENDINDICES  2
+#define D3DVSDE_NORMAL        3
+#define D3DVSDE_PSIZE         4
+#define D3DVSDE_DIFFUSE       5
+#define D3DVSDE_SPECULAR      6
+#define D3DVSDE_TEXCOORD0     7
+#define D3DVSDE_TEXCOORD1     8
+#define D3DVSDE_TEXCOORD2     9
+#define D3DVSDE_TEXCOORD3    10
+#define D3DVSDE_TEXCOORD4    11
+#define D3DVSDE_TEXCOORD5    12
+#define D3DVSDE_TEXCOORD6    13
+#define D3DVSDE_TEXCOORD7    14
+#define D3DVSDE_POSITION2    15
+#define D3DVSDE_NORMAL2      16
+*/
+/** Address of the vertex register. 0 - 16 */
+typedef enum _D3DVSDE_REGISTER {
+  D3DVSDE_POSITION     =  0,
+  D3DVSDE_BLENDWEIGHT  =  1,
+  D3DVSDE_BLENDINDICES =  2,
+  D3DVSDE_NORMAL       =  3,
+  D3DVSDE_PSIZE        =  4,
+  D3DVSDE_DIFFUSE      =  5,
+  D3DVSDE_SPECULAR     =  6,
+  D3DVSDE_TEXCOORD0    =  7,
+  D3DVSDE_TEXCOORD1    =  8,
+  D3DVSDE_TEXCOORD2    =  9,
+  D3DVSDE_TEXCOORD3    = 10,
+  D3DVSDE_TEXCOORD4    = 11,
+  D3DVSDE_TEXCOORD5    = 12,
+  D3DVSDE_TEXCOORD6    = 13,
+  D3DVSDE_TEXCOORD7    = 14,
+  D3DVSDE_POSITION2    = 15,
+  D3DVSDE_NORMAL2      = 16
+} D3DVSDE_REGISTER;
+
+/** bit-field declaration for VertexRegister Type */
+/*
+#define D3DVSDT_FLOAT1      0x00
+#define D3DVSDT_FLOAT2      0x01
+#define D3DVSDT_FLOAT3      0x02
+#define D3DVSDT_FLOAT4      0x03
+#define D3DVSDT_D3DCOLOR    0x04
+#define D3DVSDT_UBYTE4      0x05
+#define D3DVSDT_SHORT2      0x06
+#define D3DVSDT_SHORT4      0x07
+*/
+typedef enum _D3DVSDT_TYPE {
+  D3DVSDT_FLOAT1   = 0x00,
+  D3DVSDT_FLOAT2   = 0x01,
+  D3DVSDT_FLOAT3   = 0x02,
+  D3DVSDT_FLOAT4   = 0x03,
+  D3DVSDT_D3DCOLOR = 0x04,
+  D3DVSDT_UBYTE4   = 0x05,
+  D3DVSDT_SHORT2   = 0x06,
+  D3DVSDT_SHORT4   = 0x07
+} D3DVSDT_TYPE;
+
+
+#define D3DVSD_CONSTADDRESSSHIFT  0
+#define D3DVSD_EXTINFOSHIFT       0
+#define D3DVSD_STREAMNUMBERSHIFT  0
+#define D3DVSD_VERTEXREGSHIFT     0
+#define D3DVSD_CONSTRSSHIFT      16
+#define D3DVSD_DATATYPESHIFT     16
+#define D3DVSD_SKIPCOUNTSHIFT    16
+#define D3DVSD_VERTEXREGINSHIFT  20
+#define D3DVSD_EXTCOUNTSHIFT     24
+#define D3DVSD_CONSTCOUNTSHIFT   25
+#define D3DVSD_DATALOADTYPESHIFT 28
+#define D3DVSD_STREAMTESSSHIFT   28
+#define D3DVSD_TOKENTYPESHIFT    29
+
+#define D3DVSD_CONSTADDRESSMASK  (0x7F     << D3DVSD_CONSTADDRESSSHIFT)
+#define D3DVSD_EXTINFOMASK       (0xFFFFFF << D3DVSD_EXTINFOSHIFT)
+#define D3DVSD_STREAMNUMBERMASK  (0xF      << D3DVSD_STREAMNUMBERSHIFT)
+#define D3DVSD_VERTEXREGMASK     (0x1F     << D3DVSD_VERTEXREGSHIFT)
+#define D3DVSD_CONSTRSMASK       (0x1FFF   << D3DVSD_CONSTRSSHIFT)
+#define D3DVSD_DATATYPEMASK      (0xF      << D3DVSD_DATATYPESHIFT)
+#define D3DVSD_SKIPCOUNTMASK     (0xF      << D3DVSD_SKIPCOUNTSHIFT)
+#define D3DVSD_EXTCOUNTMASK      (0x1F     << D3DVSD_EXTCOUNTSHIFT)
+#define D3DVSD_VERTEXREGINMASK   (0xF      << D3DVSD_VERTEXREGINSHIFT)
+#define D3DVSD_CONSTCOUNTMASK    (0xF      << D3DVSD_CONSTCOUNTSHIFT)
+#define D3DVSD_DATALOADTYPEMASK  (0x1      << D3DVSD_DATALOADTYPESHIFT)
+#define D3DVSD_STREAMTESSMASK    (0x1      << D3DVSD_STREAMTESSSHIFT)
+#define D3DVSD_TOKENTYPEMASK     (0x7      << D3DVSD_TOKENTYPESHIFT)
+
+
+#define D3DVSD_MAKETOKENTYPE(TokenType) \
+  ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
+
+#define D3DVSD_CONST(ConstantAddress, Count) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
+
+#define D3DVSD_END() 0xFFFFFFFF
+
+#define D3DVSD_NOP() 0x00000000
+
+#define D3DVSD_REG(VertexRegister, Type) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
+
+#define D3DVSD_SKIP(Count) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
+
+#define D3DVSD_STREAM(StreamNumber) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
+
+#define D3DVSD_STREAM_TESS() \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
+
+#define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
+
+#define D3DVSD_TESSUV(Register) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
+
+
+/********************************
+ * Pixel/Vertex Shaders Functions
+ */
+
+/** Maximum number of supported texture coordinates sets operation */
+#define D3DDP_MAXTEXCOORD   8
+
+/** opcode token mask */
+#define D3DSI_OPCODE_MASK 0x0000FFFF
+
+/** opcodes types for PS and VS */
+typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE {
+  D3DSIO_NOP          =  0,
+  D3DSIO_MOV          =  1,
+  D3DSIO_ADD          =  2,
+  D3DSIO_SUB          =  3,
+  D3DSIO_MAD          =  4,
+  D3DSIO_MUL          =  5,
+  D3DSIO_RCP          =  6,
+  D3DSIO_RSQ          =  7,
+  D3DSIO_DP3          =  8,
+  D3DSIO_DP4          =  9,
+  D3DSIO_MIN          = 10,
+  D3DSIO_MAX          = 11,
+  D3DSIO_SLT          = 12,
+  D3DSIO_SGE          = 13,
+  D3DSIO_EXP          = 14,
+  D3DSIO_LOG          = 15,
+  D3DSIO_LIT          = 16,
+  D3DSIO_DST          = 17,
+  D3DSIO_LRP          = 18,
+  D3DSIO_FRC          = 19,
+  D3DSIO_M4x4         = 20,
+  D3DSIO_M4x3         = 21,
+  D3DSIO_M3x4         = 22,
+  D3DSIO_M3x3         = 23,
+  D3DSIO_M3x2         = 24,
+
+  D3DSIO_TEXCOORD     = 64,
+  D3DSIO_TEXKILL      = 65,
+  D3DSIO_TEX          = 66,
+  D3DSIO_TEXBEM       = 67,
+  D3DSIO_TEXBEML      = 68,
+  D3DSIO_TEXREG2AR    = 69,
+  D3DSIO_TEXREG2GB    = 70,
+  D3DSIO_TEXM3x2PAD   = 71,
+  D3DSIO_TEXM3x2TEX   = 72,
+  D3DSIO_TEXM3x3PAD   = 73,
+  D3DSIO_TEXM3x3TEX   = 74,
+  D3DSIO_TEXM3x3DIFF  = 75,
+  D3DSIO_TEXM3x3SPEC  = 76,
+  D3DSIO_TEXM3x3VSPEC = 77,
+  D3DSIO_EXPP         = 78,
+  D3DSIO_LOGP         = 79,
+  D3DSIO_CND          = 80,
+  D3DSIO_DEF          = 81,
+  D3DSIO_TEXREG2RGB   = 82,
+  D3DSIO_TEXDP3TEX    = 83,
+  D3DSIO_TEXM3x2DEPTH = 84,
+  D3DSIO_TEXDP3       = 85,
+  D3DSIO_TEXM3x3      = 86,
+  D3DSIO_TEXDEPTH     = 87,
+  D3DSIO_CMP          = 88,
+  D3DSIO_BEM          = 89,
+
+  D3DSIO_PHASE        = 0xFFFD,
+  D3DSIO_COMMENT      = 0xFFFE,
+  D3DSIO_END          = 0XFFFF,
+
+  D3DSIO_FORCE_DWORD  = 0X7FFFFFFF /** for 32-bit alignment */
+} D3DSHADER_INSTRUCTION_OPCODE_TYPE;
+
+/** for parallelism */
+#define D3DSI_COISSUE 0x40000000
+
+/** destination parameter modifiers (.xyzw) */
+#define D3DSP_WRITEMASK_0       0x00010000 /* .x r */
+#define D3DSP_WRITEMASK_1       0x00020000 /* .y g */
+#define D3DSP_WRITEMASK_2       0x00040000 /* .z b */
+#define D3DSP_WRITEMASK_3       0x00080000 /* .w a */
+#define D3DSP_WRITEMASK_ALL     0x000F0000 /* all */
+
+#define D3DSP_DSTMOD_SHIFT      20
+#define D3DSP_DSTMOD_MASK       (0xF << D3DSP_DSTMOD_SHIFT)
+
+typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE {
+  D3DSPDM_NONE         = 0 << D3DSP_DSTMOD_SHIFT,
+  D3DSPDM_SATURATE     = 1 << D3DSP_DSTMOD_SHIFT,
+  D3DSPDM_FORCE_DWORD  = 0X7FFFFFFF
+} D3DSHADER_PARAM_DSTMOD_TYPE;
+
+/** destination param */
+#define D3DSP_DSTSHIFT_SHIFT     24
+#define D3DSP_DSTSHIFT_MASK      (0xF << D3DSP_DSTSHIFT_SHIFT)
+
+/** destination/source reg type */
+#define D3DSP_REGTYPE_SHIFT      28
+#define D3DSP_REGTYPE_MASK       (0x7 << D3DSP_REGTYPE_SHIFT)
+
+typedef enum _D3DSHADER_PARAM_REGISTER_TYPE {
+  D3DSPR_TEMP         = 0 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_INPUT        = 1 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_CONST        = 2 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_ADDR         = 3 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_TEXTURE      = 3 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_RASTOUT      = 4 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_ATTROUT      = 5 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_TEXCRDOUT    = 6 << D3DSP_REGTYPE_SHIFT,
+  D3DSPR_FORCE_DWORD  = 0x7FFFFFFF
+} D3DSHADER_PARAM_REGISTER_TYPE;
+
+typedef enum _D3DVS_RASTOUT_OFFSETS {
+  D3DSRO_POSITION     = 0,
+  D3DSRO_FOG          = 1,
+  D3DSRO_POINT_SIZE   = 2,
+  D3DSRO_FORCE_DWORD  = 0x7FFFFFFF
+} D3DVS_RASTOUT_OFFSETS;
+
+#define D3DVS_ADDRESSMODE_SHIFT  13
+#define D3DVS_ADDRESSMODE_MASK   (0x1 << D3DVS_ADDRESSMODE_SHIFT)
+
+typedef enum _D3DVS_ADDRESSMODE_TYPE {
+  D3DVS_ADDRMODE_ABSOLUTE     = 0 << D3DVS_ADDRESSMODE_SHIFT,
+  D3DVS_ADDRMODE_RELATIVE     = 1 << D3DVS_ADDRESSMODE_SHIFT,
+  D3DVS_ADDRMODE_FORCE_DWORD  = 0x7FFFFFFF
+} D3DVS_ADDRESSMODE_TYPE;
+
+#define D3DVS_SWIZZLE_SHIFT      16
+#define D3DVS_SWIZZLE_MASK       (0xFF << D3DVS_SWIZZLE_SHIFT)
+
+#define D3DSP_SWIZZLE_SHIFT      16
+#define D3DSP_SWIZZLE_MASK       (0xFF << D3DSP_SWIZZLE_SHIFT)
+
+#define D3DVS_X_X       (0 << D3DVS_SWIZZLE_SHIFT)
+#define D3DVS_X_Y       (1 << D3DVS_SWIZZLE_SHIFT)
+#define D3DVS_X_Z       (2 << D3DVS_SWIZZLE_SHIFT)
+#define D3DVS_X_W       (3 << D3DVS_SWIZZLE_SHIFT)
+
+#define D3DVS_Y_X       (0 << (D3DVS_SWIZZLE_SHIFT + 2))
+#define D3DVS_Y_Y       (1 << (D3DVS_SWIZZLE_SHIFT + 2))
+#define D3DVS_Y_Z       (2 << (D3DVS_SWIZZLE_SHIFT + 2))
+#define D3DVS_Y_W       (3 << (D3DVS_SWIZZLE_SHIFT + 2))
+
+#define D3DVS_Z_X       (0 << (D3DVS_SWIZZLE_SHIFT + 4))
+#define D3DVS_Z_Y       (1 << (D3DVS_SWIZZLE_SHIFT + 4))
+#define D3DVS_Z_Z       (2 << (D3DVS_SWIZZLE_SHIFT + 4))
+#define D3DVS_Z_W       (3 << (D3DVS_SWIZZLE_SHIFT + 4))
+
+#define D3DVS_W_X       (0 << (D3DVS_SWIZZLE_SHIFT + 6))
+#define D3DVS_W_Y       (1 << (D3DVS_SWIZZLE_SHIFT + 6))
+#define D3DVS_W_Z       (2 << (D3DVS_SWIZZLE_SHIFT + 6))
+#define D3DVS_W_W       (3 << (D3DVS_SWIZZLE_SHIFT + 6))
+
+#define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
+
+#define D3DSP_NOSWIZZLE \
+    ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
+
+#define D3DSP_SRCMOD_SHIFT      24
+#define D3DSP_SRCMOD_MASK       (0xF << D3DSP_SRCMOD_SHIFT)
+
+typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE {
+  D3DSPSM_NONE         =  0 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_NEG          =  1 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_BIAS         =  2 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_BIASNEG      =  3 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_SIGN         =  4 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_SIGNNEG      =  5 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_COMP         =  6 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_X2           =  7 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_X2NEG        =  8 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_DZ           =  9 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_DW           = 10 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_FORCE_DWORD  = 0x7FFFFFFF
+} D3DSHADER_PARAM_SRCMOD_TYPE;
+
+#define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
+#define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
+#define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
+#define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
+
+#define D3DSI_COMMENTSIZE_SHIFT 16
+#define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
+
+#define D3DSHADER_COMMENT(commentSize) \
+  ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
+
+#define D3DPS_END() 0x0000FFFF
+#define D3DVS_END() 0x0000FFFF
+
+
+/*****************************************************************************
+ * Direct 3D v8 enumerated types
+ */
+typedef enum _D3DBACKBUFFER_TYPE {
+    D3DBACKBUFFER_TYPE_MONO         = 0,
+    D3DBACKBUFFER_TYPE_LEFT         = 1,
+    D3DBACKBUFFER_TYPE_RIGHT        = 2,
+
+    D3DBACKBUFFER_TYPE_FORCE_DWORD  = 0x7fffffff
+} D3DBACKBUFFER_TYPE;
+
+typedef enum _D3DBASISTYPE{
+   D3DBASIS_BEZIER        = 0,
+   D3DBASIS_BSPLINE       = 1,
+   D3DBASIS_INTERPOLATE   = 2,
+
+   D3DBASIS_FORCE_DWORD   = 0x7fffffff
+} D3DBASISTYPE;
+
+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,
+
+    D3DBLEND_FORCE_DWORD        = 0x7fffffff
+} D3DBLEND;
+
+typedef enum _D3DBLENDOP {
+    D3DBLENDOP_ADD              = 1,
+    D3DBLENDOP_SUBTRACT         = 2,
+    D3DBLENDOP_REVSUBTRACT      = 3,
+    D3DBLENDOP_MIN              = 4,
+    D3DBLENDOP_MAX              = 5,
+
+    D3DBLENDOP_FORCE_DWORD      = 0x7fffffff
+} D3DBLENDOP;
+
+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,
+
+    D3DCMP_FORCE_DWORD          = 0x7fffffff
+} D3DCMPFUNC;
+
+typedef enum _D3DCUBEMAP_FACES {
+    D3DCUBEMAP_FACE_POSITIVE_X     = 0,
+    D3DCUBEMAP_FACE_NEGATIVE_X     = 1,
+    D3DCUBEMAP_FACE_POSITIVE_Y     = 2,
+    D3DCUBEMAP_FACE_NEGATIVE_Y     = 3,
+    D3DCUBEMAP_FACE_POSITIVE_Z     = 4,
+    D3DCUBEMAP_FACE_NEGATIVE_Z     = 5,
+
+    D3DCUBEMAP_FACE_FORCE_DWORD    = 0xffffffff
+} D3DCUBEMAP_FACES;
+
+typedef enum _D3DCULL {
+    D3DCULL_NONE                = 1,
+    D3DCULL_CW                  = 2,
+    D3DCULL_CCW                 = 3,
+
+    D3DCULL_FORCE_DWORD         = 0x7fffffff
+} D3DCULL;
+
+typedef enum _D3DDEBUGMONITORTOKENS {
+    D3DDMT_ENABLE          = 0,
+    D3DDMT_DISABLE         = 1,
+
+    D3DDMT_FORCE_DWORD     = 0x7fffffff
+} D3DDEBUGMONITORTOKENS;
+
+typedef enum _D3DDEVTYPE {
+    D3DDEVTYPE_HAL         = 1,
+    D3DDEVTYPE_REF         = 2,
+    D3DDEVTYPE_SW          = 3,
+
+    D3DDEVTYPE_FORCE_DWORD = 0xffffffff
+} D3DDEVTYPE;
+
+typedef enum _D3DFILLMODE {
+    D3DFILL_POINT               = 1,
+    D3DFILL_WIREFRAME           = 2,
+    D3DFILL_SOLID               = 3,
+
+    D3DFILL_FORCE_DWORD         = 0x7fffffff
+} D3DFILLMODE;
+
+typedef enum _D3DFOGMODE {
+    D3DFOG_NONE                 = 0,
+    D3DFOG_EXP                  = 1,
+    D3DFOG_EXP2                 = 2,
+    D3DFOG_LINEAR               = 3,
+
+    D3DFOG_FORCE_DWORD          = 0x7fffffff
+} D3DFOGMODE;
+
+typedef enum _D3DFORMAT {
+    D3DFMT_UNKNOWN              =   0,
+
+    D3DFMT_R8G8B8               =  20,
+    D3DFMT_A8R8G8B8             =  21,
+    D3DFMT_X8R8G8B8             =  22,
+    D3DFMT_R5G6B5               =  23,
+    D3DFMT_X1R5G5B5             =  24,
+    D3DFMT_A1R5G5B5             =  25,
+    D3DFMT_A4R4G4B4             =  26,
+    D3DFMT_R3G3B2               =  27,
+    D3DFMT_A8                   =  28,
+    D3DFMT_A8R3G3B2             =  29,
+    D3DFMT_X4R4G4B4             =  30,
+    D3DFMT_A2B10G10R10          =  31,
+    D3DFMT_G16R16               =  34,
+
+    D3DFMT_A8P8                 =  40,
+    D3DFMT_P8                   =  41,
+
+    D3DFMT_L8                   =  50,
+    D3DFMT_A8L8                 =  51,
+    D3DFMT_A4L4                 =  52,
+
+    D3DFMT_V8U8                 =  60,
+    D3DFMT_L6V5U5               =  61,
+    D3DFMT_X8L8V8U8             =  62,
+    D3DFMT_Q8W8V8U8             =  63,
+    D3DFMT_V16U16               =  64,
+    D3DFMT_W11V11U10            =  65,
+    D3DFMT_A2W10V10U10          =  67,
+
+    D3DFMT_UYVY                 =  MAKEFOURCC('U', 'Y', 'V', 'Y'),
+    D3DFMT_YUY2                 =  MAKEFOURCC('Y', 'U', 'Y', '2'),
+    D3DFMT_DXT1                 =  MAKEFOURCC('D', 'X', 'T', '1'),
+    D3DFMT_DXT2                 =  MAKEFOURCC('D', 'X', 'T', '2'),
+    D3DFMT_DXT3                 =  MAKEFOURCC('D', 'X', 'T', '3'),
+    D3DFMT_DXT4                 =  MAKEFOURCC('D', 'X', 'T', '4'),
+    D3DFMT_DXT5                 =  MAKEFOURCC('D', 'X', 'T', '5'),
+
+    D3DFMT_D16_LOCKABLE         =  70,
+    D3DFMT_D32                  =  71,
+    D3DFMT_D15S1                =  73,
+    D3DFMT_D24S8                =  75,
+    D3DFMT_D16                  =  80,
+    D3DFMT_D24X8                =  77,
+    D3DFMT_D24X4S4              =  79,
+
+    D3DFMT_VERTEXDATA           = 100,
+    D3DFMT_INDEX16              = 101,
+    D3DFMT_INDEX32              = 102,
+
+    D3DFMT_FORCE_DWORD          = 0xFFFFFFFF
+} D3DFORMAT;
+
+typedef enum _D3DLIGHTTYPE {
+    D3DLIGHT_POINT          = 1,
+    D3DLIGHT_SPOT           = 2,
+    D3DLIGHT_DIRECTIONAL    = 3,
+
+    D3DLIGHT_FORCE_DWORD    = 0x7fffffff
+} D3DLIGHTTYPE;
+
+typedef enum _D3DMATERIALCOLORSOURCE {
+    D3DMCS_MATERIAL         = 0,
+    D3DMCS_COLOR1           = 1,
+    D3DMCS_COLOR2           = 2,
+
+    D3DMCS_FORCE_DWORD      = 0x7fffffff
+} D3DMATERIALCOLORSOURCE;
+
+typedef enum _D3DMULTISAMPLE_TYPE {
+    D3DMULTISAMPLE_NONE            =  0,
+    D3DMULTISAMPLE_2_SAMPLES       =  2,
+    D3DMULTISAMPLE_3_SAMPLES       =  3,
+    D3DMULTISAMPLE_4_SAMPLES       =  4,
+    D3DMULTISAMPLE_5_SAMPLES       =  5,
+    D3DMULTISAMPLE_6_SAMPLES       =  6,
+    D3DMULTISAMPLE_7_SAMPLES       =  7,
+    D3DMULTISAMPLE_8_SAMPLES       =  8,
+    D3DMULTISAMPLE_9_SAMPLES       =  9,
+    D3DMULTISAMPLE_10_SAMPLES      = 10,
+    D3DMULTISAMPLE_11_SAMPLES      = 11,
+    D3DMULTISAMPLE_12_SAMPLES      = 12,
+    D3DMULTISAMPLE_13_SAMPLES      = 13,
+    D3DMULTISAMPLE_14_SAMPLES      = 14,
+    D3DMULTISAMPLE_15_SAMPLES      = 15,
+    D3DMULTISAMPLE_16_SAMPLES      = 16,
+
+    D3DMULTISAMPLE_FORCE_DWORD     = 0x7fffffff
+} D3DMULTISAMPLE_TYPE;
+
+typedef enum _D3DORDERTYPE {
+   D3DORDER_LINEAR      = 1,
+   D3DORDER_QUADRATIC   = 2,
+   D3DORDER_CUBIC       = 3,
+   D3DORDER_QUINTIC     = 5,
+
+   D3DORDER_FORCE_DWORD = 0x7fffffff
+} D3DORDERTYPE;
+
+typedef enum _D3DPATCHEDGESTYLE {
+   D3DPATCHEDGE_DISCRETE    = 0,
+   D3DPATCHEDGE_CONTINUOUS  = 1,
+
+   D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
+} D3DPATCHEDGESTYLE;
+
+typedef enum _D3DPOOL {
+    D3DPOOL_DEFAULT                 = 0,
+    D3DPOOL_MANAGED                 = 1,
+    D3DPOOL_SYSTEMMEM               = 2,
+    D3DPOOL_SCRATCH                 = 3,
+
+    D3DPOOL_FORCE_DWORD             = 0x7fffffff
+} D3DPOOL;
+
+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
+} D3DPRIMITIVETYPE;
+
+typedef enum _D3DRENDERSTATETYPE {
+    D3DRS_ZENABLE                   =   7,
+    D3DRS_FILLMODE                  =   8,
+    D3DRS_SHADEMODE                 =   9,
+    D3DRS_LINEPATTERN               =  10,
+    D3DRS_ZWRITEENABLE              =  14,
+    D3DRS_ALPHATESTENABLE           =  15,
+    D3DRS_LASTPIXEL                 =  16,
+    D3DRS_SRCBLEND                  =  19,
+    D3DRS_DESTBLEND                 =  20,
+    D3DRS_CULLMODE                  =  22,
+    D3DRS_ZFUNC                     =  23,
+    D3DRS_ALPHAREF                  =  24,
+    D3DRS_ALPHAFUNC                 =  25,
+    D3DRS_DITHERENABLE              =  26,
+    D3DRS_ALPHABLENDENABLE          =  27,
+    D3DRS_FOGENABLE                 =  28,
+    D3DRS_SPECULARENABLE            =  29,
+    D3DRS_ZVISIBLE                  =  30,
+    D3DRS_FOGCOLOR                  =  34,
+    D3DRS_FOGTABLEMODE              =  35,
+    D3DRS_FOGSTART                  =  36,
+    D3DRS_FOGEND                    =  37,
+    D3DRS_FOGDENSITY                =  38,
+    D3DRS_EDGEANTIALIAS             =  40,
+    D3DRS_ZBIAS                     =  47,
+    D3DRS_RANGEFOGENABLE            =  48,
+    D3DRS_STENCILENABLE             =  52,
+    D3DRS_STENCILFAIL               =  53,
+    D3DRS_STENCILZFAIL              =  54,
+    D3DRS_STENCILPASS               =  55,
+    D3DRS_STENCILFUNC               =  56,
+    D3DRS_STENCILREF                =  57,
+    D3DRS_STENCILMASK               =  58,
+    D3DRS_STENCILWRITEMASK          =  59,
+    D3DRS_TEXTUREFACTOR             =  60,
+    D3DRS_WRAP0                     = 128,
+    D3DRS_WRAP1                     = 129,
+    D3DRS_WRAP2                     = 130,
+    D3DRS_WRAP3                     = 131,
+    D3DRS_WRAP4                     = 132,
+    D3DRS_WRAP5                     = 133,
+    D3DRS_WRAP6                     = 134,
+    D3DRS_WRAP7                     = 135,
+    D3DRS_CLIPPING                  = 136,
+    D3DRS_LIGHTING                  = 137,
+    D3DRS_AMBIENT                   = 139,
+    D3DRS_FOGVERTEXMODE             = 140,
+    D3DRS_COLORVERTEX               = 141,
+    D3DRS_LOCALVIEWER               = 142,
+    D3DRS_NORMALIZENORMALS          = 143,
+    D3DRS_DIFFUSEMATERIALSOURCE     = 145,
+    D3DRS_SPECULARMATERIALSOURCE    = 146,
+    D3DRS_AMBIENTMATERIALSOURCE     = 147,
+    D3DRS_EMISSIVEMATERIALSOURCE    = 148,
+    D3DRS_VERTEXBLEND               = 151,
+    D3DRS_CLIPPLANEENABLE           = 152,
+    D3DRS_SOFTWAREVERTEXPROCESSING  = 153,
+    D3DRS_POINTSIZE                 = 154,
+    D3DRS_POINTSIZE_MIN             = 155,
+    D3DRS_POINTSPRITEENABLE         = 156,
+    D3DRS_POINTSCALEENABLE          = 157,
+    D3DRS_POINTSCALE_A              = 158,
+    D3DRS_POINTSCALE_B              = 159,
+    D3DRS_POINTSCALE_C              = 160,
+    D3DRS_MULTISAMPLEANTIALIAS      = 161,
+    D3DRS_MULTISAMPLEMASK           = 162,
+    D3DRS_PATCHEDGESTYLE            = 163,
+    D3DRS_PATCHSEGMENTS             = 164,
+    D3DRS_DEBUGMONITORTOKEN         = 165,
+    D3DRS_POINTSIZE_MAX             = 166,
+    D3DRS_INDEXEDVERTEXBLENDENABLE  = 167,
+    D3DRS_COLORWRITEENABLE          = 168,
+    D3DRS_TWEENFACTOR               = 170,
+    D3DRS_BLENDOP                   = 171,
+    D3DRS_POSITIONORDER             = 172,
+    D3DRS_NORMALORDER               = 173,
+
+    D3DRS_FORCE_DWORD               = 0x7fffffff
+} D3DRENDERSTATETYPE;
+
+typedef enum _D3DRESOURCETYPE {
+    D3DRTYPE_SURFACE                =  1,
+    D3DRTYPE_VOLUME                 =  2,
+    D3DRTYPE_TEXTURE                =  3,
+    D3DRTYPE_VOLUMETEXTURE          =  4,
+    D3DRTYPE_CUBETEXTURE            =  5,
+    D3DRTYPE_VERTEXBUFFER           =  6,
+    D3DRTYPE_INDEXBUFFER            =  7,
+
+    D3DRTYPE_FORCE_DWORD            = 0x7fffffff
+} D3DRESOURCETYPE;
+
+typedef enum _D3DSHADEMODE {
+    D3DSHADE_FLAT               = 1,
+    D3DSHADE_GOURAUD            = 2,
+    D3DSHADE_PHONG              = 3,
+
+    D3DSHADE_FORCE_DWORD        = 0x7fffffff
+} D3DSHADEMODE;
+
+typedef enum _D3DSTATEBLOCKTYPE {
+    D3DSBT_ALL           = 1,
+    D3DSBT_PIXELSTATE    = 2,
+    D3DSBT_VERTEXSTATE   = 3,
+
+    D3DSBT_FORCE_DWORD   = 0xffffffff
+} D3DSTATEBLOCKTYPE;
+
+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
+} D3DSTENCILOP;
+
+typedef enum _D3DSWAPEFFECT {
+    D3DSWAPEFFECT_DISCARD         = 1,
+    D3DSWAPEFFECT_FLIP            = 2,
+    D3DSWAPEFFECT_COPY            = 3,
+    D3DSWAPEFFECT_COPY_VSYNC      = 4,
+
+    D3DSWAPEFFECT_FORCE_DWORD     = 0xFFFFFFFF
+} D3DSWAPEFFECT;
+
+typedef enum _D3DTEXTUREADDRESS {
+    D3DTADDRESS_WRAP            = 1,
+    D3DTADDRESS_MIRROR          = 2,
+    D3DTADDRESS_CLAMP           = 3,
+    D3DTADDRESS_BORDER          = 4,
+    D3DTADDRESS_MIRRORONCE      = 5,
+
+    D3DTADDRESS_FORCE_DWORD     = 0x7fffffff
+} D3DTEXTUREADDRESS;
+
+typedef enum _D3DTEXTUREFILTERTYPE {
+    D3DTEXF_NONE            = 0,
+    D3DTEXF_POINT           = 1,
+    D3DTEXF_LINEAR          = 2,
+    D3DTEXF_ANISOTROPIC     = 3,
+    D3DTEXF_FLATCUBIC       = 4,
+    D3DTEXF_GAUSSIANCUBIC   = 5,
+
+    D3DTEXF_FORCE_DWORD     = 0x7fffffff
+} D3DTEXTUREFILTERTYPE;
+
+typedef enum _D3DTEXTUREOP {
+    D3DTOP_DISABLE                   =  1,
+    D3DTOP_SELECTARG1                =  2,
+    D3DTOP_SELECTARG2                =  3,
+    D3DTOP_MODULATE                  =  4,
+    D3DTOP_MODULATE2X                =  5,
+    D3DTOP_MODULATE4X                =  6,
+    D3DTOP_ADD                       =  7,
+    D3DTOP_ADDSIGNED                 =  8,
+    D3DTOP_ADDSIGNED2X               =  9,
+    D3DTOP_SUBTRACT                  = 10,
+    D3DTOP_ADDSMOOTH                 = 11,
+    D3DTOP_BLENDDIFFUSEALPHA         = 12,
+    D3DTOP_BLENDTEXTUREALPHA         = 13,
+    D3DTOP_BLENDFACTORALPHA          = 14,
+    D3DTOP_BLENDTEXTUREALPHAPM       = 15,
+    D3DTOP_BLENDCURRENTALPHA         = 16,
+    D3DTOP_PREMODULATE               = 17,
+    D3DTOP_MODULATEALPHA_ADDCOLOR    = 18,
+    D3DTOP_MODULATECOLOR_ADDALPHA    = 19,
+    D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
+    D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
+    D3DTOP_BUMPENVMAP                = 22,
+    D3DTOP_BUMPENVMAPLUMINANCE       = 23,
+    D3DTOP_DOTPRODUCT3               = 24,
+    D3DTOP_MULTIPLYADD               = 25,
+    D3DTOP_LERP                      = 26,
+
+    D3DTOP_FORCE_DWORD               = 0x7fffffff,
+} D3DTEXTUREOP;
+
+typedef enum _D3DTEXTURESTAGESTATETYPE {
+    D3DTSS_COLOROP               =  1,
+    D3DTSS_COLORARG1             =  2,
+    D3DTSS_COLORARG2             =  3,
+    D3DTSS_ALPHAOP               =  4,
+    D3DTSS_ALPHAARG1             =  5,
+    D3DTSS_ALPHAARG2             =  6,
+    D3DTSS_BUMPENVMAT00          =  7,
+    D3DTSS_BUMPENVMAT01          =  8,
+    D3DTSS_BUMPENVMAT10          =  9,
+    D3DTSS_BUMPENVMAT11          = 10,
+    D3DTSS_TEXCOORDINDEX         = 11,
+    D3DTSS_ADDRESSU              = 13,
+    D3DTSS_ADDRESSV              = 14,
+    D3DTSS_BORDERCOLOR           = 15,
+    D3DTSS_MAGFILTER             = 16,
+    D3DTSS_MINFILTER             = 17,
+    D3DTSS_MIPFILTER             = 18,
+    D3DTSS_MIPMAPLODBIAS         = 19,
+    D3DTSS_MAXMIPLEVEL           = 20,
+    D3DTSS_MAXANISOTROPY         = 21,
+    D3DTSS_BUMPENVLSCALE         = 22,
+    D3DTSS_BUMPENVLOFFSET        = 23,
+    D3DTSS_TEXTURETRANSFORMFLAGS = 24,
+    D3DTSS_ADDRESSW              = 25,
+    D3DTSS_COLORARG0             = 26,
+    D3DTSS_ALPHAARG0             = 27,
+    D3DTSS_RESULTARG             = 28,
+
+    D3DTSS_FORCE_DWORD           = 0x7fffffff
+} D3DTEXTURESTAGESTATETYPE;
+
+typedef enum _D3DTEXTURETRANSFORMFLAGS {
+    D3DTTFF_DISABLE         =   0,
+    D3DTTFF_COUNT1          =   1,
+    D3DTTFF_COUNT2          =   2,
+    D3DTTFF_COUNT3          =   3,
+    D3DTTFF_COUNT4          =   4,
+    D3DTTFF_PROJECTED       = 256,
+
+    D3DTTFF_FORCE_DWORD     = 0x7fffffff
+} D3DTEXTURETRANSFORMFLAGS;
+
+typedef enum _D3DTRANSFORMSTATETYPE {
+    D3DTS_VIEW            =  2,
+    D3DTS_PROJECTION      =  3,
+    D3DTS_TEXTURE0        = 16,
+    D3DTS_TEXTURE1        = 17,
+    D3DTS_TEXTURE2        = 18,
+    D3DTS_TEXTURE3        = 19,
+    D3DTS_TEXTURE4        = 20,
+    D3DTS_TEXTURE5        = 21,
+    D3DTS_TEXTURE6        = 22,
+    D3DTS_TEXTURE7        = 23,
+
+    D3DTS_FORCE_DWORD     = 0x7fffffff
+} D3DTRANSFORMSTATETYPE;
+
+typedef enum _D3DVERTEXBLENDFLAGS {
+    D3DVBF_DISABLE  =   0,
+    D3DVBF_1WEIGHTS =   1,
+    D3DVBF_2WEIGHTS =   2,
+    D3DVBF_3WEIGHTS =   3,
+    D3DVBF_TWEENING = 255,
+    D3DVBF_0WEIGHTS = 256
+} D3DVERTEXBLENDFLAGS;
+
+typedef enum _D3DZBUFFERTYPE {
+    D3DZB_FALSE                 = 0,
+    D3DZB_TRUE                  = 1,
+    D3DZB_USEW                  = 2,
+
+    D3DZB_FORCE_DWORD           = 0x7fffffff
+} D3DZBUFFERTYPE;
+
+
+/*****************************************************************************
+ * Direct 3D v8 typedefs
+ */
+typedef DWORD D3DCOLOR;
+
+/*****************************************************************************
+ * Direct 3D v8 structures
+ */
+typedef struct _D3DADAPTER_IDENTIFIER8 {
+    char            Driver[MAX_DEVICE_IDENTIFIER_STRING];
+    char            Description[MAX_DEVICE_IDENTIFIER_STRING];
+
+    LARGE_INTEGER   DriverVersion;
+    DWORD           VendorId;
+    DWORD           DeviceId;
+    DWORD           SubSysId;
+    DWORD           Revision;
+
+    GUID            DeviceIdentifier;
+
+    DWORD           WHQLLevel;
+} D3DADAPTER_IDENTIFIER8;
+
+typedef struct _D3DBOX {
+    UINT                Left;
+    UINT                Top;
+    UINT                Right;
+    UINT                Bottom;
+    UINT                Front;
+    UINT                Back;
+} D3DBOX;
+
+typedef struct _D3DCLIPSTATUS8 {
+   DWORD ClipUnion;
+   DWORD ClipIntersection;
+} D3DCLIPSTATUS8;
+
+typedef struct _D3DCOLORVALUE {
+    float r;
+    float g;
+    float b;
+    float a;
+} D3DCOLORVALUE;
+
+typedef struct _D3DDEVICE_CREATION_PARAMETERS {
+    UINT          AdapterOrdinal;
+    D3DDEVTYPE    DeviceType;
+    HWND          hFocusWindow;
+    DWORD         BehaviorFlags;
+} D3DDEVICE_CREATION_PARAMETERS;
+
+typedef struct _D3DDISPLAYMODE {
+    UINT            Width;
+    UINT            Height;
+    UINT            RefreshRate;
+    D3DFORMAT       Format;
+} D3DDISPLAYMODE;
+
+typedef struct _D3DGAMMARAMP {
+    WORD                red  [256];
+    WORD                green[256];
+    WORD                blue [256];
+} D3DGAMMARAMP;
+
+typedef struct _D3DINDEXBUFFER_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+    UINT                Size;
+} D3DINDEXBUFFER_DESC;
+
+#ifndef D3DVECTOR_DEFINED
+typedef struct _D3DVECTOR {
+    float x;
+    float y;
+    float z;
+} D3DVECTOR;
+#define D3DVECTOR_DEFINED
+#endif
+
+typedef struct _D3DLIGHT8 {
+    D3DLIGHTTYPE    Type;
+    D3DCOLORVALUE   Diffuse;
+    D3DCOLORVALUE   Specular;
+    D3DCOLORVALUE   Ambient;
+    D3DVECTOR       Position;
+    D3DVECTOR       Direction;
+    float           Range;
+    float           Falloff;
+    float           Attenuation0;
+    float           Attenuation1;
+    float           Attenuation2;
+    float           Theta;
+    float           Phi;
+} D3DLIGHT8;
+
+typedef struct _D3DLINEPATTERN {
+    WORD    wRepeatFactor;
+    WORD    wLinePattern;
+} D3DLINEPATTERN;
+
+typedef struct _D3DLOCKED_BOX {
+    INT                 RowPitch;
+    INT                 SlicePitch;
+    void*               pBits;
+} D3DLOCKED_BOX;
+
+typedef struct _D3DLOCKED_RECT {
+    INT                 Pitch;
+    void*               pBits;
+} D3DLOCKED_RECT;
+
+typedef struct _D3DMATERIAL8 {
+    D3DCOLORVALUE   Diffuse;
+    D3DCOLORVALUE   Ambient;
+    D3DCOLORVALUE   Specular;
+    D3DCOLORVALUE   Emissive;
+    float           Power;
+} D3DMATERIAL8;
+
+typedef struct _D3DMATRIX {
+    union {
+        struct {
+            float        _11, _12, _13, _14;
+            float        _21, _22, _23, _24;
+            float        _31, _32, _33, _34;
+            float        _41, _42, _43, _44;
+        } DUMMYSTRUCTNAME;
+        float m[4][4];
+    } DUMMYUNIONNAME;
+} D3DMATRIX;
+
+typedef struct _D3DPRESENT_PARAMETERS_ {
+    UINT                    BackBufferWidth;
+    UINT                    BackBufferHeight;
+    D3DFORMAT               BackBufferFormat;
+    UINT                    BackBufferCount;
+
+    D3DMULTISAMPLE_TYPE     MultiSampleType;
+
+    D3DSWAPEFFECT           SwapEffect;
+    HWND                    hDeviceWindow;
+    BOOL                    Windowed;
+    BOOL                    EnableAutoDepthStencil;
+    D3DFORMAT               AutoDepthStencilFormat;
+    DWORD                   Flags;
+
+    UINT                    FullScreen_RefreshRateInHz;
+    UINT                    FullScreen_PresentationInterval;
+
+} D3DPRESENT_PARAMETERS;
+
+#define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER  0x00000001
+
+typedef struct _D3DRANGE {
+    UINT                Offset;
+    UINT                Size;
+} D3DRANGE;
+
+typedef struct _D3DRASTER_STATUS {
+    BOOL            InVBlank;
+    UINT            ScanLine;
+} D3DRASTER_STATUS;
+
+typedef struct _D3DRECT {
+    LONG x1;
+    LONG y1;
+    LONG x2;
+    LONG y2;
+} D3DRECT;
+
+typedef struct _D3DRECTPATCH_INFO {
+    UINT                StartVertexOffsetWidth;
+    UINT                StartVertexOffsetHeight;
+    UINT                Width;
+    UINT                Height;
+    UINT                Stride;
+    D3DBASISTYPE        Basis;
+    D3DORDERTYPE        Order;
+} D3DRECTPATCH_INFO;
+
+typedef struct _D3DSURFACE_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+    UINT                Size;
+    D3DMULTISAMPLE_TYPE MultiSampleType;
+    UINT                Width;
+    UINT                Height;
+} D3DSURFACE_DESC;
+
+typedef struct _D3DTRIPATCH_INFO {
+    UINT                StartVertexOffset;
+    UINT                NumVertices;
+    D3DBASISTYPE        Basis;
+    D3DORDERTYPE        Order;
+} D3DTRIPATCH_INFO;
+
+typedef struct _D3DVERTEXBUFFER_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+    UINT                Size;
+    DWORD               FVF;
+} D3DVERTEXBUFFER_DESC;
+
+typedef struct _D3DVIEWPORT8 {
+    DWORD       X;
+    DWORD       Y;
+    DWORD       Width;
+    DWORD       Height;
+    float       MinZ;
+    float       MaxZ;
+} D3DVIEWPORT8;
+
+typedef struct _D3DVOLUME_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+    UINT                Size;
+    UINT                Width;
+    UINT                Height;
+    UINT                Depth;
+} D3DVOLUME_DESC;
+
+#endif  /* __WINE_D3D8TYPES_H */
diff --git a/misc/builddeps/dp.win32/include/d3d9.h b/misc/builddeps/dp.win32/include/d3d9.h
new file mode 100644 (file)
index 0000000..3f9ebf2
--- /dev/null
@@ -0,0 +1,2031 @@
+/*
+ * Copyright (C) 2002-2003 Jason Edmeades
+ *                         Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D9_H
+#define __WINE_D3D9_H
+
+#ifndef DIRECT3D_VERSION
+#define DIRECT3D_VERSION  0x0900
+#endif
+
+#include <stdlib.h>
+
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+
+#ifndef __WINESRC__
+# include <windows.h>
+#endif
+
+#include <d3d9types.h>
+#include <d3d9caps.h>
+
+/*****************************************************************************
+ * Behavior Flags for IDirect3D8::CreateDevice
+ */
+#define D3DCREATE_FPU_PRESERVE                  0x00000002L
+#define D3DCREATE_MULTITHREADED                 0x00000004L
+#define D3DCREATE_PUREDEVICE                    0x00000010L
+#define D3DCREATE_SOFTWARE_VERTEXPROCESSING     0x00000020L
+#define D3DCREATE_HARDWARE_VERTEXPROCESSING     0x00000040L
+#define D3DCREATE_MIXED_VERTEXPROCESSING        0x00000080L
+#define D3DCREATE_DISABLE_DRIVER_MANAGEMENT     0x00000100L
+#define D3DCREATE_ADAPTERGROUP_DEVICE           0x00000200L
+
+/*****************************************************************************
+ * Flags for SetPrivateData
+ */
+#define D3DSPD_IUNKNOWN                         0x00000001L
+
+
+/*****************************************************************************
+ * #defines and error codes
+ */
+#define D3D_SDK_VERSION                         32
+#define D3DADAPTER_DEFAULT                      0
+#define D3DENUM_NO_WHQL_LEVEL                   0x00000002L
+#define D3DPRESENT_BACK_BUFFERS_MAX             3L
+#define D3DSGR_NO_CALIBRATION                   0x00000000L
+#define D3DSGR_CALIBRATE                        0x00000001L
+
+#define _FACD3D  0x876
+#define MAKE_D3DHRESULT( code )                 MAKE_HRESULT( 1, _FACD3D, code )
+#define MAKE_D3DSTATUS( code )                  MAKE_HRESULT( 0, _FACD3D, code )
+
+/*****************************************************************************
+ * Direct3D Errors
+ */
+#define D3D_OK                                  S_OK
+#define D3DERR_WRONGTEXTUREFORMAT               MAKE_D3DHRESULT(2072)
+#define D3DERR_UNSUPPORTEDCOLOROPERATION        MAKE_D3DHRESULT(2073)
+#define D3DERR_UNSUPPORTEDCOLORARG              MAKE_D3DHRESULT(2074)
+#define D3DERR_UNSUPPORTEDALPHAOPERATION        MAKE_D3DHRESULT(2075)
+#define D3DERR_UNSUPPORTEDALPHAARG              MAKE_D3DHRESULT(2076)
+#define D3DERR_TOOMANYOPERATIONS                MAKE_D3DHRESULT(2077)
+#define D3DERR_CONFLICTINGTEXTUREFILTER         MAKE_D3DHRESULT(2078)
+#define D3DERR_UNSUPPORTEDFACTORVALUE           MAKE_D3DHRESULT(2079)
+#define D3DERR_CONFLICTINGRENDERSTATE           MAKE_D3DHRESULT(2081)
+#define D3DERR_UNSUPPORTEDTEXTUREFILTER         MAKE_D3DHRESULT(2082)
+#define D3DERR_CONFLICTINGTEXTUREPALETTE        MAKE_D3DHRESULT(2086)
+#define D3DERR_DRIVERINTERNALERROR              MAKE_D3DHRESULT(2087)
+#define D3DERR_NOTFOUND                         MAKE_D3DHRESULT(2150)
+#define D3DERR_MOREDATA                         MAKE_D3DHRESULT(2151)
+#define D3DERR_DEVICELOST                       MAKE_D3DHRESULT(2152)
+#define D3DERR_DEVICENOTRESET                   MAKE_D3DHRESULT(2153)
+#define D3DERR_NOTAVAILABLE                     MAKE_D3DHRESULT(2154)
+#define D3DERR_OUTOFVIDEOMEMORY                 MAKE_D3DHRESULT(380)
+#define D3DERR_INVALIDDEVICE                    MAKE_D3DHRESULT(2155)
+#define D3DERR_INVALIDCALL                      MAKE_D3DHRESULT(2156)
+#define D3DERR_DRIVERINVALIDCALL                MAKE_D3DHRESULT(2157)
+#define D3DERR_WASSTILLDRAWING                  MAKE_D3DHRESULT(540)
+#define D3DOK_NOAUTOGEN                         MAKE_D3DSTATUS(2159)
+
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(IID_IDirect3D9,                   0x81BDCBCA, 0x64D4, 0x426D, 0xAE, 0x8D, 0xAD, 0x1, 0x47, 0xF4, 0x27, 0x5C);
+typedef struct IDirect3D9 *LPDIRECT3D9, *PDIRECT3D9;
+
+DEFINE_GUID(IID_IDirect3D9Ex,                 0x02177241, 0x69FC, 0x400C, 0x8F, 0xF1, 0x93, 0xA4, 0x4D, 0xF6, 0x86, 0x1D);
+typedef struct IDirect3D9Ex *LPDIRECT3D9EX, *PDIRECT3D9EX;
+
+DEFINE_GUID(IID_IDirect3DDevice9,             0xd0223b96, 0xbf7a, 0x43fd, 0x92, 0xbd, 0xa4, 0x3b, 0xd, 0x82, 0xb9, 0xeb);
+typedef struct IDirect3DDevice9 *LPDIRECT3DDEVICE9;
+
+DEFINE_GUID(IID_IDirect3DDevice9Ex,           0xb18b10ce, 0x2649, 0x405a, 0x87, 0xf, 0x95, 0xf7, 0x77, 0xd4, 0x31, 0x3a);
+typedef struct IDirect3DDevice9Ex *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX;
+
+DEFINE_GUID(IID_IDirect3DResource9,           0x5eec05d, 0x8f7d, 0x4362, 0xb9, 0x99, 0xd1, 0xba, 0xf3, 0x57, 0xc7, 0x4);
+typedef struct IDirect3DResource9 *LPDIRECT3DRESOURCE9, *PDIRECT3DRESOURCE9;
+
+DEFINE_GUID(IID_IDirect3DVertexBuffer9,       0xb64bb1b5, 0xfd70, 0x4df6, 0xbf, 0x91, 0x19, 0xd0, 0xa1, 0x24, 0x55, 0xe3);
+typedef struct IDirect3DVertexBuffer9 *LPDIRECT3DVERTEXBUFFER9, *PDIRECT3DVERTEXBUFFER9;
+
+DEFINE_GUID(IID_IDirect3DVolume9,             0x24f416e6, 0x1f67, 0x4aa7, 0xb8, 0x8e, 0xd3, 0x3f, 0x6f, 0x31, 0x28, 0xa1);
+typedef struct IDirect3DVolume9 *LPDIRECT3DVOLUME9, *PDIRECT3DVOLUME9;
+
+DEFINE_GUID(IID_IDirect3DSwapChain9,          0x794950f2, 0xadfc, 0x458a, 0x90, 0x5e, 0x10, 0xa1, 0xb, 0xb, 0x50, 0x3b);
+typedef struct IDirect3DSwapChain9 *LPDIRECT3DSWAPCHAIN9, *PDIRECT3DSWAPCHAIN9;
+
+DEFINE_GUID(IID_IDirect3DSwapChain9Ex,        0x91886caf, 0x1c3d, 0x4d2e, 0xa0, 0xab, 0x3e, 0x4c, 0x7d, 0x8d, 0x33, 0x3);
+typedef struct IDirect3DSwapChain9Ex *LPDIRECT3DSWAPCHAIN9EX, *PDIRECT3DSWAPCHAIN9EX;
+
+DEFINE_GUID(IID_IDirect3DSurface9,            0xcfbaf3a, 0x9ff6, 0x429a, 0x99, 0xb3, 0xa2, 0x79, 0x6a, 0xf8, 0xb8, 0x9b);
+typedef struct IDirect3DSurface9 *LPDIRECT3DSURFACE9, *PDIRECT3DSURFACE9;
+
+DEFINE_GUID(IID_IDirect3DIndexBuffer9,        0x7c9dd65e, 0xd3f7, 0x4529, 0xac, 0xee, 0x78, 0x58, 0x30, 0xac, 0xde, 0x35);
+typedef struct IDirect3DIndexBuffer9 *LPDIRECT3DINDEXBUFFER9, *PDIRECT3DINDEXBUFFER9;
+
+DEFINE_GUID(IID_IDirect3DBaseTexture9,        0x580ca87e, 0x1d3c, 0x4d54, 0x99, 0x1d, 0xb7, 0xd3, 0xe3, 0xc2, 0x98, 0xce);
+typedef struct IDirect3DBaseTexture9 *LPDIRECT3DBASETEXTURE9, *PDIRECT3DBASETEXTURE9;
+
+DEFINE_GUID(IID_IDirect3DTexture9,            0x85c31227, 0x3de5, 0x4f00, 0x9b, 0x3a, 0xf1, 0x1a, 0xc3, 0x8c, 0x18, 0xb5);
+typedef struct IDirect3DTexture9 *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9;
+
+DEFINE_GUID(IID_IDirect3DCubeTexture9,        0xfff32f81, 0xd953, 0x473a, 0x92, 0x23, 0x93, 0xd6, 0x52, 0xab, 0xa9, 0x3f);
+typedef struct IDirect3DCubeTexture9 *LPDIRECT3DCUBETEXTURE9, *PDIRECT3DCUBETEXTURE9;
+
+DEFINE_GUID(IID_IDirect3DVolumeTexture9,      0x2518526c, 0xe789, 0x4111, 0xa7, 0xb9, 0x47, 0xef, 0x32, 0x8d, 0x13, 0xe6);
+typedef struct IDirect3DVolumeTexture9 *LPDIRECT3DVOLUMETEXTURE9, *PDIRECT3DVOLUMETEXTURE9;
+
+DEFINE_GUID(IID_IDirect3DVertexDeclaration9,  0xdd13c59c, 0x36fa, 0x4098, 0xa8, 0xfb, 0xc7, 0xed, 0x39, 0xdc, 0x85, 0x46);
+typedef struct IDirect3DVertexDeclaration9 *LPDIRECT3DVERTEXDECLARATION9;
+
+DEFINE_GUID(IID_IDirect3DVertexShader9,       0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
+typedef struct IDirect3DVertexShader9 *LPDIRECT3DVERTEXSHADER9;
+
+DEFINE_GUID(IID_IDirect3DPixelShader9,        0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
+typedef struct IDirect3DPixelShader9 *LPDIRECT3DPIXELSHADER9;
+
+DEFINE_GUID(IID_IDirect3DStateBlock9,         0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0xf, 0x20, 0x6f, 0x21, 0x8b);
+typedef struct IDirect3DStateBlock9 *LPDIRECT3DSTATEBLOCK9;
+
+DEFINE_GUID(IID_IDirect3DQuery9,              0xd9771460, 0xa695, 0x4f26, 0xbb, 0xd3, 0x27, 0xb8, 0x40, 0xb5, 0x41, 0xcc);
+typedef struct IDirect3DQuery9 *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9;
+
+/*****************************************************************************
+ * IDirect3D9 interface
+ */
+#undef INTERFACE
+#define INTERFACE IDirect3D9
+DECLARE_INTERFACE_(IDirect3D9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3D9 methods ***/
+    STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE;
+    STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE;
+    STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) PURE;
+    STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter, D3DFORMAT Format) PURE;
+    STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) PURE;
+    STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter, D3DDISPLAYMODE* pMode) PURE;
+    STDMETHOD(CheckDeviceType)(THIS_ UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) PURE;
+    STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE;
+    STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) PURE;
+    STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) PURE;
+    STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) PURE;
+    STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) PURE;
+    STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE;
+    STDMETHOD(CreateDevice)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, struct IDirect3DDevice9** ppReturnedDeviceInterface) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3D9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3D9_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirect3D9_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirect3D9 methods ***/
+#define IDirect3D9_RegisterSoftwareDevice(p,a)                (p)->lpVtbl->RegisterSoftwareDevice(p,a)
+#define IDirect3D9_GetAdapterCount(p)                         (p)->lpVtbl->GetAdapterCount(p)
+#define IDirect3D9_GetAdapterIdentifier(p,a,b,c)              (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
+#define IDirect3D9_GetAdapterModeCount(p,a,b)                 (p)->lpVtbl->GetAdapterModeCount(p,a,b)
+#define IDirect3D9_EnumAdapterModes(p,a,b,c,d)                (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d)
+#define IDirect3D9_GetAdapterDisplayMode(p,a,b)               (p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
+#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e)               (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e)
+#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f)           (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f)
+#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f)  (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f)
+#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e)        (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e)
+#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d)     (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d)
+#define IDirect3D9_GetDeviceCaps(p,a,b,c)                     (p)->lpVtbl->GetDeviceCaps(p,a,b,c)
+#define IDirect3D9_GetAdapterMonitor(p,a)                     (p)->lpVtbl->GetAdapterMonitor(p,a)
+#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f)                (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f)
+#else
+/*** IUnknown methods ***/
+#define IDirect3D9_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D9_AddRef(p)             (p)->AddRef()
+#define IDirect3D9_Release(p)            (p)->Release()
+/*** IDirect3D9 methods ***/
+#define IDirect3D9_RegisterSoftwareDevice(p,a)                (p)->RegisterSoftwareDevice(a)
+#define IDirect3D9_GetAdapterCount(p)                         (p)->GetAdapterCount()
+#define IDirect3D9_GetAdapterIdentifier(p,a,b,c)              (p)->GetAdapterIdentifier(a,b,c)
+#define IDirect3D9_GetAdapterModeCount(p,a,b)                 (p)->GetAdapterModeCount(a,b)
+#define IDirect3D9_EnumAdapterModes(p,a,b,c,d)                (p)->EnumAdapterModes(a,b,c,d)
+#define IDirect3D9_GetAdapterDisplayMode(p,a,b)               (p)->GetAdapterDisplayMode(a,b)
+#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e)               (p)->CheckDeviceType(a,b,c,d,e)
+#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f)           (p)->CheckDeviceFormat(a,b,c,d,e,f)
+#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f)  (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f)
+#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e)        (p)->CheckDepthStencilMatch(a,b,c,d,e)
+#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d)     (p)->CheckDeviceFormatConversion(a,b,c,d)
+#define IDirect3D9_GetDeviceCaps(p,a,b,c)                     (p)->GetDeviceCaps(a,b,c)
+#define IDirect3D9_GetAdapterMonitor(p,a)                     (p)->GetAdapterMonitor(a)
+#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f)                (p)->CreateDevice(a,b,c,d,e,f)
+#endif
+
+/*****************************************************************************
+ * IDirect3D9Ex interface
+ */
+#define INTERFACE IDirect3D9Ex
+DECLARE_INTERFACE_(IDirect3D9Ex,IDirect3D9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3D9 methods ***/
+
+    /* Note: Microsoft's d3d9.h does not declare IDirect3D9Ex::RegisterSoftwareDevice . This would mean that
+     * the offsets of the other methods in the Vtable change too. This is wrong. In Microsoft's
+     * d3d9.dll, the offsets for the other functions are still compatible with IDirect3D9.
+     * This is probably because even in MS's header IDirect3D9Ex inherits from IDirect3D9, which makes the
+     * C++ inferface compatible, and nobody uses the C interface in Windows world.
+     */
+    STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE;
+
+    STDMETHOD_(UINT, GetAdapterCount)(THIS) PURE;
+    STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) PURE;
+    STDMETHOD_(UINT, GetAdapterModeCount)(THIS_ UINT Adapter, D3DFORMAT Format) PURE;
+    STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) PURE;
+    STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter, D3DDISPLAYMODE* pMode) PURE;
+    STDMETHOD(CheckDeviceType)(THIS_ UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) PURE;
+    STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE;
+    STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) PURE;
+    STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) PURE;
+    STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) PURE;
+    STDMETHOD(GetDeviceCaps)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) PURE;
+    STDMETHOD_(HMONITOR, GetAdapterMonitor)(THIS_ UINT Adapter) PURE;
+    STDMETHOD(CreateDevice)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, struct IDirect3DDevice9** ppReturnedDeviceInterface) PURE;
+    /*** IDirect3D9Ex methods ***/
+    STDMETHOD_(UINT, GetAdapterModeCountEx)(THIS_ UINT Adapter, CONST D3DDISPLAYMODEFILTER *pFilter) PURE;
+    STDMETHOD(EnumAdapterModesEx)(THIS_ UINT Adapter, CONST D3DDISPLAYMODEFILTER *pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode) PURE;
+    STDMETHOD(GetAdapterDisplayModeEx)(THIS_ UINT Adapter, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation);
+    STDMETHOD(CreateDeviceEx)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, struct IDirect3DDevice9Ex **ppReturnedDeviceInterface) PURE;
+    STDMETHOD(GetAdapterLUID)(THIS_ UINT Adatper, LUID *pLUID) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3D9Ex_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirect3D9Ex_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirect3D9 methods ***/
+#define IDirect3D9Ex_RegisterSoftwareDevice(p,a)                (p)->lpVtbl->RegisterSoftwareDevice(p,a)
+#define IDirect3D9Ex_GetAdapterCount(p)                         (p)->lpVtbl->GetAdapterCount(p)
+#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c)              (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
+#define IDirect3D9Ex_GetAdapterModeCount(p,a,b)                 (p)->lpVtbl->GetAdapterModeCount(p,a,b)
+#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d)                (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d)
+#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b)               (p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
+#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e)               (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e)
+#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f)           (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f)
+#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f)  (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f)
+#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e)        (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e)
+#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d)     (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d)
+#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c)                     (p)->lpVtbl->GetDeviceCaps(p,a,b,c)
+#define IDirect3D9Ex_GetAdapterMonitor(p,a)                     (p)->lpVtbl->GetAdapterMonitor(p,a)
+#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f)                (p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f)
+/*** IDirect3D9Ex methods ***/
+#define IDirect3D9Ex_GetAdapterModeCountEx(p,a,b)               (p)->lpVtbl->GetAdapterModeCountEx(p,a,b)
+#define IDirect3D9Ex_EnumAdapterModesEx(p,a,b,c,d)              (p)->lpVtbl->EnumAdapterModesEx(p,a,b,c,d)
+#define IDirect3D9Ex_GetAdapterDisplayModeEx(p,a,b,c)           (p)->lpVtbl->GetAdapterDisplayModeEx(p,a,b,c)
+#define IDirect3D9Ex_CreateDeviceEx(p,a,b,c,d,e,f,g)            (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d,e,f,g)
+#define IDirect3D9Ex_GetAdapterLUID(p,a,b)                      (p)->lpVtbl->GetAdapterLUID(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3D9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3D9Ex_AddRef(p)             (p)->AddRef()
+#define IDirect3D9Ex_Release(p)            (p)->Release()
+/*** IDirect3D9 methods ***/
+#define IDirect3D9Ex_RegisterSoftwareDevice(p,a)                (p)->RegisterSoftwareDevice(a)
+#define IDirect3D9Ex_GetAdapterCount(p)                         (p)->GetAdapterCount()
+#define IDirect3D9Ex_GetAdapterIdentifier(p,a,b,c)              (p)->GetAdapterIdentifier(a,b,c)
+#define IDirect3D9Ex_GetAdapterModeCount(p,a,b)                 (p)->GetAdapterModeCount(a,b)
+#define IDirect3D9Ex_EnumAdapterModes(p,a,b,c,d)                (p)->EnumAdapterModes(a,b,c,d)
+#define IDirect3D9Ex_GetAdapterDisplayMode(p,a,b)               (p)->GetAdapterDisplayMode(a,b)
+#define IDirect3D9Ex_CheckDeviceType(p,a,b,c,d,e)               (p)->CheckDeviceType(a,b,c,d,e)
+#define IDirect3D9Ex_CheckDeviceFormat(p,a,b,c,d,e,f)           (p)->CheckDeviceFormat(a,b,c,d,e,f)
+#define IDirect3D9Ex_CheckDeviceMultiSampleType(p,a,b,c,d,e,f)  (p)->CheckDeviceMultiSampleType(a,b,c,d,e,f)
+#define IDirect3D9Ex_CheckDepthStencilMatch(p,a,b,c,d,e)        (p)->CheckDepthStencilMatch(a,b,c,d,e)
+#define IDirect3D9Ex_CheckDeviceFormatConversion(p,a,b,c,d)     (p)->CheckDeviceFormatConversion(a,b,c,d)
+#define IDirect3D9Ex_GetDeviceCaps(p,a,b,c)                     (p)->GetDeviceCaps(a,b,c)
+#define IDirect3D9Ex_GetAdapterMonitor(p,a)                     (p)->GetAdapterMonitor(a)
+#define IDirect3D9Ex_CreateDevice(p,a,b,c,d,e,f)                (p)->CreateDevice(a,b,c,d,e,f)
+#endif
+
+/*****************************************************************************
+ * IDirect3DVolume9 interface
+ */
+#define INTERFACE IDirect3DVolume9
+DECLARE_INTERFACE_(IDirect3DVolume9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DVolume9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD(GetContainer)(THIS_ REFIID riid, void** ppContainer) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DVOLUME_DESC* pDesc) PURE;
+    STDMETHOD(LockBox)(THIS_ D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) PURE;
+    STDMETHOD(UnlockBox)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVolume9_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVolume9_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DVolume9_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DVolume9 methods ***/
+#define IDirect3DVolume9_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DVolume9_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DVolume9_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DVolume9_GetContainer(p,a,b)          (p)->lpVtbl->GetContainer(p,a,b)
+#define IDirect3DVolume9_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#define IDirect3DVolume9_LockBox(p,a,b,c)             (p)->lpVtbl->LockBox(p,a,b,c)
+#define IDirect3DVolume9_UnlockBox(p)                 (p)->lpVtbl->UnlockBox(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVolume9_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DVolume9_AddRef(p)                    (p)->AddRef()
+#define IDirect3DVolume9_Release(p)                   (p)->Release()
+/*** IDirect3DVolume9 methods ***/
+#define IDirect3DVolume9_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DVolume9_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DVolume9_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DVolume9_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DVolume9_GetContainer(p,a,b)          (p)->GetContainer(a,b)
+#define IDirect3DVolume9_GetDesc(p,a)                 (p)->GetDesc(a)
+#define IDirect3DVolume9_LockBox(p,a,b,c)             (p)->LockBox(a,b,c)
+#define IDirect3DVolume9_UnlockBox(p)                 (p)->UnlockBox()
+#endif
+
+/*****************************************************************************
+ * IDirect3DSwapChain9 interface
+ */
+#define INTERFACE IDirect3DSwapChain9
+DECLARE_INTERFACE_(IDirect3DSwapChain9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DSwapChain9 methods ***/
+    STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags) PURE;
+    STDMETHOD(GetFrontBufferData)(THIS_ struct IDirect3DSurface9* pDestSurface) PURE;
+    STDMETHOD(GetBackBuffer)(THIS_ UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, struct IDirect3DSurface9** ppBackBuffer) PURE;
+    STDMETHOD(GetRasterStatus)(THIS_ D3DRASTER_STATUS* pRasterStatus) PURE;
+    STDMETHOD(GetDisplayMode)(THIS_ D3DDISPLAYMODE* pMode) PURE;
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(GetPresentParameters)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DSwapChain9_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DSwapChain9_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DSwapChain9_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DSwapChain9 methods ***/
+#define IDirect3DSwapChain9_Present(p,a,b,c,d,e)         (p)->lpVtbl->Present(p,a,b,c,d,e)
+#define IDirect3DSwapChain9_GetFrontBufferData(p,a)      (p)->lpVtbl->GetFrontBufferData(p,a)
+#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c)       (p)->lpVtbl->GetBackBuffer(p,a,b,c)
+#define IDirect3DSwapChain9_GetRasterStatus(p,a)         (p)->lpVtbl->GetRasterStatus(p,a)
+#define IDirect3DSwapChain9_GetDisplayMode(p,a)          (p)->lpVtbl->GetDisplayMode(p,a)
+#define IDirect3DSwapChain9_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DSwapChain9_GetPresentParameters(p,a)    (p)->lpVtbl->GetPresentParameters(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DSwapChain9_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DSwapChain9_AddRef(p)                    (p)->AddRef()
+#define IDirect3DSwapChain9_Release(p)                   (p)->Release()
+/*** IDirect3DSwapChain9 methods ***/
+#define IDirect3DSwapChain9_Present(p,a,b,c,d,e)         (p)->Present(a,b,c,d,e)
+#define IDirect3DSwapChain9_GetFrontBufferData(p,a)      (p)->GetFrontBufferData(a)
+#define IDirect3DSwapChain9_GetBackBuffer(p,a,b,c)       (p)->GetBackBuffer(a,b,c)
+#define IDirect3DSwapChain9_GetRasterStatus(p,a)         (p)->GetRasterStatus(a)
+#define IDirect3DSwapChain9_GetDisplayMode(p,a)          (p)->GetDisplayMode(a)
+#define IDirect3DSwapChain9_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DSwapChain9_GetPresentParameters(p,a)    (p)->GetPresentParameters(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DResource9 interface
+ */
+#define INTERFACE IDirect3DResource9
+DECLARE_INTERFACE_(IDirect3DResource9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DResource9_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DResource9_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DResource9_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DResource9 methods ***/
+#define IDirect3DResource9_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DResource9_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DResource9_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DResource9_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DResource9_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DResource9_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DResource9_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DResource9_GetType(p)                   (p)->lpVtbl->GetType(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DResource9_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DResource9_AddRef(p)                    (p)->AddRef()
+#define IDirect3DResource9_Release(p)                   (p)->Release()
+/*** IDirect3DResource9 methods ***/
+#define IDirect3DResource9_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DResource9_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DResource9_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DResource9_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DResource9_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DResource9_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DResource9_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DResource9_GetType(p)                   (p)->GetType()
+#endif
+
+/*****************************************************************************
+ * IDirect3DSurface9 interface
+ */
+#define INTERFACE IDirect3DSurface9
+DECLARE_INTERFACE_(IDirect3DSurface9,IDirect3DResource9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+    /*** IDirect3DSurface9 methods ***/
+    STDMETHOD(GetContainer)(THIS_ REFIID riid, void** ppContainer) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DSURFACE_DESC* pDesc) PURE;
+    STDMETHOD(LockRect)(THIS_ D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE;
+    STDMETHOD(UnlockRect)(THIS) PURE;
+    STDMETHOD(GetDC)(THIS_ HDC* phdc) PURE;
+    STDMETHOD(ReleaseDC)(THIS_ HDC hdc) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DSurface9_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DSurface9_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DSurface9_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DSurface9 methods: IDirect3DResource9 ***/
+#define IDirect3DSurface9_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DSurface9_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DSurface9_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DSurface9_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DSurface9_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DSurface9_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DSurface9_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DSurface9 methods ***/
+#define IDirect3DSurface9_GetContainer(p,a,b)          (p)->lpVtbl->GetContainer(p,a,b)
+#define IDirect3DSurface9_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#define IDirect3DSurface9_LockRect(p,a,b,c)            (p)->lpVtbl->LockRect(p,a,b,c)
+#define IDirect3DSurface9_UnlockRect(p)                (p)->lpVtbl->UnlockRect(p)
+#define IDirect3DSurface9_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
+#define IDirect3DSurface9_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DSurface9_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DSurface9_AddRef(p)                    (p)->AddRef()
+#define IDirect3DSurface9_Release(p)                   (p)->Release()
+/*** IDirect3DSurface9 methods: IDirect3DResource9 ***/
+#define IDirect3DSurface9_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DSurface9_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DSurface9_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DSurface9_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DSurface9_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DSurface9_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DSurface9_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DSurface9_GetType(p)                   (p)->GetType()
+/*** IDirect3DSurface9 methods ***/
+#define IDirect3DSurface9_GetContainer(p,a,b)          (p)->GetContainer(a,b)
+#define IDirect3DSurface9_GetDesc(p,a)                 (p)->GetDesc(a)
+#define IDirect3DSurface9_LockRect(p,a,b,c)            (p)->LockRect(a,b,c)
+#define IDirect3DSurface9_UnlockRect(p)                (p)->UnlockRect()
+#define IDirect3DSurface9_GetDC(p,a)                   (p)->GetDC(a)
+#define IDirect3DSurface9_ReleaseDC(p,a)               (p)->ReleaseDC(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DVertexBuffer9 interface
+ */
+#define INTERFACE IDirect3DVertexBuffer9
+DECLARE_INTERFACE_(IDirect3DVertexBuffer9,IDirect3DResource9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+    /*** IDirect3DVertexBuffer9 methods ***/
+    STDMETHOD(Lock)(THIS_ UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags) PURE;
+    STDMETHOD(Unlock)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DVERTEXBUFFER_DESC* pDesc) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVertexBuffer9_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVertexBuffer9_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DVertexBuffer9_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DVertexBuffer9 methods: IDirect3DResource9 ***/
+#define IDirect3DVertexBuffer9_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DVertexBuffer9_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DVertexBuffer9_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DVertexBuffer9_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DVertexBuffer9_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DVertexBuffer9_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DVertexBuffer9 methods ***/
+#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirect3DVertexBuffer9_Unlock(p)                    (p)->lpVtbl->Unlock(p)
+#define IDirect3DVertexBuffer9_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVertexBuffer9_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DVertexBuffer9_AddRef(p)                    (p)->AddRef()
+#define IDirect3DVertexBuffer9_Release(p)                   (p)->Release()
+/*** IDirect3DVertexBuffer9 methods: IDirect3DResource9 ***/
+#define IDirect3DVertexBuffer9_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DVertexBuffer9_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DVertexBuffer9_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DVertexBuffer9_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DVertexBuffer9_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DVertexBuffer9_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DVertexBuffer9_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DVertexBuffer9_GetType(p)                   (p)->GetType()
+/*** IDirect3DVertexBuffer9 methods ***/
+#define IDirect3DVertexBuffer9_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirect3DVertexBuffer9_Unlock(p)                    (p)->Unlock()
+#define IDirect3DVertexBuffer9_GetDesc(p,a)                 (p)->GetDesc(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DIndexBuffer9 interface
+ */
+#define INTERFACE IDirect3DIndexBuffer9
+DECLARE_INTERFACE_(IDirect3DIndexBuffer9,IDirect3DResource9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+    /*** IDirect3DIndexBuffer9 methods ***/
+    STDMETHOD(Lock)(THIS_ UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags) PURE;
+    STDMETHOD(Unlock)(THIS) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DINDEXBUFFER_DESC* pDesc) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DIndexBuffer9_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DIndexBuffer9_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DIndexBuffer9_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DIndexBuffer9 methods: IDirect3DResource9 ***/
+#define IDirect3DIndexBuffer9_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d)    (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c)      (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DIndexBuffer9_FreePrivateData(p,a)         (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DIndexBuffer9_SetPriority(p,a)             (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DIndexBuffer9_GetPriority(p)               (p)->lpVtbl->GetPriority(p)
+#define IDirect3DIndexBuffer9_PreLoad(p)                   (p)->lpVtbl->PreLoad(p)
+#define IDirect3DIndexBuffer9_GetType(p)                   (p)->lpVtbl->GetType(p)
+/*** IDirect3DIndexBuffer9 methods ***/
+#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
+#define IDirect3DIndexBuffer9_Unlock(p)                    (p)->lpVtbl->Unlock(p)
+#define IDirect3DIndexBuffer9_GetDesc(p,a)                 (p)->lpVtbl->GetDesc(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DIndexBuffer9_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DIndexBuffer9_AddRef(p)                    (p)->AddRef()
+#define IDirect3DIndexBuffer9_Release(p)                   (p)->Release()
+/*** IDirect3DIndexBuffer9 methods: IDirect3DResource9 ***/
+#define IDirect3DIndexBuffer9_GetDevice(p,a)               (p)->GetDevice(a)
+#define IDirect3DIndexBuffer9_SetPrivateData(p,a,b,c,d)    (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DIndexBuffer9_GetPrivateData(p,a,b,c)      (p)->GetPrivateData(a,b,c)
+#define IDirect3DIndexBuffer9_FreePrivateData(p,a)         (p)->FreePrivateData(a)
+#define IDirect3DIndexBuffer9_SetPriority(p,a)             (p)->SetPriority(a)
+#define IDirect3DIndexBuffer9_GetPriority(p)               (p)->GetPriority()
+#define IDirect3DIndexBuffer9_PreLoad(p)                   (p)->PreLoad()
+#define IDirect3DIndexBuffer9_GetType(p)                   (p)->GetType()
+/*** IDirect3DIndexBuffer9 methods ***/
+#define IDirect3DIndexBuffer9_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
+#define IDirect3DIndexBuffer9_Unlock(p)                    (p)->Unlock()
+#define IDirect3DIndexBuffer9_GetDesc(p,a)                 (p)->GetDesc(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DBaseTexture9 interface
+ */
+#define INTERFACE IDirect3DBaseTexture9
+DECLARE_INTERFACE_(IDirect3DBaseTexture9,IDirect3DResource9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture9 methods ***/
+    STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
+    STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
+    STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE;
+    STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
+    STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DBaseTexture9_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DBaseTexture9_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IDirect3DBaseTexture9_Release(p)             (p)->lpVtbl->Release(p)
+/*** IDirect3DBaseTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DBaseTexture9_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d)  (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c)    (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DBaseTexture9_FreePrivateData(p,a)       (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DBaseTexture9_SetPriority(p,a)           (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DBaseTexture9_GetPriority(p)             (p)->lpVtbl->GetPriority(p)
+#define IDirect3DBaseTexture9_PreLoad(p)                 (p)->lpVtbl->PreLoad(p)
+#define IDirect3DBaseTexture9_GetType(p)                 (p)->lpVtbl->GetType(p)
+/*** IDirect3DBaseTexture9 methods ***/
+#define IDirect3DBaseTexture9_SetLOD(p,a)                (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DBaseTexture9_GetLOD(p)                  (p)->lpVtbl->GetLOD(p)
+#define IDirect3DBaseTexture9_GetLevelCount(p)           (p)->lpVtbl->GetLevelCount(p)
+#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a)  (p)->lpVtbl->SetAutoGenFilterType(p,a)
+#define IDirect3DBaseTexture9_GetAutoGenFilterType(p)    (p)->lpVtbl->GetAutoGenFilterType(p)
+#define IDirect3DBaseTexture9_GenerateMipSubLevels(p)    (p)->lpVtbl->GenerateMipSubLevels(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DBaseTexture9_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
+#define IDirect3DBaseTexture9_AddRef(p)              (p)->AddRef()
+#define IDirect3DBaseTexture9_Release(p)             (p)->Release()
+/*** IDirect3DBaseTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DBaseTexture9_GetDevice(p,a)             (p)->GetDevice(a)
+#define IDirect3DBaseTexture9_SetPrivateData(p,a,b,c,d)  (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DBaseTexture9_GetPrivateData(p,a,b,c)    (p)->GetPrivateData(a,b,c)
+#define IDirect3DBaseTexture9_FreePrivateData(p,a)       (p)->FreePrivateData(a)
+#define IDirect3DBaseTexture9_SetPriority(p,a)           (p)->SetPriority(a)
+#define IDirect3DBaseTexture9_GetPriority(p)             (p)->GetPriority()
+#define IDirect3DBaseTexture9_PreLoad(p)                 (p)->PreLoad()
+#define IDirect3DBaseTexture9_GetType(p)                 (p)->GetType()
+/*** IDirect3DBaseTexture9 methods ***/
+#define IDirect3DBaseTexture9_SetLOD(p,a)                (p)->SetLOD(a)
+#define IDirect3DBaseTexture9_GetLOD(p)                  (p)->GetLOD()
+#define IDirect3DBaseTexture9_GetLevelCount(p)           (p)->GetLevelCount()
+#define IDirect3DBaseTexture9_SetAutoGenFilterType(p,a)  (p)->SetAutoGenFilterType(a)
+#define IDirect3DBaseTexture9_GetAutoGenFilterType(p)    (p)->GetAutoGenFilterType()
+#define IDirect3DBaseTexture9_GenerateMipSubLevels(p)    (p)->GenerateMipSubLevels()
+#endif
+
+/*****************************************************************************
+ * IDirect3DCubeTexture9 interface
+ */
+#define INTERFACE IDirect3DCubeTexture9
+DECLARE_INTERFACE_(IDirect3DCubeTexture9,IDirect3DBaseTexture9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture9 methods ***/
+    STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
+    STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
+    STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE;
+    STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
+    STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
+    /*** IDirect3DCubeTexture9 methods ***/
+    STDMETHOD(GetLevelDesc)(THIS_ UINT Level,D3DSURFACE_DESC* pDesc) PURE;
+    STDMETHOD(GetCubeMapSurface)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9** ppCubeMapSurface) PURE;
+    STDMETHOD(LockRect)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE;
+    STDMETHOD(UnlockRect)(THIS_ D3DCUBEMAP_FACES FaceType, UINT Level) PURE;
+    STDMETHOD(AddDirtyRect)(THIS_ D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DCubeTexture9_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DCubeTexture9_AddRef(p)                   (p)->lpVtbl->AddRef(p)
+#define IDirect3DCubeTexture9_Release(p)                  (p)->lpVtbl->Release(p)
+/*** IDirect3DCubeTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DCubeTexture9_GetDevice(p,a)              (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d)   (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c)     (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DCubeTexture9_FreePrivateData(p,a)        (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DCubeTexture9_SetPriority(p,a)            (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DCubeTexture9_GetPriority(p)              (p)->lpVtbl->GetPriority(p)
+#define IDirect3DCubeTexture9_PreLoad(p)                  (p)->lpVtbl->PreLoad(p)
+#define IDirect3DCubeTexture9_GetType(p)                  (p)->lpVtbl->GetType(p)
+/*** IDirect3DCubeTexture9 methods: IDirect3DBaseTexture9 ***/
+#define IDirect3DCubeTexture9_SetLOD(p,a)                 (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DCubeTexture9_GetLOD(p)                   (p)->lpVtbl->GetLOD(p)
+#define IDirect3DCubeTexture9_GetLevelCount(p)            (p)->lpVtbl->GetLevelCount(p)
+#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a)   (p)->lpVtbl->SetAutoGenFilterType(p,a)
+#define IDirect3DCubeTexture9_GetAutoGenFilterType(p)     (p)->lpVtbl->GetAutoGenFilterType(p)
+#define IDirect3DCubeTexture9_GenerateMipSubLevels(p)     (p)->lpVtbl->GenerateMipSubLevels(p)
+/*** IDirect3DCubeTexture9 methods ***/
+#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b)         (p)->lpVtbl->GetLevelDesc(p,a,b)
+#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c)  (p)->lpVtbl->GetCubeMapSurface(p,a,b,c)
+#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e)       (p)->lpVtbl->LockRect(p,a,b,c,d,e)
+#define IDirect3DCubeTexture9_UnlockRect(p,a,b)           (p)->lpVtbl->UnlockRect(p,a,b)
+#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b)         (p)->lpVtbl->AddDirtyRect(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DCubeTexture9_QueryInterface(p,a,b)       (p)->QueryInterface(a,b)
+#define IDirect3DCubeTexture9_AddRef(p)                   (p)->AddRef()
+#define IDirect3DCubeTexture9_Release(p)                  (p)->Release()
+/*** IDirect3DCubeTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DCubeTexture9_GetDevice(p,a)              (p)->GetDevice(a)
+#define IDirect3DCubeTexture9_SetPrivateData(p,a,b,c,d)   (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DCubeTexture9_GetPrivateData(p,a,b,c)     (p)->GetPrivateData(a,b,c)
+#define IDirect3DCubeTexture9_FreePrivateData(p,a)        (p)->FreePrivateData(a)
+#define IDirect3DCubeTexture9_SetPriority(p,a)            (p)->SetPriority(a)
+#define IDirect3DCubeTexture9_GetPriority(p)              (p)->GetPriority()
+#define IDirect3DCubeTexture9_PreLoad(p)                  (p)->PreLoad()
+#define IDirect3DCubeTexture9_GetType(p)                  (p)->GetType()
+/*** IDirect3DCubeTexture9 methods: IDirect3DBaseTexture9 ***/
+#define IDirect3DCubeTexture9_SetLOD(p,a)                 (p)->SetLOD(a)
+#define IDirect3DCubeTexture9_GetLOD(p)                   (p)->GetLOD()
+#define IDirect3DCubeTexture9_GetLevelCount(p)            (p)->GetLevelCount()
+#define IDirect3DCubeTexture9_SetAutoGenFilterType(p,a)   (p)->SetAutoGenFilterType(a)
+#define IDirect3DCubeTexture9_GetAutoGenFilterType(p)     (p)->GetAutoGenFilterType()
+#define IDirect3DCubeTexture9_GenerateMipSubLevels(p)     (p)->GenerateMipSubLevels()
+/*** IDirect3DCubeTexture9 methods ***/
+#define IDirect3DCubeTexture9_GetLevelDesc(p,a,b)         (p)->GetLevelDesc(a,b)
+#define IDirect3DCubeTexture9_GetCubeMapSurface(p,a,b,c)  (p)->GetCubeMapSurface(a,b,c)
+#define IDirect3DCubeTexture9_LockRect(p,a,b,c,d,e)       (p)->LockRect(a,b,c,d,e)
+#define IDirect3DCubeTexture9_UnlockRect(p,a,b)           (p)->UnlockRect(a,b)
+#define IDirect3DCubeTexture9_AddDirtyRect(p,a,b)         (p)->AddDirtyRect(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DTexture9 interface
+ */
+#define INTERFACE IDirect3DTexture9
+DECLARE_INTERFACE_(IDirect3DTexture9,IDirect3DBaseTexture9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture9 methods ***/
+    STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
+    STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
+    STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE;
+    STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
+    STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
+    /*** IDirect3DTexture9 methods ***/
+    STDMETHOD(GetLevelDesc)(THIS_ UINT Level, D3DSURFACE_DESC* pDesc) PURE;
+    STDMETHOD(GetSurfaceLevel)(THIS_ UINT Level, IDirect3DSurface9** ppSurfaceLevel) PURE;
+    STDMETHOD(LockRect)(THIS_ UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) PURE;
+    STDMETHOD(UnlockRect)(THIS_ UINT Level) PURE;
+    STDMETHOD(AddDirtyRect)(THIS_ CONST RECT* pDirtyRect) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DTexture9_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DTexture9_AddRef(p)                  (p)->lpVtbl->AddRef(p)
+#define IDirect3DTexture9_Release(p)                 (p)->lpVtbl->Release(p)
+/*** IDirect3DTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DTexture9_GetDevice(p,a)             (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d)  (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DTexture9_GetPrivateData(p,a,b,c)    (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DTexture9_FreePrivateData(p,a)       (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DTexture9_SetPriority(p,a)           (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DTexture9_GetPriority(p)             (p)->lpVtbl->GetPriority(p)
+#define IDirect3DTexture9_PreLoad(p)                 (p)->lpVtbl->PreLoad(p)
+#define IDirect3DTexture9_GetType(p)                 (p)->lpVtbl->GetType(p)
+/*** IDirect3DTexture9 methods: IDirect3DBaseTexture9 ***/
+#define IDirect3DTexture9_SetLOD(p,a)                (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DTexture9_GetLOD(p)                  (p)->lpVtbl->GetLOD(p)
+#define IDirect3DTexture9_GetLevelCount(p)           (p)->lpVtbl->GetLevelCount(p)
+#define IDirect3DTexture9_SetAutoGenFilterType(p,a)  (p)->lpVtbl->SetAutoGenFilterType(p,a)
+#define IDirect3DTexture9_GetAutoGenFilterType(p)    (p)->lpVtbl->GetAutoGenFilterType(p)
+#define IDirect3DTexture9_GenerateMipSubLevels(p)    (p)->lpVtbl->GenerateMipSubLevels(p)
+/*** IDirect3DTexture9 methods ***/
+#define IDirect3DTexture9_GetLevelDesc(p,a,b)        (p)->lpVtbl->GetLevelDesc(p,a,b)
+#define IDirect3DTexture9_GetSurfaceLevel(p,a,b)     (p)->lpVtbl->GetSurfaceLevel(p,a,b)
+#define IDirect3DTexture9_LockRect(p,a,b,c,d)        (p)->lpVtbl->LockRect(p,a,b,c,d)
+#define IDirect3DTexture9_UnlockRect(p,a)            (p)->lpVtbl->UnlockRect(p,a)
+#define IDirect3DTexture9_AddDirtyRect(p,a)          (p)->lpVtbl->AddDirtyRect(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DTexture9_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
+#define IDirect3DTexture9_AddRef(p)                  (p)->AddRef()
+#define IDirect3DTexture9_Release(p)                 (p)->Release()
+/*** IDirect3DTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DTexture9_GetDevice(p,a)             (p)->GetDevice(a)
+#define IDirect3DTexture9_SetPrivateData(p,a,b,c,d)  (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DTexture9_GetPrivateData(p,a,b,c)    (p)->GetPrivateData(a,b,c)
+#define IDirect3DTexture9_FreePrivateData(p,a)       (p)->FreePrivateData(a)
+#define IDirect3DTexture9_SetPriority(p,a)           (p)->SetPriority(a)
+#define IDirect3DTexture9_GetPriority(p)             (p)->GetPriority()
+#define IDirect3DTexture9_PreLoad(p)                 (p)->PreLoad()
+#define IDirect3DTexture9_GetType(p)                 (p)->GetType()
+/*** IDirect3DTexture9 methods: IDirect3DBaseTexture9 ***/
+#define IDirect3DTexture9_SetLOD(p,a)                (p)->SetLOD(a)
+#define IDirect3DTexture9_GetLOD(p)                  (p)->GetLOD()
+#define IDirect3DTexture9_GetLevelCount(p)           (p)->GetLevelCount()
+#define IDirect3DTexture9_SetAutoGenFilterType(p,a)  (p)->SetAutoGenFilterType(a)
+#define IDirect3DTexture9_GetAutoGenFilterType(p)    (p)->GetAutoGenFilterType()
+#define IDirect3DTexture9_GenerateMipSubLevels(p)    (p)->GenerateMipSubLevels()
+/*** IDirect3DTexture9 methods ***/
+#define IDirect3DTexture9_GetLevelDesc(p,a,b)        (p)->GetLevelDesc(a,b)
+#define IDirect3DTexture9_GetSurfaceLevel(p,a,b)     (p)->GetSurfaceLevel(a,b)
+#define IDirect3DTexture9_LockRect(p,a,b,c,d)        (p)->LockRect(a,b,c,d)
+#define IDirect3DTexture9_UnlockRect(p,a)            (p)->UnlockRect(a)
+#define IDirect3DTexture9_AddDirtyRect(p,a)          (p)->AddDirtyRect(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DVolumeTexture9 interface
+ */
+#define INTERFACE IDirect3DVolumeTexture9
+DECLARE_INTERFACE_(IDirect3DVolumeTexture9,IDirect3DBaseTexture9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DResource9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(SetPrivateData)(THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) PURE;
+    STDMETHOD(GetPrivateData)(THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData) PURE;
+    STDMETHOD(FreePrivateData)(THIS_ REFGUID refguid) PURE;
+    STDMETHOD_(DWORD, SetPriority)(THIS_ DWORD PriorityNew) PURE;
+    STDMETHOD_(DWORD, GetPriority)(THIS) PURE;
+    STDMETHOD_(void, PreLoad)(THIS) PURE;
+    STDMETHOD_(D3DRESOURCETYPE, GetType)(THIS) PURE;
+    /*** IDirect3DBaseTexture9 methods ***/
+    STDMETHOD_(DWORD, SetLOD)(THIS_ DWORD LODNew) PURE;
+    STDMETHOD_(DWORD, GetLOD)(THIS) PURE;
+    STDMETHOD_(DWORD, GetLevelCount)(THIS) PURE;
+    STDMETHOD(SetAutoGenFilterType)(THIS_ D3DTEXTUREFILTERTYPE FilterType) PURE;
+    STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(THIS) PURE;
+    STDMETHOD_(void, GenerateMipSubLevels)(THIS) PURE;
+    /*** IDirect3DVolumeTexture9 methods ***/
+    STDMETHOD(GetLevelDesc)(THIS_ UINT Level, D3DVOLUME_DESC *pDesc) PURE;
+    STDMETHOD(GetVolumeLevel)(THIS_ UINT Level, IDirect3DVolume9** ppVolumeLevel) PURE;
+    STDMETHOD(LockBox)(THIS_ UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) PURE;
+    STDMETHOD(UnlockBox)(THIS_ UINT Level) PURE;
+    STDMETHOD(AddDirtyBox)(THIS_ CONST D3DBOX* pDirtyBox) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVolumeTexture9_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DVolumeTexture9_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirect3DVolumeTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
+#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->lpVtbl->GetPrivateData(p,a,b,c)
+#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->lpVtbl->FreePrivateData(p,a)
+#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->lpVtbl->SetPriority(p,a)
+#define IDirect3DVolumeTexture9_GetPriority(p) (p)->lpVtbl->GetPriority(p)
+#define IDirect3DVolumeTexture9_PreLoad(p) (p)->lpVtbl->PreLoad(p)
+#define IDirect3DVolumeTexture9_GetType(p) (p)->lpVtbl->GetType(p)
+/*** IDirect3DVolumeTexture9 methods: IDirect3DBaseTexture9 ***/
+#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->lpVtbl->SetLOD(p,a)
+#define IDirect3DVolumeTexture9_GetLOD(p) (p)->lpVtbl->GetLOD(p)
+#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->lpVtbl->GetLevelCount(p)
+#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->lpVtbl->SetAutoGenFilterType(p,a)
+#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->lpVtbl->GetAutoGenFilterType(p)
+#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->lpVtbl->GenerateMipSubLevels(p)
+/*** IDirect3DVolumeTexture9 methods ***/
+#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->lpVtbl->GetLevelDesc(p,a,b)
+#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->lpVtbl->GetVolumeLevel(p,a,b)
+#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->lpVtbl->LockBox(p,a,b,c,d)
+#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->lpVtbl->UnlockBox(p,a)
+#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->lpVtbl->AddDirtyBox(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVolumeTexture9_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DVolumeTexture9_AddRef(p) (p)->AddRef()
+#define IDirect3DVolumeTexture9_Release(p) (p)->Release()
+/*** IDirect3DVolumeTexture9 methods: IDirect3DResource9 ***/
+#define IDirect3DVolumeTexture9_GetDevice(p,a) (p)->GetDevice(a)
+#define IDirect3DVolumeTexture9_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d)
+#define IDirect3DVolumeTexture9_GetPrivateData(p,a,b,c) (p)->GetPrivateData(a,b,c)
+#define IDirect3DVolumeTexture9_FreePrivateData(p,a) (p)->FreePrivateData(a)
+#define IDirect3DVolumeTexture9_SetPriority(p,a) (p)->SetPriority(a)
+#define IDirect3DVolumeTexture9_GetPriority(p) (p)->GetPriority()
+#define IDirect3DVolumeTexture9_PreLoad(p) (p)->PreLoad()
+#define IDirect3DVolumeTexture9_GetType(p) (p)->GetType()
+/*** IDirect3DVolumeTexture9 methods: IDirect3DBaseTexture9 ***/
+#define IDirect3DVolumeTexture9_SetLOD(p,a) (p)->SetLOD(a)
+#define IDirect3DVolumeTexture9_GetLOD(p) (p)->GetLOD()
+#define IDirect3DVolumeTexture9_GetLevelCount(p) (p)->GetLevelCount()
+#define IDirect3DVolumeTexture9_SetAutoGenFilterType(p,a) (p)->SetAutoGenFilterType(a)
+#define IDirect3DVolumeTexture9_GetAutoGenFilterType(p) (p)->GetAutoGenFilterType()
+#define IDirect3DVolumeTexture9_GenerateMipSubLevels(p) (p)->GenerateMipSubLevels()
+/*** IDirect3DVolumeTexture9 methods ***/
+#define IDirect3DVolumeTexture9_GetLevelDesc(p,a,b) (p)->GetLevelDesc(a,b)
+#define IDirect3DVolumeTexture9_GetVolumeLevel(p,a,b) (p)->GetVolumeLevel(a,b)
+#define IDirect3DVolumeTexture9_LockBox(p,a,b,c,d) (p)->LockBox(a,b,c,d)
+#define IDirect3DVolumeTexture9_UnlockBox(p,a) (p)->UnlockBox(a)
+#define IDirect3DVolumeTexture9_AddDirtyBox(p,a) (p)->AddDirtyBox(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DVertexDeclaration9 interface
+ */
+#define INTERFACE IDirect3DVertexDeclaration9
+DECLARE_INTERFACE_(IDirect3DVertexDeclaration9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DVertexDeclaration9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9*, UINT* pNumElements) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVertexDeclaration9_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IDirect3DVertexDeclaration9_Release(p)             (p)->lpVtbl->Release(p)
+/*** IDirect3DVertexShader9 methods ***/
+#define IDirect3DVertexDeclaration9_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b)  (p)->lpVtbl->GetDeclaration(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVertexDeclaration9_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
+#define IDirect3DVertexDeclaration9_AddRef(p)              (p)->AddRef()
+#define IDirect3DVertexDeclaration9_Release(p)             (p)->Release()
+/*** IDirect3DVertexShader9 methods ***/
+#define IDirect3DVertexDeclaration9_GetDevice(p,a)         (p)->GetDevice(a)
+#define IDirect3DVertexDeclaration9_GetDeclaration(p,a,b)  (p)->GetDeclaration(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DVertexShader9 interface
+ */
+#define INTERFACE IDirect3DVertexShader9
+DECLARE_INTERFACE_(IDirect3DVertexShader9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DVertexShader9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DVertexShader9_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVertexShader9_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IDirect3DVertexShader9_Release(p)             (p)->lpVtbl->Release(p)
+/*** IDirect3DVertexShader9 methods ***/
+#define IDirect3DVertexShader9_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DVertexShader9_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DVertexShader9_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
+#define IDirect3DVertexShader9_AddRef(p)              (p)->AddRef()
+#define IDirect3DVertexShader9_Release(p)             (p)->Release()
+/*** IDirect3DVertexShader9 methods ***/
+#define IDirect3DVertexShader9_GetDevice(p,a)         (p)->GetDevice(a)
+#define IDirect3DVertexShader9_GetFunction(p,a,b)     (p)->GetFunction(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DPixelShader9 interface
+ */
+#define INTERFACE IDirect3DPixelShader9
+DECLARE_INTERFACE_(IDirect3DPixelShader9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DPixelShader9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(GetFunction)(THIS_ void*, UINT* pSizeOfData) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DPixelShader9_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DPixelShader9_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IDirect3DPixelShader9_Release(p)             (p)->lpVtbl->Release(p)
+/*** IDirect3DPixelShader9 methods ***/
+#define IDirect3DPixelShader9_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DPixelShader9_GetFunction(p,a,b)     (p)->lpVtbl->GetFunction(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DPixelShader9_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
+#define IDirect3DPixelShader9_AddRef(p)              (p)->AddRef()
+#define IDirect3DPixelShader9_Release(p)             (p)->Release()
+/*** IDirect3DPixelShader9 methods ***/
+#define IDirect3DPixelShader9_GetDevice(p,a)         (p)->GetDevice(a)
+#define IDirect3DPixelShader9_GetFunction(p,a,b)     (p)->GetFunction(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DStateBlock9 interface
+ */
+#define INTERFACE IDirect3DStateBlock9
+DECLARE_INTERFACE_(IDirect3DStateBlock9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DStateBlock9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD(Capture)(THIS) PURE;
+    STDMETHOD(Apply)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DStateBlock9_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DStateBlock9_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define IDirect3DStateBlock9_Release(p)             (p)->lpVtbl->Release(p)
+/*** IDirect3DStateBlock9 methods ***/
+#define IDirect3DStateBlock9_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DStateBlock9_Capture(p)             (p)->lpVtbl->Capture(p)
+#define IDirect3DStateBlock9_Apply(p)               (p)->lpVtbl->Apply(p)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DStateBlock9_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
+#define IDirect3DStateBlock9_AddRef(p)              (p)->AddRef()
+#define IDirect3DStateBlock9_Release(p)             (p)->Release()
+/*** IDirect3DStateBlock9 methods ***/
+#define IDirect3DStateBlock9_GetDevice(p,a)         (p)->GetDevice(a)
+#define IDirect3DStateBlock9_Capture(p)             (p)->Capture()
+#define IDirect3DStateBlock9_Apply(p)               (p)->Apply()
+#endif
+
+/*****************************************************************************
+ * IDirect3DQuery9 interface
+ */
+#define INTERFACE IDirect3DQuery9
+DECLARE_INTERFACE_(IDirect3DQuery9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DQuery9 methods ***/
+    STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9** ppDevice) PURE;
+    STDMETHOD_(D3DQUERYTYPE, GetType)(THIS) PURE;
+    STDMETHOD_(DWORD, GetDataSize)(THIS) PURE;
+    STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE;
+    STDMETHOD(GetData)(THIS_ void* pData, DWORD dwSize, DWORD dwGetDataFlags) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DQuery9_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DQuery9_Release(p) (p)->lpVtbl->Release(p)
+/*** IDirect3DQuery9 ***/
+#define IDirect3DQuery9_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DQuery9_GetType(p) (p)->lpVtbl->GetType(p)
+#define IDirect3DQuery9_GetDataSize(p) (p)->lpVtbl->GetDataSize(p)
+#define IDirect3DQuery9_Issue(p,a) (p)->lpVtbl->Issue(p,a)
+#define IDirect3DQuery9_GetData(p,a,b,c) (p)->lpVtbl->GetData(p,a,b,c)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DQuery9_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DQuery9_AddRef(p) (p)->AddRef()
+#define IDirect3DQuery9_Release(p) (p)->Release()
+/*** IDirect3DQuery9 ***/
+#define IDirect3DQuery9_GetDevice(p,a) (p)->GetDevice(a)
+#define IDirect3DQuery9_GetType(p) (p)->GetType()
+#define IDirect3DQuery9_GetDataSize(p) (p)->GetDataSize()
+#define IDirect3DQuery9_Issue(p,a) (p)->Issue(a)
+#define IDirect3DQuery9_GetData(p,a,b,c) (p)->GetData(a,b,c)
+#endif
+
+/*****************************************************************************
+ * IDirect3DDevice9 interface
+ */
+#define INTERFACE IDirect3DDevice9
+DECLARE_INTERFACE_(IDirect3DDevice9,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DDevice9 methods ***/
+    STDMETHOD(TestCooperativeLevel)(THIS) PURE;
+    STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
+    STDMETHOD(EvictManagedResources)(THIS) PURE;
+    STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE;
+    STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE;
+    STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain, D3DDISPLAYMODE* pMode) PURE;
+    STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;
+    STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) PURE;
+    STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y, DWORD Flags) PURE;
+    STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;
+    STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) PURE;
+    STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) PURE;
+    STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE;
+    STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
+    STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) PURE;
+    STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) PURE;
+    STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) PURE;
+    STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE;
+    STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) PURE;
+    STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, D3DGAMMARAMP* pRamp) PURE;
+    STDMETHOD(CreateTexture)(THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateRenderTarget)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) PURE;
+    STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) PURE;
+    STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) PURE;
+    STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain, IDirect3DSurface9* pDestSurface) PURE;
+    STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) PURE;
+    STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) PURE;
+    STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) PURE;
+    STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) PURE;
+    STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE;
+    STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE;
+    STDMETHOD(BeginScene)(THIS) PURE;
+    STDMETHOD(EndScene)(THIS) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) PURE;
+    STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) PURE;
+    STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE, CONST D3DMATRIX*) PURE;
+    STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE;
+    STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE;
+    STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE;
+    STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE;
+    STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9*) PURE;
+    STDMETHOD(GetLight)(THIS_ DWORD Index, D3DLIGHT9*) PURE;
+    STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE;
+    STDMETHOD(GetLightEnable)(THIS_ DWORD Index, BOOL* pEnable) PURE;
+    STDMETHOD(SetClipPlane)(THIS_ DWORD Index, CONST float* pPlane) PURE;
+    STDMETHOD(GetClipPlane)(THIS_ DWORD Index, float* pPlane) PURE;
+    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE;
+    STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD* pValue) PURE;
+    STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) PURE;
+    STDMETHOD(BeginStateBlock)(THIS) PURE;
+    STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE;
+    STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE;
+    STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE;
+    STDMETHOD(GetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9** ppTexture) PURE;
+    STDMETHOD(SetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9* pTexture) PURE;
+    STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) PURE;
+    STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE;
+    STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) PURE;
+    STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
+    STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;
+    STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries) PURE;
+    STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;
+    STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;
+    STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;
+    STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE;
+    STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE;
+    STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE;
+    STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE;
+    STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE;
+    STDMETHOD_(float, GetNPatchMode)(THIS) PURE;
+    STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE;
+    STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) PURE;
+    STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
+    STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
+    STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) PURE;
+    STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) PURE;
+    STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE;
+    STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE;
+    STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
+    STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE;
+    STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) PURE;
+    STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE;
+    STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE;
+    STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT  BoolCount) PURE;
+    STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE;
+    STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) PURE;
+    STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride) PURE;
+    STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT Divider) PURE;
+    STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT* Divider) PURE;
+    STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE;
+    STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE;
+    STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) PURE;
+    STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE;
+    STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE;
+    STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT  BoolCount) PURE;
+    STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE;
+    STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE;
+    STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE;
+    STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
+    STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DDevice9_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirect3DDevice9_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirect3DDevice9 methods ***/
+#define IDirect3DDevice9_TestCooperativeLevel(p)                       (p)->lpVtbl->TestCooperativeLevel(p)
+#define IDirect3DDevice9_GetAvailableTextureMem(p)                     (p)->lpVtbl->GetAvailableTextureMem(p)
+#define IDirect3DDevice9_EvictManagedResources(p)                      (p)->lpVtbl->EvictManagedResources(p)
+#define IDirect3DDevice9_GetDirect3D(p,a)                              (p)->lpVtbl->GetDirect3D(p,a)
+#define IDirect3DDevice9_GetDeviceCaps(p,a)                            (p)->lpVtbl->GetDeviceCaps(p,a)
+#define IDirect3DDevice9_GetDisplayMode(p,a,b)                         (p)->lpVtbl->GetDisplayMode(p,a,b)
+#define IDirect3DDevice9_GetCreationParameters(p,a)                    (p)->lpVtbl->GetCreationParameters(p,a)
+#define IDirect3DDevice9_SetCursorProperties(p,a,b,c)                  (p)->lpVtbl->SetCursorProperties(p,a,b,c)
+#define IDirect3DDevice9_SetCursorPosition(p,a,b,c)                    (p)->lpVtbl->SetCursorPosition(p,a,b,c)
+#define IDirect3DDevice9_ShowCursor(p,a)                               (p)->lpVtbl->ShowCursor(p,a)
+#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b)              (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b)
+#define IDirect3DDevice9_GetSwapChain(p,a,b)                           (p)->lpVtbl->GetSwapChain(p,a,b)
+#define IDirect3DDevice9_GetNumberOfSwapChains(p)                      (p)->lpVtbl->GetNumberOfSwapChains(p)
+#define IDirect3DDevice9_Reset(p,a)                                    (p)->lpVtbl->Reset(p,a)
+#define IDirect3DDevice9_Present(p,a,b,c,d)                            (p)->lpVtbl->Present(p,a,b,c,d)
+#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d)                      (p)->lpVtbl->GetBackBuffer(p,a,b,c,d)
+#define IDirect3DDevice9_GetRasterStatus(p,a,b)                        (p)->lpVtbl->GetRasterStatus(p,a,b)
+#define IDirect3DDevice9_SetDialogBoxMode(p,a)                         (p)->lpVtbl->SetDialogBoxMode(p,a)
+#define IDirect3DDevice9_SetGammaRamp(p,a,b,c)                         (p)->lpVtbl->SetGammaRamp(p,a,b,c)
+#define IDirect3DDevice9_GetGammaRamp(p,a,b)                           (p)->lpVtbl->GetGammaRamp(p,a,b)
+#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h)              (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i)      (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g)            (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f)             (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f)
+#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f)              (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f)
+#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h)         (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h)  (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d)                      (p)->lpVtbl->UpdateSurface(p,a,b,c,d)
+#define IDirect3DDevice9_UpdateTexture(p,a,b)                          (p)->lpVtbl->UpdateTexture(p,a,b)
+#define IDirect3DDevice9_GetRenderTargetData(p,a,b)                    (p)->lpVtbl->GetRenderTargetData(p,a,b)
+#define IDirect3DDevice9_GetFrontBufferData(p,a,b)                     (p)->lpVtbl->GetFrontBufferData(p,a,b)
+#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e)                      (p)->lpVtbl->StretchRect(p,a,b,c,d,e)
+#define IDirect3DDevice9_ColorFill(p,a,b,c)                            (p)->lpVtbl->ColorFill(p,a,b,c)
+#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f)    (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f)
+#define IDirect3DDevice9_SetRenderTarget(p,a,b)                        (p)->lpVtbl->SetRenderTarget(p,a,b)
+#define IDirect3DDevice9_GetRenderTarget(p,a,b)                        (p)->lpVtbl->GetRenderTarget(p,a,b)
+#define IDirect3DDevice9_SetDepthStencilSurface(p,a)                   (p)->lpVtbl->SetDepthStencilSurface(p,a)
+#define IDirect3DDevice9_GetDepthStencilSurface(p,a)                   (p)->lpVtbl->GetDepthStencilSurface(p,a)
+#define IDirect3DDevice9_BeginScene(p)                                 (p)->lpVtbl->BeginScene(p)
+#define IDirect3DDevice9_EndScene(p)                                   (p)->lpVtbl->EndScene(p)
+#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f)                          (p)->lpVtbl->Clear(p,a,b,c,d,e,f)
+#define IDirect3DDevice9_SetTransform(p,a,b)                           (p)->lpVtbl->SetTransform(p,a,b)
+#define IDirect3DDevice9_GetTransform(p,a,b)                           (p)->lpVtbl->GetTransform(p,a,b)
+#define IDirect3DDevice9_MultiplyTransform(p,a,b)                      (p)->lpVtbl->MultiplyTransform(p,a,b)
+#define IDirect3DDevice9_SetViewport(p,a)                              (p)->lpVtbl->SetViewport(p,a)
+#define IDirect3DDevice9_GetViewport(p,a)                              (p)->lpVtbl->GetViewport(p,a)
+#define IDirect3DDevice9_SetMaterial(p,a)                              (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DDevice9_GetMaterial(p,a)                              (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DDevice9_SetLight(p,a,b)                               (p)->lpVtbl->SetLight(p,a,b)
+#define IDirect3DDevice9_GetLight(p,a,b)                               (p)->lpVtbl->GetLight(p,a,b)
+#define IDirect3DDevice9_LightEnable(p,a,b)                            (p)->lpVtbl->LightEnable(p,a,b)
+#define IDirect3DDevice9_GetLightEnable(p,a,b)                         (p)->lpVtbl->GetLightEnable(p,a,b)
+#define IDirect3DDevice9_SetClipPlane(p,a,b)                           (p)->lpVtbl->SetClipPlane(p,a,b)
+#define IDirect3DDevice9_GetClipPlane(p,a,b)                           (p)->lpVtbl->GetClipPlane(p,a,b)
+#define IDirect3DDevice9_SetRenderState(p,a,b)                         (p)->lpVtbl->SetRenderState(p,a,b)
+#define IDirect3DDevice9_GetRenderState(p,a,b)                         (p)->lpVtbl->GetRenderState(p,a,b)
+#define IDirect3DDevice9_CreateStateBlock(p,a,b)                       (p)->lpVtbl->CreateStateBlock(p,a,b)
+#define IDirect3DDevice9_BeginStateBlock(p)                            (p)->lpVtbl->BeginStateBlock(p)
+#define IDirect3DDevice9_EndStateBlock(p,a)                            (p)->lpVtbl->EndStateBlock(p,a)
+#define IDirect3DDevice9_SetClipStatus(p,a)                            (p)->lpVtbl->SetClipStatus(p,a)
+#define IDirect3DDevice9_GetClipStatus(p,a)                            (p)->lpVtbl->GetClipStatus(p,a)
+#define IDirect3DDevice9_GetTexture(p,a,b)                             (p)->lpVtbl->GetTexture(p,a,b)
+#define IDirect3DDevice9_SetTexture(p,a,b)                             (p)->lpVtbl->SetTexture(p,a,b)
+#define IDirect3DDevice9_GetTextureStageState(p,a,b,c)                 (p)->lpVtbl->GetTextureStageState(p,a,b,c)
+#define IDirect3DDevice9_SetTextureStageState(p,a,b,c)                 (p)->lpVtbl->SetTextureStageState(p,a,b,c)
+#define IDirect3DDevice9_GetSamplerState(p,a,b,c)                      (p)->lpVtbl->GetSamplerState(p,a,b,c)
+#define IDirect3DDevice9_SetSamplerState(p,a,b,c)                      (p)->lpVtbl->SetSamplerState(p,a,b,c)
+#define IDirect3DDevice9_ValidateDevice(p,a)                           (p)->lpVtbl->ValidateDevice(p,a)
+#define IDirect3DDevice9_SetPaletteEntries(p,a,b)                      (p)->lpVtbl->SetPaletteEntries(p,a,b)
+#define IDirect3DDevice9_GetPaletteEntries(p,a,b)                      (p)->lpVtbl->GetPaletteEntries(p,a,b)
+#define IDirect3DDevice9_SetCurrentTexturePalette(p,a)                 (p)->lpVtbl->SetCurrentTexturePalette(p,a)
+#define IDirect3DDevice9_GetCurrentTexturePalette(p,a)                 (p)->lpVtbl->GetCurrentTexturePalette(p,a)
+#define IDirect3DDevice9_SetScissorRect(p,a)                           (p)->lpVtbl->SetScissorRect(p,a)
+#define IDirect3DDevice9_GetScissorRect(p,a)                           (p)->lpVtbl->GetScissorRect(p,a)
+#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a)              (p)->lpVtbl->SetSoftwareVertexProcessing(p,a)
+#define IDirect3DDevice9_GetSoftwareVertexProcessing(p)                (p)->lpVtbl->GetSoftwareVertexProcessing(p)
+#define IDirect3DDevice9_SetNPatchMode(p,a)                            (p)->lpVtbl->SetNPatchMode(p,a)
+#define IDirect3DDevice9_GetNPatchMode(p)                              (p)->lpVtbl->GetNPatchMode(p)
+#define IDirect3DDevice9_DrawPrimitive(p,a,b,c)                        (p)->lpVtbl->DrawPrimitive(p,a,b,c)
+#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f)           (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f)
+#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d)                    (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d)
+#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)     (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f)                (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f)
+#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b)                (p)->lpVtbl->CreateVertexDeclaration(p,a,b)
+#define IDirect3DDevice9_SetVertexDeclaration(p,a)                     (p)->lpVtbl->SetVertexDeclaration(p,a)
+#define IDirect3DDevice9_GetVertexDeclaration(p,a)                     (p)->lpVtbl->GetVertexDeclaration(p,a)
+#define IDirect3DDevice9_SetFVF(p,a)                                   (p)->lpVtbl->SetFVF(p,a)
+#define IDirect3DDevice9_GetFVF(p,a)                                   (p)->lpVtbl->GetFVF(p,a)
+#define IDirect3DDevice9_CreateVertexShader(p,a,b)                     (p)->lpVtbl->CreateVertexShader(p,a,b)
+#define IDirect3DDevice9_SetVertexShader(p,a)                          (p)->lpVtbl->SetVertexShader(p,a)
+#define IDirect3DDevice9_GetVertexShader(p,a)                          (p)->lpVtbl->GetVertexShader(p,a)
+#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c)             (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c)             (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c)             (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c)             (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c)             (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c)             (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d)                    (p)->lpVtbl->SetStreamSource(p,a,b,c,d)
+#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d)                    (p)->lpVtbl->GetStreamSource(p,a,b,c,d)
+#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b)                    (p)->lpVtbl->SetStreamSourceFreq(p,a,b)
+#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b)                    (p)->lpVtbl->GetStreamSourceFreq(p,a,b)
+#define IDirect3DDevice9_SetIndices(p,a)                               (p)->lpVtbl->SetIndices(p,a)
+#define IDirect3DDevice9_GetIndices(p,a)                               (p)->lpVtbl->GetIndices(p,a)
+#define IDirect3DDevice9_CreatePixelShader(p,a,b)                      (p)->lpVtbl->CreatePixelShader(p,a,b)
+#define IDirect3DDevice9_SetPixelShader(p,a)                           (p)->lpVtbl->SetPixelShader(p,a)
+#define IDirect3DDevice9_GetPixelShader(p,a)                           (p)->lpVtbl->GetPixelShader(p,a)
+#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c)              (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c)              (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c)              (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c)              (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c)              (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c)              (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9_DrawRectPatch(p,a,b,c)                        (p)->lpVtbl->DrawRectPatch(p,a,b,c)
+#define IDirect3DDevice9_DrawTriPatch(p,a,b,c)                         (p)->lpVtbl->DrawTriPatch(p,a,b,c)
+#define IDirect3DDevice9_DeletePatch(p,a)                              (p)->lpVtbl->DeletePatch(p,a)
+#define IDirect3DDevice9_CreateQuery(p,a,b)                            (p)->lpVtbl->CreateQuery(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DDevice9_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice9_AddRef(p)             (p)->AddRef()
+#define IDirect3DDevice9_Release(p)            (p)->Release()
+/*** IDirect3DDevice9 methods ***/
+#define IDirect3DDevice9_TestCooperativeLevel(p)                       (p)->TestCooperativeLevel()
+#define IDirect3DDevice9_GetAvailableTextureMem(p)                     (p)->GetAvailableTextureMem()
+#define IDirect3DDevice9_EvictManagedResources(p)                      (p)->EvictManagedResources()
+#define IDirect3DDevice9_GetDirect3D(p,a)                              (p)->GetDirect3D(a)
+#define IDirect3DDevice9_GetDeviceCaps(p,a)                            (p)->GetDeviceCaps(a)
+#define IDirect3DDevice9_GetDisplayMode(p,a,b)                         (p)->GetDisplayMode(a,b)
+#define IDirect3DDevice9_GetCreationParameters(p,a)                    (p)->GetCreationParameters(a)
+#define IDirect3DDevice9_SetCursorProperties(p,a,b,c)                  (p)->SetCursorProperties(a,b,c)
+#define IDirect3DDevice9_SetCursorPosition(p,a,b,c)                    (p)->SetCursorPosition(a,b,c)
+#define IDirect3DDevice9_ShowCursor(p,a)                               (p)->ShowCursor(a)
+#define IDirect3DDevice9_CreateAdditionalSwapChain(p,a,b)              (p)->CreateAdditionalSwapChain(a,b)
+#define IDirect3DDevice9_GetSwapChain(p,a,b)                           (p)->GetSwapChain(a,b)
+#define IDirect3DDevice9_GetNumberOfSwapChains(p)                      (p)->GetNumberOfSwapChains()
+#define IDirect3DDevice9_Reset(p,a)                                    (p)->Reset(a)
+#define IDirect3DDevice9_Present(p,a,b,c,d)                            (p)->Present(a,b,c,d)
+#define IDirect3DDevice9_GetBackBuffer(p,a,b,c,d)                      (p)->GetBackBuffer(a,b,c,d)
+#define IDirect3DDevice9_GetRasterStatus(p,a,b)                        (p)->GetRasterStatus(a,b)
+#define IDirect3DDevice9_SetDialogBoxMode(p,a)                         (p)->SetDialogBoxMode(a)
+#define IDirect3DDevice9_SetGammaRamp(p,a,b,c)                         (p)->SetGammaRamp(a,b,c)
+#define IDirect3DDevice9_GetGammaRamp(p,a,b)                           (p)->GetGammaRamp(a,b)
+#define IDirect3DDevice9_CreateTexture(p,a,b,c,d,e,f,g,h)              (p)->CreateTexture(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i)      (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9_CreateCubeTexture(p,a,b,c,d,e,f,g)            (p)->CreateCubeTexture(a,b,c,d,e,f,g)
+#define IDirect3DDevice9_CreateVertexBuffer(p,a,b,c,d,e,f)             (p)->CreateVertexBuffer(a,b,c,d,e,f)
+#define IDirect3DDevice9_CreateIndexBuffer(p,a,b,c,d,e,f)              (p)->CreateIndexBuffer(a,b,c,d,e,f)
+#define IDirect3DDevice9_CreateRenderTarget(p,a,b,c,d,e,f,g,h)         (p)->CreateRenderTarget(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h)  (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_UpdateSurface(p,a,b,c,d)                      (p)->UpdateSurface(a,b,c,d)
+#define IDirect3DDevice9_UpdateTexture(p,a,b)                          (p)->UpdateTexture(a,b)
+#define IDirect3DDevice9_GetRenderTargetData(p,a,b)                    (p)->GetRenderTargetData(a,b)
+#define IDirect3DDevice9_GetFrontBufferData(p,a,b)                     (p)->GetFrontBufferData(a,b)
+#define IDirect3DDevice9_StretchRect(p,a,b,c,d,e)                      (p)->StretchRect(a,b,c,d,e)
+#define IDirect3DDevice9_ColorFill(p,a,b,c)                            (p)->ColorFill(a,b,c)
+#define IDirect3DDevice9_CreateOffscreenPlainSurface(p,a,b,c,d,e,f)    (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f)
+#define IDirect3DDevice9_SetRenderTarget(p,a,b)                        (p)->SetRenderTarget(a,b)
+#define IDirect3DDevice9_GetRenderTarget(p,a,b)                        (p)->GetRenderTarget(a,b)
+#define IDirect3DDevice9_SetDepthStencilSurface(p,a)                   (p)->SetDepthStencilSurface(a)
+#define IDirect3DDevice9_GetDepthStencilSurface(p,a)                   (p)->GetDepthStencilSurface(a)
+#define IDirect3DDevice9_BeginScene(p)                                 (p)->BeginScene()
+#define IDirect3DDevice9_EndScene(p)                                   (p)->EndScene()
+#define IDirect3DDevice9_Clear(p,a,b,c,d,e,f)                          (p)->Clear(a,b,c,d,e,f)
+#define IDirect3DDevice9_SetTransform(p,a,b)                           (p)->SetTransform(a,b)
+#define IDirect3DDevice9_GetTransform(p,a,b)                           (p)->GetTransform(a,b)
+#define IDirect3DDevice9_MultiplyTransform(p,a,b)                      (p)->MultiplyTransform(a,b)
+#define IDirect3DDevice9_SetViewport(p,a)                              (p)->SetViewport(a)
+#define IDirect3DDevice9_GetViewport(p,a)                              (p)->GetViewport(a)
+#define IDirect3DDevice9_SetMaterial(p,a)                              (p)->SetMaterial(a)
+#define IDirect3DDevice9_GetMaterial(p,a)                              (p)->GetMaterial(a)
+#define IDirect3DDevice9_SetLight(p,a,b)                               (p)->SetLight(a,b)
+#define IDirect3DDevice9_GetLight(p,a,b)                               (p)->GetLight(a,b)
+#define IDirect3DDevice9_LightEnable(p,a,b)                            (p)->LightEnable(a,b)
+#define IDirect3DDevice9_GetLightEnable(p,a,b)                         (p)->GetLightEnable(a,b)
+#define IDirect3DDevice9_SetClipPlane(p,a,b)                           (p)->SetClipPlane(a,b)
+#define IDirect3DDevice9_GetClipPlane(p,a,b)                           (p)->GetClipPlane(a,b)
+#define IDirect3DDevice9_SetRenderState(p,a,b)                         (p)->SetRenderState(a,b)
+#define IDirect3DDevice9_GetRenderState(p,a,b)                         (p)->GetRenderState(a,b)
+#define IDirect3DDevice9_CreateStateBlock(p,a,b)                       (p)->CreateStateBlock(a,b)
+#define IDirect3DDevice9_BeginStateBlock(p)                            (p)->BeginStateBlock()
+#define IDirect3DDevice9_EndStateBlock(p,a)                            (p)->EndStateBlock(a)
+#define IDirect3DDevice9_SetClipStatus(p,a)                            (p)->SetClipStatus(a)
+#define IDirect3DDevice9_GetClipStatus(p,a)                            (p)->GetClipStatus(a)
+#define IDirect3DDevice9_GetTexture(p,a,b)                             (p)->GetTexture(a,b)
+#define IDirect3DDevice9_SetTexture(p,a,b)                             (p)->SetTexture(a,b)
+#define IDirect3DDevice9_GetTextureStageState(p,a,b,c)                 (p)->GetTextureStageState(a,b,c)
+#define IDirect3DDevice9_SetTextureStageState(p,a,b,c)                 (p)->SetTextureStageState(a,b,c)
+#define IDirect3DDevice9_GetSamplerState(p,a,b,c)                      (p)->GetSamplerState(a,b,c)
+#define IDirect3DDevice9_SetSamplerState(p,a,b,c)                      (p)->SetSamplerState(a,b,c)
+#define IDirect3DDevice9_ValidateDevice(p,a)                           (p)->ValidateDevice(a)
+#define IDirect3DDevice9_SetPaletteEntries(p,a,b)                      (p)->SetPaletteEntries(a,b)
+#define IDirect3DDevice9_GetPaletteEntries(p,a,b)                      (p)->GetPaletteEntries(a,b)
+#define IDirect3DDevice9_SetCurrentTexturePalette(p,a)                 (p)->SetCurrentTexturePalette(a)
+#define IDirect3DDevice9_GetCurrentTexturePalette(p,a)                 (p)->GetCurrentTexturePalette(a)
+#define IDirect3DDevice9_SetScissorRect(p,a)                           (p)->SetScissorRect(a)
+#define IDirect3DDevice9_GetScissorRect(p,a)                           (p)->GetScissorRect(a)
+#define IDirect3DDevice9_SetSoftwareVertexProcessing(p,a)              (p)->SetSoftwareVertexProcessing(a)
+#define IDirect3DDevice9_GetSoftwareVertexProcessing(p)                (p)->GetSoftwareVertexProcessing()
+#define IDirect3DDevice9_SetNPatchMode(p,a)                            (p)->SetNPatchMode(a)
+#define IDirect3DDevice9_GetNPatchMode(p)                              (p)->GetNPatchMode()
+#define IDirect3DDevice9_DrawPrimitive(p,a,b,c)                        (p)->DrawPrimitive(a,b,c)
+#define IDirect3DDevice9_DrawIndexedPrimitive(p,a,b,c,d,e,f)           (p)->DrawIndexedPrimitive(a,b,c,d,e,f)
+#define IDirect3DDevice9_DrawPrimitiveUP(p,a,b,c,d)                    (p)->DrawPrimitiveUP(a,b,c,d)
+#define IDirect3DDevice9_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)     (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9_ProcessVertices(p,a,b,c,d,e,f)                (p)->ProcessVertices(a,b,c,d,e,f)
+#define IDirect3DDevice9_CreateVertexDeclaration(p,a,b)                (p)->CreateVertexDeclaration(a,b)
+#define IDirect3DDevice9_SetVertexDeclaration(p,a)                     (p)->SetVertexDeclaration(a)
+#define IDirect3DDevice9_GetVertexDeclaration(p,a)                     (p)->GetVertexDeclaration(a)
+#define IDirect3DDevice9_SetFVF(p,a)                                   (p)->SetFVF(a)
+#define IDirect3DDevice9_GetFVF(p,a)                                   (p)->GetFVF(a)
+#define IDirect3DDevice9_CreateVertexShader(p,a,b)                     (p)->CreateVertexShader(a,b)
+#define IDirect3DDevice9_SetVertexShader(p,a)                          (p)->SetVertexShader(a)
+#define IDirect3DDevice9_GetVertexShader(p,a)                          (p)->GetVertexShader(a)
+#define IDirect3DDevice9_SetVertexShaderConstantF(p,a,b,c)             (p)->SetVertexShaderConstantF(a,b,c)
+#define IDirect3DDevice9_GetVertexShaderConstantF(p,a,b,c)             (p)->GetVertexShaderConstantF(a,b,c)
+#define IDirect3DDevice9_SetVertexShaderConstantI(p,a,b,c)             (p)->SetVertexShaderConstantI(a,b,c)
+#define IDirect3DDevice9_GetVertexShaderConstantI(p,a,b,c)             (p)->GetVertexShaderConstantI(a,b,c)
+#define IDirect3DDevice9_SetVertexShaderConstantB(p,a,b,c)             (p)->SetVertexShaderConstantB(a,b,c)
+#define IDirect3DDevice9_GetVertexShaderConstantB(p,a,b,c)             (p)->GetVertexShaderConstantB(a,b,c)
+#define IDirect3DDevice9_SetStreamSource(p,a,b,c,d)                    (p)->SetStreamSource(a,b,c,d)
+#define IDirect3DDevice9_GetStreamSource(p,a,b,c,d)                    (p)->GetStreamSource(a,b,c,d)
+#define IDirect3DDevice9_SetStreamSourceFreq(p,a,b)                    (p)->SetStreamSourceFreq(a,b)
+#define IDirect3DDevice9_GetStreamSourceFreq(p,a,b)                    (p)->GetStreamSourceFreq(a,b)
+#define IDirect3DDevice9_SetIndices(p,a)                               (p)->SetIndices(a)
+#define IDirect3DDevice9_GetIndices(p,a)                               (p)->GetIndices(a)
+#define IDirect3DDevice9_CreatePixelShader(p,a,b)                      (p)->CreatePixelShader(a,b)
+#define IDirect3DDevice9_SetPixelShader(p,a)                           (p)->SetPixelShader(a)
+#define IDirect3DDevice9_GetPixelShader(p,a)                           (p)->GetPixelShader(a)
+#define IDirect3DDevice9_SetPixelShaderConstantF(p,a,b,c)              (p)->SetPixelShaderConstantF(a,b,c)
+#define IDirect3DDevice9_GetPixelShaderConstantF(p,a,b,c)              (p)->GetPixelShaderConstantF(a,b,c)
+#define IDirect3DDevice9_SetPixelShaderConstantI(p,a,b,c)              (p)->SetPixelShaderConstantI(a,b,c)
+#define IDirect3DDevice9_GetPixelShaderConstantI(p,a,b,c)              (p)->GetPixelShaderConstantI(a,b,c)
+#define IDirect3DDevice9_SetPixelShaderConstantB(p,a,b,c)              (p)->SetPixelShaderConstantB(a,b,c)
+#define IDirect3DDevice9_GetPixelShaderConstantB(p,a,b,c)              (p)->GetPixelShaderConstantB(a,b,c)
+#define IDirect3DDevice9_DrawRectPatch(p,a,b,c)                        (p)->DrawRectPatch(a,b,c)
+#define IDirect3DDevice9_DrawTriPatch(p,a,b,c)                         (p)->DrawTriPatch(a,b,c)
+#define IDirect3DDevice9_DeletePatch(p,a)                              (p)->DeletePatch(a)
+#define IDirect3DDevice9_CreateQuery(p,a,b)                            (p)->CreateQuery(a,b)
+#endif
+
+
+/*****************************************************************************
+ * IDirect3DDevice9Ex interface
+ */
+#define INTERFACE IDirect3DDevice9Ex
+DECLARE_INTERFACE_(IDirect3DDevice9Ex,IDirect3DDevice9)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DDevice9 methods ***/
+    STDMETHOD(TestCooperativeLevel)(THIS) PURE;
+    STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
+    STDMETHOD(EvictManagedResources)(THIS) PURE;
+    STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE;
+    STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE;
+    STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain, D3DDISPLAYMODE* pMode) PURE;
+    STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;
+    STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) PURE;
+    STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y, DWORD Flags) PURE;
+    STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;
+    STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) PURE;
+    STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) PURE;
+    STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE;
+    STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
+    STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) PURE;
+    STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) PURE;
+    STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) PURE;
+    STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE;
+    STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) PURE;
+    STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain, D3DGAMMARAMP* pRamp) PURE;
+    STDMETHOD(CreateTexture)(THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateRenderTarget)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) PURE;
+    STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) PURE;
+    STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) PURE;
+    STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain, IDirect3DSurface9* pDestSurface) PURE;
+    STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) PURE;
+    STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) PURE;
+    STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) PURE;
+    STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) PURE;
+    STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) PURE;
+    STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE;
+    STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE;
+    STDMETHOD(BeginScene)(THIS) PURE;
+    STDMETHOD(EndScene)(THIS) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) PURE;
+    STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) PURE;
+    STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE, CONST D3DMATRIX*) PURE;
+    STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE;
+    STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE;
+    STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE;
+    STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE;
+    STDMETHOD(SetLight)(THIS_ DWORD Index, CONST D3DLIGHT9*) PURE;
+    STDMETHOD(GetLight)(THIS_ DWORD Index, D3DLIGHT9*) PURE;
+    STDMETHOD(LightEnable)(THIS_ DWORD Index, BOOL Enable) PURE;
+    STDMETHOD(GetLightEnable)(THIS_ DWORD Index, BOOL* pEnable) PURE;
+    STDMETHOD(SetClipPlane)(THIS_ DWORD Index, CONST float* pPlane) PURE;
+    STDMETHOD(GetClipPlane)(THIS_ DWORD Index, float* pPlane) PURE;
+    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD Value) PURE;
+    STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State, DWORD* pValue) PURE;
+    STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) PURE;
+    STDMETHOD(BeginStateBlock)(THIS) PURE;
+    STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE;
+    STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE;
+    STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE;
+    STDMETHOD(GetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9** ppTexture) PURE;
+    STDMETHOD(SetTexture)(THIS_ DWORD Stage, IDirect3DBaseTexture9* pTexture) PURE;
+    STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) PURE;
+    STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) PURE;
+    STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) PURE;
+    STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) PURE;
+    STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;
+    STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries) PURE;
+    STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;
+    STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;
+    STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;
+    STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE;
+    STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE;
+    STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE;
+    STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE;
+    STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE;
+    STDMETHOD_(float, GetNPatchMode)(THIS) PURE;
+    STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) PURE;
+    STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) PURE;
+    STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
+    STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) PURE;
+    STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) PURE;
+    STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) PURE;
+    STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE;
+    STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE;
+    STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
+    STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE;
+    STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) PURE;
+    STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE;
+    STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE;
+    STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT  BoolCount) PURE;
+    STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE;
+    STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) PURE;
+    STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride) PURE;
+    STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT Divider) PURE;
+    STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber, UINT* Divider) PURE;
+    STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE;
+    STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE;
+    STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) PURE;
+    STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE;
+    STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE;
+    STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
+    STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
+    STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT  BoolCount) PURE;
+    STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount) PURE;
+    STDMETHOD(DrawRectPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE;
+    STDMETHOD(DrawTriPatch)(THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE;
+    STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
+    STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) PURE;
+    /* IDirect3DDevice9Ex methods */
+    STDMETHOD(SetConvolutionMonoKernel)(THIS_ UINT width, UINT height, float *rows, float *columns) PURE;
+    STDMETHOD(ComposeRects)(THIS_ IDirect3DSurface9 *src_surface, IDirect3DSurface9 *dst_surface,
+            IDirect3DVertexBuffer9 *src_descs, UINT rect_count, IDirect3DVertexBuffer9 *dst_descs,
+            D3DCOMPOSERECTSOP operation, INT offset_x, INT offset_y) PURE;
+    STDMETHOD(PresentEx)(THIS_ CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion, DWORD dwFlags) PURE;
+    STDMETHOD(GetGPUThreadPriority)(THIS_ INT *pPriority) PURE;
+    STDMETHOD(SetGPUThreadPriority)(THIS_ INT Priority) PURE;
+    STDMETHOD(WaitForVBlank)(THIS_ UINT iSwapChain) PURE;
+    STDMETHOD(CheckResourceResidency)(THIS_ IDirect3DResource9 **resources, UINT32 resource_count) PURE;
+    STDMETHOD(SetMaximumFrameLatency)(THIS_ UINT MaxLatency) PURE;
+    STDMETHOD(GetMaximumFrameLatency)(THIS_ UINT *pMaxLatenxy) PURE;
+    STDMETHOD(CheckDeviceState)(THIS_ HWND dst_window) PURE;
+    STDMETHOD(CreateRenderTargetEx)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultiSampleQuality, BOOL Lockable, IDirect3DSurface9 ** ppSurface, HANDLE *pSharedHandle, DWORD Usage) PURE;
+    STDMETHOD(CreateOffscreenPlainSurfaceEx)(THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9 **ppSurface, HANDLE *pSharedHandle, DWORD Usage) PURE;
+    STDMETHOD(CreateDepthStencilSurfaceEx)(THIS_ UINT width, UINT height, D3DFORMAT format,
+            D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL discard,
+            IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage) PURE;
+    STDMETHOD(ResetEx)(THIS_ D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode) PURE;
+    STDMETHOD(GetDisplayModeEx)(THIS_ UINT iSwapChain, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DDevice9Ex_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirect3DDevice9Ex_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirect3DDevice9 methods ***/
+#define IDirect3DDevice9Ex_TestCooperativeLevel(p)                       (p)->lpVtbl->TestCooperativeLevel(p)
+#define IDirect3DDevice9Ex_GetAvailableTextureMem(p)                     (p)->lpVtbl->GetAvailableTextureMem(p)
+#define IDirect3DDevice9Ex_EvictManagedResources(p)                      (p)->lpVtbl->EvictManagedResources(p)
+#define IDirect3DDevice9Ex_GetDirect3D(p,a)                              (p)->lpVtbl->GetDirect3D(p,a)
+#define IDirect3DDevice9Ex_GetDeviceCaps(p,a)                            (p)->lpVtbl->GetDeviceCaps(p,a)
+#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b)                         (p)->lpVtbl->GetDisplayMode(p,a,b)
+#define IDirect3DDevice9Ex_GetCreationParameters(p,a)                    (p)->lpVtbl->GetCreationParameters(p,a)
+#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c)                  (p)->lpVtbl->SetCursorProperties(p,a,b,c)
+#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c)                    (p)->lpVtbl->SetCursorPosition(p,a,b,c)
+#define IDirect3DDevice9Ex_ShowCursor(p,a)                               (p)->lpVtbl->ShowCursor(p,a)
+#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b)              (p)->lpVtbl->CreateAdditionalSwapChain(p,a,b)
+#define IDirect3DDevice9Ex_GetSwapChain(p,a,b)                           (p)->lpVtbl->GetSwapChain(p,a,b)
+#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p)                      (p)->lpVtbl->GetNumberOfSwapChains(p)
+#define IDirect3DDevice9Ex_Reset(p,a)                                    (p)->lpVtbl->Reset(p,a)
+#define IDirect3DDevice9Ex_Present(p,a,b,c,d)                            (p)->lpVtbl->Present(p,a,b,c,d)
+#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d)                      (p)->lpVtbl->GetBackBuffer(p,a,b,c,d)
+#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b)                        (p)->lpVtbl->GetRasterStatus(p,a,b)
+#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a)                         (p)->lpVtbl->SetDialogBoxMode(p,a)
+#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c)                         (p)->lpVtbl->SetGammaRamp(p,a,b,c)
+#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b)                           (p)->lpVtbl->GetGammaRamp(p,a,b)
+#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h)              (p)->lpVtbl->CreateTexture(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i)      (p)->lpVtbl->CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g)            (p)->lpVtbl->CreateCubeTexture(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f)             (p)->lpVtbl->CreateVertexBuffer(p,a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f)              (p)->lpVtbl->CreateIndexBuffer(p,a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h)         (p)->lpVtbl->CreateRenderTarget(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h)  (p)->lpVtbl->CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d)                      (p)->lpVtbl->UpdateSurface(p,a,b,c,d)
+#define IDirect3DDevice9Ex_UpdateTexture(p,a,b)                          (p)->lpVtbl->UpdateTexture(p,a,b)
+#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b)                    (p)->lpVtbl->GetRenderTargetData(p,a,b)
+#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b)                     (p)->lpVtbl->GetFrontBufferData(p,a,b)
+#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e)                      (p)->lpVtbl->StretchRect(p,a,b,c,d,e)
+#define IDirect3DDevice9Ex_ColorFill(p,a,b,c)                            (p)->lpVtbl->ColorFill(p,a,b,c)
+#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f)    (p)->lpVtbl->CreateOffscreenPlainSurface(p,a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b)                        (p)->lpVtbl->SetRenderTarget(p,a,b)
+#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b)                        (p)->lpVtbl->GetRenderTarget(p,a,b)
+#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a)                   (p)->lpVtbl->SetDepthStencilSurface(p,a)
+#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a)                   (p)->lpVtbl->GetDepthStencilSurface(p,a)
+#define IDirect3DDevice9Ex_BeginScene(p)                                 (p)->lpVtbl->BeginScene(p)
+#define IDirect3DDevice9Ex_EndScene(p)                                   (p)->lpVtbl->EndScene(p)
+#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f)                          (p)->lpVtbl->Clear(p,a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_SetTransform(p,a,b)                           (p)->lpVtbl->SetTransform(p,a,b)
+#define IDirect3DDevice9Ex_GetTransform(p,a,b)                           (p)->lpVtbl->GetTransform(p,a,b)
+#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b)                      (p)->lpVtbl->MultiplyTransform(p,a,b)
+#define IDirect3DDevice9Ex_SetViewport(p,a)                              (p)->lpVtbl->SetViewport(p,a)
+#define IDirect3DDevice9Ex_GetViewport(p,a)                              (p)->lpVtbl->GetViewport(p,a)
+#define IDirect3DDevice9Ex_SetMaterial(p,a)                              (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DDevice9Ex_GetMaterial(p,a)                              (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DDevice9Ex_SetLight(p,a,b)                               (p)->lpVtbl->SetLight(p,a,b)
+#define IDirect3DDevice9Ex_GetLight(p,a,b)                               (p)->lpVtbl->GetLight(p,a,b)
+#define IDirect3DDevice9Ex_LightEnable(p,a,b)                            (p)->lpVtbl->LightEnable(p,a,b)
+#define IDirect3DDevice9Ex_GetLightEnable(p,a,b)                         (p)->lpVtbl->GetLightEnable(p,a,b)
+#define IDirect3DDevice9Ex_SetClipPlane(p,a,b)                           (p)->lpVtbl->SetClipPlane(p,a,b)
+#define IDirect3DDevice9Ex_GetClipPlane(p,a,b)                           (p)->lpVtbl->GetClipPlane(p,a,b)
+#define IDirect3DDevice9Ex_SetRenderState(p,a,b)                         (p)->lpVtbl->SetRenderState(p,a,b)
+#define IDirect3DDevice9Ex_GetRenderState(p,a,b)                         (p)->lpVtbl->GetRenderState(p,a,b)
+#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b)                       (p)->lpVtbl->CreateStateBlock(p,a,b)
+#define IDirect3DDevice9Ex_BeginStateBlock(p)                            (p)->lpVtbl->BeginStateBlock(p)
+#define IDirect3DDevice9Ex_EndStateBlock(p,a)                            (p)->lpVtbl->EndStateBlock(p,a)
+#define IDirect3DDevice9Ex_SetClipStatus(p,a)                            (p)->lpVtbl->SetClipStatus(p,a)
+#define IDirect3DDevice9Ex_GetClipStatus(p,a)                            (p)->lpVtbl->GetClipStatus(p,a)
+#define IDirect3DDevice9Ex_GetTexture(p,a,b)                             (p)->lpVtbl->GetTexture(p,a,b)
+#define IDirect3DDevice9Ex_SetTexture(p,a,b)                             (p)->lpVtbl->SetTexture(p,a,b)
+#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c)                 (p)->lpVtbl->GetTextureStageState(p,a,b,c)
+#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c)                 (p)->lpVtbl->SetTextureStageState(p,a,b,c)
+#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c)                      (p)->lpVtbl->GetSamplerState(p,a,b,c)
+#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c)                      (p)->lpVtbl->SetSamplerState(p,a,b,c)
+#define IDirect3DDevice9Ex_ValidateDevice(p,a)                           (p)->lpVtbl->ValidateDevice(p,a)
+#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b)                      (p)->lpVtbl->SetPaletteEntries(p,a,b)
+#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b)                      (p)->lpVtbl->GetPaletteEntries(p,a,b)
+#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a)                 (p)->lpVtbl->SetCurrentTexturePalette(p,a)
+#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a)                 (p)->lpVtbl->GetCurrentTexturePalette(p,a)
+#define IDirect3DDevice9Ex_SetScissorRect(p,a)                           (p)->lpVtbl->SetScissorRect(p,a)
+#define IDirect3DDevice9Ex_GetScissorRect(p,a)                           (p)->lpVtbl->GetScissorRect(p,a)
+#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a)              (p)->lpVtbl->SetSoftwareVertexProcessing(p,a)
+#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p)                (p)->lpVtbl->GetSoftwareVertexProcessing(p)
+#define IDirect3DDevice9Ex_SetNPatchMode(p,a)                            (p)->lpVtbl->SetNPatchMode(p,a)
+#define IDirect3DDevice9Ex_GetNPatchMode(p)                              (p)->lpVtbl->GetNPatchMode(p)
+#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c)                        (p)->lpVtbl->DrawPrimitive(p,a,b,c)
+#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f)           (p)->lpVtbl->DrawIndexedPrimitive(p,a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d)                    (p)->lpVtbl->DrawPrimitiveUP(p,a,b,c,d)
+#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)     (p)->lpVtbl->DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f)                (p)->lpVtbl->ProcessVertices(p,a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b)                (p)->lpVtbl->CreateVertexDeclaration(p,a,b)
+#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a)                     (p)->lpVtbl->SetVertexDeclaration(p,a)
+#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a)                     (p)->lpVtbl->GetVertexDeclaration(p,a)
+#define IDirect3DDevice9Ex_SetFVF(p,a)                                   (p)->lpVtbl->SetFVF(p,a)
+#define IDirect3DDevice9Ex_GetFVF(p,a)                                   (p)->lpVtbl->GetFVF(p,a)
+#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b)                     (p)->lpVtbl->CreateVertexShader(p,a,b)
+#define IDirect3DDevice9Ex_SetVertexShader(p,a)                          (p)->lpVtbl->SetVertexShader(p,a)
+#define IDirect3DDevice9Ex_GetVertexShader(p,a)                          (p)->lpVtbl->GetVertexShader(p,a)
+#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c)             (p)->lpVtbl->SetVertexShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c)             (p)->lpVtbl->GetVertexShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c)             (p)->lpVtbl->SetVertexShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c)             (p)->lpVtbl->GetVertexShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c)             (p)->lpVtbl->SetVertexShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c)             (p)->lpVtbl->GetVertexShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d)                    (p)->lpVtbl->SetStreamSource(p,a,b,c,d)
+#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d)                    (p)->lpVtbl->GetStreamSource(p,a,b,c,d)
+#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b)                    (p)->lpVtbl->SetStreamSourceFreq(p,a,b)
+#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b)                    (p)->lpVtbl->GetStreamSourceFreq(p,a,b)
+#define IDirect3DDevice9Ex_SetIndices(p,a)                               (p)->lpVtbl->SetIndices(p,a)
+#define IDirect3DDevice9Ex_GetIndices(p,a)                               (p)->lpVtbl->GetIndices(p,a)
+#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b)                      (p)->lpVtbl->CreatePixelShader(p,a,b)
+#define IDirect3DDevice9Ex_SetPixelShader(p,a)                           (p)->lpVtbl->SetPixelShader(p,a)
+#define IDirect3DDevice9Ex_GetPixelShader(p,a)                           (p)->lpVtbl->GetPixelShader(p,a)
+#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c)              (p)->lpVtbl->SetPixelShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c)              (p)->lpVtbl->GetPixelShaderConstantF(p,a,b,c)
+#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c)              (p)->lpVtbl->SetPixelShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c)              (p)->lpVtbl->GetPixelShaderConstantI(p,a,b,c)
+#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c)              (p)->lpVtbl->SetPixelShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c)              (p)->lpVtbl->GetPixelShaderConstantB(p,a,b,c)
+#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c)                        (p)->lpVtbl->DrawRectPatch(p,a,b,c)
+#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c)                         (p)->lpVtbl->DrawTriPatch(p,a,b,c)
+#define IDirect3DDevice9Ex_DeletePatch(p,a)                              (p)->lpVtbl->DeletePatch(p,a)
+#define IDirect3DDevice9Ex_CreateQuery(p,a,b)                            (p)->lpVtbl->CreateQuery(p,a,b)
+/* IDirect3DDevice9Ex */
+#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d)           (p)->lpVtbl->SetConvolutionMonoKernel(p,a,b,c,d)
+#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h)               (p)->lpVtbl->ComposeRects(p,a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e)                        (p)->lpVtbl->PresentEx(p,a,b,c,d,e)
+#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a)                     (p)->lpVtbl->GetGPUThreadPriority(p,a)
+#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a)                     (p)->lpVtbl->SetGPUThreadPriority(p,a)
+#define IDirect3DDevice9Ex_WaitForVBlank(p,a)                            (p)->lpVtbl->WaitForVBlank(p,a)
+#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b)                 (p)->lpVtbl->CheckResourceResidency(p,a,b)
+#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a)                   (p)->lpVtbl->SetMaximumFrameLatency(p,a)
+#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a)                   (p)->lpVtbl->GetMaximumFrameLatency(p,a)
+#define IDirect3DDevice9Ex_CheckDeviceState(p,a)                         (p)->lpVtbl->CheckDeviceState(p,a)
+#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i)     (p)->lpVtbl->CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g)(p)->lpVtbl->CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g)
+#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i)(p)->lpVtbl->CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9Ex_ResetEx(p,a,b)                                 (p)->lpVtbl->ResetEx(p,a,b)
+#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c)                     (p)->lpVtbl->GetDisplayModeEx(p,a,b,c)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DDevice9Ex_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirect3DDevice9Ex_AddRef(p)             (p)->AddRef()
+#define IDirect3DDevice9Ex_Release(p)            (p)->Release()
+/*** IDirect3DDevice9 methods ***/
+#define IDirect3DDevice9Ex_TestCooperativeLevel(p)                       (p)->TestCooperativeLevel()
+#define IDirect3DDevice9Ex_GetAvailableTextureMem(p)                     (p)->GetAvailableTextureMem()
+#define IDirect3DDevice9Ex_EvictManagedResources(p)                      (p)->EvictManagedResources()
+#define IDirect3DDevice9Ex_GetDirect3D(p,a)                              (p)->GetDirect3D(a)
+#define IDirect3DDevice9Ex_GetDeviceCaps(p,a)                            (p)->GetDeviceCaps(a)
+#define IDirect3DDevice9Ex_GetDisplayMode(p,a,b)                         (p)->GetDisplayMode(a,b)
+#define IDirect3DDevice9Ex_GetCreationParameters(p,a)                    (p)->GetCreationParameters(a)
+#define IDirect3DDevice9Ex_SetCursorProperties(p,a,b,c)                  (p)->SetCursorProperties(a,b,c)
+#define IDirect3DDevice9Ex_SetCursorPosition(p,a,b,c)                    (p)->SetCursorPosition(a,b,c)
+#define IDirect3DDevice9Ex_ShowCursor(p,a)                               (p)->ShowCursor(a)
+#define IDirect3DDevice9Ex_CreateAdditionalSwapChain(p,a,b)              (p)->CreateAdditionalSwapChain(a,b)
+#define IDirect3DDevice9Ex_GetSwapChain(p,a,b)                           (p)->GetSwapChain(a,b)
+#define IDirect3DDevice9Ex_GetNumberOfSwapChains(p)                      (p)->GetNumberOfSwapChains()
+#define IDirect3DDevice9Ex_Reset(p,a)                                    (p)->Reset(a)
+#define IDirect3DDevice9Ex_Present(p,a,b,c,d)                            (p)->Present(a,b,c,d)
+#define IDirect3DDevice9Ex_GetBackBuffer(p,a,b,c,d)                      (p)->GetBackBuffer(a,b,c,d)
+#define IDirect3DDevice9Ex_GetRasterStatus(p,a,b)                        (p)->GetRasterStatus(a,b)
+#define IDirect3DDevice9Ex_SetDialogBoxMode(p,a)                         (p)->SetDialogBoxMode(a)
+#define IDirect3DDevice9Ex_SetGammaRamp(p,a,b,c)                         (p)->SetGammaRamp(a,b,c)
+#define IDirect3DDevice9Ex_GetGammaRamp(p,a,b)                           (p)->GetGammaRamp(a,b)
+#define IDirect3DDevice9Ex_CreateTexture(p,a,b,c,d,e,f,g,h)              (p)->CreateTexture(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_CreateVolumeTexture(p,a,b,c,d,e,f,g,h,i)      (p)->CreateVolumeTexture(a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9Ex_CreateCubeTexture(p,a,b,c,d,e,f,g)            (p)->CreateCubeTexture(a,b,c,d,e,f,g)
+#define IDirect3DDevice9Ex_CreateVertexBuffer(p,a,b,c,d,e,f)             (p)->CreateVertexBuffer(a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_CreateIndexBuffer(p,a,b,c,d,e,f)              (p)->CreateIndexBuffer(a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_CreateRenderTarget(p,a,b,c,d,e,f,g,h)         (p)->CreateRenderTarget(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_CreateDepthStencilSurface(p,a,b,c,d,e,f,g,h)  (p)->CreateDepthStencilSurface(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_UpdateSurface(p,a,b,c,d)                      (p)->UpdateSurface(a,b,c,d)
+#define IDirect3DDevice9Ex_UpdateTexture(p,a,b)                          (p)->UpdateTexture(a,b)
+#define IDirect3DDevice9Ex_GetRenderTargetData(p,a,b)                    (p)->GetRenderTargetData(a,b)
+#define IDirect3DDevice9Ex_GetFrontBufferData(p,a,b)                     (p)->GetFrontBufferData(a,b)
+#define IDirect3DDevice9Ex_StretchRect(p,a,b,c,d,e)                      (p)->StretchRect(a,b,c,d,e)
+#define IDirect3DDevice9Ex_ColorFill(p,a,b,c)                            (p)->ColorFill(a,b,c)
+#define IDirect3DDevice9Ex_CreateOffscreenPlainSurface(p,a,b,c,d,e,f)    (p)->CreateOffscreenPlainSurface(a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_SetRenderTarget(p,a,b)                        (p)->SetRenderTarget(a,b)
+#define IDirect3DDevice9Ex_GetRenderTarget(p,a,b)                        (p)->GetRenderTarget(a,b)
+#define IDirect3DDevice9Ex_SetDepthStencilSurface(p,a)                   (p)->SetDepthStencilSurface(a)
+#define IDirect3DDevice9Ex_GetDepthStencilSurface(p,a)                   (p)->GetDepthStencilSurface(a)
+#define IDirect3DDevice9Ex_BeginScene(p)                                 (p)->BeginScene()
+#define IDirect3DDevice9Ex_EndScene(p)                                   (p)->EndScene()
+#define IDirect3DDevice9Ex_Clear(p,a,b,c,d,e,f)                          (p)->Clear(a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_SetTransform(p,a,b)                           (p)->SetTransform(a,b)
+#define IDirect3DDevice9Ex_GetTransform(p,a,b)                           (p)->GetTransform(a,b)
+#define IDirect3DDevice9Ex_MultiplyTransform(p,a,b)                      (p)->MultiplyTransform(a,b)
+#define IDirect3DDevice9Ex_SetViewport(p,a)                              (p)->SetViewport(a)
+#define IDirect3DDevice9Ex_GetViewport(p,a)                              (p)->GetViewport(a)
+#define IDirect3DDevice9Ex_SetMaterial(p,a)                              (p)->SetMaterial(a)
+#define IDirect3DDevice9Ex_GetMaterial(p,a)                              (p)->GetMaterial(a)
+#define IDirect3DDevice9Ex_SetLight(p,a,b)                               (p)->SetLight(a,b)
+#define IDirect3DDevice9Ex_GetLight(p,a,b)                               (p)->GetLight(a,b)
+#define IDirect3DDevice9Ex_LightEnable(p,a,b)                            (p)->LightEnable(a,b)
+#define IDirect3DDevice9Ex_GetLightEnable(p,a,b)                         (p)->GetLightEnable(a,b)
+#define IDirect3DDevice9Ex_SetClipPlane(p,a,b)                           (p)->SetClipPlane(a,b)
+#define IDirect3DDevice9Ex_GetClipPlane(p,a,b)                           (p)->GetClipPlane(a,b)
+#define IDirect3DDevice9Ex_SetRenderState(p,a,b)                         (p)->SetRenderState(a,b)
+#define IDirect3DDevice9Ex_GetRenderState(p,a,b)                         (p)->GetRenderState(a,b)
+#define IDirect3DDevice9Ex_CreateStateBlock(p,a,b)                       (p)->CreateStateBlock(a,b)
+#define IDirect3DDevice9Ex_BeginStateBlock(p)                            (p)->BeginStateBlock()
+#define IDirect3DDevice9Ex_EndStateBlock(p,a)                            (p)->EndStateBlock(a)
+#define IDirect3DDevice9Ex_SetClipStatus(p,a)                            (p)->SetClipStatus(a)
+#define IDirect3DDevice9Ex_GetClipStatus(p,a)                            (p)->GetClipStatus(a)
+#define IDirect3DDevice9Ex_GetTexture(p,a,b)                             (p)->GetTexture(a,b)
+#define IDirect3DDevice9Ex_SetTexture(p,a,b)                             (p)->SetTexture(a,b)
+#define IDirect3DDevice9Ex_GetTextureStageState(p,a,b,c)                 (p)->GetTextureStageState(a,b,c)
+#define IDirect3DDevice9Ex_SetTextureStageState(p,a,b,c)                 (p)->SetTextureStageState(a,b,c)
+#define IDirect3DDevice9Ex_GetSamplerState(p,a,b,c)                      (p)->GetSamplerState(a,b,c)
+#define IDirect3DDevice9Ex_SetSamplerState(p,a,b,c)                      (p)->SetSamplerState(a,b,c)
+#define IDirect3DDevice9Ex_ValidateDevice(p,a)                           (p)->ValidateDevice(a)
+#define IDirect3DDevice9Ex_SetPaletteEntries(p,a,b)                      (p)->SetPaletteEntries(a,b)
+#define IDirect3DDevice9Ex_GetPaletteEntries(p,a,b)                      (p)->GetPaletteEntries(a,b)
+#define IDirect3DDevice9Ex_SetCurrentTexturePalette(p,a)                 (p)->SetCurrentTexturePalette(a)
+#define IDirect3DDevice9Ex_GetCurrentTexturePalette(p,a)                 (p)->GetCurrentTexturePalette(a)
+#define IDirect3DDevice9Ex_SetScissorRect(p,a)                           (p)->SetScissorRect(a)
+#define IDirect3DDevice9Ex_GetScissorRect(p,a)                           (p)->GetScissorRect(a)
+#define IDirect3DDevice9Ex_SetSoftwareVertexProcessing(p,a)              (p)->SetSoftwareVertexProcessing(a)
+#define IDirect3DDevice9Ex_GetSoftwareVertexProcessing(p)                (p)->GetSoftwareVertexProcessing()
+#define IDirect3DDevice9Ex_SetNPatchMode(p,a)                            (p)->SetNPatchMode(a)
+#define IDirect3DDevice9Ex_GetNPatchMode(p)                              (p)->GetNPatchMode()
+#define IDirect3DDevice9Ex_DrawPrimitive(p,a,b,c)                        (p)->DrawPrimitive(a,b,c)
+#define IDirect3DDevice9Ex_DrawIndexedPrimitive(p,a,b,c,d,e,f)           (p)->DrawIndexedPrimitive(a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_DrawPrimitiveUP(p,a,b,c,d)                    (p)->DrawPrimitiveUP(a,b,c,d)
+#define IDirect3DDevice9Ex_DrawIndexedPrimitiveUP(p,a,b,c,d,e,f,g,h)     (p)->DrawIndexedPrimitiveUP(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_ProcessVertices(p,a,b,c,d,e,f)                (p)->ProcessVertices(a,b,c,d,e,f)
+#define IDirect3DDevice9Ex_CreateVertexDeclaration(p,a,b)                (p)->CreateVertexDeclaration(a,b)
+#define IDirect3DDevice9Ex_SetVertexDeclaration(p,a)                     (p)->SetVertexDeclaration(a)
+#define IDirect3DDevice9Ex_GetVertexDeclaration(p,a)                     (p)->GetVertexDeclaration(a)
+#define IDirect3DDevice9Ex_SetFVF(p,a)                                   (p)->SetFVF(a)
+#define IDirect3DDevice9Ex_GetFVF(p,a)                                   (p)->GetFVF(a)
+#define IDirect3DDevice9Ex_CreateVertexShader(p,a,b)                     (p)->CreateVertexShader(a,b)
+#define IDirect3DDevice9Ex_SetVertexShader(p,a)                          (p)->SetVertexShader(a)
+#define IDirect3DDevice9Ex_GetVertexShader(p,a)                          (p)->GetVertexShader(a)
+#define IDirect3DDevice9Ex_SetVertexShaderConstantF(p,a,b,c)             (p)->SetVertexShaderConstantF(a,b,c)
+#define IDirect3DDevice9Ex_GetVertexShaderConstantF(p,a,b,c)             (p)->GetVertexShaderConstantF(a,b,c)
+#define IDirect3DDevice9Ex_SetVertexShaderConstantI(p,a,b,c)             (p)->SetVertexShaderConstantI(a,b,c)
+#define IDirect3DDevice9Ex_GetVertexShaderConstantI(p,a,b,c)             (p)->GetVertexShaderConstantI(a,b,c)
+#define IDirect3DDevice9Ex_SetVertexShaderConstantB(p,a,b,c)             (p)->SetVertexShaderConstantB(a,b,c)
+#define IDirect3DDevice9Ex_GetVertexShaderConstantB(p,a,b,c)             (p)->GetVertexShaderConstantB(a,b,c)
+#define IDirect3DDevice9Ex_SetStreamSource(p,a,b,c,d)                    (p)->SetStreamSource(a,b,c,d)
+#define IDirect3DDevice9Ex_GetStreamSource(p,a,b,c,d)                    (p)->GetStreamSource(a,b,c,d)
+#define IDirect3DDevice9Ex_SetStreamSourceFreq(p,a,b)                    (p)->SetStreamSourceFreq(a,b)
+#define IDirect3DDevice9Ex_GetStreamSourceFreq(p,a,b)                    (p)->GetStreamSourceFreq(a,b)
+#define IDirect3DDevice9Ex_SetIndices(p,a)                               (p)->SetIndices(a)
+#define IDirect3DDevice9Ex_GetIndices(p,a)                               (p)->GetIndices(a)
+#define IDirect3DDevice9Ex_CreatePixelShader(p,a,b)                      (p)->CreatePixelShader(a,b)
+#define IDirect3DDevice9Ex_SetPixelShader(p,a)                           (p)->SetPixelShader(a)
+#define IDirect3DDevice9Ex_GetPixelShader(p,a)                           (p)->GetPixelShader(a)
+#define IDirect3DDevice9Ex_SetPixelShaderConstantF(p,a,b,c)              (p)->SetPixelShaderConstantF(a,b,c)
+#define IDirect3DDevice9Ex_GetPixelShaderConstantF(p,a,b,c)              (p)->GetPixelShaderConstantF(a,b,c)
+#define IDirect3DDevice9Ex_SetPixelShaderConstantI(p,a,b,c)              (p)->SetPixelShaderConstantI(a,b,c)
+#define IDirect3DDevice9Ex_GetPixelShaderConstantI(p,a,b,c)              (p)->GetPixelShaderConstantI(a,b,c)
+#define IDirect3DDevice9Ex_SetPixelShaderConstantB(p,a,b,c)              (p)->SetPixelShaderConstantB(a,b,c)
+#define IDirect3DDevice9Ex_GetPixelShaderConstantB(p,a,b,c)              (p)->GetPixelShaderConstantB(a,b,c)
+#define IDirect3DDevice9Ex_DrawRectPatch(p,a,b,c)                        (p)->DrawRectPatch(a,b,c)
+#define IDirect3DDevice9Ex_DrawTriPatch(p,a,b,c)                         (p)->DrawTriPatch(a,b,c)
+#define IDirect3DDevice9Ex_DeletePatch(p,a)                              (p)->DeletePatch(a)
+#define IDirect3DDevice9Ex_CreateQuery(p,a,b)                            (p)->CreateQuery(a,b)
+/* IDirect3DDevice9Ex */
+#define IDirect3DDevice9Ex_SetConvolutionMonoKernel(p,a,b,c,d)           (p)->SetConvolutionMonoKernel(a,b,c,d)
+#define IDirect3DDevice9Ex_ComposeRects(p,a,b,c,d,e,f,g,h)               (p)->ComposeRects(a,b,c,d,e,f,g,h)
+#define IDirect3DDevice9Ex_PresentEx(p,a,b,c,d,e)                        (p)->PresentEx(a,b,c,d,e)
+#define IDirect3DDevice9Ex_GetGPUThreadPriority(p,a)                     (p)->GetGPUThreadPriority(a)
+#define IDirect3DDevice9Ex_SetGPUThreadPriority(p,a)                     (p)->SetGPUThreadPriority(a)
+#define IDirect3DDevice9Ex_WaitForVBlank(p,a)                            (p)->WaitForVBlank(a)
+#define IDirect3DDevice9Ex_CheckResourceResidency(p,a,b)                 (p)->CheckResourceResidency(a,b)
+#define IDirect3DDevice9Ex_SetMaximumFrameLatency(p,a)                   (p)->SetMaximumFrameLatency(a)
+#define IDirect3DDevice9Ex_GetMaximumFrameLatency(p,a)                   (p)->GetMaximumFrameLatency(a)
+#define IDirect3DDevice9Ex_CheckDeviceState(p,a)                         (p)->CheckDeviceState(a)
+#define IDirect3DDevice9Ex_CreateRenderTargetEx(p,a,b,c,d,e,f,g,h,i)     (p)->CreateRenderTargetEx(a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9Ex_CreateOffscreenPlainSurfaceEx(p,a,b,c,d,e,f,g)(p)->CreateOffscreenPlainSurfaceEx(a,b,c,d,e,f,g)
+#define IDirect3DDevice9Ex_CreateDepthStencilSurfaceEx(p,a,b,c,d,e,f,g,h,i)(p)->CreateDepthStencilSurfaceEx(a,b,c,d,e,f,g,h,i)
+#define IDirect3DDevice9Ex_ResetEx(p,a,b)                                (p)->ResetEx(a,b)
+#define IDirect3DDevice9Ex_GetDisplayModeEx(p,a,b,c)                     (p)->GetDisplayModeEx(a,b,c)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif  /* defined(__cplusplus) */
+
+int         WINAPI D3DPERF_BeginEvent(D3DCOLOR,LPCWSTR);
+int         WINAPI D3DPERF_EndEvent(void);
+DWORD       WINAPI D3DPERF_GetStatus(void);
+BOOL        WINAPI D3DPERF_QueryRepeatFrame(void);
+void        WINAPI D3DPERF_SetMarker(D3DCOLOR,LPCWSTR);
+void        WINAPI D3DPERF_SetOptions(DWORD);
+void        WINAPI D3DPERF_SetRegion(D3DCOLOR,LPCWSTR);
+
+/* Define the main entrypoint as well */
+IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
+
+
+#endif /* __WINE_D3D9_H */
diff --git a/misc/builddeps/dp.win32/include/d3d9caps.h b/misc/builddeps/dp.win32/include/d3d9caps.h
new file mode 100644 (file)
index 0000000..8ed6598
--- /dev/null
@@ -0,0 +1,395 @@
+/*
+ * Copyright (C) 2002-2003 Jason Edmeades
+ *                         Raphael Junqueira
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D9CAPS_H
+#define __WINE_D3D9CAPS_H
+
+/*
+ * Definitions
+ */
+#define D3DCAPS_READ_SCANLINE 0x20000
+
+#define D3DCURSORCAPS_COLOR   1
+#define D3DCURSORCAPS_LOWRES  2
+
+
+#define D3DDEVCAPS2_STREAMOFFSET                        0x00000001L
+#define D3DDEVCAPS2_DMAPNPATCH                          0x00000002L
+#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH                 0x00000004L
+#define D3DDEVCAPS2_ADAPTIVETESSNPATCH                  0x00000008L
+#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES       0x00000010L
+#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH                0x00000020L
+#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET  0x00000040L
+
+#define D3DDEVCAPS_EXECUTESYSTEMMEMORY     0x0000010
+#define D3DDEVCAPS_EXECUTEVIDEOMEMORY      0x0000020
+#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY    0x0000040
+#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY     0x0000080
+#define D3DDEVCAPS_TEXTURESYSTEMMEMORY     0x0000100
+#define D3DDEVCAPS_TEXTUREVIDEOMEMORY      0x0000200
+#define D3DDEVCAPS_DRAWPRIMTLVERTEX        0x0000400
+#define D3DDEVCAPS_CANRENDERAFTERFLIP      0x0000800
+#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM   0x0001000
+#define D3DDEVCAPS_DRAWPRIMITIVES2         0x0002000
+#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x0004000
+#define D3DDEVCAPS_DRAWPRIMITIVES2EX       0x0008000
+#define D3DDEVCAPS_HWTRANSFORMANDLIGHT     0x0010000
+#define D3DDEVCAPS_CANBLTSYSTONONLOCAL     0x0020000
+#define D3DDEVCAPS_HWRASTERIZATION         0x0080000
+#define D3DDEVCAPS_PUREDEVICE              0x0100000
+#define D3DDEVCAPS_QUINTICRTPATCHES        0x0200000
+#define D3DDEVCAPS_RTPATCHES               0x0400000
+#define D3DDEVCAPS_RTPATCHHANDLEZERO       0x0800000
+#define D3DDEVCAPS_NPATCHES                0x1000000
+
+#define D3DFVFCAPS_TEXCOORDCOUNTMASK  0x00FFFF
+#define D3DFVFCAPS_DONOTSTRIPELEMENTS 0x080000
+#define D3DFVFCAPS_PSIZE              0x100000
+
+#define D3DLINECAPS_TEXTURE           0x01
+#define D3DLINECAPS_ZTEST             0x02
+#define D3DLINECAPS_BLEND             0x04
+#define D3DLINECAPS_ALPHACMP          0x08
+#define D3DLINECAPS_FOG               0x10
+#define D3DLINECAPS_ANTIALIAS         0x20
+
+#define D3DPBLENDCAPS_ZERO            0x00000001
+#define D3DPBLENDCAPS_ONE             0x00000002
+#define D3DPBLENDCAPS_SRCCOLOR        0x00000004
+#define D3DPBLENDCAPS_INVSRCCOLOR     0x00000008
+#define D3DPBLENDCAPS_SRCALPHA        0x00000010
+#define D3DPBLENDCAPS_INVSRCALPHA     0x00000020
+#define D3DPBLENDCAPS_DESTALPHA       0x00000040
+#define D3DPBLENDCAPS_INVDESTALPHA    0x00000080
+#define D3DPBLENDCAPS_DESTCOLOR       0x00000100
+#define D3DPBLENDCAPS_INVDESTCOLOR    0x00000200
+#define D3DPBLENDCAPS_SRCALPHASAT     0x00000400
+#define D3DPBLENDCAPS_BOTHSRCALPHA    0x00000800
+#define D3DPBLENDCAPS_BOTHINVSRCALPHA 0x00001000
+#define D3DPBLENDCAPS_BLENDFACTOR     0x00002000
+
+#define D3DPCMPCAPS_NEVER        0x01
+#define D3DPCMPCAPS_LESS         0x02
+#define D3DPCMPCAPS_EQUAL        0x04
+#define D3DPCMPCAPS_LESSEQUAL    0x08
+#define D3DPCMPCAPS_GREATER      0x10
+#define D3DPCMPCAPS_NOTEQUAL     0x20
+#define D3DPCMPCAPS_GREATEREQUAL 0x40
+#define D3DPCMPCAPS_ALWAYS       0x80
+
+#define D3DPMISCCAPS_MASKZ                      0x00000002L
+#define D3DPMISCCAPS_LINEPATTERNREP             0x00000004L
+#define D3DPMISCCAPS_CULLNONE                   0x00000010L
+#define D3DPMISCCAPS_CULLCW                     0x00000020L
+#define D3DPMISCCAPS_CULLCCW                    0x00000040L
+#define D3DPMISCCAPS_COLORWRITEENABLE           0x00000080L
+#define D3DPMISCCAPS_CLIPPLANESCALEDPOINTS      0x00000100L
+#define D3DPMISCCAPS_CLIPTLVERTS                0x00000200L
+#define D3DPMISCCAPS_TSSARGTEMP                 0x00000400L
+#define D3DPMISCCAPS_BLENDOP                    0x00000800L
+#define D3DPMISCCAPS_NULLREFERENCE              0x00001000L
+#define D3DPMISCCAPS_INDEPENDENTWRITEMASKS      0x00004000L
+#define D3DPMISCCAPS_PERSTAGECONSTANT           0x00008000L
+#define D3DPMISCCAPS_FOGANDSPECULARALPHA        0x00010000L
+#define D3DPMISCCAPS_SEPARATEALPHABLEND         0x00020000L
+#define D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS    0x00040000L
+#define D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING 0x00080000L
+#define D3DPMISCCAPS_FOGVERTEXCLAMPED           0x00100000L
+
+
+#define D3DPRASTERCAPS_DITHER                     0x00000001L
+#define D3DPRASTERCAPS_PAT                        0x00000008L
+#define D3DPRASTERCAPS_ZTEST                      0x00000010L
+#define D3DPRASTERCAPS_FOGVERTEX                  0x00000080L
+#define D3DPRASTERCAPS_FOGTABLE                   0x00000100L
+#define D3DPRASTERCAPS_ANTIALIASEDGES             0x00001000L
+#define D3DPRASTERCAPS_MIPMAPLODBIAS              0x00002000L
+#define D3DPRASTERCAPS_ZBIAS                      0x00004000L
+#define D3DPRASTERCAPS_ZBUFFERLESSHSR             0x00008000L
+#define D3DPRASTERCAPS_FOGRANGE                   0x00010000L
+#define D3DPRASTERCAPS_ANISOTROPY                 0x00020000L
+#define D3DPRASTERCAPS_WBUFFER                    0x00040000L
+#define D3DPRASTERCAPS_WFOG                       0x00100000L
+#define D3DPRASTERCAPS_ZFOG                       0x00200000L
+#define D3DPRASTERCAPS_COLORPERSPECTIVE           0x00400000L
+#define D3DPRASTERCAPS_SCISSORTEST                0x01000000L
+#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS        0x02000000L
+#define D3DPRASTERCAPS_DEPTHBIAS                  0x04000000L 
+#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE         0x08000000L
+
+#define D3DPRESENT_INTERVAL_DEFAULT               0x00000000
+#define D3DPRESENT_INTERVAL_ONE                   0x00000001
+#define D3DPRESENT_INTERVAL_TWO                   0x00000002
+#define D3DPRESENT_INTERVAL_THREE                 0x00000004
+#define D3DPRESENT_INTERVAL_FOUR                  0x00000008
+#define D3DPRESENT_INTERVAL_IMMEDIATE             0x80000000
+
+#define D3DPSHADECAPS_COLORGOURAUDRGB             0x00008
+#define D3DPSHADECAPS_SPECULARGOURAUDRGB          0x00200
+#define D3DPSHADECAPS_ALPHAGOURAUDBLEND           0x04000
+#define D3DPSHADECAPS_FOGGOURAUD                  0x80000
+
+#define D3DPTADDRESSCAPS_WRAP                     0x01
+#define D3DPTADDRESSCAPS_MIRROR                   0x02
+#define D3DPTADDRESSCAPS_CLAMP                    0x04
+#define D3DPTADDRESSCAPS_BORDER                   0x08
+#define D3DPTADDRESSCAPS_INDEPENDENTUV            0x10
+#define D3DPTADDRESSCAPS_MIRRORONCE               0x20
+
+#define D3DPTEXTURECAPS_PERSPECTIVE              0x00000001L
+#define D3DPTEXTURECAPS_POW2                     0x00000002L
+#define D3DPTEXTURECAPS_ALPHA                    0x00000004L
+#define D3DPTEXTURECAPS_SQUAREONLY               0x00000020L
+#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040L
+#define D3DPTEXTURECAPS_ALPHAPALETTE             0x00000080L
+#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL       0x00000100L
+#define D3DPTEXTURECAPS_PROJECTED                0x00000400L
+#define D3DPTEXTURECAPS_CUBEMAP                  0x00000800L
+#define D3DPTEXTURECAPS_VOLUMEMAP                0x00002000L
+#define D3DPTEXTURECAPS_MIPMAP                   0x00004000L
+#define D3DPTEXTURECAPS_MIPVOLUMEMAP             0x00008000L
+#define D3DPTEXTURECAPS_MIPCUBEMAP               0x00010000L
+#define D3DPTEXTURECAPS_CUBEMAP_POW2             0x00020000L
+#define D3DPTEXTURECAPS_VOLUMEMAP_POW2           0x00040000L
+#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV       0x00200000L
+
+#define D3DPTFILTERCAPS_MINFPOINT                0x00000100
+#define D3DPTFILTERCAPS_MINFLINEAR               0x00000200
+#define D3DPTFILTERCAPS_MINFANISOTROPIC          0x00000400
+#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD        0x00000800
+#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD         0x00001000
+#define D3DPTFILTERCAPS_MIPFPOINT                0x00010000
+#define D3DPTFILTERCAPS_MIPFLINEAR               0x00020000
+#define D3DPTFILTERCAPS_MAGFPOINT                0x01000000
+#define D3DPTFILTERCAPS_MAGFLINEAR               0x02000000
+#define D3DPTFILTERCAPS_MAGFANISOTROPIC          0x04000000
+#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD        0x08000000
+#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD         0x10000000
+
+#define D3DSTENCILCAPS_KEEP                      0x01
+#define D3DSTENCILCAPS_ZERO                      0x02
+#define D3DSTENCILCAPS_REPLACE                   0x04
+#define D3DSTENCILCAPS_INCRSAT                   0x08
+#define D3DSTENCILCAPS_DECRSAT                   0x10
+#define D3DSTENCILCAPS_INVERT                    0x20
+#define D3DSTENCILCAPS_INCR                      0x40
+#define D3DSTENCILCAPS_DECR                      0x80
+#define D3DSTENCILCAPS_TWOSIDED                  0x100
+
+#define D3DTEXOPCAPS_DISABLE                     0x0000001
+#define D3DTEXOPCAPS_SELECTARG1                  0x0000002
+#define D3DTEXOPCAPS_SELECTARG2                  0x0000004
+#define D3DTEXOPCAPS_MODULATE                    0x0000008
+#define D3DTEXOPCAPS_MODULATE2X                  0x0000010
+#define D3DTEXOPCAPS_MODULATE4X                  0x0000020
+#define D3DTEXOPCAPS_ADD                         0x0000040
+#define D3DTEXOPCAPS_ADDSIGNED                   0x0000080
+#define D3DTEXOPCAPS_ADDSIGNED2X                 0x0000100
+#define D3DTEXOPCAPS_SUBTRACT                    0x0000200
+#define D3DTEXOPCAPS_ADDSMOOTH                   0x0000400
+#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA           0x0000800
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHA           0x0001000
+#define D3DTEXOPCAPS_BLENDFACTORALPHA            0x0002000
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM         0x0004000
+#define D3DTEXOPCAPS_BLENDCURRENTALPHA           0x0008000
+#define D3DTEXOPCAPS_PREMODULATE                 0x0010000
+#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR      0x0020000
+#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA      0x0040000
+#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR   0x0080000
+#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA   0x0100000
+#define D3DTEXOPCAPS_BUMPENVMAP                  0x0200000
+#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE         0x0400000
+#define D3DTEXOPCAPS_DOTPRODUCT3                 0x0800000
+#define D3DTEXOPCAPS_MULTIPLYADD                 0x1000000
+#define D3DTEXOPCAPS_LERP                        0x2000000
+
+#define D3DVTXPCAPS_TEXGEN                         0x00000001L
+#define D3DVTXPCAPS_MATERIALSOURCE7                0x00000002L
+#define D3DVTXPCAPS_DIRECTIONALLIGHTS              0x00000008L
+#define D3DVTXPCAPS_POSITIONALLIGHTS               0x00000010L
+#define D3DVTXPCAPS_LOCALVIEWER                    0x00000020L
+#define D3DVTXPCAPS_TWEENING                       0x00000040L
+#define D3DVTXPCAPS_TEXGEN_SPHEREMAP               0x00000100L
+#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER       0x00000200L
+
+#define D3DDTCAPS_UBYTE4                           0x00000001L
+#define D3DDTCAPS_UBYTE4N                          0x00000002L
+#define D3DDTCAPS_SHORT2N                          0x00000004L
+#define D3DDTCAPS_SHORT4N                          0x00000008L
+#define D3DDTCAPS_USHORT2N                         0x00000010L
+#define D3DDTCAPS_USHORT4N                         0x00000020L
+#define D3DDTCAPS_UDEC3                            0x00000040L
+#define D3DDTCAPS_DEC3N                            0x00000080L
+#define D3DDTCAPS_FLOAT16_2                        0x00000100L
+#define D3DDTCAPS_FLOAT16_4                        0x00000200L
+
+#define D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD  0x00000020L
+#define D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION       0x00000080L
+#define D3DCAPS3_COPY_TO_VIDMEM                    0x00000100L 
+#define D3DCAPS3_COPY_TO_SYSTEMMEM                 0x00000200L
+#define D3DCAPS3_RESERVED                          0x8000001FL
+
+#define D3DCAPS2_NO2DDURING3DSCENE                 0x00000002L
+#define D3DCAPS2_FULLSCREENGAMMA                   0x00020000L
+#define D3DCAPS2_CANRENDERWINDOWED                 0x00080000L
+#define D3DCAPS2_CANCALIBRATEGAMMA                 0x00100000L
+#define D3DCAPS2_RESERVED                          0x02000000L
+#define D3DCAPS2_CANMANAGERESOURCE                 0x10000000L
+#define D3DCAPS2_DYNAMICTEXTURES                   0x20000000L
+#define D3DCAPS2_CANAUTOGENMIPMAP                  0x40000000L
+
+
+#define D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH  24
+#define D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH  0
+#define D3DVS20_MAX_NUMTEMPS                 32
+#define D3DVS20_MIN_NUMTEMPS                 12
+#define D3DVS20_MAX_STATICFLOWCONTROLDEPTH   4
+#define D3DVS20_MIN_STATICFLOWCONTROLDEPTH   1
+
+#define D3DVS20CAPS_PREDICATION              (1 << 0)
+
+#define D3DPS20CAPS_ARBITRARYSWIZZLE         (1 << 0)
+#define D3DPS20CAPS_GRADIENTINSTRUCTIONS     (1 << 1)
+#define D3DPS20CAPS_PREDICATION              (1 << 2)
+#define D3DPS20CAPS_NODEPENDENTREADLIMIT     (1 << 3)
+#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT    (1 << 4)
+
+#define D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH  24
+#define D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH  0
+#define D3DPS20_MAX_NUMTEMPS                 32
+#define D3DPS20_MIN_NUMTEMPS                 12
+#define D3DPS20_MAX_STATICFLOWCONTROLDEPTH   4
+#define D3DPS20_MIN_STATICFLOWCONTROLDEPTH   0
+#define D3DPS20_MAX_NUMINSTRUCTIONSLOTS      512
+#define D3DPS20_MIN_NUMINSTRUCTIONSLOTS      96
+
+#define D3DMIN30SHADERINSTRUCTIONS          512
+#define D3DMAX30SHADERINSTRUCTIONS          32768
+
+
+typedef struct _D3DVSHADERCAPS2_0 {
+  DWORD  Caps;
+  INT    DynamicFlowControlDepth;
+  INT    NumTemps;
+  INT    StaticFlowControlDepth;
+} D3DVSHADERCAPS2_0;
+
+typedef struct _D3DPSHADERCAPS2_0 {
+  DWORD  Caps;
+  INT    DynamicFlowControlDepth;
+  INT    NumTemps;
+  INT    StaticFlowControlDepth;
+  INT    NumInstructionSlots;
+} D3DPSHADERCAPS2_0;
+
+/*
+ * The d3dcaps9 structure
+ */
+typedef struct _D3DCAPS9 {
+  D3DDEVTYPE          DeviceType;
+  UINT                AdapterOrdinal;
+  
+  DWORD               Caps;
+  DWORD               Caps2;
+  DWORD               Caps3;
+  DWORD               PresentationIntervals;
+  
+  DWORD               CursorCaps;
+  
+  DWORD               DevCaps;
+  
+  DWORD               PrimitiveMiscCaps;
+  DWORD               RasterCaps;
+  DWORD               ZCmpCaps;
+  DWORD               SrcBlendCaps;
+  DWORD               DestBlendCaps;
+  DWORD               AlphaCmpCaps;
+  DWORD               ShadeCaps;
+  DWORD               TextureCaps;
+  DWORD               TextureFilterCaps;
+  DWORD               CubeTextureFilterCaps;
+  DWORD               VolumeTextureFilterCaps;
+  DWORD               TextureAddressCaps;
+  DWORD               VolumeTextureAddressCaps;
+  
+  DWORD               LineCaps;
+  
+  DWORD               MaxTextureWidth, MaxTextureHeight;
+  DWORD               MaxVolumeExtent;
+  
+  DWORD               MaxTextureRepeat;
+  DWORD               MaxTextureAspectRatio;
+  DWORD               MaxAnisotropy;
+  float               MaxVertexW;
+  
+  float               GuardBandLeft;
+  float               GuardBandTop;
+  float               GuardBandRight;
+  float               GuardBandBottom;
+  
+  float               ExtentsAdjust;
+  DWORD               StencilCaps;
+  
+  DWORD               FVFCaps;
+  DWORD               TextureOpCaps;
+  DWORD               MaxTextureBlendStages;
+  DWORD               MaxSimultaneousTextures;
+  
+  DWORD               VertexProcessingCaps;
+  DWORD               MaxActiveLights;
+  DWORD               MaxUserClipPlanes;
+  DWORD               MaxVertexBlendMatrices;
+  DWORD               MaxVertexBlendMatrixIndex;
+  
+  float               MaxPointSize;
+  
+  DWORD               MaxPrimitiveCount;
+  DWORD               MaxVertexIndex;
+  DWORD               MaxStreams;
+  DWORD               MaxStreamStride;
+  
+  DWORD               VertexShaderVersion;
+  DWORD               MaxVertexShaderConst;
+  
+  DWORD               PixelShaderVersion;
+  float               PixelShader1xMaxValue;
+
+  /* DX 9 */
+  DWORD               DevCaps2;
+
+  float               MaxNpatchTessellationLevel;
+  DWORD               Reserved5;
+
+  UINT                MasterAdapterOrdinal;   
+  UINT                AdapterOrdinalInGroup;  
+  UINT                NumberOfAdaptersInGroup;
+  DWORD               DeclTypes;              
+  DWORD               NumSimultaneousRTs;     
+  DWORD               StretchRectFilterCaps;  
+  D3DVSHADERCAPS2_0   VS20Caps;
+  D3DPSHADERCAPS2_0   PS20Caps;
+  DWORD               VertexTextureFilterCaps;
+  DWORD               MaxVShaderInstructionsExecuted;
+  DWORD               MaxPShaderInstructionsExecuted;
+  DWORD               MaxVertexShader30InstructionSlots; 
+  DWORD               MaxPixelShader30InstructionSlots;
+
+} D3DCAPS9;
+
+#endif
diff --git a/misc/builddeps/dp.win32/include/d3d9types.h b/misc/builddeps/dp.win32/include/d3d9types.h
new file mode 100644 (file)
index 0000000..e0e11df
--- /dev/null
@@ -0,0 +1,1582 @@
+/*
+ * Copyright (C) 2002-2003 Jason Edmeades 
+ * Copyright (C) 2002-2003 Raphael Junqueira
+ * Copyright (C) 2005 Oliver Stieber
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D9TYPES_H
+#define __WINE_D3D9TYPES_H
+
+#include <_mingw_dxhelper.h>
+
+/*****************************************************************************
+ * Direct 3D v9 #defines
+ */
+#ifndef D3DCLEAR_TARGET
+#define D3DCLEAR_TARGET   0x00000001L
+#endif
+#ifndef D3DCLEAR_ZBUFFER
+#define D3DCLEAR_ZBUFFER  0x00000002L
+#endif
+#ifndef D3DCLEAR_STENCIL
+#define D3DCLEAR_STENCIL  0x00000004L
+#endif
+
+#define D3DCLIPPLANE0 (1 << 0)
+#define D3DCLIPPLANE1 (1 << 1)
+#define D3DCLIPPLANE2 (1 << 2)
+#define D3DCLIPPLANE3 (1 << 3)
+#define D3DCLIPPLANE4 (1 << 4)
+#define D3DCLIPPLANE5 (1 << 5)
+
+#define D3DCOLOR_ARGB(a,r,g,b)       ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
+#define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f))
+#define D3DCOLOR_RGBA(r,g,b,a)       D3DCOLOR_ARGB(a,r,g,b)
+#define D3DCOLOR_XRGB(r,g,b)         D3DCOLOR_ARGB(0xff,r,g,b)
+#define D3DCOLOR_XYUV(y,u,v)         D3DCOLOR_ARGB(0xFF,y,u,v)
+#define D3DCOLOR_AYUV(a,y,u,v)       D3DCOLOR_ARGB(a,y,u,v)
+
+#define D3DCS_LEFT                   0x001L
+#define D3DCS_RIGHT                  0x002L
+#define D3DCS_TOP                    0x004L
+#define D3DCS_BOTTOM                 0x008L
+#define D3DCS_FRONT                  0x010L
+#define D3DCS_BACK                   0x020L
+#define D3DCS_PLANE0                 0x040L
+#define D3DCS_PLANE1                 0x080L
+#define D3DCS_PLANE2                 0x100L
+#define D3DCS_PLANE3                 0x200L
+#define D3DCS_PLANE4                 0x400L
+#define D3DCS_PLANE5                 0x800L
+#define D3DCS_ALL                    0xFFFL
+
+#define D3DFVF_TEXTUREFORMAT1 3
+#define D3DFVF_TEXTUREFORMAT2 0
+#define D3DFVF_TEXTUREFORMAT3 1
+#define D3DFVF_TEXTUREFORMAT4 2
+#define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
+#define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
+#define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
+#define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
+
+#define D3DLOCK_READONLY           0x0010
+#define D3DLOCK_NOSYSLOCK          0x0800
+#define D3DLOCK_NOOVERWRITE        0x1000
+#define D3DLOCK_DISCARD            0x2000
+#define D3DLOCK_DONOTWAIT          0x4000
+#define D3DLOCK_NO_DIRTY_UPDATE    0x8000
+
+#define D3DMAXUSERCLIPPLANES       32
+#define D3DCLIPPLANE0              (1 << 0)
+#define D3DCLIPPLANE1              (1 << 1)
+#define D3DCLIPPLANE2              (1 << 2)
+#define D3DCLIPPLANE3              (1 << 3)
+#define D3DCLIPPLANE4              (1 << 4)
+#define D3DCLIPPLANE5              (1 << 5)
+
+
+#define D3DRENDERSTATE_WRAPBIAS    128UL
+
+/* MSDN has this in d3d9caps.h, but it should be here */
+#define D3DTSS_TCI_PASSTHRU                       0x00000
+#define D3DTSS_TCI_CAMERASPACENORMAL              0x10000
+#define D3DTSS_TCI_CAMERASPACEPOSITION            0x20000
+#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR    0x30000
+#define D3DTSS_TCI_SPHEREMAP                      0x40000
+
+
+#define D3DTS_WORLD  D3DTS_WORLDMATRIX(0)
+#define D3DTS_WORLD1 D3DTS_WORLDMATRIX(1)
+#define D3DTS_WORLD2 D3DTS_WORLDMATRIX(2)
+#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
+#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
+
+#define D3DUSAGE_RENDERTARGET       0x00000001L
+#define D3DUSAGE_DEPTHSTENCIL       0x00000002L
+#define D3DUSAGE_WRITEONLY          0x00000008L
+#define D3DUSAGE_SOFTWAREPROCESSING 0x00000010L
+#define D3DUSAGE_DONOTCLIP          0x00000020L
+#define D3DUSAGE_POINTS             0x00000040L
+#define D3DUSAGE_RTPATCHES          0x00000080L
+#define D3DUSAGE_NPATCHES           0x00000100L
+#define D3DUSAGE_DYNAMIC            0x00000200L
+#define D3DUSAGE_AUTOGENMIPMAP      0x00000400L 
+#define D3DUSAGE_DMAP               0x00004000L
+
+#define D3DUSAGE_QUERY_FILTER                   0x00020000L
+#define D3DUSAGE_QUERY_LEGACYBUMPMAP            0x00008000L
+#define D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING 0x00080000L
+#define D3DUSAGE_QUERY_SRGBREAD                 0x00010000L
+#define D3DUSAGE_QUERY_SRGBWRITE                0x00040000L
+#define D3DUSAGE_QUERY_VERTEXTEXTURE            0x00100000L
+#define D3DUSAGE_QUERY_WRAPANDMIP               0x00200000L
+
+#define D3DWRAP_U        1
+#define D3DWRAP_V        2
+#define D3DWRAP_W        4
+#define D3DWRAPCOORD_0   1
+#define D3DWRAPCOORD_1   2
+#define D3DWRAPCOORD_2   4
+#define D3DWRAPCOORD_3   8
+
+#define MAX_DEVICE_IDENTIFIER_STRING        512
+
+#define D3DFVF_RESERVED0           0x0001
+#define D3DFVF_POSITION_MASK       0x400E
+#define D3DFVF_XYZ                 0x0002
+#define D3DFVF_XYZRHW              0x0004
+#define D3DFVF_XYZB1               0x0006
+#define D3DFVF_XYZB2               0x0008
+#define D3DFVF_XYZB3               0x000a
+#define D3DFVF_XYZB4               0x000c
+#define D3DFVF_XYZB5               0x000e
+#define D3DFVF_XYZW                0x4002
+#define D3DFVF_NORMAL              0x0010
+#define D3DFVF_PSIZE               0x0020
+#define D3DFVF_DIFFUSE             0x0040
+#define D3DFVF_SPECULAR            0x0080
+#define D3DFVF_TEXCOUNT_MASK       0x0f00
+#define D3DFVF_TEXCOUNT_SHIFT           8
+#define D3DFVF_TEX0                0x0000
+#define D3DFVF_TEX1                0x0100
+#define D3DFVF_TEX2                0x0200
+#define D3DFVF_TEX3                0x0300
+#define D3DFVF_TEX4                0x0400
+#define D3DFVF_TEX5                0x0500
+#define D3DFVF_TEX6                0x0600
+#define D3DFVF_TEX7                0x0700
+#define D3DFVF_TEX8                0x0800
+#define D3DFVF_LASTBETA_UBYTE4     0x1000
+#define D3DFVF_LASTBETA_D3DCOLOR   0x8000
+#define D3DFVF_RESERVED2           0x6000
+
+#define D3DTA_SELECTMASK        0x0000000f
+#define D3DTA_DIFFUSE           0x00000000
+#define D3DTA_CURRENT           0x00000001
+#define D3DTA_TEXTURE           0x00000002
+#define D3DTA_TFACTOR           0x00000003
+#define D3DTA_SPECULAR          0x00000004
+#define D3DTA_TEMP              0x00000005
+#define D3DTA_CONSTANT          0x00000006
+#define D3DTA_COMPLEMENT        0x00000010
+#define D3DTA_ALPHAREPLICATE    0x00000020
+
+#define D3DCOLORWRITEENABLE_RED   (1L<<0)   
+#define D3DCOLORWRITEENABLE_GREEN (1L<<1)
+#define D3DCOLORWRITEENABLE_BLUE  (1L<<2)
+#define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
+
+#define D3DPV_DONOTCOPYDATA         (1 << 0)
+
+#define D3DSTREAMSOURCE_INDEXEDDATA  (1 << 30)
+#define D3DSTREAMSOURCE_INSTANCEDATA (2 << 30)
+
+#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4
+
+#define MAXD3DDECLLENGTH         64 /* +end marker */
+#define MAXD3DDECLMETHOD         D3DDECLMETHOD_LOOKUPPRESAMPLED
+#define MAXD3DDECLTYPE           D3DDECLTYPE_UNUSED
+#define MAXD3DDECLUSAGE          D3DDECLUSAGE_SAMPLE
+#define MAXD3DDECLUSAGEINDEX     15
+
+#define D3DDMAPSAMPLER 256
+#define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1)
+#define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2)
+#define D3DVERTEXTEXTURESAMPLER2 (D3DDMAPSAMPLER+3)
+#define D3DVERTEXTEXTURESAMPLER3 (D3DDMAPSAMPLER+4)
+
+#ifndef MAKEFOURCC
+#define MAKEFOURCC(ch0, ch1, ch2, ch3)  \
+    ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |  \
+    ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
+#endif /* MAKEFOURCC */
+
+/* Constants used by D3DPRESENT_PARAMETERS. when creating a device or swapchain */
+
+#define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER  0x00000001 /* Create a lockable backbuffer */
+#define D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 0x00000002 /* Discard Z buffer */
+#define D3DPRESENTFLAG_DEVICECLIP           0x00000004 /* Clip the window blited into the client area 2k + xp only */
+#define D3DPRESENTFLAG_VIDEO                0x00000010 /* backbuffer 'may' contain video data */
+#define D3DPRESENTFLAG_NOAUTOROTATE         0x00000020 /* d3d9ex, ignore display rotation */
+#define D3DPRESENTFLAG_UNPRUNEDMODE         0x00000040 /* d3d9ex, specify invalid display modes */
+
+#define D3DPRESENT_BACK_BUFFERS_MAX         3L
+#define D3DPRESENT_RATE_DEFAULT             0x00000000
+
+/**************************** 
+ * Vertex Shaders Declaration
+ */
+
+typedef enum _D3DDECLUSAGE {
+  D3DDECLUSAGE_POSITION     = 0,
+  D3DDECLUSAGE_BLENDWEIGHT  = 1,
+  D3DDECLUSAGE_BLENDINDICES = 2,
+  D3DDECLUSAGE_NORMAL       = 3,      
+  D3DDECLUSAGE_PSIZE        = 4,       
+  D3DDECLUSAGE_TEXCOORD     = 5,    
+  D3DDECLUSAGE_TANGENT      = 6,     
+  D3DDECLUSAGE_BINORMAL     = 7,    
+  D3DDECLUSAGE_TESSFACTOR   = 8,  
+  D3DDECLUSAGE_POSITIONT    = 9,   
+  D3DDECLUSAGE_COLOR        = 10,       
+  D3DDECLUSAGE_FOG          = 11,        
+  D3DDECLUSAGE_DEPTH        = 12,      
+  D3DDECLUSAGE_SAMPLE       = 13     
+} D3DDECLUSAGE;
+
+#define D3DMAXDECLUSAGE         D3DDECLUSAGE_SAMPLE
+#define D3DMAXDECLUSAGEINDEX    15
+#define D3DMAXDECLLENGTH        18
+#define D3DMAXDECLUSAGE_DX8     D3DDECLUSAGE_TEXCOORD
+
+typedef enum _D3DDECLMETHOD {
+  D3DDECLMETHOD_DEFAULT          = 0,
+  D3DDECLMETHOD_PARTIALU         = 1,
+  D3DDECLMETHOD_PARTIALV         = 2,
+  D3DDECLMETHOD_CROSSUV          = 3,
+  D3DDECLMETHOD_UV               = 4,
+  D3DDECLMETHOD_LOOKUP           = 5,
+  D3DDECLMETHOD_LOOKUPPRESAMPLED = 6
+} D3DDECLMETHOD;
+
+
+#define D3DMAXDECLMETHOD        D3DDECLMETHOD_LOOKUPPRESAMPLED
+
+typedef enum _D3DDECLTYPE {
+  D3DDECLTYPE_FLOAT1    =  0,
+  D3DDECLTYPE_FLOAT2    =  1,
+  D3DDECLTYPE_FLOAT3    =  2,
+  D3DDECLTYPE_FLOAT4    =  3,
+  D3DDECLTYPE_D3DCOLOR  =  4,
+  D3DDECLTYPE_UBYTE4    =  5,
+  D3DDECLTYPE_SHORT2    =  6,
+  D3DDECLTYPE_SHORT4    =  7,
+  /* VS 2.0 */
+  D3DDECLTYPE_UBYTE4N   =  8,
+  D3DDECLTYPE_SHORT2N   =  9,
+  D3DDECLTYPE_SHORT4N   = 10,
+  D3DDECLTYPE_USHORT2N  = 11,
+  D3DDECLTYPE_USHORT4N  = 12,
+  D3DDECLTYPE_UDEC3     = 13,
+  D3DDECLTYPE_DEC3N     = 14,
+  D3DDECLTYPE_FLOAT16_2 = 15,
+  D3DDECLTYPE_FLOAT16_4 = 16,
+  D3DDECLTYPE_UNUSED    = 17,
+} D3DDECLTYPE;
+
+#define D3DMAXDECLTYPE          D3DDECLTYPE_UNUSED
+
+typedef struct _D3DVERTEXELEMENT9 {
+  WORD    Stream;
+  WORD    Offset;
+  BYTE    Type;
+  BYTE    Method;
+  BYTE    Usage;
+  BYTE    UsageIndex;
+} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
+
+
+typedef enum _D3DQUERYTYPE {
+    D3DQUERYTYPE_VCACHE = 4,
+    D3DQUERYTYPE_RESOURCEMANAGER = 5,
+    D3DQUERYTYPE_VERTEXSTATS = 6,
+    D3DQUERYTYPE_EVENT = 8,
+    D3DQUERYTYPE_OCCLUSION = 9,
+    D3DQUERYTYPE_TIMESTAMP = 10,
+    D3DQUERYTYPE_TIMESTAMPDISJOINT = 11,
+    D3DQUERYTYPE_TIMESTAMPFREQ = 12,
+    D3DQUERYTYPE_PIPELINETIMINGS = 13,
+    D3DQUERYTYPE_INTERFACETIMINGS = 14,
+    D3DQUERYTYPE_VERTEXTIMINGS = 15,
+    D3DQUERYTYPE_PIXELTIMINGS = 16,
+    D3DQUERYTYPE_BANDWIDTHTIMINGS = 17,
+    D3DQUERYTYPE_CACHEUTILIZATION = 18
+} D3DQUERYTYPE;
+
+#define D3DISSUE_BEGIN   (1 << 1)
+#define D3DISSUE_END     (1 << 0)
+#define D3DGETDATA_FLUSH (1 << 0)
+
+
+#define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0}
+#define D3DDP_MAXTEXCOORD   8
+
+
+#define D3DVSD_MAKETOKENTYPE(TokenType) \
+  ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
+
+#define D3DVSD_CONST(ConstantAddress, Count) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
+
+#define D3DVSD_END() 0xFFFFFFFF
+
+#define D3DVSD_NOP() 0x00000000
+
+#define D3DVSD_REG(VertexRegister, Type) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | ((Type) << D3DVSD_DATATYPESHIFT) | (VertexRegister))
+
+#define D3DVSD_SKIP(Count) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | ((Count) << D3DVSD_SKIPCOUNTSHIFT))
+
+#define D3DVSD_STREAM(StreamNumber) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (StreamNumber))
+
+#define D3DVSD_STREAM_TESS() \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK))
+
+#define D3DVSD_TESSNORMAL(RegisterIn, RegisterOut) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | ((RegisterIn) << D3DVSD_VERTEXREGINSHIFT) | ((0x02) << D3DVSD_DATATYPESHIFT) | (RegisterOut))
+
+#define D3DVSD_TESSUV(Register) \
+  (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | ((0x01) << D3DVSD_DATATYPESHIFT) | (Register))
+
+
+/********************************
+ * Pixel/Vertex Shaders Functions
+ */
+
+/** Maximum number of supported texture coordinates sets operation */
+#define D3DDP_MAXTEXCOORD   8
+
+/** opcode token mask */
+#define D3DSI_OPCODE_MASK       0x0000FFFF
+#define D3DSI_INSTLENGTH_MASK   0x0F000000
+#define D3DSI_INSTLENGTH_SHIFT  24
+
+/** opcodes types for PS and VS */
+typedef enum _D3DSHADER_INSTRUCTION_OPCODE_TYPE {
+  D3DSIO_NOP          =  0,
+  D3DSIO_MOV          =  1,
+  D3DSIO_ADD          =  2,
+  D3DSIO_SUB          =  3,
+  D3DSIO_MAD          =  4,
+  D3DSIO_MUL          =  5,
+  D3DSIO_RCP          =  6,
+  D3DSIO_RSQ          =  7,
+  D3DSIO_DP3          =  8,
+  D3DSIO_DP4          =  9,
+  D3DSIO_MIN          = 10,
+  D3DSIO_MAX          = 11,
+  D3DSIO_SLT          = 12,
+  D3DSIO_SGE          = 13,
+  D3DSIO_EXP          = 14,
+  D3DSIO_LOG          = 15,
+  D3DSIO_LIT          = 16,
+  D3DSIO_DST          = 17,
+  D3DSIO_LRP          = 18,
+  D3DSIO_FRC          = 19,
+  D3DSIO_M4x4         = 20,
+  D3DSIO_M4x3         = 21,
+  D3DSIO_M3x4         = 22,
+  D3DSIO_M3x3         = 23,
+  D3DSIO_M3x2         = 24,
+  D3DSIO_CALL         = 25,
+  D3DSIO_CALLNZ       = 26,
+  D3DSIO_LOOP         = 27,
+  D3DSIO_RET          = 28,
+  D3DSIO_ENDLOOP      = 29,
+  D3DSIO_LABEL        = 30,
+  D3DSIO_DCL          = 31,
+  D3DSIO_POW          = 32,
+  D3DSIO_CRS          = 33,
+  D3DSIO_SGN          = 34,
+  D3DSIO_ABS          = 35,
+  D3DSIO_NRM          = 36,
+  D3DSIO_SINCOS       = 37,
+  D3DSIO_REP          = 38,
+  D3DSIO_ENDREP       = 39,
+  D3DSIO_IF           = 40,
+  D3DSIO_IFC          = 41,
+  D3DSIO_ELSE         = 42,
+  D3DSIO_ENDIF        = 43,
+  D3DSIO_BREAK        = 44,
+  D3DSIO_BREAKC       = 45,
+  D3DSIO_MOVA         = 46,
+  D3DSIO_DEFB         = 47,
+  D3DSIO_DEFI         = 48,
+
+  D3DSIO_TEXCOORD     = 64,
+  D3DSIO_TEXKILL      = 65,
+  D3DSIO_TEX          = 66,
+  D3DSIO_TEXBEM       = 67,
+  D3DSIO_TEXBEML      = 68,
+  D3DSIO_TEXREG2AR    = 69,
+  D3DSIO_TEXREG2GB    = 70,
+  D3DSIO_TEXM3x2PAD   = 71,
+  D3DSIO_TEXM3x2TEX   = 72,
+  D3DSIO_TEXM3x3PAD   = 73,
+  D3DSIO_TEXM3x3TEX   = 74,
+  D3DSIO_TEXM3x3DIFF  = 75,
+  D3DSIO_TEXM3x3SPEC  = 76,
+  D3DSIO_TEXM3x3VSPEC = 77,
+  D3DSIO_EXPP         = 78,
+  D3DSIO_LOGP         = 79,
+  D3DSIO_CND          = 80,
+  D3DSIO_DEF          = 81,
+  D3DSIO_TEXREG2RGB   = 82,
+  D3DSIO_TEXDP3TEX    = 83,
+  D3DSIO_TEXM3x2DEPTH = 84,
+  D3DSIO_TEXDP3       = 85,
+  D3DSIO_TEXM3x3      = 86,
+  D3DSIO_TEXDEPTH     = 87,
+  D3DSIO_CMP          = 88,
+  D3DSIO_BEM          = 89,
+  D3DSIO_DP2ADD       = 90,
+  D3DSIO_DSX          = 91,
+  D3DSIO_DSY          = 92,
+  D3DSIO_TEXLDD       = 93,
+  D3DSIO_SETP         = 94,
+  D3DSIO_TEXLDL       = 95,
+  D3DSIO_BREAKP       = 96,
+  
+  D3DSIO_PHASE        = 0xFFFD,
+  D3DSIO_COMMENT      = 0xFFFE,
+  D3DSIO_END          = 0XFFFF,
+
+  D3DSIO_FORCE_DWORD  = 0X7FFFFFFF /** for 32-bit alignment */
+} D3DSHADER_INSTRUCTION_OPCODE_TYPE;
+
+#define D3DSINCOSCONST1   -1.5500992e-006f, -2.1701389e-005f,  0.0026041667f, 0.00026041668f
+#define D3DSINCOSCONST2   -0.020833334f,    -0.12500000f,      1.0f,          0.50000000f
+
+#define D3DSHADER_INSTRUCTION_PREDICATED    (1 << 28)
+
+#define D3DSI_TEXLD_PROJECT 0x00010000
+#define D3DSI_TEXLD_BIAS    0x00020000
+
+/** for parallelism */
+#define D3DSI_COISSUE 0x40000000
+
+#define D3DSP_DCL_USAGE_SHIFT 0
+#define D3DSP_DCL_USAGE_MASK  0x0000000f
+
+#define D3DSP_DCL_USAGEINDEX_SHIFT 16
+#define D3DSP_DCL_USAGEINDEX_MASK  0x000f0000
+
+#define D3DSP_TEXTURETYPE_SHIFT 27
+#define D3DSP_TEXTURETYPE_MASK  0x78000000
+
+typedef enum _D3DSAMPLER_TEXTURE_TYPE {
+  D3DSTT_UNKNOWN      = 0 << D3DSP_TEXTURETYPE_SHIFT,
+  D3DSTT_1D           = 1 << D3DSP_TEXTURETYPE_SHIFT,
+  D3DSTT_2D           = 2 << D3DSP_TEXTURETYPE_SHIFT,
+  D3DSTT_CUBE         = 3 << D3DSP_TEXTURETYPE_SHIFT,
+  D3DSTT_VOLUME       = 4 << D3DSP_TEXTURETYPE_SHIFT,
+
+  D3DSTT_FORCE_DWORD  = 0x7FFFFFFF
+} D3DSAMPLER_TEXTURE_TYPE;
+
+#define D3DSP_REGNUM_MASK       0x000007FF
+
+/** destination parameter modifiers (.xyzw) */
+#define D3DSP_WRITEMASK_0       0x00010000 /* .x r */
+#define D3DSP_WRITEMASK_1       0x00020000 /* .y g */
+#define D3DSP_WRITEMASK_2       0x00040000 /* .z b */
+#define D3DSP_WRITEMASK_3       0x00080000 /* .w a */
+#define D3DSP_WRITEMASK_ALL     0x000F0000 /* all */
+
+#define D3DSP_DSTMOD_SHIFT      20
+#define D3DSP_DSTMOD_MASK       (0xF << D3DSP_DSTMOD_SHIFT)
+
+typedef enum _D3DSHADER_PARAM_DSTMOD_TYPE {
+  D3DSPDM_NONE             = 0 << D3DSP_DSTMOD_SHIFT,
+  D3DSPDM_SATURATE         = 1 << D3DSP_DSTMOD_SHIFT,
+  D3DSPDM_PARTIALPRECISION = 2 << D3DSP_DSTMOD_SHIFT,
+  D3DSPDM_MSAMPCENTROID    = 4 << D3DSP_DSTMOD_SHIFT,
+
+  D3DSPDM_FORCE_DWORD  = 0x7FFFFFFF
+} D3DSHADER_PARAM_DSTMOD_TYPE;
+
+/** destination param */
+#define D3DSP_DSTSHIFT_SHIFT     24
+#define D3DSP_DSTSHIFT_MASK      (0xF << D3DSP_DSTSHIFT_SHIFT)
+
+/** destination/source reg type */
+#define D3DSP_REGTYPE_SHIFT      28
+#define D3DSP_REGTYPE_SHIFT2     8
+#define D3DSP_REGTYPE_MASK       (0x7 << D3DSP_REGTYPE_SHIFT)
+#define D3DSP_REGTYPE_MASK2      0x00001800
+
+typedef enum _D3DSHADER_PARAM_REGISTER_TYPE {
+  D3DSPR_TEMP         =  0, 
+  D3DSPR_INPUT        =  1,
+  D3DSPR_CONST        =  2,
+  D3DSPR_ADDR         =  3,
+  D3DSPR_TEXTURE      =  3,
+  D3DSPR_RASTOUT      =  4,
+  D3DSPR_ATTROUT      =  5,
+  D3DSPR_TEXCRDOUT    =  6,
+  D3DSPR_OUTPUT       =  6,
+  D3DSPR_CONSTINT     =  7,
+  D3DSPR_COLOROUT     =  8,
+  D3DSPR_DEPTHOUT     =  9,
+  D3DSPR_SAMPLER      = 10,
+  D3DSPR_CONST2       = 11,
+  D3DSPR_CONST3       = 12,
+  D3DSPR_CONST4       = 13,
+  D3DSPR_CONSTBOOL    = 14,
+  D3DSPR_LOOP         = 15,
+  D3DSPR_TEMPFLOAT16  = 16,
+  D3DSPR_MISCTYPE     = 17,
+  D3DSPR_LABEL        = 18,
+  D3DSPR_PREDICATE    = 19,
+
+  D3DSPR_FORCE_DWORD  = 0x7FFFFFFF
+} D3DSHADER_PARAM_REGISTER_TYPE;
+
+typedef enum _D3DSHADER_MISCTYPE_OFFSETS {
+    D3DSMO_POSITION  = 0,
+    D3DSMO_FACE      = 1
+} D3DSHADER_MISCTYPE_OFFSETS;
+
+typedef enum _D3DVS_RASTOUT_OFFSETS {
+  D3DSRO_POSITION     = 0,
+  D3DSRO_FOG          = 1,
+  D3DSRO_POINT_SIZE   = 2,
+
+  D3DSRO_FORCE_DWORD  = 0x7FFFFFFF
+} D3DVS_RASTOUT_OFFSETS;
+
+#define D3DVS_ADDRESSMODE_SHIFT  13
+#define D3DVS_ADDRESSMODE_MASK   (0x1 << D3DVS_ADDRESSMODE_SHIFT)
+
+typedef enum _D3DVS_ADDRESSMODE_TYPE {
+  D3DVS_ADDRMODE_ABSOLUTE     = 0 << D3DVS_ADDRESSMODE_SHIFT,
+  D3DVS_ADDRMODE_RELATIVE     = 1 << D3DVS_ADDRESSMODE_SHIFT,
+
+  D3DVS_ADDRMODE_FORCE_DWORD  = 0x7FFFFFFF
+} D3DVS_ADDRESSMODE_TYPE;
+
+#define D3DSHADER_ADDRESSMODE_SHIFT 13
+#define D3DSHADER_ADDRESSMODE_MASK  (1 << D3DSHADER_ADDRESSMODE_SHIFT)
+
+typedef enum _D3DSHADER_ADDRESSMODE_TYPE {
+  D3DSHADER_ADDRMODE_ABSOLUTE    = 0 << D3DSHADER_ADDRESSMODE_SHIFT,
+  D3DSHADER_ADDRMODE_RELATIVE    = 1 << D3DSHADER_ADDRESSMODE_SHIFT,
+
+  D3DSHADER_ADDRMODE_FORCE_DWORD = 0x7FFFFFFF
+} D3DSHADER_ADDRESSMODE_TYPE;
+
+
+#define D3DVS_SWIZZLE_SHIFT      16
+#define D3DVS_SWIZZLE_MASK       (0xFF << D3DVS_SWIZZLE_SHIFT)
+
+#define D3DSP_SWIZZLE_SHIFT      16
+#define D3DSP_SWIZZLE_MASK       (0xFF << D3DSP_SWIZZLE_SHIFT)
+
+#define D3DVS_X_X       (0 << D3DVS_SWIZZLE_SHIFT)
+#define D3DVS_X_Y       (1 << D3DVS_SWIZZLE_SHIFT)
+#define D3DVS_X_Z       (2 << D3DVS_SWIZZLE_SHIFT)
+#define D3DVS_X_W       (3 << D3DVS_SWIZZLE_SHIFT)
+
+#define D3DVS_Y_X       (0 << (D3DVS_SWIZZLE_SHIFT + 2))
+#define D3DVS_Y_Y       (1 << (D3DVS_SWIZZLE_SHIFT + 2))
+#define D3DVS_Y_Z       (2 << (D3DVS_SWIZZLE_SHIFT + 2))
+#define D3DVS_Y_W       (3 << (D3DVS_SWIZZLE_SHIFT + 2))
+
+#define D3DVS_Z_X       (0 << (D3DVS_SWIZZLE_SHIFT + 4))
+#define D3DVS_Z_Y       (1 << (D3DVS_SWIZZLE_SHIFT + 4))
+#define D3DVS_Z_Z       (2 << (D3DVS_SWIZZLE_SHIFT + 4))
+#define D3DVS_Z_W       (3 << (D3DVS_SWIZZLE_SHIFT + 4))
+
+#define D3DVS_W_X       (0 << (D3DVS_SWIZZLE_SHIFT + 6))
+#define D3DVS_W_Y       (1 << (D3DVS_SWIZZLE_SHIFT + 6))
+#define D3DVS_W_Z       (2 << (D3DVS_SWIZZLE_SHIFT + 6))
+#define D3DVS_W_W       (3 << (D3DVS_SWIZZLE_SHIFT + 6))
+
+#define D3DVS_NOSWIZZLE (D3DVS_X_X | D3DVS_Y_Y | D3DVS_Z_Z | D3DVS_W_W)
+
+#define D3DSP_NOSWIZZLE \
+    ((0 << (D3DSP_SWIZZLE_SHIFT + 0)) | (1 << (D3DSP_SWIZZLE_SHIFT + 2)) | (2 << (D3DSP_SWIZZLE_SHIFT + 4)) | (3 << (D3DSP_SWIZZLE_SHIFT + 6)))
+
+#define D3DSP_SRCMOD_SHIFT      24
+#define D3DSP_SRCMOD_MASK       (0xF << D3DSP_SRCMOD_SHIFT)
+
+typedef enum _D3DSHADER_PARAM_SRCMOD_TYPE {
+  D3DSPSM_NONE         =  0 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_NEG          =  1 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_BIAS         =  2 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_BIASNEG      =  3 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_SIGN         =  4 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_SIGNNEG      =  5 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_COMP         =  6 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_X2           =  7 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_X2NEG        =  8 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_DZ           =  9 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_DW           = 10 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_ABS          = 11 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_ABSNEG       = 12 << D3DSP_SRCMOD_SHIFT,
+  D3DSPSM_NOT          = 13 << D3DSP_SRCMOD_SHIFT,
+
+  D3DSPSM_FORCE_DWORD  = 0x7FFFFFFF
+} D3DSHADER_PARAM_SRCMOD_TYPE;
+
+#define D3DPS_VERSION(major, minor) (0xFFFF0000 | ((major) << 8) | (minor))
+#define D3DVS_VERSION(major, minor) (0xFFFE0000 | ((major) << 8) | (minor))
+#define D3DSHADER_VERSION_MAJOR(version) (((version) >> 8) & 0xFF)
+#define D3DSHADER_VERSION_MINOR(version) (((version) >> 0) & 0xFF)
+
+#define D3DSI_COMMENTSIZE_SHIFT 16
+#define D3DSI_COMMENTSIZE_MASK (0x7FFF << D3DSI_COMMENTSIZE_SHIFT)
+
+#define D3DSHADER_COMMENT(commentSize) \
+  ((((commentSize) << D3DSI_COMMENTSIZE_SHIFT) & D3DSI_COMMENTSIZE_MASK) | D3DSIO_COMMENT)
+
+#define D3DPS_END() 0x0000FFFF
+#define D3DVS_END() 0x0000FFFF
+
+
+/*****************************************************************************
+ * Direct 3D v8 enumerated types
+ */
+typedef enum _D3DBACKBUFFER_TYPE {
+    D3DBACKBUFFER_TYPE_MONO         = 0,
+    D3DBACKBUFFER_TYPE_LEFT         = 1,
+    D3DBACKBUFFER_TYPE_RIGHT        = 2,
+
+    D3DBACKBUFFER_TYPE_FORCE_DWORD  = 0x7fffffff
+} D3DBACKBUFFER_TYPE;
+
+#define D3DPRESENT_BACK_BUFFER_MAX 3L
+
+typedef enum _D3DBASISTYPE {
+   D3DBASIS_BEZIER        = 0,
+   D3DBASIS_BSPLINE       = 1,
+   D3DBASIS_INTERPOLATE   = 2,
+
+   D3DBASIS_FORCE_DWORD   = 0x7fffffff
+} D3DBASISTYPE;
+
+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,
+    D3DBLEND_BLENDFACTOR        = 14,
+    D3DBLEND_INVBLENDFACTOR     = 15,
+    D3DBLEND_FORCE_DWORD        = 0x7fffffff
+} D3DBLEND;
+
+typedef enum _D3DBLENDOP {
+    D3DBLENDOP_ADD              = 1,
+    D3DBLENDOP_SUBTRACT         = 2,
+    D3DBLENDOP_REVSUBTRACT      = 3,
+    D3DBLENDOP_MIN              = 4,
+    D3DBLENDOP_MAX              = 5,
+
+    D3DBLENDOP_FORCE_DWORD      = 0x7fffffff
+} D3DBLENDOP;
+
+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,
+
+    D3DCMP_FORCE_DWORD          = 0x7fffffff
+} D3DCMPFUNC;
+
+typedef enum _D3DCUBEMAP_FACES {
+    D3DCUBEMAP_FACE_POSITIVE_X     = 0,
+    D3DCUBEMAP_FACE_NEGATIVE_X     = 1,
+    D3DCUBEMAP_FACE_POSITIVE_Y     = 2,
+    D3DCUBEMAP_FACE_NEGATIVE_Y     = 3,
+    D3DCUBEMAP_FACE_POSITIVE_Z     = 4,
+    D3DCUBEMAP_FACE_NEGATIVE_Z     = 5,
+
+    D3DCUBEMAP_FACE_FORCE_DWORD    = 0xffffffff
+} D3DCUBEMAP_FACES;
+
+typedef enum _D3DCULL {
+    D3DCULL_NONE                = 1,
+    D3DCULL_CW                  = 2,
+    D3DCULL_CCW                 = 3,
+
+    D3DCULL_FORCE_DWORD         = 0x7fffffff
+} D3DCULL;
+
+typedef enum _D3DDEBUGMONITORTOKENS {
+    D3DDMT_ENABLE          = 0,
+    D3DDMT_DISABLE         = 1,
+
+    D3DDMT_FORCE_DWORD     = 0x7fffffff
+} D3DDEBUGMONITORTOKENS;
+
+typedef enum _D3DDEGREETYPE {
+    D3DDEGREE_LINEAR      = 1,
+    D3DDEGREE_QUADRATIC   = 2,
+    D3DDEGREE_CUBIC       = 3,
+    D3DDEGREE_QUINTIC     = 5,
+    
+    D3DDEGREE_FORCE_DWORD   = 0x7fffffff
+} D3DDEGREETYPE;
+
+typedef enum _D3DDEVTYPE {
+    D3DDEVTYPE_HAL         = 1,
+    D3DDEVTYPE_REF         = 2,
+    D3DDEVTYPE_SW          = 3,
+    D3DDEVTYPE_NULLREF     = 4,
+
+    D3DDEVTYPE_FORCE_DWORD = 0xffffffff
+} D3DDEVTYPE;
+
+typedef enum _D3DFILLMODE {
+    D3DFILL_POINT               = 1,
+    D3DFILL_WIREFRAME           = 2,
+    D3DFILL_SOLID               = 3,
+
+    D3DFILL_FORCE_DWORD         = 0x7fffffff
+} D3DFILLMODE;
+
+typedef enum _D3DFOGMODE {
+    D3DFOG_NONE                 = 0,
+    D3DFOG_EXP                  = 1,
+    D3DFOG_EXP2                 = 2,
+    D3DFOG_LINEAR               = 3,
+
+    D3DFOG_FORCE_DWORD          = 0x7fffffff
+} D3DFOGMODE;
+
+typedef enum _D3DFORMAT {
+    D3DFMT_UNKNOWN              =   0,
+
+    D3DFMT_R8G8B8               =  20,
+    D3DFMT_A8R8G8B8             =  21,
+    D3DFMT_X8R8G8B8             =  22,
+    D3DFMT_R5G6B5               =  23,
+    D3DFMT_X1R5G5B5             =  24,
+    D3DFMT_A1R5G5B5             =  25,
+    D3DFMT_A4R4G4B4             =  26,
+    D3DFMT_R3G3B2               =  27,
+    D3DFMT_A8                   =  28,
+    D3DFMT_A8R3G3B2             =  29,
+    D3DFMT_X4R4G4B4             =  30,
+    D3DFMT_A2B10G10R10          =  31,
+    D3DFMT_A8B8G8R8             =  32,
+    D3DFMT_X8B8G8R8             =  33,
+    D3DFMT_G16R16               =  34,
+    D3DFMT_A2R10G10B10          =  35,
+    D3DFMT_A16B16G16R16         =  36,
+  
+
+    D3DFMT_A8P8                 =  40,
+    D3DFMT_P8                   =  41,
+
+    D3DFMT_L8                   =  50,
+    D3DFMT_A8L8                 =  51,
+    D3DFMT_A4L4                 =  52,
+
+    D3DFMT_V8U8                 =  60,
+    D3DFMT_L6V5U5               =  61,
+    D3DFMT_X8L8V8U8             =  62,
+    D3DFMT_Q8W8V8U8             =  63,
+    D3DFMT_V16U16               =  64,
+    D3DFMT_A2W10V10U10          =  67,
+
+    D3DFMT_UYVY                 =  MAKEFOURCC('U', 'Y', 'V', 'Y'),
+    D3DFMT_YUY2                 =  MAKEFOURCC('Y', 'U', 'Y', '2'),
+    D3DFMT_DXT1                 =  MAKEFOURCC('D', 'X', 'T', '1'),
+    D3DFMT_DXT2                 =  MAKEFOURCC('D', 'X', 'T', '2'),
+    D3DFMT_DXT3                 =  MAKEFOURCC('D', 'X', 'T', '3'),
+    D3DFMT_DXT4                 =  MAKEFOURCC('D', 'X', 'T', '4'),
+    D3DFMT_DXT5                 =  MAKEFOURCC('D', 'X', 'T', '5'),
+    D3DFMT_MULTI2_ARGB8         =  MAKEFOURCC('M', 'E', 'T', '1'),
+    D3DFMT_G8R8_G8B8            =  MAKEFOURCC('G', 'R', 'G', 'B'),
+    D3DFMT_R8G8_B8G8            =  MAKEFOURCC('R', 'G', 'B', 'G'),
+
+    D3DFMT_D16_LOCKABLE         =  70,
+    D3DFMT_D32                  =  71,
+    D3DFMT_D15S1                =  73,
+    D3DFMT_D24S8                =  75,
+    D3DFMT_D24X8                =  77,
+    D3DFMT_D24X4S4              =  79,
+    D3DFMT_D16                  =  80,
+    D3DFMT_L16                  =  81,
+    D3DFMT_D32F_LOCKABLE        =  82,
+    D3DFMT_D24FS8               =  83,
+
+    D3DFMT_VERTEXDATA           = 100,
+    D3DFMT_INDEX16              = 101,
+    D3DFMT_INDEX32              = 102,
+    D3DFMT_Q16W16V16U16         = 110,
+    /* Floating point formats */
+    D3DFMT_R16F                 = 111,
+    D3DFMT_G16R16F              = 112,
+    D3DFMT_A16B16G16R16F        = 113,
+    
+    /* IEEE formats */
+    D3DFMT_R32F                 = 114,
+    D3DFMT_G32R32F              = 115,
+    D3DFMT_A32B32G32R32F        = 116,
+    
+    D3DFMT_CxV8U8               = 117,
+
+
+    D3DFMT_FORCE_DWORD          = 0xFFFFFFFF
+} D3DFORMAT;
+
+typedef enum _D3DLIGHTTYPE {
+    D3DLIGHT_POINT          = 1,
+    D3DLIGHT_SPOT           = 2,
+    D3DLIGHT_DIRECTIONAL    = 3,
+
+    D3DLIGHT_FORCE_DWORD    = 0x7fffffff
+} D3DLIGHTTYPE;
+
+typedef enum _D3DMATERIALCOLORSOURCE {
+    D3DMCS_MATERIAL         = 0,
+    D3DMCS_COLOR1           = 1,
+    D3DMCS_COLOR2           = 2,
+
+    D3DMCS_FORCE_DWORD      = 0x7fffffff
+} D3DMATERIALCOLORSOURCE;
+
+typedef enum _D3DMULTISAMPLE_TYPE {
+    D3DMULTISAMPLE_NONE            =  0,
+    D3DMULTISAMPLE_NONMASKABLE     =  1,
+    D3DMULTISAMPLE_2_SAMPLES       =  2,
+    D3DMULTISAMPLE_3_SAMPLES       =  3,
+    D3DMULTISAMPLE_4_SAMPLES       =  4,
+    D3DMULTISAMPLE_5_SAMPLES       =  5,
+    D3DMULTISAMPLE_6_SAMPLES       =  6,
+    D3DMULTISAMPLE_7_SAMPLES       =  7,
+    D3DMULTISAMPLE_8_SAMPLES       =  8,
+    D3DMULTISAMPLE_9_SAMPLES       =  9,
+    D3DMULTISAMPLE_10_SAMPLES      = 10,
+    D3DMULTISAMPLE_11_SAMPLES      = 11,
+    D3DMULTISAMPLE_12_SAMPLES      = 12,
+    D3DMULTISAMPLE_13_SAMPLES      = 13,
+    D3DMULTISAMPLE_14_SAMPLES      = 14,
+    D3DMULTISAMPLE_15_SAMPLES      = 15,
+    D3DMULTISAMPLE_16_SAMPLES      = 16,
+
+    D3DMULTISAMPLE_FORCE_DWORD     = 0x7fffffff
+} D3DMULTISAMPLE_TYPE;
+
+#if 0
+typedef enum _D3DORDERTYPE {
+   D3DORDER_LINEAR      = 1,
+   D3DORDER_QUADRATIC   = 2,
+   D3DORDER_CUBIC       = 3,
+   D3DORDER_QUINTIC     = 5,
+
+   D3DORDER_FORCE_DWORD = 0x7fffffff
+} D3DORDERTYPE;
+#endif
+typedef enum _D3DPATCHEDGESTYLE {
+   D3DPATCHEDGE_DISCRETE    = 0,
+   D3DPATCHEDGE_CONTINUOUS  = 1,
+
+   D3DPATCHEDGE_FORCE_DWORD = 0x7fffffff,
+} D3DPATCHEDGESTYLE;
+
+typedef enum _D3DPOOL {
+    D3DPOOL_DEFAULT                 = 0,
+    D3DPOOL_MANAGED                 = 1,
+    D3DPOOL_SYSTEMMEM               = 2,
+    D3DPOOL_SCRATCH                 = 3,
+
+    D3DPOOL_FORCE_DWORD             = 0x7fffffff
+} D3DPOOL;
+
+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
+} D3DPRIMITIVETYPE;
+
+typedef enum _D3DRENDERSTATETYPE {
+    D3DRS_ZENABLE                   =   7,
+    D3DRS_FILLMODE                  =   8,
+    D3DRS_SHADEMODE                 =   9,
+    D3DRS_ZWRITEENABLE              =  14,
+    D3DRS_ALPHATESTENABLE           =  15,
+    D3DRS_LASTPIXEL                 =  16,
+    D3DRS_SRCBLEND                  =  19,
+    D3DRS_DESTBLEND                 =  20,
+    D3DRS_CULLMODE                  =  22,
+    D3DRS_ZFUNC                     =  23,
+    D3DRS_ALPHAREF                  =  24,
+    D3DRS_ALPHAFUNC                 =  25,
+    D3DRS_DITHERENABLE              =  26,
+    D3DRS_ALPHABLENDENABLE          =  27,
+    D3DRS_FOGENABLE                 =  28,
+    D3DRS_SPECULARENABLE            =  29,
+    D3DRS_FOGCOLOR                  =  34,
+    D3DRS_FOGTABLEMODE              =  35,
+    D3DRS_FOGSTART                  =  36,
+    D3DRS_FOGEND                    =  37,
+    D3DRS_FOGDENSITY                =  38,
+    D3DRS_RANGEFOGENABLE            =  48,
+    D3DRS_STENCILENABLE             =  52,
+    D3DRS_STENCILFAIL               =  53,
+    D3DRS_STENCILZFAIL              =  54,
+    D3DRS_STENCILPASS               =  55,
+    D3DRS_STENCILFUNC               =  56,
+    D3DRS_STENCILREF                =  57,
+    D3DRS_STENCILMASK               =  58,
+    D3DRS_STENCILWRITEMASK          =  59,
+    D3DRS_TEXTUREFACTOR             =  60,
+    D3DRS_WRAP0                     = 128,
+    D3DRS_WRAP1                     = 129,
+    D3DRS_WRAP2                     = 130,
+    D3DRS_WRAP3                     = 131,
+    D3DRS_WRAP4                     = 132,
+    D3DRS_WRAP5                     = 133,
+    D3DRS_WRAP6                     = 134,
+    D3DRS_WRAP7                     = 135,
+    D3DRS_CLIPPING                  = 136,
+    D3DRS_LIGHTING                  = 137,
+    D3DRS_AMBIENT                   = 139,
+    D3DRS_FOGVERTEXMODE             = 140,
+    D3DRS_COLORVERTEX               = 141,
+    D3DRS_LOCALVIEWER               = 142,
+    D3DRS_NORMALIZENORMALS          = 143,
+    D3DRS_DIFFUSEMATERIALSOURCE     = 145,
+    D3DRS_SPECULARMATERIALSOURCE    = 146,
+    D3DRS_AMBIENTMATERIALSOURCE     = 147,
+    D3DRS_EMISSIVEMATERIALSOURCE    = 148,
+    D3DRS_VERTEXBLEND               = 151,
+    D3DRS_CLIPPLANEENABLE           = 152,
+    D3DRS_POINTSIZE                 = 154,
+    D3DRS_POINTSIZE_MIN             = 155,
+    D3DRS_POINTSPRITEENABLE         = 156,
+    D3DRS_POINTSCALEENABLE          = 157,
+    D3DRS_POINTSCALE_A              = 158,
+    D3DRS_POINTSCALE_B              = 159,
+    D3DRS_POINTSCALE_C              = 160,
+    D3DRS_MULTISAMPLEANTIALIAS      = 161,
+    D3DRS_MULTISAMPLEMASK           = 162,
+    D3DRS_PATCHEDGESTYLE            = 163,
+    D3DRS_DEBUGMONITORTOKEN         = 165,
+    D3DRS_POINTSIZE_MAX             = 166,
+    D3DRS_INDEXEDVERTEXBLENDENABLE  = 167,
+    D3DRS_COLORWRITEENABLE          = 168,
+    D3DRS_TWEENFACTOR               = 170,
+    D3DRS_BLENDOP                   = 171,
+    D3DRS_POSITIONDEGREE            = 172,
+    D3DRS_NORMALDEGREE              = 173,
+    D3DRS_SCISSORTESTENABLE         = 174,
+    D3DRS_SLOPESCALEDEPTHBIAS       = 175,
+    D3DRS_ANTIALIASEDLINEENABLE     = 176,
+    D3DRS_MINTESSELLATIONLEVEL      = 178,
+    D3DRS_MAXTESSELLATIONLEVEL      = 179,
+    D3DRS_ADAPTIVETESS_X            = 180,
+    D3DRS_ADAPTIVETESS_Y            = 181,
+    D3DRS_ADAPTIVETESS_Z            = 182,
+    D3DRS_ADAPTIVETESS_W            = 183,
+    D3DRS_ENABLEADAPTIVETESSELLATION= 184,
+    D3DRS_TWOSIDEDSTENCILMODE       = 185,
+    D3DRS_CCW_STENCILFAIL           = 186,
+    D3DRS_CCW_STENCILZFAIL          = 187,
+    D3DRS_CCW_STENCILPASS           = 188,
+    D3DRS_CCW_STENCILFUNC           = 189,
+    D3DRS_COLORWRITEENABLE1         = 190,
+    D3DRS_COLORWRITEENABLE2         = 191,
+    D3DRS_COLORWRITEENABLE3         = 192,
+    D3DRS_BLENDFACTOR               = 193,
+    D3DRS_SRGBWRITEENABLE           = 194,
+    D3DRS_DEPTHBIAS                 = 195,
+    D3DRS_WRAP8                     = 198,
+    D3DRS_WRAP9                     = 199,
+    D3DRS_WRAP10                    = 200,
+    D3DRS_WRAP11                    = 201,
+    D3DRS_WRAP12                    = 202,
+    D3DRS_WRAP13                    = 203,
+    D3DRS_WRAP14                    = 204,
+    D3DRS_WRAP15                    = 205,
+    D3DRS_SEPARATEALPHABLENDENABLE  = 206,
+    D3DRS_SRCBLENDALPHA             = 207,
+    D3DRS_DESTBLENDALPHA            = 208,
+    D3DRS_BLENDOPALPHA              = 209,
+
+    D3DRS_FORCE_DWORD               = 0x7fffffff
+} D3DRENDERSTATETYPE;
+
+typedef enum _D3DRESOURCETYPE {
+    D3DRTYPE_SURFACE                =  1,
+    D3DRTYPE_VOLUME                 =  2,
+    D3DRTYPE_TEXTURE                =  3,
+    D3DRTYPE_VOLUMETEXTURE          =  4,
+    D3DRTYPE_CUBETEXTURE            =  5,
+    D3DRTYPE_VERTEXBUFFER           =  6,
+    D3DRTYPE_INDEXBUFFER            =  7,
+
+    D3DRTYPE_FORCE_DWORD            = 0x7fffffff
+} D3DRESOURCETYPE;
+
+#define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)
+
+typedef enum _D3DSHADEMODE {
+    D3DSHADE_FLAT               = 1,
+    D3DSHADE_GOURAUD            = 2,
+    D3DSHADE_PHONG              = 3,
+
+    D3DSHADE_FORCE_DWORD        = 0x7fffffff
+} D3DSHADEMODE;
+
+typedef enum _D3DSTATEBLOCKTYPE {
+    D3DSBT_ALL           = 1,
+    D3DSBT_PIXELSTATE    = 2,
+    D3DSBT_VERTEXSTATE   = 3,
+
+    D3DSBT_FORCE_DWORD   = 0xffffffff
+} D3DSTATEBLOCKTYPE;
+
+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
+} D3DSTENCILOP;
+
+typedef enum _D3DSWAPEFFECT {
+    D3DSWAPEFFECT_DISCARD         = 1,
+    D3DSWAPEFFECT_FLIP            = 2,
+    D3DSWAPEFFECT_COPY            = 3,
+    D3DSWAPEFFECT_FORCE_DWORD     = 0xFFFFFFFF
+} D3DSWAPEFFECT;
+
+typedef enum _D3DTEXTUREADDRESS {
+    D3DTADDRESS_WRAP            = 1,
+    D3DTADDRESS_MIRROR          = 2,
+    D3DTADDRESS_CLAMP           = 3,
+    D3DTADDRESS_BORDER          = 4,
+    D3DTADDRESS_MIRRORONCE      = 5,
+
+    D3DTADDRESS_FORCE_DWORD     = 0x7fffffff
+} D3DTEXTUREADDRESS;
+
+typedef enum _D3DTEXTUREFILTERTYPE {
+    D3DTEXF_NONE            = 0,
+    D3DTEXF_POINT           = 1,
+    D3DTEXF_LINEAR          = 2,
+    D3DTEXF_ANISOTROPIC     = 3,
+    D3DTEXF_FLATCUBIC       = 4,
+    D3DTEXF_GAUSSIANCUBIC   = 5,
+    D3DTEXF_PYRAMIDALQUAD   = 6,
+    D3DTEXF_GAUSSIANQUAD    = 7,
+    D3DTEXF_FORCE_DWORD     = 0x7fffffff
+} D3DTEXTUREFILTERTYPE;
+
+typedef enum _D3DTEXTUREOP {
+    D3DTOP_DISABLE                   =  1,
+    D3DTOP_SELECTARG1                =  2,
+    D3DTOP_SELECTARG2                =  3,
+    D3DTOP_MODULATE                  =  4,
+    D3DTOP_MODULATE2X                =  5,
+    D3DTOP_MODULATE4X                =  6,
+    D3DTOP_ADD                       =  7,
+    D3DTOP_ADDSIGNED                 =  8,
+    D3DTOP_ADDSIGNED2X               =  9,
+    D3DTOP_SUBTRACT                  = 10,
+    D3DTOP_ADDSMOOTH                 = 11,
+    D3DTOP_BLENDDIFFUSEALPHA         = 12,
+    D3DTOP_BLENDTEXTUREALPHA         = 13,
+    D3DTOP_BLENDFACTORALPHA          = 14,
+    D3DTOP_BLENDTEXTUREALPHAPM       = 15,
+    D3DTOP_BLENDCURRENTALPHA         = 16,
+    D3DTOP_PREMODULATE               = 17,
+    D3DTOP_MODULATEALPHA_ADDCOLOR    = 18,
+    D3DTOP_MODULATECOLOR_ADDALPHA    = 19,
+    D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
+    D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
+    D3DTOP_BUMPENVMAP                = 22,
+    D3DTOP_BUMPENVMAPLUMINANCE       = 23,
+    D3DTOP_DOTPRODUCT3               = 24,
+    D3DTOP_MULTIPLYADD               = 25,
+    D3DTOP_LERP                      = 26,
+
+    D3DTOP_FORCE_DWORD               = 0x7fffffff,
+} D3DTEXTUREOP;
+
+typedef enum _D3DTEXTURESTAGESTATETYPE {
+    D3DTSS_COLOROP               =  1,
+    D3DTSS_COLORARG1             =  2,
+    D3DTSS_COLORARG2             =  3,
+    D3DTSS_ALPHAOP               =  4,
+    D3DTSS_ALPHAARG1             =  5,
+    D3DTSS_ALPHAARG2             =  6,
+    D3DTSS_BUMPENVMAT00          =  7,
+    D3DTSS_BUMPENVMAT01          =  8,
+    D3DTSS_BUMPENVMAT10          =  9,
+    D3DTSS_BUMPENVMAT11          = 10,
+    D3DTSS_TEXCOORDINDEX         = 11,
+    D3DTSS_BUMPENVLSCALE         = 22,
+    D3DTSS_BUMPENVLOFFSET        = 23,
+    D3DTSS_TEXTURETRANSFORMFLAGS = 24,
+    D3DTSS_COLORARG0             = 26,
+    D3DTSS_ALPHAARG0             = 27,
+    D3DTSS_RESULTARG             = 28,
+    D3DTSS_CONSTANT              = 32,
+
+    D3DTSS_FORCE_DWORD           = 0x7fffffff
+} D3DTEXTURESTAGESTATETYPE;
+
+typedef enum _D3DTEXTURETRANSFORMFLAGS {
+    D3DTTFF_DISABLE         =   0,
+    D3DTTFF_COUNT1          =   1,
+    D3DTTFF_COUNT2          =   2,
+    D3DTTFF_COUNT3          =   3,
+    D3DTTFF_COUNT4          =   4,
+    D3DTTFF_PROJECTED       = 256,
+
+    D3DTTFF_FORCE_DWORD     = 0x7fffffff
+} D3DTEXTURETRANSFORMFLAGS;
+
+typedef enum _D3DTRANSFORMSTATETYPE {
+    D3DTS_VIEW            =  2,
+    D3DTS_PROJECTION      =  3,
+    D3DTS_TEXTURE0        = 16,
+    D3DTS_TEXTURE1        = 17,
+    D3DTS_TEXTURE2        = 18,
+    D3DTS_TEXTURE3        = 19,
+    D3DTS_TEXTURE4        = 20,
+    D3DTS_TEXTURE5        = 21,
+    D3DTS_TEXTURE6        = 22,
+    D3DTS_TEXTURE7        = 23,
+
+    D3DTS_FORCE_DWORD     = 0x7fffffff
+} D3DTRANSFORMSTATETYPE;
+
+typedef enum _D3DVERTEXBLENDFLAGS {
+    D3DVBF_DISABLE  =   0,
+    D3DVBF_1WEIGHTS =   1,
+    D3DVBF_2WEIGHTS =   2,
+    D3DVBF_3WEIGHTS =   3,
+    D3DVBF_TWEENING = 255,
+    D3DVBF_0WEIGHTS = 256
+} D3DVERTEXBLENDFLAGS;
+
+typedef enum _D3DZBUFFERTYPE {
+    D3DZB_FALSE                 = 0,
+    D3DZB_TRUE                  = 1,
+    D3DZB_USEW                  = 2,
+
+    D3DZB_FORCE_DWORD           = 0x7fffffff
+} D3DZBUFFERTYPE;
+
+typedef enum _D3DSAMPLERSTATETYPE {
+    D3DSAMP_ADDRESSU       = 1,
+    D3DSAMP_ADDRESSV       = 2,
+    D3DSAMP_ADDRESSW       = 3,
+    D3DSAMP_BORDERCOLOR    = 4,
+    D3DSAMP_MAGFILTER      = 5,
+    D3DSAMP_MINFILTER      = 6,
+    D3DSAMP_MIPFILTER      = 7,
+    D3DSAMP_MIPMAPLODBIAS  = 8,
+    D3DSAMP_MAXMIPLEVEL    = 9,
+    D3DSAMP_MAXANISOTROPY  = 10,
+    D3DSAMP_SRGBTEXTURE    = 11,
+    D3DSAMP_ELEMENTINDEX   = 12,
+    D3DSAMP_DMAPOFFSET     = 13,
+                                
+    D3DSAMP_FORCE_DWORD   = 0x7fffffff,
+} D3DSAMPLERSTATETYPE;
+
+
+/*****************************************************************************
+ * Direct 3D v9 typedefs
+ */
+#ifndef D3DCOLOR_DEFINED
+typedef DWORD D3DCOLOR;
+#define D3DCOLOR_DEFINED
+#endif
+
+/*****************************************************************************
+ * Direct 3D v9 structures
+ */
+typedef struct _D3DADAPTER_IDENTIFIER9 {
+    char            Driver[MAX_DEVICE_IDENTIFIER_STRING];
+    char            Description[MAX_DEVICE_IDENTIFIER_STRING];
+    char            DeviceName[32];
+    LARGE_INTEGER   DriverVersion; 
+
+    DWORD           VendorId;
+    DWORD           DeviceId;
+    DWORD           SubSysId;
+    DWORD           Revision;
+
+    GUID            DeviceIdentifier;
+
+    DWORD           WHQLLevel;
+} D3DADAPTER_IDENTIFIER9;
+
+typedef struct _D3DBOX {
+    UINT                Left;
+    UINT                Top;
+    UINT                Right;
+    UINT                Bottom;
+    UINT                Front;
+    UINT                Back;
+} D3DBOX;
+
+typedef struct _D3DCLIPSTATUS9 {
+   DWORD ClipUnion;
+   DWORD ClipIntersection;
+} D3DCLIPSTATUS9;
+
+#ifndef D3DCOLORVALUE_DEFINED
+typedef struct _D3DCOLORVALUE {
+    float r;
+    float g;
+    float b;
+    float a;
+} D3DCOLORVALUE;
+#define D3DCOLORVALUE_DEFINED
+#endif
+
+typedef struct _D3DDEVICE_CREATION_PARAMETERS {
+    UINT          AdapterOrdinal;
+    D3DDEVTYPE    DeviceType;
+    HWND          hFocusWindow;
+    DWORD         BehaviorFlags;
+} D3DDEVICE_CREATION_PARAMETERS;
+
+typedef struct _D3DDEVINFO_D3D9BANDWIDTHTIMINGS {
+    float         MaxBandwidthUtilized;
+    float         FrontEndUploadMemoryUtilizedPercent;
+    float         VertexRateUtilizedPercent;
+    float         TriangleSetupRateUtilizedPercent;
+    float         FillRateUtilizedPercent;
+} D3DDEVINFO_D3D9BANDWIDTHTIMINGS;
+
+typedef struct _D3DDEVINFO_D3D9CACHEUTILIZATION {
+    float         TextureCacheHitRate;
+    float         PostTransformVertexCacheHitRate;
+} D3DDEVINFO_D3D9CACHEUTILIZATION;
+
+typedef struct _D3DDEVINFO_D3D9INTERFACETIMINGS {
+    float         WaitingForGPUToUseApplicationResourceTimePercent;
+    float         WaitingForGPUToAcceptMoreCommandsTimePercent;
+    float         WaitingForGPUToStayWithinLatencyTimePercent;
+    float         WaitingForGPUExclusiveResourceTimePercent;
+    float         WaitingForGPUOtherTimePercent;
+} D3DDEVINFO_D3D9INTERFACETIMINGS;
+
+typedef struct _D3DDEVINFO_D3D9PIPELINETIMINGS {
+    float         VertexProcessingTimePercent;
+    float         PixelProcessingTimePercent;
+    float         OtherGPUProcessingTimePercent;
+    float         GPUIdleTimePercent;
+} D3DDEVINFO_D3D9PIPELINETIMINGS;
+
+typedef struct _D3DDEVINFO_D3D9STAGETIMINGS {
+    float         MemoryProcessingPercent;
+    float         ComputationProcessingPercent;
+} D3DDEVINFO_D3D9STAGETIMINGS;
+
+
+/* Vertex cache optimization hints. */
+typedef struct D3DDEVINFO_VCACHE {
+    /* Must be a 4 char code FOURCC (e.g. CACH) */
+    DWORD         Pattern; 
+    /* 0 to get the longest  strips, 1 vertex cache */
+    DWORD         OptMethod; 
+     /* Cache size to use (only valid if OptMethod==1) */
+    DWORD         CacheSize;
+    /* internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1) */
+    DWORD         MagicNumber; 
+} D3DDEVINFO_VCACHE;
+
+typedef struct D3DRESOURCESTATS {
+    BOOL                bThrashing;
+    DWORD               ApproxBytesDownloaded;
+    DWORD               NumEvicts;
+    DWORD               NumVidCreates;
+    DWORD               LastPri;
+    DWORD               NumUsed;
+    DWORD               NumUsedInVidMem;
+    DWORD               WorkingSet;
+    DWORD               WorkingSetBytes;
+    DWORD               TotalManaged;
+    DWORD               TotalBytes;
+} D3DRESOURCESTATS;
+
+typedef struct _D3DDEVINFO_D3DRESOURCEMANAGER {
+    D3DRESOURCESTATS stats[D3DRTYPECOUNT];
+} D3DDEVINFO_D3DRESOURCEMANAGER;
+
+typedef struct _D3DDEVINFO_D3DVERTEXSTATS {
+    DWORD NumRenderedTriangles;
+    DWORD NumExtraClippingTriangles;
+} D3DDEVINFO_D3DVERTEXSTATS;
+
+typedef struct _D3DDISPLAYMODE {
+    UINT            Width;
+    UINT            Height;
+    UINT            RefreshRate;
+    D3DFORMAT       Format;
+} D3DDISPLAYMODE;
+
+typedef struct _D3DGAMMARAMP {
+    WORD                red  [256];
+    WORD                green[256];
+    WORD                blue [256];
+} D3DGAMMARAMP;
+
+typedef struct _D3DINDEXBUFFER_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+    UINT                Size;
+} D3DINDEXBUFFER_DESC;
+
+#ifndef D3DVECTOR_DEFINED
+typedef struct _D3DVECTOR {
+    float x;
+    float y;
+    float z;
+} D3DVECTOR;
+#define D3DVECTOR_DEFINED
+#endif
+
+typedef struct _D3DLIGHT9 {
+    D3DLIGHTTYPE    Type;
+    D3DCOLORVALUE   Diffuse;
+    D3DCOLORVALUE   Specular;
+    D3DCOLORVALUE   Ambient;
+    D3DVECTOR       Position;
+    D3DVECTOR       Direction;
+    float           Range;
+    float           Falloff;
+    float           Attenuation0;
+    float           Attenuation1;
+    float           Attenuation2;
+    float           Theta;
+    float           Phi;
+} D3DLIGHT9;
+
+typedef struct _D3DLINEPATTERN {
+    WORD    wRepeatFactor;
+    WORD    wLinePattern;
+} D3DLINEPATTERN;
+
+typedef struct _D3DLOCKED_BOX {
+    INT                 RowPitch;
+    INT                 SlicePitch;
+    void*               pBits;
+} D3DLOCKED_BOX;
+
+typedef struct _D3DLOCKED_RECT {
+    INT                 Pitch;
+    void*               pBits;
+} D3DLOCKED_RECT;
+
+typedef struct _D3DMATERIAL9 {
+    D3DCOLORVALUE   Diffuse;
+    D3DCOLORVALUE   Ambient;
+    D3DCOLORVALUE   Specular;
+    D3DCOLORVALUE   Emissive;
+    float           Power;
+} D3DMATERIAL9;
+
+#ifndef D3DMATRIX_DEFINED
+typedef struct _D3DMATRIX {
+    union {
+        struct {
+            float        _11, _12, _13, _14;
+            float        _21, _22, _23, _24;
+            float        _31, _32, _33, _34;
+            float        _41, _42, _43, _44;
+        } DUMMYSTRUCTNAME;
+        float m[4][4];
+    } DUMMYUNIONNAME;
+} D3DMATRIX;
+#define D3DMATRIX_DEFINED
+#endif
+
+typedef struct _D3DPRESENT_PARAMETERS_ {
+    UINT                    BackBufferWidth;
+    UINT                    BackBufferHeight;
+    D3DFORMAT               BackBufferFormat;
+    UINT                    BackBufferCount;
+
+    D3DMULTISAMPLE_TYPE     MultiSampleType;
+    DWORD                   MultiSampleQuality;
+
+    D3DSWAPEFFECT           SwapEffect;
+    HWND                    hDeviceWindow;
+    BOOL                    Windowed;
+    BOOL                    EnableAutoDepthStencil;
+    D3DFORMAT               AutoDepthStencilFormat;
+    DWORD                   Flags;
+
+    UINT                    FullScreen_RefreshRateInHz;
+    UINT                    PresentationInterval;
+
+} D3DPRESENT_PARAMETERS;
+
+typedef struct _D3DRANGE {
+    UINT                Offset;
+    UINT                Size;
+} D3DRANGE;
+
+typedef struct _D3DRASTER_STATUS {
+    BOOL            InVBlank;
+    UINT            ScanLine;
+} D3DRASTER_STATUS;
+
+#ifndef D3DRECT_DEFINED
+typedef struct _D3DRECT {
+    LONG x1;
+    LONG y1;
+    LONG x2;
+    LONG y2;
+} D3DRECT;
+#define D3DRECT_DEFINED
+#endif
+
+typedef struct _D3DRECTPATCH_INFO {
+    UINT                StartVertexOffsetWidth;
+    UINT                StartVertexOffsetHeight;
+    UINT                Width;
+    UINT                Height;
+    UINT                Stride;
+    D3DBASISTYPE        Basis;
+    D3DDEGREETYPE       Degree;
+} D3DRECTPATCH_INFO;
+
+typedef struct _D3DSURFACE_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+    D3DMULTISAMPLE_TYPE MultiSampleType;
+    DWORD               MultiSampleQuality;
+    UINT                Width;
+    UINT                Height;
+} D3DSURFACE_DESC;
+
+typedef struct _D3DTRIPATCH_INFO {
+    UINT                StartVertexOffset;
+    UINT                NumVertices;
+    D3DBASISTYPE        Basis;
+    D3DDEGREETYPE       Degree;
+} D3DTRIPATCH_INFO;
+
+typedef struct _D3DVERTEXBUFFER_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+    UINT                Size;
+    DWORD               FVF;
+} D3DVERTEXBUFFER_DESC;
+
+typedef struct _D3DVIEWPORT9 {
+    DWORD       X;
+    DWORD       Y;
+    DWORD       Width;
+    DWORD       Height;
+    float       MinZ;
+    float       MaxZ;
+} D3DVIEWPORT9;
+
+typedef struct _D3DVOLUME_DESC {
+    D3DFORMAT           Format;
+    D3DRESOURCETYPE     Type;
+    DWORD               Usage;
+    D3DPOOL             Pool;
+
+    UINT                Width;
+    UINT                Height;
+    UINT                Depth;
+} D3DVOLUME_DESC;
+
+/* Parts added with d3d9ex */
+#if !defined(D3D_DISABLE_9EX)
+typedef enum D3DSCANLINEORDERING
+{
+    D3DSCANLINEORDERING_UNKNOWN,
+    D3DSCANLINEORDERING_PROGRESSIVE,
+    D3DSCANLINEORDERING_INTERLACED,
+} D3DSCANLINEORDERING;
+
+
+typedef struct D3DDISPLAYMODEFILTER
+{
+    UINT                Size;
+    D3DFORMAT           Format;
+    D3DSCANLINEORDERING ScanLineOrdering;
+} D3DDISPLAYMODEFILTER;
+
+typedef struct D3DDISPLAYMODEEX
+{
+    UINT                Size;
+    UINT                Width;
+    UINT                Height;
+    UINT                RefreshRate;
+    D3DFORMAT           Format;
+    D3DSCANLINEORDERING ScanLineOrdering;
+} D3DDISPLAYMODEEX;
+
+typedef enum D3DDISPLAYROTATION
+{
+    D3DDISPLAYROTATION_IDENTITY = 1,
+    D3DDISPLAYROTATION_90,
+    D3DDISPLAYROTATION_180,
+    D3DDISPLAYROTATION_270
+} D3DDISPLAYROTATION;
+
+typedef enum _D3DCOMPOSERECTSOP{
+    D3DCOMPOSERECTS_COPY        = 1,
+    D3DCOMPOSERECTS_OR,
+    D3DCOMPOSERECTS_AND,
+    D3DCOMPOSERECTS_NEG,
+    D3DCOMPOSERECTS_FORCE_DWORD = 0x7fffffff
+} D3DCOMPOSERECTSOP;
+#endif /* D3D_DISABLE_9EX */
+
+typedef enum _D3DSHADER_COMPARISON
+{
+    D3DSPC_RESERVED0 = 0,
+    D3DSPC_GT,
+    D3DSPC_EQ,
+    D3DSPC_GE,
+    D3DSPC_LT,
+    D3DSPC_NE,
+    D3DSPC_LE,
+    D3DSPC_RESERVED1,
+} D3DSHADER_COMPARISON;
+
+#endif /* __WINE_D3D9TYPES_H */
diff --git a/misc/builddeps/dp.win32/include/d3dcaps.h b/misc/builddeps/dp.win32/include/d3dcaps.h
new file mode 100644 (file)
index 0000000..b44c49d
--- /dev/null
@@ -0,0 +1,432 @@
+/*
+ * Copyright (C) 2000 Peter Hunnisett
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3DCAPS_H
+#define __WINE_D3DCAPS_H
+
+#include <ddraw.h>
+
+typedef struct _D3DTRANSFORMCAPS {
+       DWORD dwSize;
+       DWORD dwCaps;
+} D3DTRANSFORMCAPS, *LPD3DTRANSFORMCAPS;
+
+#define D3DTRANSFORMCAPS_CLIP           0x00000001L
+
+typedef struct _D3DLIGHTINGCAPS {
+       DWORD dwSize;
+       DWORD dwCaps;
+       DWORD dwLightingModel;
+       DWORD dwNumLights;
+} D3DLIGHTINGCAPS, *LPD3DLIGHTINGCAPS;
+
+#define D3DLIGHTINGMODEL_RGB            0x00000001
+#define D3DLIGHTINGMODEL_MONO           0x00000002
+
+#define D3DLIGHTCAPS_POINT              0x00000001
+#define D3DLIGHTCAPS_SPOT               0x00000002
+#define D3DLIGHTCAPS_DIRECTIONAL        0x00000004
+#define D3DLIGHTCAPS_PARALLELPOINT      0x00000008
+#define D3DLIGHTCAPS_GLSPOT             0x00000010
+
+typedef struct _D3dPrimCaps {
+    DWORD dwSize;
+    DWORD dwMiscCaps;
+    DWORD dwRasterCaps;
+    DWORD dwZCmpCaps;
+    DWORD dwSrcBlendCaps;
+    DWORD dwDestBlendCaps;
+    DWORD dwAlphaCmpCaps;
+    DWORD dwShadeCaps;
+    DWORD dwTextureCaps;
+    DWORD dwTextureFilterCaps;
+    DWORD dwTextureBlendCaps;
+    DWORD dwTextureAddressCaps;
+    DWORD dwStippleWidth;
+    DWORD dwStippleHeight;
+} D3DPRIMCAPS, *LPD3DPRIMCAPS;
+
+#define D3DPMISCCAPS_MASKPLANES         0x00000001
+#define D3DPMISCCAPS_MASKZ              0x00000002
+#define D3DPMISCCAPS_LINEPATTERNREP     0x00000004
+#define D3DPMISCCAPS_CONFORMANT         0x00000008
+#define D3DPMISCCAPS_CULLNONE           0x00000010
+#define D3DPMISCCAPS_CULLCW             0x00000020
+#define D3DPMISCCAPS_CULLCCW            0x00000040
+
+#define D3DPRASTERCAPS_DITHER                     0x00000001
+#define D3DPRASTERCAPS_ROP2                       0x00000002
+#define D3DPRASTERCAPS_XOR                        0x00000004
+#define D3DPRASTERCAPS_PAT                        0x00000008
+#define D3DPRASTERCAPS_ZTEST                      0x00000010
+#define D3DPRASTERCAPS_SUBPIXEL                   0x00000020
+#define D3DPRASTERCAPS_SUBPIXELX                  0x00000040
+#define D3DPRASTERCAPS_FOGVERTEX                  0x00000080
+#define D3DPRASTERCAPS_FOGTABLE                   0x00000100
+#define D3DPRASTERCAPS_STIPPLE                    0x00000200
+#define D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT     0x00000400
+#define D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT   0x00000800
+#define D3DPRASTERCAPS_ANTIALIASEDGES             0x00001000
+#define D3DPRASTERCAPS_MIPMAPLODBIAS              0x00002000
+#define D3DPRASTERCAPS_ZBIAS                      0x00004000
+#define D3DPRASTERCAPS_ZBUFFERLESSHSR             0x00008000
+#define D3DPRASTERCAPS_FOGRANGE                   0x00010000
+#define D3DPRASTERCAPS_ANISOTROPY                 0x00020000
+#define D3DPRASTERCAPS_WBUFFER                    0x00040000
+#define D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT 0x00080000
+#define D3DPRASTERCAPS_WFOG                       0x00100000
+#define D3DPRASTERCAPS_ZFOG                       0x00200000
+
+#define D3DPCMPCAPS_NEVER               0x00000001
+#define D3DPCMPCAPS_LESS                0x00000002
+#define D3DPCMPCAPS_EQUAL               0x00000004
+#define D3DPCMPCAPS_LESSEQUAL           0x00000008
+#define D3DPCMPCAPS_GREATER             0x00000010
+#define D3DPCMPCAPS_NOTEQUAL            0x00000020
+#define D3DPCMPCAPS_GREATEREQUAL        0x00000040
+#define D3DPCMPCAPS_ALWAYS              0x00000080
+
+#define D3DPBLENDCAPS_ZERO              0x00000001
+#define D3DPBLENDCAPS_ONE               0x00000002
+#define D3DPBLENDCAPS_SRCCOLOR          0x00000004
+#define D3DPBLENDCAPS_INVSRCCOLOR       0x00000008
+#define D3DPBLENDCAPS_SRCALPHA          0x00000010
+#define D3DPBLENDCAPS_INVSRCALPHA       0x00000020
+#define D3DPBLENDCAPS_DESTALPHA         0x00000040
+#define D3DPBLENDCAPS_INVDESTALPHA      0x00000080
+#define D3DPBLENDCAPS_DESTCOLOR         0x00000100
+#define D3DPBLENDCAPS_INVDESTCOLOR      0x00000200
+#define D3DPBLENDCAPS_SRCALPHASAT       0x00000400
+#define D3DPBLENDCAPS_BOTHSRCALPHA      0x00000800
+#define D3DPBLENDCAPS_BOTHINVSRCALPHA   0x00001000
+
+#define D3DPSHADECAPS_COLORFLATMONO     0x00000001
+#define D3DPSHADECAPS_COLORFLATRGB      0x00000002
+#define D3DPSHADECAPS_COLORGOURAUDMONO  0x00000004
+#define D3DPSHADECAPS_COLORGOURAUDRGB   0x00000008
+#define D3DPSHADECAPS_COLORPHONGMONO    0x00000010
+#define D3DPSHADECAPS_COLORPHONGRGB     0x00000020
+
+#define D3DPSHADECAPS_SPECULARFLATMONO    0x00000040
+#define D3DPSHADECAPS_SPECULARFLATRGB     0x00000080
+#define D3DPSHADECAPS_SPECULARGOURAUDMONO 0x00000100
+#define D3DPSHADECAPS_SPECULARGOURAUDRGB  0x00000200
+#define D3DPSHADECAPS_SPECULARPHONGMONO   0x00000400
+#define D3DPSHADECAPS_SPECULARPHONGRGB    0x00000800
+
+#define D3DPSHADECAPS_ALPHAFLATBLEND       0x00001000
+#define D3DPSHADECAPS_ALPHAFLATSTIPPLED    0x00002000
+#define D3DPSHADECAPS_ALPHAGOURAUDBLEND    0x00004000
+#define D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED 0x00008000
+#define D3DPSHADECAPS_ALPHAPHONGBLEND      0x00010000
+#define D3DPSHADECAPS_ALPHAPHONGSTIPPLED   0x00020000
+
+#define D3DPSHADECAPS_FOGFLAT           0x00040000
+#define D3DPSHADECAPS_FOGGOURAUD        0x00080000
+#define D3DPSHADECAPS_FOGPHONG          0x00100000
+
+#define D3DPTEXTURECAPS_PERSPECTIVE              0x00000001
+#define D3DPTEXTURECAPS_POW2                     0x00000002
+#define D3DPTEXTURECAPS_ALPHA                    0x00000004
+#define D3DPTEXTURECAPS_TRANSPARENCY             0x00000008
+#define D3DPTEXTURECAPS_BORDER                   0x00000010
+#define D3DPTEXTURECAPS_SQUAREONLY               0x00000020
+#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE 0x00000040
+#define D3DPTEXTURECAPS_ALPHAPALETTE             0x00000080
+#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL  0x00000100L
+/* yes actually 0x00000200 is unused - or at least unreleased */
+#define D3DPTEXTURECAPS_PROJECTED                0x00000400
+#define D3DPTEXTURECAPS_CUBEMAP                  0x00000800
+#define D3DPTEXTURECAPS_COLORKEYBLEND            0x00001000
+
+#define D3DPTFILTERCAPS_NEAREST           0x00000001
+#define D3DPTFILTERCAPS_LINEAR            0x00000002
+#define D3DPTFILTERCAPS_MIPNEAREST        0x00000004
+#define D3DPTFILTERCAPS_MIPLINEAR         0x00000008
+#define D3DPTFILTERCAPS_LINEARMIPNEAREST  0x00000010
+#define D3DPTFILTERCAPS_LINEARMIPLINEAR   0x00000020
+/* yes - missing numbers */
+#define D3DPTFILTERCAPS_MINFPOINT         0x00000100
+#define D3DPTFILTERCAPS_MINFLINEAR        0x00000200
+#define D3DPTFILTERCAPS_MINFANISOTROPIC   0x00000400
+/* yes - missing numbers */
+#define D3DPTFILTERCAPS_MIPFPOINT         0x00010000
+#define D3DPTFILTERCAPS_MIPFLINEAR        0x00020000
+/* yes - missing numbers */
+#define D3DPTFILTERCAPS_MAGFPOINT         0x01000000
+#define D3DPTFILTERCAPS_MAGFLINEAR        0x02000000
+#define D3DPTFILTERCAPS_MAGFANISOTROPIC   0x04000000
+#define D3DPTFILTERCAPS_MAGFAFLATCUBIC    0x08000000
+#define D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC 0x10000000
+
+#define D3DPTBLENDCAPS_DECAL            0x00000001
+#define D3DPTBLENDCAPS_MODULATE         0x00000002
+#define D3DPTBLENDCAPS_DECALALPHA       0x00000004
+#define D3DPTBLENDCAPS_MODULATEALPHA    0x00000008
+#define D3DPTBLENDCAPS_DECALMASK        0x00000010
+#define D3DPTBLENDCAPS_MODULATEMASK     0x00000020
+#define D3DPTBLENDCAPS_COPY             0x00000040
+#define D3DPTBLENDCAPS_ADD              0x00000080
+
+#define D3DPTADDRESSCAPS_WRAP           0x00000001
+#define D3DPTADDRESSCAPS_MIRROR         0x00000002
+#define D3DPTADDRESSCAPS_CLAMP          0x00000004
+#define D3DPTADDRESSCAPS_BORDER         0x00000008
+#define D3DPTADDRESSCAPS_INDEPENDENTUV  0x00000010
+
+
+typedef struct _D3DDeviceDesc {
+        DWORD           dwSize;
+        DWORD           dwFlags;
+        D3DCOLORMODEL   dcmColorModel;
+        DWORD           dwDevCaps;
+        D3DTRANSFORMCAPS dtcTransformCaps;
+        BOOL            bClipping;
+        D3DLIGHTINGCAPS dlcLightingCaps;
+        D3DPRIMCAPS     dpcLineCaps;
+        D3DPRIMCAPS     dpcTriCaps;
+        DWORD           dwDeviceRenderBitDepth;
+        DWORD           dwDeviceZBufferBitDepth;
+        DWORD           dwMaxBufferSize;
+        DWORD           dwMaxVertexCount;
+
+        DWORD           dwMinTextureWidth,dwMinTextureHeight;
+        DWORD           dwMaxTextureWidth,dwMaxTextureHeight;
+        DWORD           dwMinStippleWidth,dwMaxStippleWidth;
+        DWORD           dwMinStippleHeight,dwMaxStippleHeight;
+
+        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;
+} D3DDEVICEDESC,*LPD3DDEVICEDESC;
+#define D3DDEVICEDESCSIZE (sizeof(D3DDEVICEDESC))
+
+typedef struct _D3DDeviceDesc7 {
+        DWORD            dwDevCaps;
+        D3DPRIMCAPS      dpcLineCaps;
+        D3DPRIMCAPS      dpcTriCaps;
+        DWORD            dwDeviceRenderBitDepth;
+        DWORD            dwDeviceZBufferBitDepth;
+
+        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;
+#define D3DDEVICEDESC7SIZE (sizeof(D3DDEVICEDESC7))
+
+#define D3DDD_COLORMODEL                0x00000001
+#define D3DDD_DEVCAPS                   0x00000002
+#define D3DDD_TRANSFORMCAPS             0x00000004
+#define D3DDD_LIGHTINGCAPS              0x00000008
+#define D3DDD_BCLIPPING                 0x00000010
+#define D3DDD_LINECAPS                  0x00000020
+#define D3DDD_TRICAPS                   0x00000040
+#define D3DDD_DEVICERENDERBITDEPTH      0x00000080
+#define D3DDD_DEVICEZBUFFERBITDEPTH     0x00000100
+#define D3DDD_MAXBUFFERSIZE             0x00000200
+#define D3DDD_MAXVERTEXCOUNT            0x00000400
+
+#define D3DDEVCAPS_FLOATTLVERTEX           0x00000001
+#define D3DDEVCAPS_SORTINCREASINGZ         0x00000002
+#define D3DDEVCAPS_SORTDECREASINGZ         0X00000004
+#define D3DDEVCAPS_SORTEXACT               0x00000008
+#define D3DDEVCAPS_EXECUTESYSTEMMEMORY     0x00000010
+#define D3DDEVCAPS_EXECUTEVIDEOMEMORY      0x00000020
+#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY    0x00000040
+#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY     0x00000080
+#define D3DDEVCAPS_TEXTURESYSTEMMEMORY     0x00000100
+#define D3DDEVCAPS_TEXTUREVIDEOMEMORY      0x00000200
+#define D3DDEVCAPS_DRAWPRIMTLVERTEX        0x00000400
+#define D3DDEVCAPS_CANRENDERAFTERFLIP      0x00000800
+#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM   0x00001000
+#define D3DDEVCAPS_DRAWPRIMITIVES2         0x00002000
+#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES 0x00004000
+#define D3DDEVCAPS_DRAWPRIMITIVES2EX       0x00008000
+#define D3DDEVCAPS_HWTRANSFORMANDLIGHT     0x00010000
+#define D3DDEVCAPS_CANBLTSYSTONONLOCAL     0x00020000
+#define D3DDEVCAPS_HWRASTERIZATION         0x00080000
+
+#define D3DSTENCILCAPS_KEEP     0x00000001
+#define D3DSTENCILCAPS_ZERO     0x00000002
+#define D3DSTENCILCAPS_REPLACE  0x00000004
+#define D3DSTENCILCAPS_INCRSAT  0x00000008
+#define D3DSTENCILCAPS_DECRSAT  0x00000010
+#define D3DSTENCILCAPS_INVERT   0x00000020
+#define D3DSTENCILCAPS_INCR     0x00000040
+#define D3DSTENCILCAPS_DECR     0x00000080
+
+#define D3DTEXOPCAPS_DISABLE                    0x00000001
+#define D3DTEXOPCAPS_SELECTARG1                 0x00000002
+#define D3DTEXOPCAPS_SELECTARG2                 0x00000004
+#define D3DTEXOPCAPS_MODULATE                   0x00000008
+#define D3DTEXOPCAPS_MODULATE2X                 0x00000010
+#define D3DTEXOPCAPS_MODULATE4X                 0x00000020
+#define D3DTEXOPCAPS_ADD                        0x00000040
+#define D3DTEXOPCAPS_ADDSIGNED                  0x00000080
+#define D3DTEXOPCAPS_ADDSIGNED2X                0x00000100
+#define D3DTEXOPCAPS_SUBTRACT                   0x00000200
+#define D3DTEXOPCAPS_ADDSMOOTH                  0x00000400
+#define D3DTEXOPCAPS_BLENDDIFFUSEALPHA          0x00000800
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHA          0x00001000
+#define D3DTEXOPCAPS_BLENDFACTORALPHA           0x00002000
+#define D3DTEXOPCAPS_BLENDTEXTUREALPHAPM        0x00004000
+#define D3DTEXOPCAPS_BLENDCURRENTALPHA          0x00008000
+#define D3DTEXOPCAPS_PREMODULATE                0x00010000
+#define D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR     0x00020000
+#define D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA     0x00040000
+#define D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR  0x00080000
+#define D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA  0x00100000
+#define D3DTEXOPCAPS_BUMPENVMAP                 0x00200000
+#define D3DTEXOPCAPS_BUMPENVMAPLUMINANCE        0x00400000
+#define D3DTEXOPCAPS_DOTPRODUCT3                0x00800000
+
+#define D3DFVFCAPS_TEXCOORDCOUNTMASK    0x0000FFFF
+#define D3DFVFCAPS_DONOTSTRIPELEMENTS   0x00080000
+
+#define D3DVTXPCAPS_TEXGEN              0x00000001
+#define D3DVTXPCAPS_MATERIALSOURCE7     0x00000002
+#define D3DVTXPCAPS_VERTEXFOG           0x00000004
+#define D3DVTXPCAPS_DIRECTIONALLIGHTS   0x00000008
+#define D3DVTXPCAPS_POSITIONALLIGHTS    0x00000010
+#define D3DVTXPCAPS_LOCALVIEWER         0x00000020
+
+typedef HRESULT (CALLBACK *LPD3DENUMDEVICESCALLBACK)(LPGUID lpGuid,LPSTR lpDeviceDescription,LPSTR lpDeviceName,LPD3DDEVICEDESC,LPD3DDEVICEDESC,LPVOID);
+typedef HRESULT (CALLBACK *LPD3DENUMDEVICESCALLBACK7)(LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPD3DDEVICEDESC7, LPVOID);
+
+#define D3DFDS_COLORMODEL          0x00000001
+#define D3DFDS_GUID                0x00000002
+#define D3DFDS_HARDWARE            0x00000004
+#define D3DFDS_TRIANGLES           0x00000008
+#define D3DFDS_LINES               0x00000010
+#define D3DFDS_MISCCAPS            0x00000020
+#define D3DFDS_RASTERCAPS          0x00000040
+#define D3DFDS_ZCMPCAPS            0x00000080
+#define D3DFDS_ALPHACMPCAPS        0x00000100
+#define D3DFDS_SRCBLENDCAPS        0x00000200
+#define D3DFDS_DSTBLENDCAPS        0x00000400
+#define D3DFDS_SHADECAPS           0x00000800
+#define D3DFDS_TEXTURECAPS         0x00001000
+#define D3DFDS_TEXTUREFILTERCAPS   0x00002000
+#define D3DFDS_TEXTUREBLENDCAPS    0x00004000
+#define D3DFDS_TEXTUREADDRESSCAPS  0x00008000
+
+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;
+    D3DDEVICEDESC       ddHwDesc;
+    D3DDEVICEDESC       ddSwDesc;
+} D3DFINDDEVICERESULT,*LPD3DFINDDEVICERESULT;
+
+typedef struct _D3DExecuteBufferDesc {
+  DWORD  dwSize;
+  DWORD  dwFlags;
+  DWORD  dwCaps;
+  DWORD  dwBufferSize;
+  LPVOID lpData;
+} D3DEXECUTEBUFFERDESC, *LPD3DEXECUTEBUFFERDESC;
+
+#define D3DDEB_BUFSIZE          0x00000001
+#define D3DDEB_CAPS             0x00000002
+#define D3DDEB_LPDATA           0x00000004
+
+#define D3DDEBCAPS_SYSTEMMEMORY 0x00000001
+#define D3DDEBCAPS_VIDEOMEMORY  0x00000002
+#define D3DDEBCAPS_MEM          (D3DDEBCAPS_SYSTEMMEMORY|D3DDEBCAPS_VIDEOMEMORY) /* = 0x3 */
+
+typedef struct _D3DDEVINFO_TEXTUREMANAGER {
+       BOOL    bThrashing;
+       DWORD   dwApproxBytesDownloaded;
+       DWORD   dwNumEvicts;
+       DWORD   dwNumVidCreates;
+       DWORD   dwNumTexturesUsed;
+       DWORD   dwNumUsedTexInVid;
+       DWORD   dwWorkingSet;
+       DWORD   dwWorkingSetBytes;
+       DWORD   dwTotalManaged;
+       DWORD   dwTotalBytes;
+       DWORD   dwLastPri;
+} D3DDEVINFO_TEXTUREMANAGER, *LPD3DDEVINFO_TEXTUREMANAGER;
+
+typedef struct _D3DDEVINFO_TEXTURING {
+       DWORD   dwNumLoads;
+       DWORD   dwApproxBytesLoaded;
+       DWORD   dwNumPreLoads;
+       DWORD   dwNumSet;
+       DWORD   dwNumCreates;
+       DWORD   dwNumDestroys;
+       DWORD   dwNumSetPriorities;
+       DWORD   dwNumSetLODs;
+       DWORD   dwNumLocks;
+       DWORD   dwNumGetDCs;
+} D3DDEVINFO_TEXTURING, *LPD3DDEVINFO_TEXTURING;
+
+
+
+#endif
diff --git a/misc/builddeps/dp.win32/include/d3dhal.h b/misc/builddeps/dp.win32/include/d3dhal.h
new file mode 100644 (file)
index 0000000..806f299
--- /dev/null
@@ -0,0 +1,535 @@
+/*
+ * Direct3D driver interface
+ * (DirectX 7 version)
+ *
+ * Copyright (C) 2001 Ove Kaaven
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _D3DHAL_H_
+#define _D3DHAL_H_
+
+#include <_mingw_dxhelper.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <d3d.h>
+
+/*****************************************************************************
+ * device info structures
+ */
+typedef struct _D3DDeviceDesc_V1 {
+  DWORD                        dwSize;
+  DWORD                        dwFlags;
+  D3DCOLORMODEL                dcmColorModel;
+  DWORD                        dwDevCaps;
+  D3DTRANSFORMCAPS     dtcTransformCaps;
+  WINBOOL              bClipping;
+  D3DLIGHTINGCAPS      dlcLightingCaps;
+  D3DPRIMCAPS          dpcLineCaps;
+  D3DPRIMCAPS          dpcTriCaps;
+  DWORD                        dwDeviceRenderBitDepth;
+  DWORD                        dwDeviceZBufferBitDepth;
+  DWORD                        dwMaxBufferSize;
+  DWORD                        dwMaxVertexCount;
+} D3DDEVICEDESC_V1,*LPD3DDEVICEDESC_V1;
+
+/* this is to allow keeping the bulk of our OpenGL code out of x11drv */
+#define D3DDD_WINE_OPENGL_DEVICE 0x00008000
+
+typedef struct _D3DHAL_GLOBALDRIVERDATA {
+  DWORD                        dwSize;
+  D3DDEVICEDESC_V1     hwCaps;
+  DWORD                        dwNumVertices;
+  DWORD                        dwNumClipVertices;
+  DWORD                        dwNumTextureFormats;
+  LPDDSURFACEDESC      lpTextureFormats;
+} D3DHAL_GLOBALDRIVERDATA;
+
+#ifndef D3DHAL_GLOBALDRIVERDATA_DEFINED
+typedef D3DHAL_GLOBALDRIVERDATA *LPD3DHAL_GLOBALDRIVERDATA;
+#define D3DHAL_GLOBALDRIVERDATA_DEFINED
+#endif
+
+typedef struct _D3DHAL_D3DEXTENDEDCAPS {
+  DWORD                        dwSize;
+  /* DirectX 5 */
+  DWORD                        dwMinTextureWidth, dwMaxTextureWidth;
+  DWORD                        dwMinTextureHeight, dwMaxTextureHeight;
+  DWORD                        dwMinStippleWidth, dwMaxStippleWidth;
+  DWORD                        dwMinStippleHeight, dwMaxStippleHeight;
+  /* DirectX 6 */
+  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;
+  /* DirectX 7 */
+  DWORD                        dwMaxActiveLights;
+  D3DVALUE             dvMaxVertexW;
+  WORD                 wMaxUserClipPlanes;
+  WORD                 wMaxVertexBlendMatrices;
+  DWORD                        dwVertexProcessingCaps;
+  DWORD                        dwReserved1;
+  DWORD                        dwReserved2;
+  DWORD                        dwReserved3;
+  DWORD                        dwReserved4;
+} D3DHAL_D3DEXTENDEDCAPS,*LPD3DHAL_D3DEXTENDEDCAPS;
+
+/*****************************************************************************
+ * d3d->driver callbacks
+ */
+typedef struct _D3DHAL_CONTEXTCREATEDATA       *LPD3DHAL_CONTEXTCREATEDATA;
+typedef struct _D3DHAL_CONTEXTDESTROYDATA      *LPD3DHAL_CONTEXTDESTROYDATA;
+typedef struct _D3DHAL_CONTEXTDESTROYALLDATA   *LPD3DHAL_CONTEXTDESTROYALLDATA;
+typedef struct _D3DHAL_SCENECAPTUREDATA                *LPD3DHAL_SCENECAPTUREDATA;
+typedef struct _D3DHAL_RENDERSTATEDATA         *LPD3DHAL_RENDERSTATEDATA;
+typedef struct _D3DHAL_RENDERPRIMITIVEDATA     *LPD3DHAL_RENDERPRIMITIVEDATA;
+typedef struct _D3DHAL_TEXTURECREATEDATA       *LPD3DHAL_TEXTURECREATEDATA;
+typedef struct _D3DHAL_TEXTUREDESTROYDATA      *LPD3DHAL_TEXTUREDESTROYDATA;
+typedef struct _D3DHAL_TEXTURESWAPDATA         *LPD3DHAL_TEXTURESWAPDATA;
+typedef struct _D3DHAL_TEXTUREGETSURFDATA      *LPD3DHAL_TEXTUREGETSURFDATA;
+typedef struct _D3DHAL_GETSTATEDATA            *LPD3DHAL_GETSTATEDATA;
+
+typedef DWORD (PASCAL *LPD3DHAL_CONTEXTCREATECB)    (LPD3DHAL_CONTEXTCREATEDATA);
+typedef DWORD (PASCAL *LPD3DHAL_CONTEXTDESTROYCB)   (LPD3DHAL_CONTEXTDESTROYDATA);
+typedef DWORD (PASCAL *LPD3DHAL_CONTEXTDESTROYALLCB)(LPD3DHAL_CONTEXTDESTROYALLDATA);
+typedef DWORD (PASCAL *LPD3DHAL_SCENECAPTURECB)            (LPD3DHAL_SCENECAPTUREDATA);
+typedef DWORD (PASCAL *LPD3DHAL_RENDERSTATECB)     (LPD3DHAL_RENDERSTATEDATA);
+typedef DWORD (PASCAL *LPD3DHAL_RENDERPRIMITIVECB)  (LPD3DHAL_RENDERPRIMITIVEDATA);
+typedef DWORD (PASCAL *LPD3DHAL_TEXTURECREATECB)    (LPD3DHAL_TEXTURECREATEDATA);
+typedef DWORD (PASCAL *LPD3DHAL_TEXTUREDESTROYCB)   (LPD3DHAL_TEXTUREDESTROYDATA);
+typedef DWORD (PASCAL *LPD3DHAL_TEXTURESWAPCB)     (LPD3DHAL_TEXTURESWAPDATA);
+typedef DWORD (PASCAL *LPD3DHAL_TEXTUREGETSURFCB)   (LPD3DHAL_TEXTUREGETSURFDATA);
+typedef DWORD (PASCAL *LPD3DHAL_GETSTATECB)        (LPD3DHAL_GETSTATEDATA);
+
+typedef struct _D3DHAL_CALLBACKS {
+  DWORD                                dwSize;
+  LPD3DHAL_CONTEXTCREATECB     ContextCreate;
+  LPD3DHAL_CONTEXTDESTROYCB    ContextDestroy;
+  LPD3DHAL_CONTEXTDESTROYALLCB ContextDestroyAll;
+  LPD3DHAL_SCENECAPTURECB      SceneCapture;
+  LPVOID                       lpReserved10;
+  LPVOID                       lpReserved11;
+  LPD3DHAL_RENDERSTATECB       RenderState;
+  LPD3DHAL_RENDERPRIMITIVECB   RenderPrimitive;
+  DWORD                                dwReserved;
+  LPD3DHAL_TEXTURECREATECB     TextureCreate;
+  LPD3DHAL_TEXTUREDESTROYCB    TextureDestroy;
+  LPD3DHAL_TEXTURESWAPCB       TextureSwap;
+  LPD3DHAL_TEXTUREGETSURFCB    TextureGetSurf;
+  /* now why did MS create CALLBACKS2 and CALLBACKS3 structures if
+   * all these reserved fields were available? we may never know */
+  LPVOID                       lpReserved12;
+  LPVOID                       lpReserved13;
+  LPVOID                       lpReserved14;
+  LPVOID                       lpReserved15;
+  LPVOID                       lpReserved16;
+  LPVOID                       lpReserved17;
+  LPVOID                       lpReserved18;
+  LPVOID                       lpReserved19;
+  LPVOID                       lpReserved20;
+  LPVOID                       lpReserved21;
+  LPD3DHAL_GETSTATECB          GetState;
+  DWORD                                dwReserved0;
+  DWORD                                dwReserved1;
+  DWORD                                dwReserved2;
+  DWORD                                dwReserved3;
+  DWORD                                dwReserved4;
+  DWORD                                dwReserved5;
+  DWORD                                dwReserved6;
+  DWORD                                dwReserved7;
+  DWORD                                dwReserved8;
+  DWORD                                dwReserved9;
+} D3DHAL_CALLBACKS;
+
+#ifndef D3DHAL_CALLBACKS_DEFINED
+typedef D3DHAL_CALLBACKS *LPD3DHAL_CALLBACKS;
+#define D3DHAL_CALLBACKS_DEFINED
+#endif
+
+typedef struct _D3DHAL_SETRENDERTARGETDATA             *LPD3DHAL_SETRENDERTARGETDATA;
+typedef struct _D3DHAL_CLEARDATA                       *LPD3DHAL_CLEARDATA;
+typedef struct _D3DHAL_DRAWONEPRIMITIVEDATA            *LPD3DHAL_DRAWONEPRIMITIVEDATA;
+typedef struct _D3DHAL_DRAWONEINDEXEDPRIMITIVEDATA     *LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA;
+typedef struct _D3DHAL_DRAWPRIMITIVESDATA              *LPD3DHAL_DRAWPRIMITIVESDATA;
+
+typedef DWORD (PASCAL *LPD3DHAL_SETRENDERTARGETCB)       (LPD3DHAL_SETRENDERTARGETDATA);
+typedef DWORD (PASCAL *LPD3DHAL_CLEARCB)                 (LPD3DHAL_CLEARDATA);
+typedef DWORD (PASCAL *LPD3DHAL_DRAWONEPRIMITIVECB)      (LPD3DHAL_DRAWONEPRIMITIVEDATA);
+typedef DWORD (PASCAL *LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB)(LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA);
+typedef DWORD (PASCAL *LPD3DHAL_DRAWPRIMITIVESCB)        (LPD3DHAL_DRAWPRIMITIVESDATA);
+
+typedef struct _D3DHAL_CALLBACKS2 {
+  DWORD                                        dwSize;
+  DWORD                                        dwFlags;
+  LPD3DHAL_SETRENDERTARGETCB           SetRenderTarget;
+  LPD3DHAL_CLEARCB                     Clear;
+  LPD3DHAL_DRAWONEPRIMITIVECB          DrawOnePrimitive;
+  LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB   DrawOneIndexedPrimitive;
+  LPD3DHAL_DRAWPRIMITIVESCB            DrawPrimitives;
+} D3DHAL_CALLBACKS2,*LPD3DHAL_CALLBACKS2;
+
+typedef struct _D3DHAL_CLEAR2DATA                      *LPD3DHAL_CLEAR2DATA;
+typedef struct _D3DHAL_VALIDATETEXTURESTAGESTATEDATA   *LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA;
+typedef struct _D3DHAL_DRAWPRIMITIVES2DATA             *LPD3DHAL_DRAWPRIMITIVES2DATA;
+
+typedef DWORD (PASCAL *LPD3DHAL_CLEAR2CB)                (LPD3DHAL_CLEAR2DATA);
+typedef DWORD (PASCAL *LPD3DHAL_VALIDATETEXTURESTAGESTATECB)(LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA);
+typedef DWORD (PASCAL *LPD3DHAL_DRAWPRIMITIVES2CB)       (LPD3DHAL_DRAWPRIMITIVES2DATA);
+
+typedef struct _D3DHAL_CALLBACKS3 {
+  DWORD                                        dwSize;
+  DWORD                                        dwFlags;
+  LPD3DHAL_CLEAR2CB                    Clear2;
+  LPVOID                               lpvReserved;
+  LPD3DHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState;
+  LPD3DHAL_DRAWPRIMITIVES2CB           DrawPrimitives2;
+} D3DHAL_CALLBACKS3,*LPD3DHAL_CALLBACKS3;
+
+/*****************************************************************************
+ * parameter structures
+ */
+typedef struct _D3DHAL_CONTEXTCREATEDATA {
+  union {
+    LPDDRAWI_DIRECTDRAW_GBL    lpDDGbl; /* pre-DirectX 7 */
+    LPDDRAWI_DIRECTDRAW_LCL    lpDDLcl; /* DirectX 7 */
+  } DUMMYUNIONNAME1;
+  union {
+    LPDIRECTDRAWSURFACE                lpDDS;
+    LPDDRAWI_DDRAWSURFACE_LCL  lpDDSLcl; /* DirectX 7 */
+  } DUMMYUNIONNAME2;
+  union {
+    LPDIRECTDRAWSURFACE                lpDDSZ;
+    LPDDRAWI_DDRAWSURFACE_LCL  lpDDSZLcl; /* DirectX 7 */
+  } DUMMYUNIONNAME3;
+  union {
+    DWORD                      dwPID;
+    ULONG_PTR                  dwrstates;
+  } DUMMYUNIONNAME4;
+  ULONG_PTR                    dwhContext;
+  HRESULT                      ddrval;
+} D3DHAL_CONTEXTCREATEDATA;
+
+typedef struct _D3DHAL_CONTEXTDESTROYDATA {
+  ULONG_PTR                    dwhContext;
+  HRESULT                      ddrval;
+} D3DHAL_CONTEXTDESTROYDATA;
+
+typedef struct _D3DHAL_CONTEXTDESTROYALLDATA {
+  DWORD                                dwPID;
+  HRESULT                      ddrval;
+} D3DHAL_CONTEXTDESTROYALLDATA;
+
+typedef struct _D3DHAL_SCENECAPTUREDATA {
+  ULONG_PTR                    dwhContext;
+  DWORD                                dwFlag;
+  HRESULT                      ddrval;
+} D3DHAL_SCENECAPTUREDATA;
+
+#define D3DHAL_SCENE_CAPTURE_START     0x00000000
+#define D3DHAL_SCENE_CAPTURE_END       0x00000001
+
+typedef struct _D3DHAL_SETRENDERTARGETDATA {
+  ULONG_PTR                    dwhContext;
+  union {
+    LPDIRECTDRAWSURFACE                lpDDS;
+    LPDDRAWI_DDRAWSURFACE_LCL  lpDDSLcl;
+  } DUMMYUNIONNAME1;
+  union {
+    LPDIRECTDRAWSURFACE                lpDDSZ;
+    LPDDRAWI_DDRAWSURFACE_LCL  lpDDSZLcl;
+  } DUMMYUNIONNAME2;
+  HRESULT                      ddrval;
+} D3DHAL_SETRENDERTARGETDATA;
+
+typedef struct _D3DHAL_DRAWPRIMITIVES2DATA {
+  ULONG_PTR                    dwhContext;
+  DWORD                                dwFlags;
+  DWORD                                dwVertexType;
+  LPDDRAWI_DDRAWSURFACE_LCL    lpDDCommands;
+  DWORD                                dwCommandOffset;
+  DWORD                                dwCommandLength;
+  union {
+    LPDDRAWI_DDRAWSURFACE_LCL  lpDDVertex;
+    LPVOID                     lpVertices;
+  } DUMMYUNIONNAME1;
+  DWORD                                dwVertexOffset;
+  DWORD                                dwVertexLength;
+  DWORD                                dwReqVertexBufSize;
+  DWORD                                dwReqCommandBufSize;
+  LPDWORD                      lpdwRStates;
+  union {
+    DWORD                      dwVertexSize;
+    HRESULT                    ddrval;
+  } DUMMYUNIONNAME2;
+  DWORD                                dwErrorOffset;
+} D3DHAL_DRAWPRIMITIVES2DATA;
+
+#define D3DHALDP2_USERMEMVERTICES      0x00000001
+#define D3DHALDP2_EXECUTEBUFFER                0x00000002
+#define D3DHALDP2_SWAPVERTEXBUFFER     0x00000004
+#define D3DHALDP2_SWAPCOMMANDBUFFER    0x00000008
+#define D3DHALDP2_REQVERTEXBUFSIZE     0x00000010
+#define D3DHALDP2_REQCOMMANDBUFSIZE    0x00000020
+#define D3DHALDP2_VIDMEMVERTEXBUF      0x00000040
+#define D3DHALDP2_VIDMEMCOMMANDBUF     0x00000080
+
+/*****************************************************************************
+ * DrawPrimitives2 command structures
+ */
+typedef struct _D3DHAL_DP2COMMAND {
+  BYTE bCommand;
+  BYTE bReserved;
+  union {
+    WORD wPrimitiveCount;
+    WORD wStateCount;
+  } DUMMYUNIONNAME;
+} D3DHAL_DP2COMMAND,*LPD3DHAL_DP2COMMAND;
+
+typedef enum _D3DHAL_DP2OPERATION {
+  D3DDP2OP_POINTS              = 1,
+  D3DDP2OP_INDEXEDLINELIST     = 2,
+  D3DDP2OP_INDEXEDTRIANGLELIST = 3,
+  D3DDP2OP_RENDERSTATE         = 8,
+  D3DDP2OP_LINELIST            = 15,
+  D3DDP2OP_LINESTRIP           = 16,
+  D3DDP2OP_INDEXEDLINESTRIP    = 17,
+  D3DDP2OP_TRIANGLELIST                = 18,
+  D3DDP2OP_TRIANGLESTRIP       = 19,
+  D3DDP2OP_INDEXEDTRIANGLESTRIP        = 20,
+  D3DDP2OP_TRIANGLEFAN         = 21,
+  D3DDP2OP_INDEXEDTRIANGLEFAN  = 22,
+  D3DDP2OP_TRIANGLEFAN_IMM     = 23,
+  D3DDP2OP_LINELIST_IMM                = 24,
+  D3DDP2OP_TEXTURESTAGESTATE   = 25,
+  D3DDP2OP_INDEXEDTRIANGLELIST2        = 26,
+  D3DDP2OP_INDEXEDLINELIST2    = 27,
+  D3DDP2OP_VIEWPORTINFO                = 28,
+  D3DDP2OP_WINFO               = 29,
+  /* pre-DirectX 7 interfaces */
+  D3DDP2OP_SETPALETTE          = 30,
+  D3DDP2OP_UPDATEPALETTE       = 31,
+  /* DirectX 7 interfaces */
+  D3DDP2OP_ZRANGE              = 32,
+  D3DDP2OP_SETMATERIAL         = 33,
+  D3DDP2OP_SETLIGHT            = 34,
+  D3DDP2OP_CREATELIGHT         = 35,
+  D3DDP2OP_SETTRANSFORM                = 36,
+  D3DDP2OP_TEXBLT              = 38,
+  D3DDP2OP_STATESET            = 39,
+  D3DDP2OP_SETPRIORITY         = 40,
+  /* all interfaces */
+  D3DDP2OP_SETRENDERTARGET     = 41,
+  D3DDP2OP_CLEAR               = 42,
+  /* DirectX 7 interfaces */
+  D3DDP2OP_SETTEXLOD           = 43,
+  D3DPP2OP_SETCLIPPLANE                = 44,
+} D3DHAL_DP2OPERATION;
+
+/* point primitives */
+
+typedef struct _D3DHAL_POINTS {
+  WORD wCount;
+  WORD wVStart;
+} D3DHAL_DP2POINTS,*LPD3DHAL_DP2POINTS;
+
+/* line primitives */
+
+typedef struct _D3DHAL_DP2STARTVERTEX {
+  WORD wVStart;
+} D3DHAL_DP2STARTVERTEX,*LPD3DHAL_DP2STARTVERTEX;
+
+typedef struct _D3DHAL_DP2LINELIST {
+  WORD wVStart;
+} D3DHAL_DP2LINELIST,*LPD3DHAL_DP2LINELIST;
+
+typedef struct _D3DHAL_DP2INDEXEDLINELIST {
+  WORD wV1;
+  WORD wV2;
+} D3DHAL_DP2INDEXEDLINELIST,*LPD3DHAL_DP2INDEXEDLINELIST;
+
+typedef struct _D3DHAL_DP2LINESTRIP {
+  WORD wVStart;
+} D3DHAL_DP2LINESTRIP,*LPD3DHAL_DP2LINESTRIP;
+
+typedef struct _D3DHAL_DP2INDEXEDLINESTRIP {
+  WORD wV[2];
+} D3DHAL_DP2INDEXEDLINESTRIP,*LPD3DHAL_DP2INDEXEDLINESTRIP;
+
+/* triangle primitives */
+
+typedef struct _D3DHAL_DP2TRIANGLELIST {
+  WORD wVStart;
+} D3DHAL_DP2TRIANGLELIST,*LPD3DHAL_DP2TRIANGLELIST;
+
+typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST {
+  WORD wV1;
+  WORD wV2;
+  WORD wV3;
+  WORD wFlags;
+} D3DHAL_DP2INDEXEDTRIANGLELIST,*LPD3DHAL_DP2INDEXEDTRIANGLELIST;
+
+typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST2 {
+  WORD wV1;
+  WORD wV2;
+  WORD wV3;
+} D3DHAL_DP2INDEXEDTRIANGLELIST2,*LPD3DHAL_DP2INDEXEDTRIANGLELIST2;
+
+typedef struct _D3DHAL_DP2TRIANGLESTRIP {
+  WORD wVStart;
+} D3DHAL_DP2TRIANGLESTRIP,*LPD3DHAL_DP2TRIANGLESTRIP;
+
+typedef struct _D3DHAL_DP2INDEXEDTRIANGLESTRIP {
+  WORD wV[3];
+} D3DHAL_DP2INDEXEDTRIANGLESTRIP,*LPD3DHAL_DP2INDEXEDTRIANGLESTRIP;
+
+typedef struct _D3DHAL_DP2TRIANGLEFAN {
+  WORD wVStart;
+} D3DHAL_DP2TRIANGLEFAN,*LPD3DHAL_DP2TRIANGLEFAN;
+
+typedef struct _D3DHAL_DP2INDEXEDTRIANGLEFAN {
+  WORD wV[3];
+} D3DHAL_DP2INDEXEDTRIANGLEFAN,*LPD3DHAL_DP2INDEXEDTRIANGLEFAN;
+
+typedef struct _D3DHAL_DP2TRIANGLEFAN_IMM {
+  DWORD dwEdgeFlags;
+} D3DHAL_DP2TRIANGLEFAN_IMM,*LPD3DHAL_DP2TRIANGLEFAN_IMM;
+
+/* render states */
+typedef struct _D3DHAL_DP2RENDERSTATE {
+  D3DRENDERSTATETYPE   RenderState;
+  union {
+    D3DVALUE dvState;
+    DWORD dwState;
+  } DUMMYUNIONNAME;
+} D3DHAL_DP2RENDERSTATE,*LPD3DHAL_DP2RENDERSTATE;
+
+typedef struct _D3DHAL_DP2TEXTURESTAGESTATE {
+  WORD wStage;
+  WORD TSState;
+  DWORD dwValue;
+} D3DHAL_DP2TEXTURESTAGESTATE,*LPD3DHAL_DP2TEXTURESTAGESTATE;
+
+#define D3DTSS_TEXTUREMAP 0
+
+typedef struct _D3DHAL_DP2VIEWPORTINFO {
+  DWORD dwX;
+  DWORD dwY;
+  DWORD dwWidth;
+  DWORD dwHeight;
+} D3DHAL_DP2VIEWPORTINFO,*LPD3DHAL_DP2VIEWPORTINFO;
+
+typedef struct _D3DHAL_DP2WINFO {
+  D3DVALUE dwWNear;
+  D3DVALUE dwWFar;
+} D3DHAL_DP2WINFO,*LPD3DHAL_DP2WINFO;
+
+typedef struct _D3DHAL_DP2SETPALETTE {
+  DWORD dwPaletteHandle;
+  DWORD dwPaletteFlags;
+  DWORD dwSurfaceHandle;
+} D3DHAL_DP2SETPALETTE,*LPD3DHAL_DP2SETPALETTE;
+
+typedef struct _D3DHAL_DP2UPDATEPALETTE {
+  DWORD dwPaletteHandle;
+  WORD wStartIndex;
+  WORD wNumEntries;
+} D3DHAL_DP2UPDATEPALETTE,*LPD3DHAL_DP2UPDATEPALETTE;
+
+typedef struct _D3DHAL_DP2ZRANGE {
+  D3DVALUE dvMinZ;
+  D3DVALUE dvMaxZ;
+} D3DHAL_DP2ZRANGE,*LPD3DHAL_DP2ZRANGE;
+
+typedef D3DMATERIAL7 D3DHAL_DP2SETMATERIAL,*LPD3DHAL_DP2SETMATERIAL;
+
+typedef struct _D3DHAL_DP2SETLIGHT {
+  DWORD dwIndex;
+  DWORD dwDataType;
+} D3DHAL_DP2SETLIGHT,*LPD3DHAL_DP2SETLIGHT;
+
+#define D3DHAL_SETLIGHT_ENABLE 0
+#define D3DHAL_SETLIGHT_DISABLE        1
+#define D3DHAL_SETLIGHT_DATA   2
+
+typedef struct _D3DHAL_DP2CREATELIGHT {
+  DWORD dwIndex;
+} D3DHAL_DP2CREATELIGHT,*LPD3DHAL_DP2CREATELIGHT;
+
+typedef struct _D3DHAL_DP2SETTRANSFORM {
+  D3DTRANSFORMSTATETYPE        xfrmType;
+  D3DMATRIX            matrix;
+} D3DHAL_DP2SETTRANSFORM,*LPD3DHAL_DP2SETTRANSFORM;
+
+typedef struct _D3DHAL_DP2TEXBLT {
+  DWORD dwDDDestSurface;
+  DWORD dwDDSrcSurface;
+  POINT pDest;
+  RECTL rSrc;
+  DWORD dwFlags;
+} D3DHAL_DP2TEXBLT,*LPD3DHAL_DP2TEXBLT;
+
+typedef struct _D3DHAL_DP2STATESET {
+  DWORD               dwOperation;
+  DWORD               dwParam;
+  D3DSTATEBLOCKTYPE   sbType;
+} D3DHAL_DP2STATESET,*LPD3DHAL_DP2STATESET;
+
+#define D3DHAL_STATESETBEGIN   0
+#define D3DHAL_STATESETEND     1
+#define D3DHAL_STATESETDELETE  2
+#define D3DHAL_STATESETEXECUTE 3
+#define D3DHAL_STATESETCAPTURE 4
+
+typedef struct _D3DHAL_DP2SETPRIORITY {
+  DWORD dwDDSurface;
+  DWORD dwPriority;
+} D3DHAL_DP2SETPRIORITY,*LPD3DHAL_DP2SETPRIORITY;
+
+typedef struct _D3DHAL_DP2SETRENDERTARGET {
+  DWORD hRenderTarget;
+  DWORD hZBuffer;
+} D3DHAL_DP2SETRENDERTARGET,*LPD3DHAL_DP2SETRENDERTARGET;
+
+typedef struct _D3DHAL_DP2CLEAR {
+  DWORD                dwFlags;
+  DWORD                dwFillColor;
+  D3DVALUE     dvFillDepth;
+  DWORD                dwFillStencil;
+  RECT         Rects[1];
+} D3DHAL_DP2CLEAR,*LPD3DHAL_DP2CLEAR;
+
+typedef struct _D3DHAL_DP2SETTEXLOD {
+  DWORD dwDDSurface;
+  DWORD dwLOD;
+} D3DHAL_DP2SETTEXLOD,*LPD3DHAL_DP2SETTEXLOD;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _D3DHAL_H_ */
diff --git a/misc/builddeps/dp.win32/include/d3drm.h b/misc/builddeps/dp.win32/include/d3drm.h
new file mode 100644 (file)
index 0000000..240014e
--- /dev/null
@@ -0,0 +1,497 @@
+/*
+ * Copyright (C) 2005 Peter Berg Larsen
+ * Copyright (C) 2010 Christian Costa
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __D3DRM_H__
+#define __D3DRM_H__
+
+#include <ddraw.h>
+
+typedef struct IDirect3DRM *LPDIRECT3DRM;
+
+#include <d3drmobj.h>
+
+
+/* Direct3DRM Object CLSID */
+DEFINE_GUID(CLSID_CDirect3DRM,              0x4516ec41, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+
+/* Direct3DRM Interface GUIDs */
+DEFINE_GUID(IID_IDirect3DRM,                0x2bc49361, 0x8327, 0x11cf, 0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRM2,               0x4516ecc8, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRM3,               0x4516ec83, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+
+HRESULT WINAPI Direct3DRMCreate(LPDIRECT3DRM* ppDirect3DRM);
+
+/*****************************************************************************
+ * IDirect3DRMObject interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRM
+DECLARE_INTERFACE_(IDirect3DRM,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRM methods ***/
+    STDMETHOD(CreateObject)(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(CreateFrame)(THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME *) PURE;
+    STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH *) PURE;
+    STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE;
+    STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE *) PURE;
+    STDMETHOD(CreateAnimation)(THIS_ LPDIRECT3DRMANIMATION *) PURE;
+    STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
+    STDMETHOD(CreateTexture)(THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE *) PURE;
+    STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
+    STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
+    STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
+    STDMETHOD(CreateDevice)(THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE *) PURE;
+    STDMETHOD(CreateDeviceFromSurface)(THIS_ LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack,
+        LPDIRECT3DRMDEVICE *) PURE;
+    STDMETHOD(CreateDeviceFromD3D)(THIS_ LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE *) PURE;
+    STDMETHOD(CreateDeviceFromClipper)(THIS_ LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height,
+        LPDIRECT3DRMDEVICE *) PURE;
+    STDMETHOD(CreateShadow)(THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, D3DVALUE px, D3DVALUE py, D3DVALUE pz,
+        D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL *) PURE;
+    STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE *) PURE;
+    STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, DWORD, DWORD,
+        LPDIRECT3DRMVIEWPORT *) PURE;
+    STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
+        D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov,
+        D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP *) PURE;
+    STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK, LPVOID pArg, LPDIRECT3DRMUSERVISUAL *) PURE;
+    STDMETHOD(LoadTexture)(THIS_ const char *, LPDIRECT3DRMTEXTURE *) PURE;
+    STDMETHOD(LoadTextureFromResource)(THIS_ HRSRC rs, LPDIRECT3DRMTEXTURE *) PURE;
+    STDMETHOD(SetSearchPath)(THIS_ LPCSTR) PURE;
+    STDMETHOD(AddSearchPath)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetSearchPath)(THIS_ DWORD *size_return, LPSTR path_return) PURE;
+    STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
+    STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
+    STDMETHOD(GetDevices)(THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
+    STDMETHOD(GetNamedObject)(THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
+    STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
+    STDMETHOD(Load)(THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, D3DRMLOADCALLBACK, LPVOID,
+        D3DRMLOADTEXTURECALLBACK, LPVOID, LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(Tick)(THIS_ D3DVALUE) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRM_QueryInterface(p,a,b)                         (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRM_AddRef(p)                                     (p)->lpVtbl->AddRef(p)
+#define IDirect3DRM_Release(p)                                    (p)->lpVtbl->Release(p)
+/*** IDirect3DRM methods ***/
+#define IDirect3DRM_CreateObject(p,a,b,c,d)                       (p)->lpVtbl->CreateObject(p,a,b,d)
+#define IDirect3DRM_CreateFrame(p,a,b)                            (p)->lpVtbl->CreateFrame(p,a,b)
+#define IDirect3DRM_CreateMesh(p,a)                               (p)->lpVtbl->CreateMesh(p,a)
+#define IDirect3DRM_CreateMeshBuilder(p,a)                        (p)->lpVtbl->CreateMeshBuilder(p,a)
+#define IDirect3DRM_CreateFace(p,a)                               (p)->lpVtbl->CreateFace(p,a)
+#define IDirect3DRM_CreateAnimation(p,a)                          (p)->lpVtbl->CreateAnimation(p,a)
+#define IDirect3DRM_CreateAnimationSet(p,a)                       (p)->lpVtbl->CreateAnimationSet(p,a)
+#define IDirect3DRM_CreateTexture(p,a,b)                          (p)->lpVtbl->CreateTexture(p,a,b)
+#define IDirect3DRM_CreateLight(p,a,b,c)                          (p)->lpVtbl->CreateLight(p,a,b,c)
+#define IDirect3DRM_CreateLightRGB(p,a,b,c,d,e)                   (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e)
+#define IDirect3DRM_CreateMaterial(p,a,b)                         (p)->lpVtbl->CreateMaterial(p,a,b)
+#define IDirect3DRM_CreateDevice(p,a,b,c)                         (p)->lpVtbl->CreateDevice(p,a,b,c)
+#define IDirect3DRM_CreateDeviceFromSurface(p,a,b,c,d)            (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d)
+#define IDirect3DRM_CreateDeviceFromD3D(p,a,b,c)                  (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c)
+#define IDirect3DRM_CreateDeviceFromClipper(p,a,b,c,d,e)          (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e)
+#define IDirect3DRM_CreateTextureFromSurface(p,a,b)               (p)->lpVtbl->CreateTextureFromSurface(p,a,b)
+#define IDirect3DRM_CreateShadow(p,a,b,c,d,e,f,g,h,i)             (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i)
+#define IDirect3DRM_CreateViewport(p,a,b,c,d,e,f,g)               (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g)
+#define IDirect3DRM_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
+#define IDirect3DRM_CreateUserVisual(p,a,b,c)                     (p)->lpVtbl->CreateUserVisual(p,a,b,c)
+#define IDirect3DRM_LoadTexture(p,a,b)                            (p)->lpVtbl->LoadTexture(p,a,b)
+#define IDirect3DRM_LoadTextureFromResource(p,a,b)                (p)->lpVtbl->LoadTextureFromResource(p,a,b)
+#define IDirect3DRM_SetSearchPath(p,a)                            (p)->lpVtbl->SetSearchPath(p,a)
+#define IDirect3DRM_AddSearchPath(p,a)                            (p)->lpVtbl->AddSearchPath(p,a)
+#define IDirect3DRM_GetSearchPath(p,a,b)                          (p)->lpVtbl->GetSearchPath(p,a,b)
+#define IDirect3DRM_SetDefaultTextureColors(p,a)                  (p)->lpVtbl->SetDefaultTextureColors(p,a)
+#define IDirect3DRM_SetDefaultTextureShades(p,a)                  (p)->lpVtbl->SetDefaultTextureShades(p,a)
+#define IDirect3DRM_GetDevices(p,a)                               (p)->lpVtbl->GetDevices(p,a)
+#define IDirect3DRM_GetNamedObject(p,a,b)                         (p)->lpVtbl->GetNamedObject(p,a,b)
+#define IDirect3DRM_EnumerateObjects(p,a,b)                       (p)->lpVtbl->EnumerateObjects(p,a,b)
+#define IDirect3DRM_Load(p,a,b,c,d,e,f,g,h,i,j)                   (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j)
+#define IDirect3DRM_Tick(p,a)                                     (p)->lpVtbl->Tick(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRM_QueryInterface(p,a,b)                         (p)->QueryInterface(a,b)
+#define IDirect3DRM_AddRef(p)                                     (p)->AddRef()
+#define IDirect3DRM_Release(p)                                    (p)->Release()
+/*** IDirect3DRM methods ***/
+#define IDirect3DRM_CreateObject(p,a,b,c,d)                       (p)->CreateObject(a,b,d)
+#define IDirect3DRM_CreateFrame(p,a,b)                            (p)->CreateFrame(a,b)
+#define IDirect3DRM_CreateMesh(p,a)                               (p)->CreateMesh(a)
+#define IDirect3DRM_CreateMeshBuilder(p,a)                        (p)->CreateMeshBuilder(a)
+#define IDirect3DRM_CreateFace(p,a)                               (p)->CreateFace(a)
+#define IDirect3DRM_CreateAnimation(p,a)                          (p)->CreateAnimation(a)
+#define IDirect3DRM_CreateAnimationSet(p,a)                       (p)->CreateAnimationSet(a)
+#define IDirect3DRM_CreateTexture(p,a,b)                          (p)->CreateTexture(a,b)
+#define IDirect3DRM_CreateLight(p,a,b,c)                          (p)->CreateLight(a,b,c)
+#define IDirect3DRM_CreateLightRGB(p,a,b,c,d,e)                   (p)->CreateLightRGB(a,b,c,d,e)
+#define IDirect3DRM_CreateMaterial(p,a,b)                         (p)->CreateMaterial(a,b)
+#define IDirect3DRM_CreateDevice(p,a,b,c)                         (p)->CreateDevice(a,b,c)
+#define IDirect3DRM_CreateDeviceFromSurface(p,a,b,c,d)            (p)->CreateDeviceFromSurface(a,b,c,d)
+#define IDirect3DRM_CreateDeviceFromD3D(p,a,b,c)                  (p)->CreateDeviceFromD3D(a,b,c)
+#define IDirect3DRM_CreateDeviceFromClipper(p,a,b,c,d,e)          (p)->CreateDeviceFromClipper(a,b,c,d,e)
+#define IDirect3DRM_CreateTextureFromSurface(p,a,b)               (p)->CreateTextureFromSurface(a,b)
+#define IDirect3DRM_CreateShadow(p,a,b,c,d,e,f,g,h,i)             (p)->CreateShadow(a,b,c,d,e,f,g,h,i)
+#define IDirect3DRM_CreateViewport(p,a,b,c,d,e,f,g)               (p)->CreateViewport(a,b,c,d,e,f,g)
+#define IDirect3DRM_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
+#define IDirect3DRM_CreateUserVisual(p,a,b,c)                     (p)->CreateUserVisual(a,b,c)
+#define IDirect3DRM_LoadTexture(p,a,b)                            (p)->LoadTexture(a,b)
+#define IDirect3DRM_LoadTextureFromResource(p,a,b)                (p)->LoadTextureFromResource(a,b)
+#define IDirect3DRM_SetSearchPath(p,a)                            (p)->SetSearchPath(a)
+#define IDirect3DRM_AddSearchPath(p,a)                            (p)->AddSearchPath(a)
+#define IDirect3DRM_GetSearchPath(p,a,b)                          (p)->GetSearchPath(a,b)
+#define IDirect3DRM_SetDefaultTextureColors(p,a)                  (p)->SetDefaultTextureColors(a)
+#define IDirect3DRM_SetDefaultTextureShades(p,a)                  (p)->SetDefaultTextureShades(a)
+#define IDirect3DRM_GetDevices(p,a)                               (p)->GetDevices(a)
+#define IDirect3DRM_GetNamedObject(p,a,b)                         (p)->GetNamedObject(a,b)
+#define IDirect3DRM_EnumerateObjects(p,a,b)                       (p)->EnumerateObjects(a,b)
+#define IDirect3DRM_Load(p,a,b,c,d,e,f,g,h,i,j)                   (p)->Load(a,b,c,d,e,f,g,h,i,j)
+#define IDirect3DRM_Tick(p,a)                                     (p)->Tick(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRM2 interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRM2
+DECLARE_INTERFACE_(IDirect3DRM2,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRM2 methods ***/
+    STDMETHOD(CreateObject)(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(CreateFrame)(THIS_ LPDIRECT3DRMFRAME, LPDIRECT3DRMFRAME2 *) PURE;
+    STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH *) PURE;
+    STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE;
+    STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE *) PURE;
+    STDMETHOD(CreateAnimation)(THIS_ LPDIRECT3DRMANIMATION *) PURE;
+    STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET *) PURE;
+    STDMETHOD(CreateTexture)(THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE2 *) PURE;
+    STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
+    STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
+    STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
+    STDMETHOD(CreateDevice)(THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE2 *) PURE;
+    STDMETHOD(CreateDeviceFromSurface)(THIS_ LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack,
+        LPDIRECT3DRMDEVICE2 *) PURE;
+    STDMETHOD(CreateDeviceFromD3D)(THIS_ LPDIRECT3D2 pD3D, LPDIRECT3DDEVICE2 pD3DDev, LPDIRECT3DRMDEVICE2 *) PURE;
+    STDMETHOD(CreateDeviceFromClipper)(THIS_ LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height,
+        LPDIRECT3DRMDEVICE2 *) PURE;
+    STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE2 *) PURE;
+    STDMETHOD(CreateShadow)(THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMLIGHT, D3DVALUE px, D3DVALUE py, D3DVALUE pz,
+        D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL *) PURE;
+    STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DRMDEVICE, LPDIRECT3DRMFRAME, DWORD, DWORD, DWORD, DWORD,
+        LPDIRECT3DRMVIEWPORT *) PURE;
+    STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
+        D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov,
+        D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP *) PURE;
+    STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK, LPVOID pArg, LPDIRECT3DRMUSERVISUAL *) PURE;
+    STDMETHOD(LoadTexture)(THIS_ const char *, LPDIRECT3DRMTEXTURE2 *) PURE;
+    STDMETHOD(LoadTextureFromResource)(THIS_ HMODULE hModule, LPCSTR /* LPCTSTR */ strName, LPCSTR /* LPCTSTR */ strType, LPDIRECT3DRMTEXTURE2 *) PURE;
+    STDMETHOD(SetSearchPath)(THIS_ LPCSTR) PURE;
+    STDMETHOD(AddSearchPath)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetSearchPath)(THIS_ DWORD *size_return, LPSTR path_return) PURE;
+    STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
+    STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
+    STDMETHOD(GetDevices)(THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
+    STDMETHOD(GetNamedObject)(THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
+    STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
+    STDMETHOD(Load)(THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, D3DRMLOADCALLBACK, LPVOID,
+        D3DRMLOADTEXTURECALLBACK, LPVOID, LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(Tick)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRM2_QueryInterface(p,a,b)                         (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRM2_AddRef(p)                                     (p)->lpVtbl->AddRef(p)
+#define IDirect3DRM2_Release(p)                                    (p)->lpVtbl->Release(p)
+/*** IDirect3DRM2 methods ***/
+#define IDirect3DRM2_CreateObject(p,a,b,c,d)                       (p)->lpVtbl->CreateObject(p,a,b,d)
+#define IDirect3DRM2_CreateFrame(p,a,b)                            (p)->lpVtbl->CreateFrame(p,a,b)
+#define IDirect3DRM2_CreateMesh(p,a)                               (p)->lpVtbl->CreateMesh(p,a)
+#define IDirect3DRM2_CreateMeshBuilder(p,a)                        (p)->lpVtbl->CreateMeshBuilder(p,a)
+#define IDirect3DRM2_CreateFace(p,a)                               (p)->lpVtbl->CreateFace(p,a)
+#define IDirect3DRM2_CreateAnimation(p,a)                          (p)->lpVtbl->CreateAnimation(p,a)
+#define IDirect3DRM2_CreateAnimationSet(p,a)                       (p)->lpVtbl->CreateAnimationSet(p,a)
+#define IDirect3DRM2_CreateTexture(p,a,b)                          (p)->lpVtbl->CreateTexture(p,a,b)
+#define IDirect3DRM2_CreateLight(p,a,b,c)                          (p)->lpVtbl->CreateLight(p,a,b,c)
+#define IDirect3DRM2_CreateLightRGB(p,a,b,c,d,e)                   (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e)
+#define IDirect3DRM2_CreateMaterial(p,a,b)                         (p)->lpVtbl->CreateMaterial(p,a,b)
+#define IDirect3DRM2_CreateDevice(p,a,b,c)                         (p)->lpVtbl->CreateDevice(p,a,b,c)
+#define IDirect3DRM2_CreateDeviceFromSurface(p,a,b,c,d)            (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d)
+#define IDirect3DRM2_CreateDeviceFromD3D(p,a,b,c)                  (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c)
+#define IDirect3DRM2_CreateDeviceFromClipper(p,a,b,c,d,e)          (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e)
+#define IDirect3DRM2_CreateTextureFromSurface(p,a,b)               (p)->lpVtbl->CreateTextureFromSurface(p,a,b)
+#define IDirect3DRM2_CreateShadow(p,a,b,c,d,e,f,g,h,i)             (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i)
+#define IDirect3DRM2_CreateViewport(p,a,b,c,d,e,f,g)               (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g)
+#define IDirect3DRM2_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
+#define IDirect3DRM2_CreateUserVisual(p,a,b,c)                     (p)->lpVtbl->CreateUserVisual(p,a,b,c)
+#define IDirect3DRM2_LoadTexture(p,a,b)                            (p)->lpVtbl->LoadTexture(p,a,b)
+#define IDirect3DRM2_LoadTextureFromResource(p,a,b,c,d)            (p)->lpVtbl->LoadTextureFromResource(p,a,b,c,d)
+#define IDirect3DRM2_SetSearchPath(p,a)                            (p)->lpVtbl->SetSearchPath(p,a)
+#define IDirect3DRM2_AddSearchPath(p,a)                            (p)->lpVtbl->AddSearchPath(p,a)
+#define IDirect3DRM2_GetSearchPath(p,a,b)                          (p)->lpVtbl->GetSearchPath(p,a,b)
+#define IDirect3DRM2_SetDefaultTextureColors(p,a)                  (p)->lpVtbl->SetDefaultTextureColors(p,a)
+#define IDirect3DRM2_SetDefaultTextureShades(p,a)                  (p)->lpVtbl->SetDefaultTextureShades(p,a)
+#define IDirect3DRM2_GetDevices(p,a)                               (p)->lpVtbl->GetDevices(p,a)
+#define IDirect3DRM2_GetNamedObject(p,a,b)                         (p)->lpVtbl->GetNamedObject(p,a,b)
+#define IDirect3DRM2_EnumerateObjects(p,a,b)                       (p)->lpVtbl->EnumerateObjects(p,a,b)
+#define IDirect3DRM2_Load(p,a,b,c,d,e,f,g,h,i,j)                   (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j)
+#define IDirect3DRM2_Tick(p,a)                                     (p)->lpVtbl->Tick(p,a)
+#define IDirect3DRM2_CreateProgressiveMesh(p,a)                    (p)->lpVtbl->CreateProgressiveMesh(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRM2_QueryInterface(p,a,b)                         (p)->QueryInterface(a,b)
+#define IDirect3DRM2_AddRef(p)                                     (p)->AddRef()
+#define IDirect3DRM2_Release(p)                                    (p)->Release()
+/*** IDirect3DRM2 methods ***/
+#define IDirect3DRM2_CreateObject(p,a,b,c,d)                       (p)->CreateObject(a,b,d)
+#define IDirect3DRM2_CreateFrame(p,a,b)                            (p)->CreateFrame(a,b)
+#define IDirect3DRM2_CreateMesh(p,a)                               (p)->CreateMesh(a)
+#define IDirect3DRM2_CreateMeshBuilder(p,a)                        (p)->CreateMeshBuilder(a)
+#define IDirect3DRM2_CreateFace(p,a)                               (p)->CreateFace(a)
+#define IDirect3DRM2_CreateAnimation(p,a)                          (p)->CreateAnimation(a)
+#define IDirect3DRM2_CreateAnimationSet(p,a)                       (p)->CreateAnimationSet(a)
+#define IDirect3DRM2_CreateTexture(p,a,b)                          (p)->CreateTexture(a,b)
+#define IDirect3DRM2_CreateLight(p,a,b,c)                          (p)->CreateLight(a,b,c)
+#define IDirect3DRM2_CreateLightRGB(p,a,b,c,d,e)                   (p)->CreateLightRGB(a,b,c,d,e)
+#define IDirect3DRM2_CreateMaterial(p,a,b)                         (p)->CreateMaterial(a,b)
+#define IDirect3DRM2_CreateDevice(p,a,b,c)                         (p)->CreateDevice(a,b,c)
+#define IDirect3DRM2_CreateDeviceFromSurface(p,a,b,c,d)            (p)->CreateDeviceFromSurface(a,b,c,d)
+#define IDirect3DRM2_CreateDeviceFromD3D(p,a,b,c)                  (p)->CreateDeviceFromD3D(a,b,c)
+#define IDirect3DRM2_CreateDeviceFromClipper(p,a,b,c,d,e)          (p)->CreateDeviceFromClipper(a,b,c,d,e)
+#define IDirect3DRM2_CreateTextureFromSurface(p,a,b)               (p)->CreateTextureFromSurface(a,b)
+#define IDirect3DRM2_CreateShadow(p,a,b,c,d,e,f,g,h,i)             (p)->CreateShadow(a,b,c,d,e,f,g,h,i)
+#define IDirect3DRM2_CreateViewport(p,a,b,c,d,e,f,g)               (p)->CreateViewport(a,b,c,d,e,f,g)
+#define IDirect3DRM2_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
+#define IDirect3DRM2_CreateUserVisual(p,a,b,c)                     (p)->CreateUserVisual(a,b,c)
+#define IDirect3DRM2_LoadTexture(p,a,b)                            (p)->LoadTexture(a,b)
+#define IDirect3DRM2_LoadTextureFromResource(p,a,b)                (p)->LoadTextureFromResource(a,b)
+#define IDirect3DRM2_SetSearchPath(p,a)                            (p)->SetSearchPath(a)
+#define IDirect3DRM2_AddSearchPath(p,a)                            (p)->AddSearchPath(a)
+#define IDirect3DRM2_GetSearchPath(p,a,b)                          (p)->GetSearchPath(a,b)
+#define IDirect3DRM2_SetDefaultTextureColors(p,a)                  (p)->SetDefaultTextureColors(a)
+#define IDirect3DRM2_SetDefaultTextureShades(p,a)                  (p)->SetDefaultTextureShades(a)
+#define IDirect3DRM2_GetDevices(p,a)                               (p)->GetDevices(a)
+#define IDirect3DRM2_GetNamedObject(p,a,b)                         (p)->GetNamedObject(a,b)
+#define IDirect3DRM2_EnumerateObjects(p,a,b)                       (p)->EnumerateObjects(a,b)
+#define IDirect3DRM2_Load(p,a,b,c,d,e,f,g,h,i,j)                   (p)->Load(a,b,c,d,e,f,g,h,i,j)
+#define IDirect3DRM2_Tick(p,a)                                     (p)->Tick(a)
+#define IDirect3DRM2_CreateProgressiveMesh(p,a)                    (p)->CreateProgressiveMesh(p,a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRM3 interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRM3
+DECLARE_INTERFACE_(IDirect3DRM3,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRM2 methods ***/
+    STDMETHOD(CreateObject)(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(CreateFrame)(THIS_ LPDIRECT3DRMFRAME3, LPDIRECT3DRMFRAME3 *) PURE;
+    STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH *) PURE;
+    STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3 *) PURE;
+    STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE2 *) PURE;
+    STDMETHOD(CreateAnimation)(THIS_ LPDIRECT3DRMANIMATION2 *) PURE;
+    STDMETHOD(CreateAnimationSet)(THIS_ LPDIRECT3DRMANIMATIONSET2 *) PURE;
+    STDMETHOD(CreateTexture)(THIS_ LPD3DRMIMAGE, LPDIRECT3DRMTEXTURE3 *) PURE;
+    STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE, D3DCOLOR, LPDIRECT3DRMLIGHT *) PURE;
+    STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE, D3DVALUE, D3DVALUE, D3DVALUE, LPDIRECT3DRMLIGHT *) PURE;
+    STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL2 *) PURE;
+    STDMETHOD(CreateDevice)(THIS_ DWORD, DWORD, LPDIRECT3DRMDEVICE3 *) PURE;
+    STDMETHOD(CreateDeviceFromSurface)(THIS_ LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack,
+        LPDIRECT3DRMDEVICE3 *) PURE;
+    STDMETHOD(CreateDeviceFromD3D)(THIS_ LPDIRECT3D2 pD3D, LPDIRECT3DDEVICE2 pD3DDev, LPDIRECT3DRMDEVICE3 *) PURE;
+    STDMETHOD(CreateDeviceFromClipper)(THIS_ LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height,
+        LPDIRECT3DRMDEVICE3 *) PURE;
+    STDMETHOD(CreateTextureFromSurface)(THIS_ LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE3 *) PURE;
+    STDMETHOD(CreateShadow)(THIS_ LPUNKNOWN, LPDIRECT3DRMLIGHT, D3DVALUE px, D3DVALUE py, D3DVALUE pz,
+        D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMSHADOW2 *) PURE;
+    STDMETHOD(CreateViewport)(THIS_ LPDIRECT3DRMDEVICE3, LPDIRECT3DRMFRAME3, DWORD, DWORD, DWORD, DWORD,
+        LPDIRECT3DRMVIEWPORT2 *) PURE;
+    STDMETHOD(CreateWrap)(THIS_ D3DRMWRAPTYPE, LPDIRECT3DRMFRAME3, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
+        D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov,
+        D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP *) PURE;
+    STDMETHOD(CreateUserVisual)(THIS_ D3DRMUSERVISUALCALLBACK, LPVOID pArg, LPDIRECT3DRMUSERVISUAL *) PURE;
+    STDMETHOD(LoadTexture)(THIS_ const char *, LPDIRECT3DRMTEXTURE3 *) PURE;
+    STDMETHOD(LoadTextureFromResource)(THIS_ HMODULE hModule, LPCSTR /* LPCTSTR */ strName, LPCSTR  /* LPCTSTR */ strType, LPDIRECT3DRMTEXTURE3 *) PURE;
+    STDMETHOD(SetSearchPath)(THIS_ LPCSTR) PURE;
+    STDMETHOD(AddSearchPath)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetSearchPath)(THIS_ DWORD *size_return, LPSTR path_return) PURE;
+    STDMETHOD(SetDefaultTextureColors)(THIS_ DWORD) PURE;
+    STDMETHOD(SetDefaultTextureShades)(THIS_ DWORD) PURE;
+    STDMETHOD(GetDevices)(THIS_ LPDIRECT3DRMDEVICEARRAY *) PURE;
+    STDMETHOD(GetNamedObject)(THIS_ const char *, LPDIRECT3DRMOBJECT *) PURE;
+    STDMETHOD(EnumerateObjects)(THIS_ D3DRMOBJECTCALLBACK, LPVOID) PURE;
+    STDMETHOD(Load)(THIS_ LPVOID, LPVOID, LPIID *, DWORD, D3DRMLOADOPTIONS, D3DRMLOADCALLBACK, LPVOID,
+        D3DRMLOADTEXTURECALLBACK, LPVOID, LPDIRECT3DRMFRAME3) PURE;
+    STDMETHOD(Tick)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(CreateProgressiveMesh)(THIS_ LPDIRECT3DRMPROGRESSIVEMESH) PURE;
+    STDMETHOD(RegisterClient)(THIS_ REFGUID rguid, LPDWORD lpdwID) PURE;
+    STDMETHOD(UnregisterClient)(THIS_ REFGUID rguid) PURE;
+    STDMETHOD(CreateClippedVisual)(THIS_ LPDIRECT3DRMVISUAL, LPDIRECT3DRMCLIPPEDVISUAL *) PURE;
+    STDMETHOD(SetOptions)(THIS_ DWORD) PURE;
+    STDMETHOD(GetOptions)(THIS_ LPDWORD) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRM3_QueryInterface(p,a,b)                         (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRM3_AddRef(p)                                     (p)->lpVtbl->AddRef(p)
+#define IDirect3DRM3_Release(p)                                    (p)->lpVtbl->Release(p)
+/*** IDirect3DRM3 methods ***/
+#define IDirect3DRM3_CreateObject(p,a,b,c,d)                       (p)->lpVtbl->CreateObject(p,a,b,d)
+#define IDirect3DRM3_CreateFrame(p,a,b)                            (p)->lpVtbl->CreateFrame(p,a,b)
+#define IDirect3DRM3_CreateMesh(p,a)                               (p)->lpVtbl->CreateMesh(p,a)
+#define IDirect3DRM3_CreateMeshBuilder(p,a)                        (p)->lpVtbl->CreateMeshBuilder(p,a)
+#define IDirect3DRM3_CreateFace(p,a)                               (p)->lpVtbl->CreateFace(p,a)
+#define IDirect3DRM3_CreateAnimation(p,a)                          (p)->lpVtbl->CreateAnimation(p,a)
+#define IDirect3DRM3_CreateAnimationSet(p,a)                       (p)->lpVtbl->CreateAnimationSet(p,a)
+#define IDirect3DRM3_CreateTexture(p,a,b)                          (p)->lpVtbl->CreateTexture(p,a,b)
+#define IDirect3DRM3_CreateLight(p,a,b,c)                          (p)->lpVtbl->CreateLight(p,a,b,c)
+#define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e)                   (p)->lpVtbl->CreateLightRGB(p,a,b,c,d,e)
+#define IDirect3DRM3_CreateMaterial(p,a,b)                         (p)->lpVtbl->CreateMaterial(p,a,b)
+#define IDirect3DRM3_CreateDevice(p,a,b,c)                         (p)->lpVtbl->CreateDevice(p,a,b,c)
+#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d)            (p)->lpVtbl->CreateDeviceFromSurface(p,a,b,c,d)
+#define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c)                  (p)->lpVtbl->CreateDeviceFromD3D(p,a,b,c)
+#define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e)          (p)->lpVtbl->CreateDeviceFromClipper(p,a,b,c,d,e)
+#define IDirect3DRM3_CreateTextureFromSurface(p,a,b)               (p)->lpVtbl->CreateTextureFromSurface(p,a,b)
+#define IDirect3DRM3_CreateShadow(p,a,b,c,d,e,f,g,h,i)             (p)->lpVtbl->CreateShadow(p,a,b,c,d,e,f,g,h,i)
+#define IDirect3DRM3_CreateViewport(p,a,b,c,d,e,f,g)               (p)->lpVtbl->CreateViewport(p,a,b,c,d,e,f,g)
+#define IDirect3DRM3_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q) (p)->lpVtbl->CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q)
+#define IDirect3DRM3_CreateUserVisual(p,a,b,c)                     (p)->lpVtbl->CreateUserVisual(p,a,b,c)
+#define IDirect3DRM3_LoadTexture(p,a,b)                            (p)->lpVtbl->LoadTexture(p,a,b)
+#define IDirect3DRM3_LoadTextureFromResource(p,a,b,c,d)            (p)->lpVtbl->LoadTextureFromResource(p,a,b,c,d)
+#define IDirect3DRM3_SetSearchPath(p,a)                            (p)->lpVtbl->SetSearchPath(p,a)
+#define IDirect3DRM3_AddSearchPath(p,a)                            (p)->lpVtbl->AddSearchPath(p,a)
+#define IDirect3DRM3_GetSearchPath(p,a,b)                          (p)->lpVtbl->GetSearchPath(p,a,b)
+#define IDirect3DRM3_SetDefaultTextureColors(p,a)                  (p)->lpVtbl->SetDefaultTextureColors(p,a)
+#define IDirect3DRM3_SetDefaultTextureShades(p,a)                  (p)->lpVtbl->SetDefaultTextureShades(p,a)
+#define IDirect3DRM3_GetDevices(p,a)                               (p)->lpVtbl->GetDevices(p,a)
+#define IDirect3DRM3_GetNamedObject(p,a,b)                         (p)->lpVtbl->GetNamedObject(p,a,b)
+#define IDirect3DRM3_EnumerateObjects(p,a,b)                       (p)->lpVtbl->EnumerateObjects(p,a,b)
+#define IDirect3DRM3_Load(p,a,b,c,d,e,f,g,h,i,j)                   (p)->lpVtbl->Load(p,a,b,c,d,e,f,g,h,i,j)
+#define IDirect3DRM3_Tick(p,a)                                     (p)->lpVtbl->Tick(p,a)
+#define IDirect3DRM3_CreateProgressiveMesh(p,a)                    (p)->lpVtbl->CreateProgressiveMesh(p,a)
+#define IDirect3DRM3_RegisterClient(p,a,b)                         (p)->lpVtbl->RegisterClient(p,a,b)
+#define IDirect3DRM3_UnregisterClient(p,a)                         (p)->lpVtbl->UnregisterClient(p,a)
+#define IDirect3DRM3_CreateClippedVisual(p,ab)                     (p)->lpVtbl->CreateClippedVisual(p,a,b)
+#define IDirect3DRM3_SetOptions(p,a)                               (p)->lpVtbl->SetOptions(p,a)
+#define IDirect3DRM3_GetOptions(p,a)                               (p)->lpVtbl->GetOptions(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRM3_QueryInterface(p,a,b)                         (p)->QueryInterface(a,b)
+#define IDirect3DRM3_AddRef(p)                                     (p)->AddRef()
+#define IDirect3DRM3_Release(p)                                    (p)->Release()
+/*** IDirect3DRM3 methods ***/
+#define IDirect3DRM3_CreateObject(p,a,b,c,d)                       (p)->CreateObject(a,b,d)
+#define IDirect3DRM3_CreateFrame(p,a,b)                            (p)->CreateFrame(a,b)
+#define IDirect3DRM3_CreateMesh(p,a)                               (p)->CreateMesh(a)
+#define IDirect3DRM3_CreateMeshBuilder(p,a)                        (p)->CreateMeshBuilder(a)
+#define IDirect3DRM3_CreateFace(p,a)                               (p)->CreateFace(a)
+#define IDirect3DRM3_CreateAnimation(p,a)                          (p)->CreateAnimation(a)
+#define IDirect3DRM3_CreateAnimationSet(p,a)                       (p)->CreateAnimationSet(a)
+#define IDirect3DRM3_CreateTexture(p,a,b)                          (p)->CreateTexture(a,b)
+#define IDirect3DRM3_CreateLight(p,a,b,c)                          (p)->CreateLight(a,b,c)
+#define IDirect3DRM3_CreateLightRGB(p,a,b,c,d,e)                   (p)->CreateLightRGB(a,b,c,d,e)
+#define IDirect3DRM3_CreateMaterial(p,a,b)                         (p)->CreateMaterial(a,b)
+#define IDirect3DRM3_CreateDevice(p,a,b,c)                         (p)->CreateDevice(a,b,c)
+#define IDirect3DRM3_CreateDeviceFromSurface(p,a,b,c,d)            (p)->CreateDeviceFromSurface(a,b,c,d)
+#define IDirect3DRM3_CreateDeviceFromD3D(p,a,b,c)                  (p)->CreateDeviceFromD3D(a,b,c)
+#define IDirect3DRM3_CreateDeviceFromClipper(p,a,b,c,d,e)          (p)->CreateDeviceFromClipper(a,b,c,d,e)
+#define IDirect3DRM3_CreateTextureFromSurface(p,a,b)               (p)->CreateTextureFromSurface(a,b)
+#define IDirect3DRM3_CreateShadow(p,a,b,c,d,e,f,g,h,i)             (p)->CreateShadow(a,b,c,d,e,f,g,h,i)
+#define IDirect3DRM3_CreateViewport(p,a,b,c,d,e,f,g)               (p)->CreateViewport(a,b,c,d,e,f,g)
+#define IDirect3DRM3_CreateWrap(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) (p)->CreateWrap(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
+#define IDirect3DRM3_CreateUserVisual(p,a,b,c)                     (p)->CreateUserVisual(a,b,c)
+#define IDirect3DRM3_LoadTexture(p,a,b)                            (p)->LoadTexture(a,b)
+#define IDirect3DRM3_LoadTextureFromResource(p,a,b,c,d)            (p)->LoadTextureFromResource(a,b,c,d)
+#define IDirect3DRM3_SetSearchPath(p,a)                            (p)->SetSearchPath(a)
+#define IDirect3DRM3_AddSearchPath(p,a)                            (p)->AddSearchPath(a)
+#define IDirect3DRM3_GetSearchPath(p,a,b)                          (p)->GetSearchPath(a,b)
+#define IDirect3DRM3_SetDefaultTextureColors(p,a)                  (p)->SetDefaultTextureColors(a)
+#define IDirect3DRM3_SetDefaultTextureShades(p,a)                  (p)->SetDefaultTextureShades(a)
+#define IDirect3DRM3_GetDevices(p,a)                               (p)->GetDevices(a)
+#define IDirect3DRM3_GetNamedObject(p,a,b)                         (p)->GetNamedObject(a,b)
+#define IDirect3DRM3_EnumerateObjects(p,a,b)                       (p)->EnumerateObjects(a,b)
+#define IDirect3DRM3_Load(p,a,b,c,d,e,f,g,h,i,j)                   (p)->Load(a,b,c,d,e,f,g,h,i,j)
+#define IDirect3DRM3_Tick(p,a)                                     (p)->Tick(a)
+#define IDirect3DRM3_CreateProgressiveMesh(p,a)                    (p)->CreateProgressiveMesh(p,a)
+#define IDirect3DRM3_RegisterClient(p,a,b)                         (p)->RegisterClient(p,a,b)
+#define IDirect3DRM3_UnregisterClient(p,a)                         (p)->UnregisterClient(p,a)
+#define IDirect3DRM3_CreateClippedVisual(p,ab)                     (p)->CreateClippedVisual(p,a,b)
+#define IDirect3DRM3_SetOptions(p,a)                               (p)->SetOptions(p,a)
+#define IDirect3DRM3_GetOptions(p,a)                               (p)->GetOptions(p,a)
+#endif
+
+#define D3DRM_OK                        DD_OK
+#define D3DRMERR_BADOBJECT              MAKE_DDHRESULT(781)
+#define D3DRMERR_BADTYPE                MAKE_DDHRESULT(782)
+#define D3DRMERR_BADALLOC               MAKE_DDHRESULT(783)
+#define D3DRMERR_FACEUSED               MAKE_DDHRESULT(784)
+#define D3DRMERR_NOTFOUND               MAKE_DDHRESULT(785)
+#define D3DRMERR_NOTDONEYET             MAKE_DDHRESULT(786)
+#define D3DRMERR_FILENOTFOUND           MAKE_DDHRESULT(787)
+#define D3DRMERR_BADFILE                MAKE_DDHRESULT(788)
+#define D3DRMERR_BADDEVICE              MAKE_DDHRESULT(789)
+#define D3DRMERR_BADVALUE               MAKE_DDHRESULT(790)
+#define D3DRMERR_BADMAJORVERSION        MAKE_DDHRESULT(791)
+#define D3DRMERR_BADMINORVERSION        MAKE_DDHRESULT(792)
+#define D3DRMERR_UNABLETOEXECUTE        MAKE_DDHRESULT(793)
+#define D3DRMERR_LIBRARYNOTFOUND        MAKE_DDHRESULT(794)
+#define D3DRMERR_INVALIDLIBRARY         MAKE_DDHRESULT(795)
+#define D3DRMERR_PENDING                MAKE_DDHRESULT(796)
+#define D3DRMERR_NOTENOUGHDATA          MAKE_DDHRESULT(797)
+#define D3DRMERR_REQUESTTOOLARGE        MAKE_DDHRESULT(798)
+#define D3DRMERR_REQUESTTOOSMALL        MAKE_DDHRESULT(799)
+#define D3DRMERR_CONNECTIONLOST         MAKE_DDHRESULT(800)
+#define D3DRMERR_LOADABORTED            MAKE_DDHRESULT(801)
+#define D3DRMERR_NOINTERNET             MAKE_DDHRESULT(802)
+#define D3DRMERR_BADCACHEFILE           MAKE_DDHRESULT(803)
+#define D3DRMERR_BOXNOTSET              MAKE_DDHRESULT(804)
+#define D3DRMERR_BADPMDATA              MAKE_DDHRESULT(805)
+#define D3DRMERR_CLIENTNOTREGISTERED    MAKE_DDHRESULT(806)
+#define D3DRMERR_NOTCREATEDFROMDDS      MAKE_DDHRESULT(807)
+#define D3DRMERR_NOSUCHKEY              MAKE_DDHRESULT(808)
+#define D3DRMERR_INCOMPATABLEKEY        MAKE_DDHRESULT(809)
+#define D3DRMERR_ELEMENTINUSE           MAKE_DDHRESULT(810)
+#define D3DRMERR_TEXTUREFORMATNOTFOUND  MAKE_DDHRESULT(811)
+#define D3DRMERR_NOTAGGREGATED          MAKE_DDHRESULT(812)
+
+#endif /* __D3DRM_H__ */
diff --git a/misc/builddeps/dp.win32/include/d3drmdef.h b/misc/builddeps/dp.win32/include/d3drmdef.h
new file mode 100644 (file)
index 0000000..80086dc
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2007 Vijay Kiran Kamuju
+ * Copyright 2007 David ADAM
+ * Copyright 2010 Christian Costa
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __D3DRMDEFS_H__
+#define __D3DRMDEFS_H__
+
+#include <stddef.h>
+#include <d3dtypes.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+typedef struct _D3DRMVECTOR4D
+{
+    D3DVALUE x;
+    D3DVALUE y;
+    D3DVALUE z;
+    D3DVALUE w;
+} D3DRMVECTOR4D, *LPD3DRMVECTOR4D;
+
+typedef D3DVALUE D3DRMMATRIX4D[4][4];
+
+typedef struct _D3DRMQUATERNION {
+    D3DVALUE s;
+    D3DVECTOR v;
+} D3DRMQUATERNION, *LPD3DRMQUATERNION;
+
+typedef struct _D3DRMRAY {
+    D3DVECTOR dvDir;
+    D3DVECTOR dvPos;
+} D3DRMRAY, *LPD3DRMRAY;
+
+typedef struct _D3DRMBOX {
+    D3DVECTOR min;
+    D3DVECTOR max;
+} D3DRMBOX, *LPD3DRMBOX;
+
+typedef enum _D3DRMLIGHTTYPE {
+    D3DRMLIGHT_AMBIENT,
+    D3DRMLIGHT_POINT,
+    D3DRMLIGHT_SPOT,
+    D3DRMLIGHT_DIRECTIONAL,
+    D3DRMLIGHT_PARALLELPOINT
+} D3DRMLIGHTTYPE, *LPD3DRMLIGHTTYPE;
+
+typedef DWORD D3DRMRENDERQUALITY, *LPD3DRMRENDERQUALITY;
+
+typedef enum _D3DRMTEXTUREQUALITY {
+    D3DRMTEXTURE_NEAREST,
+    D3DRMTEXTURE_LINEAR,
+    D3DRMTEXTURE_MIPNEAREST,
+    D3DRMTEXTURE_MIPLINEAR,
+    D3DRMTEXTURE_LINEARMIPNEAREST,
+    D3DRMTEXTURE_LINEARMIPLINEAR
+} D3DRMTEXTUREQUALITY, *LPD3DRMTEXTUREQUALITY;
+
+typedef enum _D3DRMCOMBINETYPE {
+    D3DRMCOMBINE_REPLACE,
+    D3DRMCOMBINE_BEFORE,
+    D3DRMCOMBINE_AFTER
+} D3DRMCOMBINETYPE, *LPD3DRMCOMBINETYPE;
+
+typedef struct _D3DRMPALETTEENTRY {
+    unsigned char red;
+    unsigned char green;
+    unsigned char blue;
+    unsigned char flags;
+} D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;
+
+typedef struct _D3DRMIMAGE {
+    int width;
+    int height;
+    int aspectx;
+    int aspecty;
+    int depth;
+    int rgb;
+    int bytes_per_line;
+    void* buffer1;
+    void* buffer2;
+    unsigned long red_mask;
+    unsigned long green_mask;
+    unsigned long blue_mask;
+    unsigned long alpha_mask;
+    int palette_size;
+    D3DRMPALETTEENTRY* palette;
+} D3DRMIMAGE, *LPD3DRMIMAGE;
+
+typedef enum _D3DRMWRAPTYPE {
+    D3DRMWRAP_FLAT,
+    D3DRMWRAP_CYLINDER,
+    D3DRMWRAP_SPHERE,
+    D3DRMWRAP_CHROME,
+    D3DRMWRAP_SHEET,
+    D3DRMWRAP_BOX
+} D3DRMWRAPTYPE, *LPD3DRMWRAPTYPE;
+
+typedef enum _D3DRMPROJECTIONTYPE
+{
+    D3DRMPROJECT_PERSPECTIVE,
+    D3DRMPROJECT_ORTHOGRAPHIC,
+    D3DRMPROJECT_RIGHTHANDPERSPECTIVE,
+    D3DRMPROJECT_RIGHTHANDORTHOGRAPHIC
+} D3DRMPROJECTIONTYPE, *LPD3DRMPROJECTIONTYPE;
+
+typedef enum _D3DRMXOFFORMAT {
+    D3DRMXOF_BINARY,
+    D3DRMXOF_COMPRESSED,
+    D3DRMXOF_TEXT
+} D3DRMXOFFORMAT, *LPD3DRMXOFFORMAT;
+
+typedef DWORD D3DRMSAVEOPTIONS;
+
+typedef enum _D3DRMCOLORSOURCE {
+    D3DRMCOLOR_FROMFACE,
+    D3DRMCOLOR_FROMVERTEX
+} D3DRMCOLORSOURCE, *LPD3DRMCOLORSOURCE;
+
+typedef enum _D3DRMFRAMECONSTRAINT {
+    D3DRMCONSTRAIN_Z,
+    D3DRMCONSTRAIN_Y,
+    D3DRMCONSTRAIN_X
+} D3DRMFRAMECONSTRAINT, *LPD3DRMFRAMECONSTRAINT;
+
+typedef enum _D3DRMMATERIALMODE {
+    D3DRMMATERIAL_FROMMESH,
+    D3DRMMATERIAL_FROMPARENT,
+    D3DRMMATERIAL_FROMFRAME
+} D3DRMMATERIALMODE, *LPD3DRMMATERIALMODE;
+
+typedef enum _D3DRMFOGMODE {
+    D3DRMFOG_LINEAR,
+    D3DRMFOG_EXPONENTIAL,
+    D3DRMFOG_EXPONENTIALSQUARED
+} D3DRMFOGMODE, *LPD3DRMFOGMODE;
+
+typedef enum _D3DRMZBUFFERMODE {
+    D3DRMZBUFFER_FROMPARENT,
+    D3DRMZBUFFER_ENABLE,
+    D3DRMZBUFFER_DISABLE
+} D3DRMZBUFFERMODE, *LPD3DRMZBUFFERMODE;
+
+typedef enum _D3DRMSORTMODE {
+    D3DRMSORT_FROMPARENT,
+    D3DRMSORT_NONE,
+    D3DRMSORT_FRONTTOBACK,
+    D3DRMSORT_BACKTOFRONT
+} D3DRMSORTMODE, *LPD3DRMSORTMODE;
+
+typedef struct _D3DRMMATERIALOVERRIDE {
+    DWORD         dwSize;
+    DWORD         dwFlags;
+    D3DCOLORVALUE dcDiffuse;
+    D3DCOLORVALUE dcAmbient;
+    D3DCOLORVALUE dcEmissive;
+    D3DCOLORVALUE dcSpecular;
+    D3DVALUE      dvPower;
+    LPUNKNOWN     lpD3DRMTex;
+} D3DRMMATERIALOVERRIDE, *LPD3DRMMATERIALOVERRIDE;
+
+typedef DWORD D3DRMLOADOPTIONS;
+
+#define D3DRMLOAD_FROMFILE             0x000L
+#define D3DRMLOAD_FROMRESOURCE         0x001L
+#define D3DRMLOAD_FROMMEMORY           0x002L
+#define D3DRMLOAD_FROMSTREAM           0x004L
+#define D3DRMLOAD_FROMURL              0x008L
+
+#define D3DRMLOAD_BYNAME               0x010L
+#define D3DRMLOAD_BYPOSITION           0x020L
+#define D3DRMLOAD_BYGUID               0x040L
+#define D3DRMLOAD_FIRST                0x080L
+
+#define D3DRMLOAD_INSTANCEBYREFERENCE  0x100L
+#define D3DRMLOAD_INSTANCEBYCOPYING    0x200L
+
+#define D3DRMLOAD_ASYNCHRONOUS         0x400L
+
+typedef struct _D3DRMLOADRESOURCE {
+    HMODULE hModule;
+    LPCSTR /*LPCTSTR*/ lpName;
+    LPCSTR /*LPCTSTR*/ lpType;
+} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE;
+
+typedef struct _D3DRMLOADMEMORY {
+    LPVOID lpMemory;
+    DWORD dSize;
+} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY;
+
+typedef struct _D3DRMPMESHLOADSTATUS {
+    DWORD dwSize;
+    DWORD dwPMeshSize;
+    DWORD dwBaseMeshSize;
+    DWORD dwBytesLoaded;
+    DWORD dwVerticesLoaded;
+    DWORD dwFacesLoaded;
+    HRESULT dwLoadResult;
+    DWORD dwFlags;
+} D3DRMPMESHLOADSTATUS, *LPD3DRMPMESHLOADSTATUS;
+
+typedef enum _D3DRMUSERVISUALREASON {
+    D3DRMUSERVISUAL_CANSEE,
+    D3DRMUSERVISUAL_RENDER
+} D3DRMUSERVISUALREASON, *LPD3DRMUSERVISUALREASON;
+
+typedef DWORD D3DRMMAPPING;
+
+typedef struct _D3DRMVERTEX {
+    D3DVECTOR position;
+    D3DVECTOR normal;
+    D3DVALUE  tu;
+    D3DVALUE  tv;
+    D3DCOLOR  color;
+} D3DRMVERTEX, *LPD3DRMVERTEX;
+
+typedef LONG D3DRMGROUPINDEX;
+
+void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D, LPD3DRMQUATERNION);
+
+LPD3DRMQUATERNION WINAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION ,LPD3DVECTOR,D3DVALUE);
+LPD3DRMQUATERNION WINAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION);
+LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION, D3DVALUE);
+
+LPD3DVECTOR WINAPI D3DRMVectorAdd(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR);
+LPD3DVECTOR WINAPI D3DRMVectorCrossProduct(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR);
+D3DVALUE WINAPI D3DRMVectorDotProduct(LPD3DVECTOR, LPD3DVECTOR);
+LPD3DVECTOR WINAPI D3DRMVectorNormalize(LPD3DVECTOR);
+
+#define D3DRMVectorNormalise D3DRMVectorNormalize
+
+D3DVALUE WINAPI D3DRMVectorModulus(LPD3DVECTOR);
+LPD3DVECTOR WINAPI D3DRMVectorRandom(LPD3DVECTOR);
+LPD3DVECTOR WINAPI D3DRMVectorRotate(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR, D3DVALUE);
+LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR);
+LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR, LPD3DVECTOR, D3DVALUE);
+LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR);
+
+D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE, D3DVALUE, D3DVALUE);
+D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE);
+D3DVALUE WINAPI D3DRMColorGetAlpha(D3DCOLOR);
+D3DVALUE WINAPI D3DRMColorGetBlue(D3DCOLOR);
+D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR);
+D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/misc/builddeps/dp.win32/include/d3drmobj.h b/misc/builddeps/dp.win32/include/d3drmobj.h
new file mode 100644 (file)
index 0000000..bd22e89
--- /dev/null
@@ -0,0 +1,3033 @@
+/*
+ * Copyright (C) 2008 Vijay Kiran Kamuju
+ * Copyright (C) 2010 Christian Costa
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __D3DRMOBJ_H__
+#define __D3DRMOBJ_H__
+
+#include <objbase.h>
+#define VIRTUAL
+#include <d3drmdef.h>
+#include <d3d.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+
+DEFINE_GUID(IID_IDirect3DRMObject,          0xeb16cb00, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMObject2,         0x4516ec7c, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMDevice,          0xe9e19280, 0x6e05, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMDevice2,         0x4516ec78, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMDevice3,         0x549f498b, 0xbfeb, 0x11d1, 0x8e, 0xd8, 0x00, 0xa0, 0xc9, 0x67, 0xa4, 0x82);
+DEFINE_GUID(IID_IDirect3DRMViewport,        0xeb16cb02, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMViewport2,       0x4a1b1be6, 0xbfed, 0x11d1, 0x8e, 0xd8, 0x00, 0xa0, 0xc9, 0x67, 0xa4, 0x82);
+DEFINE_GUID(IID_IDirect3DRMFrame,           0xeb16cb03, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMFrame2,          0xc3dfbd60, 0x3988, 0x11d0, 0x9e, 0xc2, 0x00, 0x00, 0xc0, 0x29, 0x1a, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMFrame3,          0xff6b7f70, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66);
+DEFINE_GUID(IID_IDirect3DRMVisual,          0xeb16cb04, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMMesh,            0xa3a80d01, 0x6e12, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMMeshBuilder,     0xa3a80d02, 0x6e12, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMMeshBuilder2,    0x4516ec77, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMMeshBuilder3,    0x4516ec82, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMFace,            0xeb16cb07, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMFace2,           0x4516ec81, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMLight,           0xeb16cb08, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMTexture,         0xeb16cb09, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMTexture2,        0x120f30c0, 0x1629, 0x11d0, 0x94, 0x1c, 0x00, 0x80, 0xc8, 0x0c, 0xfa, 0x7b);
+DEFINE_GUID(IID_IDirect3DRMTexture3,        0xff6b7f73, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66);
+DEFINE_GUID(IID_IDirect3DRMWrap,            0xeb16cb0a, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMMaterial,        0xeb16cb0b, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMMaterial2,       0xff6b7f75, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66);
+DEFINE_GUID(IID_IDirect3DRMAnimation,       0xeb16cb0d, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMAnimation2,      0xff6b7f77, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66);
+DEFINE_GUID(IID_IDirect3DRMAnimationSet,    0xeb16cb0e, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMAnimationSet2,   0xff6b7f79, 0xa40e, 0x11d1, 0x91, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0x8e, 0x66);
+DEFINE_GUID(IID_IDirect3DRMObjectArray,     0x242f6bc2, 0x3849, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMDeviceArray,     0xeb16cb10, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMViewportArray,   0xeb16cb11, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMFrameArray,      0xeb16cb12, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMVisualArray,     0xeb16cb13, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMLightArray,      0xeb16cb14, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMPickedArray,     0xeb16cb16, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMFaceArray,       0xeb16cb17, 0xd271, 0x11ce, 0xac, 0x48, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMAnimationArray,  0xd5f1cae0, 0x4bd7, 0x11d1, 0xb9, 0x74, 0x00, 0x60, 0x08, 0x3e, 0x45, 0xf3);
+DEFINE_GUID(IID_IDirect3DRMUserVisual,      0x59163de0, 0x6d43, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMShadow,          0xaf359780, 0x6ba3, 0x11cf, 0xac, 0x4a, 0x00, 0x00, 0xc0, 0x38, 0x25, 0xa1);
+DEFINE_GUID(IID_IDirect3DRMShadow2,         0x86b44e25, 0x9c82, 0x11d1, 0xbb, 0x0b, 0x00, 0xa0, 0xc9, 0x81, 0xa0, 0xa6);
+DEFINE_GUID(IID_IDirect3DRMInterpolator,    0x242f6bc1, 0x3849, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMProgressiveMesh, 0x4516ec79, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMPicked2Array,    0x4516ec7b, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3);
+DEFINE_GUID(IID_IDirect3DRMClippedVisual,   0x5434e733, 0x6d66, 0x11d1, 0xbb, 0x0b, 0x00, 0x00, 0xf8, 0x75, 0x86, 0x5a);
+
+typedef struct IDirect3DRMObject          *LPDIRECT3DRMOBJECT, **LPLPDIRECT3DRMOBJECT;
+typedef struct IDirect3DRMObject2         *LPDIRECT3DRMOBJECT2, **LPLPDIRECT3DRMOBJECT2;
+typedef struct IDirect3DRMDevice          *LPDIRECT3DRMDEVICE, **LPLPDIRECT3DRMDEVICE;
+typedef struct IDirect3DRMDevice2         *LPDIRECT3DRMDEVICE2, **LPLPDIRECT3DRMDEVICE2;
+typedef struct IDirect3DRMDevice3         *LPDIRECT3DRMDEVICE3, **LPLPDIRECT3DRMDEVICE3;
+typedef struct IDirect3DRMViewport        *LPDIRECT3DRMVIEWPORT, **LPLPDIRECT3DRMVIEWPORT;
+typedef struct IDirect3DRMViewport2       *LPDIRECT3DRMVIEWPORT2, **LPLPDIRECT3DRMVIEWPORT2;
+typedef struct IDirect3DRMFrame           *LPDIRECT3DRMFRAME, **LPLPDIRECT3DRMFRAME;
+typedef struct IDirect3DRMFrame2          *LPDIRECT3DRMFRAME2, **LPLPDIRECT3DRMFRAME2;
+typedef struct IDirect3DRMFrame3          *LPDIRECT3DRMFRAME3, **LPLPDIRECT3DRMFRAME3;
+typedef struct IDirect3DRMVisual          *LPDIRECT3DRMVISUAL, **LPLPDIRECT3DRMVISUAL;
+typedef struct IDirect3DRMMesh            *LPDIRECT3DRMMESH, **LPLPDIRECT3DRMMESH;
+typedef struct IDirect3DRMMeshBuilder     *LPDIRECT3DRMMESHBUILDER, **LPLPDIRECT3DRMMESHBUILDER;
+typedef struct IDirect3DRMMeshBuilder2    *LPDIRECT3DRMMESHBUILDER2, **LPLPDIRECT3DRMMESHBUILDER2;
+typedef struct IDirect3DRMMeshBuilder3    *LPDIRECT3DRMMESHBUILDER3, **LPLPDIRECT3DRMMESHBUILDER3;
+typedef struct IDirect3DRMFace            *LPDIRECT3DRMFACE, **LPLPDIRECT3DRMFACE;
+typedef struct IDirect3DRMFace2           *LPDIRECT3DRMFACE2, **LPLPDIRECT3DRMFACE2;
+typedef struct IDirect3DRMLight           *LPDIRECT3DRMLIGHT, **LPLPDIRECT3DRMLIGHT;
+typedef struct IDirect3DRMTexture         *LPDIRECT3DRMTEXTURE, **LPLPDIRECT3DRMTEXTURE;
+typedef struct IDirect3DRMTexture2        *LPDIRECT3DRMTEXTURE2, **LPLPDIRECT3DRMTEXTURE2;
+typedef struct IDirect3DRMTexture3        *LPDIRECT3DRMTEXTURE3, **LPLPDIRECT3DRMTEXTURE3;
+typedef struct IDirect3DRMWrap            *LPDIRECT3DRMWRAP, **LPLPDIRECT3DRMWRAP;
+typedef struct IDirect3DRMMaterial        *LPDIRECT3DRMMATERIAL, **LPLPDIRECT3DRMMATERIAL;
+typedef struct IDirect3DRMMaterial2       *LPDIRECT3DRMMATERIAL2, **LPLPDIRECT3DRMMATERIAL2;
+typedef struct IDirect3DRMAnimation       *LPDIRECT3DRMANIMATION, **LPLPDIRECT3DRMANIMATION;
+typedef struct IDirect3DRMAnimation2      *LPDIRECT3DRMANIMATION2, **LPLPDIRECT3DRMANIMATION2;
+typedef struct IDirect3DRMAnimationSet    *LPDIRECT3DRMANIMATIONSET, **LPLPDIRECT3DRMANIMATIONSET;
+typedef struct IDirect3DRMAnimationSet2   *LPDIRECT3DRMANIMATIONSET2, **LPLPDIRECT3DRMANIMATIONSET2;
+typedef struct IDirect3DRMUserVisual      *LPDIRECT3DRMUSERVISUAL, **LPLPDIRECT3DRMUSERVISUAL;
+typedef struct IDirect3DRMShadow          *LPDIRECT3DRMSHADOW, **LPLPDIRECT3DRMSHADOW;
+typedef struct IDirect3DRMShadow2         *LPDIRECT3DRMSHADOW2, **LPLPDIRECT3DRMSHADOW2;
+typedef struct IDirect3DRMArray           *LPDIRECT3DRMARRAY, **LPLPDIRECT3DRMARRAY;
+typedef struct IDirect3DRMObjectArray     *LPDIRECT3DRMOBJECTARRAY, **LPLPDIRECT3DRMOBJECTARRAY;
+typedef struct IDirect3DRMDeviceArray     *LPDIRECT3DRMDEVICEARRAY, **LPLPDIRECT3DRMDEVICEARRAY;
+typedef struct IDirect3DRMFaceArray       *LPDIRECT3DRMFACEARRAY, **LPLPDIRECT3DRMFACEARRAY;
+typedef struct IDirect3DRMViewportArray   *LPDIRECT3DRMVIEWPORTARRAY, **LPLPDIRECT3DRMVIEWPORTARRAY;
+typedef struct IDirect3DRMFrameArray      *LPDIRECT3DRMFRAMEARRAY, **LPLPDIRECT3DRMFRAMEARRAY;
+typedef struct IDirect3DRMAnimationArray  *LPDIRECT3DRMANIMATIONARRAY, **LPLPDIRECT3DRMANIMATIONARRAY;
+typedef struct IDirect3DRMVisualArray     *LPDIRECT3DRMVISUALARRAY, **LPLPDIRECT3DRMVISUALARRAY;
+typedef struct IDirect3DRMPickedArray     *LPDIRECT3DRMPICKEDARRAY, **LPLPDIRECT3DRMPICKEDARRAY;
+typedef struct IDirect3DRMPicked2Array    *LPDIRECT3DRMPICKED2ARRAY, **LPLPDIRECT3DRMPICKED2ARRAY;
+typedef struct IDirect3DRMLightArray      *LPDIRECT3DRMLIGHTARRAY, **LPLPDIRECT3DRMLIGHTARRAY;
+typedef struct IDirect3DRMProgressiveMesh *LPDIRECT3DRMPROGRESSIVEMESH, **LPLPDIRECT3DRMPROGRESSIVEMESH;
+typedef struct IDirect3DRMClippedVisual   *LPDIRECT3DRMCLIPPEDVISUAL, **LPLPDIRECT3DRMCLIPPEDVISUAL;
+
+/* ********************************************************************
+   Types and structures
+   ******************************************************************** */
+
+typedef void (__cdecl *D3DRMOBJECTCALLBACK)(LPDIRECT3DRMOBJECT obj, LPVOID arg);
+typedef void (__cdecl *D3DRMFRAMEMOVECALLBACK)(LPDIRECT3DRMFRAME obj, LPVOID arg, D3DVALUE delta);
+typedef void (__cdecl *D3DRMFRAME3MOVECALLBACK)(LPDIRECT3DRMFRAME3 obj, LPVOID arg, D3DVALUE delta);
+typedef void (__cdecl *D3DRMUPDATECALLBACK)(LPDIRECT3DRMDEVICE obj, LPVOID arg, int, LPD3DRECT);
+typedef int (__cdecl *D3DRMUSERVISUALCALLBACK)(LPDIRECT3DRMUSERVISUAL obj, LPVOID arg,
+    D3DRMUSERVISUALREASON reason, LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMVIEWPORT view);
+typedef HRESULT (__cdecl *D3DRMLOADTEXTURECALLBACK)(char *tex_name, void *arg, LPDIRECT3DRMTEXTURE *);
+typedef HRESULT (__cdecl *D3DRMLOADTEXTURE3CALLBACK)(char *tex_name, void *arg, LPDIRECT3DRMTEXTURE3 *);
+typedef void (__cdecl *D3DRMLOADCALLBACK)(LPDIRECT3DRMOBJECT object, REFIID objectguid, LPVOID arg);
+
+typedef struct _D3DRMPICKDESC
+{
+    ULONG     ulFaceIdx;
+    LONG      lGroupIdx;
+    D3DVECTOR vPosition;
+} D3DRMPICKDESC, *LPD3DRMPICKDESC;
+
+typedef struct _D3DRMPICKDESC2
+{
+    ULONG     ulFaceIdx;
+    LONG      lGroupIdx;
+    D3DVECTOR vPosition;
+    D3DVALUE  tu;
+    D3DVALUE  tv;
+    D3DVECTOR dvNormal;
+    D3DCOLOR  dcColor;
+} D3DRMPICKDESC2, *LPD3DRMPICKDESC2;
+
+/*****************************************************************************
+ * IDirect3DRMObject interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRMObject
+DECLARE_INTERFACE_(IDirect3DRMObject,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMObject_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMObject_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMObject_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMObject_Clone(p,a,b,c)               (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMObject_AddDestroyCallback(p,a,b)    (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMObject_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMObject_SetAppData(p,a)              (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMObject_GetAppData(p)                (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMObject_SetName(p,a)                 (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMObject_GetName(p,a,b)               (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMObject_GetClassName(p,a,b)          (p)->lpVtbl->GetClassName(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMObject_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DRMObject_AddRef(p)                    (p)->AddRef()
+#define IDirect3DRMObject_Release(p)                   (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMObject_Clone(p,a,b,c)               (p)->Clone(a,b,c)
+#define IDirect3DRMObject_AddDestroyCallback(p,a,b)    (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMObject_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMObject_SetAppData(p,a)              (p)->SetAppData(a)
+#define IDirect3DRMObject_GetAppData(p)                (p)->GetAppData()
+#define IDirect3DRMObject_SetName(p,a)                 (p)->SetName(a)
+#define IDirect3DRMObject_GetName(p,a,b)               (p)->GetName(a,b)
+#define IDirect3DRMObject_GetClassName(p,a,b)          (p)->GetClassName(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMObject2 interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRMObject2
+DECLARE_INTERFACE_(IDirect3DRMObject2,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject2 methods ***/
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(GetClientData)(THIS_ DWORD id, LPVOID* ppData) PURE;
+    STDMETHOD(GetDirect3DRM)(THIS_ LPDIRECT3DRM* ppDirect3DRM) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD pSize, LPSTR pName) PURE;
+    STDMETHOD(SetClientData)(THIS_ DWORD id, LPVOID pData, DWORD flags) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR pName) PURE;
+    STDMETHOD(GetAge)(THIS_ DWORD flags, LPDWORD pAge) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMObject2_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMObject2_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMObject2_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject2 methods ***/
+#define IDirect3DRMObject2_AddDestroyCallback(p,a,b)    (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMObject2_Clone(p,a,b,c)               (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMObject2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMObject2_GetClientData(p,a,b)         (p)->lpVtbl->SetClientData(p,a,b)
+#define IDirect3DRMObject2_GetDirect3DRM(p,a)           (p)->lpVtbl->GetDirect3DRM(p,a)
+#define IDirect3DRMObject2_GetName(p,a,b)               (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMObject2_SetClientData(p,a,b,c)       (p)->lpVtbl->SetClientData(p,a,b,c)
+#define IDirect3DRMObject2_SetName(p,a)                 (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMObject2_GetAge(p,a,b)                (p)->lpVtbl->GetAge(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMObject2_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DRMObject2_AddRef(p)                    (p)->AddRef()
+#define IDirect3DRMObject2_Release(p)                   (p)->Release()
+/*** IDirect3DRMObject2 methods ***/
+#define IDirect3DRMObject2_AddDestroyCallback(p,a,b)    (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMObject2_Clone(p,a,b,c)               (p)->Clone(a,b,c)
+#define IDirect3DRMObject2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMObject2_GetClientData(p,a,b)         (p)->SetClientData(a,b)
+#define IDirect3DRMObject2_GetDirect3DRM(p,a)           (p)->GetDirect3DRM(a)
+#define IDirect3DRMObject2_GetName(p,a,b)               (p)->GetName(a,b)
+#define IDirect3DRMObject2_SetClientData(p,a,b,c)       (p)->SetClientData(a,b,c)
+#define IDirect3DRMObject2_SetName(p,a)                 (p)->SetName(a)
+#define IDirect3DRMObject2_GetAge(p,a,b)                (p)->GetAge(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMVisual interface
+ */
+#define INTERFACE IDirect3DRMVisual
+DECLARE_INTERFACE_(IDirect3DRMVisual,IDirect3DRMObject)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMVisual_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMVisual_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMVisual_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMVisual_Clone(p,a,b,c)               (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMVisual_AddDestroyCallback(p,a,b)    (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMVisual_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMVisual_SetAppData(p,a)              (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMVisual_GetAppData(p)                (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMVisual_SetName(p,a)                 (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMVisual_GetName(p,a,b)               (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMVisual_GetClassName(p,a,b)          (p)->lpVtbl->GetClassName(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMVisual_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DRMVisual_AddRef(p)                    (p)->AddRef()
+#define IDirect3DRMVisual_Release(p)                   (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMVisual_Clone(p,a,b,c)               (p)->Clone(a,b,c)
+#define IDirect3DRMVisual_AddDestroyCallback(p,a,b)    (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMVisual_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMVisual_SetAppData(p,a)              (p)->SetAppData(a)
+#define IDirect3DRMVisual_GetAppData(p)                (p)->GetAppData()
+#define IDirect3DRMVisual_SetName(p,a)                 (p)->SetName(a)
+#define IDirect3DRMVisual_GetName(p,a,b)               (p)->GetName(a,b)
+#define IDirect3DRMVisual_GetClassName(p,a,b)          (p)->GetClassName(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMDevice interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRMDevice
+DECLARE_INTERFACE_(IDirect3DRMDevice,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMDevice methods ***/
+    STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE;
+    STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev) PURE;
+    STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height) PURE;
+    STDMETHOD(Update)(THIS) PURE;
+    STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE;
+    STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE;
+    STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE;
+    STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE;
+    STDMETHOD(SetDither)(THIS_ BOOL) PURE;
+    STDMETHOD(SetShades)(THIS_ DWORD) PURE;
+    STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
+    STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE;
+    STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE;
+    STDMETHOD_(BOOL, GetDither)(THIS) PURE;
+    STDMETHOD_(DWORD, GetShades)(THIS) PURE;
+    STDMETHOD_(DWORD, GetHeight)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWidth)(THIS) PURE;
+    STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE;
+    STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE;
+    STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE;
+    STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE;
+    STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMDevice_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMDevice_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMDevice_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMDevice_Clone(p,a,b,c)               (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMDevice_AddDestroyCallback(p,a,b)    (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMDevice_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMDevice_SetAppData(p,a)              (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMDevice_GetAppData(p)                (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMDevice_SetName(p,a)                 (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMDevice_GetName(p,a,b)               (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMDevice_GetClassName(p,a,b)          (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMDevice methods ***/
+#define IDirect3DRMDevice_Init(p,a,b)                  (p)->lpVtbl->Init(p,a,b)
+#define IDirect3DRMDevice_InitFromD3D(p,a,b)           (p)->lpVtbl->InitFromD3D(p,a,b)
+#define IDirect3DRMDevice_InitFromClipper(p,a,b,c,d)   (p)->lpVtbl->InitFromClipper(p,a,b,c,d)
+#define IDirect3DRMDevice_Update(p)                    (p)->lpVtbl->Update(p)
+#define IDirect3DRMDevice_AddUpdateCallback(p,a,b)     (p)->lpVtbl->AddUpdateCallback(p,a,b)
+#define IDirect3DRMDevice_DeleteUpdateCallback(p,a,b)  (p)->lpVtbl->DeleteUpdateCallback(p,a,b,c)
+#define IDirect3DRMDevice_SetBufferCount(p,a)          (p)->lpVtbl->SetBufferCount(p,a)
+#define IDirect3DRMDevice_GetBufferCount(p)            (p)->lpVtbl->GetBufferCount(p)
+#define IDirect3DRMDevice_SetDither(p,a)               (p)->lpVtbl->SetDither(p,a)
+#define IDirect3DRMDevice_SetShades(p,a)               (p)->lpVtbl->SetShades(p,a)
+#define IDirect3DRMDevice_SetQuality(p,a)              (p)->lpVtbl->SetQuality(p,a)
+#define IDirect3DRMDevice_SetTextureQuality(p,a)       (p)->lpVtbl->SetTextureQuality(p,a)
+#define IDirect3DRMDevice_GetViewports(p,a)            (p)->lpVtbl->GetViewports(p,a)
+#define IDirect3DRMDevice_GetDither(p)                 (p)->lpVtbl->GetDither(p)
+#define IDirect3DRMDevice_GetShades(p)                 (p)->lpVtbl->GetShades(p)
+#define IDirect3DRMDevice_GetHeight(p)                 (p)->lpVtbl->GetHeight(p)
+#define IDirect3DRMDevice_GetWidth(p)                  (p)->lpVtbl->GetWidth(p)
+#define IDirect3DRMDevice_GetTrianglesDrawn(p)         (p)->lpVtbl->GetTrianglesDrawn(p)
+#define IDirect3DRMDevice_GetWireframeOptions(p)       (p)->lpVtbl->GetWireframeOptions(p)
+#define IDirect3DRMDevice_GetQuality(p)                (p)->lpVtbl->GetQuality(p)
+#define IDirect3DRMDevice_GetColorModel(p)             (p)->lpVtbl->GetColorModel(p)
+#define IDirect3DRMDevice_GetTextureQuality(p)         (p)->lpVtbl->GetTextureQuality(p)
+#define IDirect3DRMDevice_GetDirect3DDevice(p,a)       (p)->lpVtbl->GetDirect3DDevice(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMDevice_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DRMDevice_AddRef(p)                    (p)->AddRef()
+#define IDirect3DRMDevice_Release(p)                   (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMDevice_Clone(p,a,b,c)               (p)->Clone(a,b,c)
+#define IDirect3DRMDevice_AddDestroyCallback(p,a,b)    (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMDevice_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMDevice_SetAppData(p,a)              (p)->SetAppData(a)
+#define IDirect3DRMDevice_GetAppData(p)                (p)->GetAppData()
+#define IDirect3DRMDevice_SetName(p,a)                 (p)->SetName(a)
+#define IDirect3DRMDevice_GetName(p,a,b)               (p)->GetName(a,b)
+#define IDirect3DRMDevice_GetClassName(p,a,b)          (p)->GetClassName(a,b)
+/*** IDirect3DRMDevice methods ***/
+#define IDirect3DRMDevice_Init(p,a,b)                  (p)->Init(p,a,b)
+#define IDirect3DRMDevice_InitFromD3D(p,a,b)           (p)->InitFromD3D(p,a,b)
+#define IDirect3DRMDevice_InitFromClipper(p,a,b,c,d)   (p)->InitFromClipper(p,a,b,c,d)
+#define IDirect3DRMDevice_Update(p)                    (p)->Update(p)
+#define IDirect3DRMDevice_AddUpdateCallback(p,a,b)     (p)->AddUpdateCallback(p,a,b)
+#define IDirect3DRMDevice_DeleteUpdateCallback(p,a,b)  (p)->DeleteUpdateCallback(p,a,b,c)
+#define IDirect3DRMDevice_SetBufferCount(p,a)          (p)->SetBufferCount(p,a)
+#define IDirect3DRMDevice_GetBufferCount(p)            (p)->GetBufferCount(p)
+#define IDirect3DRMDevice_SetDither(p,a)               (p)->SetDither(p,a)
+#define IDirect3DRMDevice_SetShades(p,a)               (p)->SetShades(p,a)
+#define IDirect3DRMDevice_SetQuality(p,a)              (p)->SetQuality(p,a)
+#define IDirect3DRMDevice_SetTextureQuality(p,a)       (p)->SetTextureQuality(p,a)
+#define IDirect3DRMDevice_GetViewports(p,a)            (p)->GetViewports(p,a)
+#define IDirect3DRMDevice_GetDither(p)                 (p)->GetDither(p)
+#define IDirect3DRMDevice_GetShades(p)                 (p)->GetShades(p)
+#define IDirect3DRMDevice_GetHeight(p)                 (p)->GetHeight(p)
+#define IDirect3DRMDevice_GetWidth(p)                  (p)->GetWidth(p)
+#define IDirect3DRMDevice_GetTrianglesDrawn(p)         (p)->GetTrianglesDrawn(p)
+#define IDirect3DRMDevice_GetWireframeOptions(p)       (p)->GetWireframeOptions(p)
+#define IDirect3DRMDevice_GetQuality(p)                (p)->GetQuality(p)
+#define IDirect3DRMDevice_GetColorModel(p)             (p)->GetColorModel(p)
+#define IDirect3DRMDevice_GetTextureQuality(p)         (p)->GetTextureQuality(p)
+#define IDirect3DRMDevice_GetDirect3DDevice(p,a)       (p)->GetDirect3DDevice(p,a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMDevice2 interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRMDevice2
+DECLARE_INTERFACE_(IDirect3DRMDevice2,IDirect3DRMDevice)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMDevice methods ***/
+    STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE;
+    STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev) PURE;
+    STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height) PURE;
+    STDMETHOD(Update)(THIS) PURE;
+    STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE;
+    STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE;
+    STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE;
+    STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE;
+    STDMETHOD(SetDither)(THIS_ BOOL) PURE;
+    STDMETHOD(SetShades)(THIS_ DWORD) PURE;
+    STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
+    STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE;
+    STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE;
+    STDMETHOD_(BOOL, GetDither)(THIS) PURE;
+    STDMETHOD_(DWORD, GetShades)(THIS) PURE;
+    STDMETHOD_(DWORD, GetHeight)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWidth)(THIS) PURE;
+    STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE;
+    STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE;
+    STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE;
+    STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE;
+    STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE;
+    /*** IDirect3DRMDevice2 methods ***/
+    STDMETHOD(InitFromD3D2)(THIS_ LPDIRECT3D2 pD3D, LPDIRECT3DDEVICE2 pD3DDev) PURE;
+    STDMETHOD(InitFromSurface)(THIS_ LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack) PURE;
+    STDMETHOD(SetRenderMode)(THIS_ DWORD flags) PURE;
+    STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE;
+    STDMETHOD(GetDirect3DDevice2)(THIS_ LPDIRECT3DDEVICE2 *) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMDevice2_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMDevice2_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMDevice2_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMDevice2_Clone(p,a,b,c)               (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMDevice2_AddDestroyCallback(p,a,b)    (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMDevice2_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMDevice2_SetAppData(p,a)              (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMDevice2_GetAppData(p)                (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMDevice2_SetName(p,a)                 (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMDevice2_GetName(p,a,b)               (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMDevice2_GetClassName(p,a,b)          (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMDevice methods ***/
+#define IDirect3DRMDevice2_Init(p,a,b)                  (p)->lpVtbl->Init(p,a,b)
+#define IDirect3DRMDevice2_InitFromD3D(p,a,b)           (p)->lpVtbl->InitFromD3D(p,a,b)
+#define IDirect3DRMDevice2_InitFromClipper(p,a,b,c,d)   (p)->lpVtbl->InitFromClipper(p,a,b,c,d)
+#define IDirect3DRMDevice2_Update(p)                    (p)->lpVtbl->Update(p)
+#define IDirect3DRMDevice2_AddUpdateCallback(p,a,b)     (p)->lpVtbl->AddUpdateCallback(p,a,b)
+#define IDirect3DRMDevice2_DeleteUpdateCallback(p,a,b)  (p)->lpVtbl->DeleteUpdateCallback(p,a,b,c)
+#define IDirect3DRMDevice2_SetBufferCount(p,a)          (p)->lpVtbl->SetBufferCount(p,a)
+#define IDirect3DRMDevice2_GetBufferCount(p)            (p)->lpVtbl->GetBufferCount(p)
+#define IDirect3DRMDevice2_SetDither(p,a)               (p)->lpVtbl->SetDither(p,a)
+#define IDirect3DRMDevice2_SetShades(p,a)               (p)->lpVtbl->SetShades(p,a)
+#define IDirect3DRMDevice2_SetQuality(p,a)              (p)->lpVtbl->SetQuality(p,a)
+#define IDirect3DRMDevice2_SetTextureQuality(p,a)       (p)->lpVtbl->SetTextureQuality(p,a)
+#define IDirect3DRMDevice2_GetViewports(p,a)            (p)->lpVtbl->GetViewports(p,a)
+#define IDirect3DRMDevice2_GetDither(p)                 (p)->lpVtbl->GetDither(p)
+#define IDirect3DRMDevice2_GetShades(p)                 (p)->lpVtbl->GetShades(p)
+#define IDirect3DRMDevice2_GetHeight(p)                 (p)->lpVtbl->GetHeight(p)
+#define IDirect3DRMDevice2_GetWidth(p)                  (p)->lpVtbl->GetWidth(p)
+#define IDirect3DRMDevice2_GetTrianglesDrawn(p)         (p)->lpVtbl->GetTrianglesDrawn(p)
+#define IDirect3DRMDevice2_GetWireframeOptions(p)       (p)->lpVtbl->GetWireframeOptions(p)
+#define IDirect3DRMDevice2_GetQuality(p)                (p)->lpVtbl->GetQuality(p)
+#define IDirect3DRMDevice2_GetColorModel(p)             (p)->lpVtbl->GetColorModel(p)
+#define IDirect3DRMDevice2_GetTextureQuality(p)         (p)->lpVtbl->GetTextureQuality(p)
+#define IDirect3DRMDevice2_GetDirect3DDevice(p,a)       (p)->lpVtbl->GetDirect3DDevice(p,a)
+/*** IDirect3DRMDevice2 methods ***/
+#define IDirect3DRMDevice2_InitFromD3D2(p,a,b)          (p)->lpVtbl->InitFromD3D2(p,a,b)
+#define IDirect3DRMDevice2_InitFromSurface(p,a,b,c)     (p)->lpVtbl->InitFromSurface(p,a,b,c)
+#define IDirect3DRMDevice2_SetRenderMode(p,a)           (p)->lpVtbl->SetRenderMode(p,a)
+#define IDirect3DRMDevice2_GetRenderMode(p)             (p)->lpVtbl->GetRenderMode(p)
+#define IDirect3DRMDevice2_GetDirect3DDevice2(p,a)      (p)->lpVtbl->GetDirect3DDevice2(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMDevice2_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DRMDevice2_AddRef(p)                    (p)->AddRef()
+#define IDirect3DRMDevice2_Release(p)                   (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMDevice2_Clone(p,a,b,c)               (p)->Clone(a,b,c)
+#define IDirect3DRMDevice2_AddDestroyCallback(p,a,b)    (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMDevice2_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMDevice2_SetAppData(p,a)              (p)->SetAppData(a)
+#define IDirect3DRMDevice2_GetAppData(p)                (p)->GetAppData()
+#define IDirect3DRMDevice2_SetName(p,a)                 (p)->SetName(a)
+#define IDirect3DRMDevice2_GetName(p,a,b)               (p)->GetName(a,b)
+#define IDirect3DRMDevice2_GetClassName(p,a,b)          (p)->GetClassName(a,b)
+/*** IDirect3DRMDevice methods ***/
+#define IDirect3DRMDevice2_Init(p,a,b)                  (p)->Init(p,a,b)
+#define IDirect3DRMDevice2_InitFromD3D(p,a,b)           (p)->InitFromD3D(p,a,b)
+#define IDirect3DRMDevice2_InitFromClipper(p,a,b,c,d)   (p)->InitFromClipper(p,a,b,c,d)
+#define IDirect3DRMDevice2_Update(p)                    (p)->Update(p)
+#define IDirect3DRMDevice2_AddUpdateCallback(p,a,b)     (p)->AddUpdateCallback(p,a,b)
+#define IDirect3DRMDevice2_DeleteUpdateCallback(p,a,b)  (p)->DeleteUpdateCallback(p,a,b,c)
+#define IDirect3DRMDevice2_SetBufferCount(p,a)          (p)->SetBufferCount(p,a)
+#define IDirect3DRMDevice2_GetBufferCount(p)            (p)->GetBufferCount(p)
+#define IDirect3DRMDevice2_SetDither(p,a)               (p)->SetDither(p,a)
+#define IDirect3DRMDevice2_SetShades(p,a)               (p)->SetShades(p,a)
+#define IDirect3DRMDevice2_SetQuality(p,a)              (p)->SetQuality(p,a)
+#define IDirect3DRMDevice2_SetTextureQuality(p,a)       (p)->SetTextureQuality(p,a)
+#define IDirect3DRMDevice2_GetViewports(p,a)            (p)->GetViewports(p,a)
+#define IDirect3DRMDevice2_GetDither(p)                 (p)->GetDither(p)
+#define IDirect3DRMDevice2_GetShades(p)                 (p)->GetShades(p)
+#define IDirect3DRMDevice2_GetHeight(p)                 (p)->GetHeight(p)
+#define IDirect3DRMDevice2_GetWidth(p)                  (p)->GetWidth(p)
+#define IDirect3DRMDevice2_GetTrianglesDrawn(p)         (p)->GetTrianglesDrawn(p)
+#define IDirect3DRMDevice2_GetWireframeOptions(p)       (p)->GetWireframeOptions(p)
+#define IDirect3DRMDevice2_GetQuality(p)                (p)->GetQuality(p)
+#define IDirect3DRMDevice2_GetColorModel(p)             (p)->GetColorModel(p)
+#define IDirect3DRMDevice2_GetTextureQuality(p)         (p)->GetTextureQuality(p)
+#define IDirect3DRMDevice2_GetDirect3DDevice(p,a)       (p)->GetDirect3DDevice(p,a)
+/*** IDirect3DRMDevice2 methods ***/
+#define IDirect3DRMDevice2_InitFromD3D2(p,a,b)          (p)->InitFromD3D2(a,b)
+#define IDirect3DRMDevice2_InitFromSurface(p,a,b,c)     (p)->InitFromSurface(a,b,c)
+#define IDirect3DRMDevice2_SetRenderMode(p,a)           (p)->SetRenderMode(a)
+#define IDirect3DRMDevice2_GetRenderMode(p)             (p)->GetRenderMode()
+#define IDirect3DRMDevice2_GetDirect3DDevice2(p,a)      (p)->GetDirect3DDevice2(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMDevice3 interface
+ */
+#ifdef WINE_NO_UNICODE_MACROS
+#undef GetClassName
+#endif
+#define INTERFACE IDirect3DRMDevice3
+DECLARE_INTERFACE_(IDirect3DRMDevice3,IDirect3DRMObject)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK pFunc, LPVOID pArg) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMDevice methods ***/
+    STDMETHOD(Init)(THIS_ ULONG width, ULONG height) PURE;
+    STDMETHOD(InitFromD3D)(THIS_ LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev) PURE;
+    STDMETHOD(InitFromClipper)(THIS_ LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height) PURE;
+    STDMETHOD(Update)(THIS) PURE;
+    STDMETHOD(AddUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE;
+    STDMETHOD(DeleteUpdateCallback)(THIS_ D3DRMUPDATECALLBACK, LPVOID arg) PURE;
+    STDMETHOD(SetBufferCount)(THIS_ DWORD) PURE;
+    STDMETHOD_(DWORD, GetBufferCount)(THIS) PURE;
+    STDMETHOD(SetDither)(THIS_ BOOL) PURE;
+    STDMETHOD(SetShades)(THIS_ DWORD) PURE;
+    STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
+    STDMETHOD(SetTextureQuality)(THIS_ D3DRMTEXTUREQUALITY) PURE;
+    STDMETHOD(GetViewports)(THIS_ LPDIRECT3DRMVIEWPORTARRAY *return_views) PURE;
+    STDMETHOD_(BOOL, GetDither)(THIS) PURE;
+    STDMETHOD_(DWORD, GetShades)(THIS) PURE;
+    STDMETHOD_(DWORD, GetHeight)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWidth)(THIS) PURE;
+    STDMETHOD_(DWORD, GetTrianglesDrawn)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWireframeOptions)(THIS) PURE;
+    STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE;
+    STDMETHOD_(D3DCOLORMODEL, GetColorModel)(THIS) PURE;
+    STDMETHOD_(D3DRMTEXTUREQUALITY, GetTextureQuality)(THIS) PURE;
+    STDMETHOD(GetDirect3DDevice)(THIS_ LPDIRECT3DDEVICE *) PURE;
+    /*** IDirect3DRMDevice2 methods ***/
+    STDMETHOD(InitFromD3D2)(THIS_ LPDIRECT3D2 pD3D, LPDIRECT3DDEVICE2 pD3DDev) PURE;
+    STDMETHOD(InitFromSurface)(THIS_ LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack) PURE;
+    STDMETHOD(SetRenderMode)(THIS_ DWORD flags) PURE;
+    STDMETHOD_(DWORD, GetRenderMode)(THIS) PURE;
+    STDMETHOD(GetDirect3DDevice2)(THIS_ LPDIRECT3DDEVICE2 *) PURE;
+    /*** IDirect3DRMDevice3 methods ***/
+    STDMETHOD(FindPreferredTextureFormat)(THIS_ DWORD BitDepths, DWORD flags, LPDDPIXELFORMAT pDDPF) PURE;
+    STDMETHOD(RenderStateChange)(THIS_ D3DRENDERSTATETYPE drsType, DWORD val, DWORD flags) PURE;
+    STDMETHOD(LightStateChange)(THIS_ D3DLIGHTSTATETYPE drsType, DWORD val, DWORD flags) PURE;
+    STDMETHOD(GetStateChangeOptions)(THIS_ DWORD StateClass, DWORD StateNum, LPDWORD pFlags) PURE;
+    STDMETHOD(SetStateChangeOptions)(THIS_ DWORD StateClass, DWORD StateNum, DWORD flags) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMDevice3_QueryInterface(p,a,b)               (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMDevice3_AddRef(p)                           (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMDevice3_Release(p)                          (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMDevice3_Clone(p,a,b,c)                      (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMDevice3_AddDestroyCallback(p,a,b)           (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMDevice3_DeleteDestroyCallback(p,a,b)        (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMDevice3_SetAppData(p,a)                     (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMDevice3_GetAppData(p)                       (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMDevice3_SetName(p,a)                        (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMDevice3_GetName(p,a,b)                      (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMDevice3_GetClassName(p,a,b)                 (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMDevice methods ***/
+#define IDirect3DRMDevice3_Init(p,a,b)                         (p)->lpVtbl->Init(p,a,b)
+#define IDirect3DRMDevice3_InitFromD3D(p,a,b)                  (p)->lpVtbl->InitFromD3D(p,a,b)
+#define IDirect3DRMDevice3_InitFromClipper(p,a,b,c,d)          (p)->lpVtbl->InitFromClipper(p,a,b,c,d)
+#define IDirect3DRMDevice3_Update(p)                           (p)->lpVtbl->Update(p)
+#define IDirect3DRMDevice3_AddUpdateCallback(p,a,b)            (p)->lpVtbl->AddUpdateCallback(p,a,b)
+#define IDirect3DRMDevice3_DeleteUpdateCallback(p,a,b)         (p)->lpVtbl->DeleteUpdateCallback(p,a,b,c)
+#define IDirect3DRMDevice3_SetBufferCount(p,a)                 (p)->lpVtbl->SetBufferCount(p,a)
+#define IDirect3DRMDevice3_GetBufferCount(p)                   (p)->lpVtbl->GetBufferCount(p)
+#define IDirect3DRMDevice3_SetDither(p,a)                      (p)->lpVtbl->SetDither(p,a)
+#define IDirect3DRMDevice3_SetShades(p,a)                      (p)->lpVtbl->SetShades(p,a)
+#define IDirect3DRMDevice3_SetQuality(p,a)                     (p)->lpVtbl->SetQuality(p,a)
+#define IDirect3DRMDevice3_SetTextureQuality(p,a)              (p)->lpVtbl->SetTextureQuality(p,a)
+#define IDirect3DRMDevice3_GetViewports(p,a)                   (p)->lpVtbl->GetViewports(p,a)
+#define IDirect3DRMDevice3_GetDither(p)                        (p)->lpVtbl->GetDither(p)
+#define IDirect3DRMDevice3_GetShades(p)                        (p)->lpVtbl->GetShades(p)
+#define IDirect3DRMDevice3_GetHeight(p)                        (p)->lpVtbl->GetHeight(p)
+#define IDirect3DRMDevice3_GetWidth(p)                         (p)->lpVtbl->GetWidth(p)
+#define IDirect3DRMDevice3_GetTrianglesDrawn(p)                (p)->lpVtbl->GetTrianglesDrawn(p)
+#define IDirect3DRMDevice3_GetWireframeOptions(p)              (p)->lpVtbl->GetWireframeOptions(p)
+#define IDirect3DRMDevice3_GetQuality(p)                       (p)->lpVtbl->GetQuality(p)
+#define IDirect3DRMDevice3_GetColorModel(p)                    (p)->lpVtbl->GetColorModel(p)
+#define IDirect3DRMDevice3_GetTextureQuality(p)                (p)->lpVtbl->GetTextureQuality(p)
+#define IDirect3DRMDevice3_GetDirect3DDevice(p,a)              (p)->lpVtbl->GetDirect3DDevice(p,a)
+/*** IDirect3DRMDevice2 methods ***/
+#define IDirect3DRMDevice3_InitFromD3D2(p,a,b)                 (p)->lpVtbl->InitFromD3D2(p,a,b)
+#define IDirect3DRMDevice3_InitFromSurface(p,a,b,c)            (p)->lpVtbl->InitFromSurface(p,a,b,c)
+#define IDirect3DRMDevice3_SetRenderMode(p,a)                  (p)->lpVtbl->SetRenderMode(p,a)
+#define IDirect3DRMDevice3_GetRenderMode(p)                    (p)->lpVtbl->GetRenderMode(p)
+#define IDirect3DRMDevice3_GetDirect3DDevice2(p,a)             (p)->lpVtbl->GetDirect3DDevice2(p,a)
+/*** IDirect3DRMDevice3 methods ***/
+#define IDirect3DRMDevice3_FindPreferredTextureFormat(p,a,b,c) (p)->lpVtbl->FindPreferredTextureFormat(p,a,b)
+#define IDirect3DRMDevice3_RenderStateChange(p,a,b,c)          (p)->lpVtbl->RenderStateChange(p,a,b)
+#define IDirect3DRMDevice3_LightStateChange(p,a,b,c)           (p)->lpVtbl->LightStateChange(p,a,b)
+#define IDirect3DRMDevice3_GetStateChangeOptions(p,a,b,c)      (p)->lpVtbl->GetStateChangeOptions(p,a,b)
+#define IDirect3DRMDevice3_SetStateChangeOptions(p,a,b,c)      (p)->lpVtbl->SetStateChangeOptions(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMDevice3_QueryInterface(p,a,b)               (p)->QueryInterface(a,b)
+#define IDirect3DRMDevice3_AddRef(p)                           (p)->AddRef()
+#define IDirect3DRMDevice3_Release(p)                          (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMDevice3_Clone(p,a,b,c)                      (p)->Clone(a,b,c)
+#define IDirect3DRMDevice3_AddDestroyCallback(p,a,b)           (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMDevice3_DeleteDestroyCallback(p,a,b)        (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMDevice3_SetAppData(p,a)                     (p)->SetAppData(a)
+#define IDirect3DRMDevice3_GetAppData(p)                       (p)->GetAppData()
+#define IDirect3DRMDevice3_SetName(p,a)                        (p)->SetName(a)
+#define IDirect3DRMDevice3_GetName(p,a,b)                      (p)->GetName(a,b)
+#define IDirect3DRMDevice3_GetClassName(p,a,b)                 (p)->GetClassName(a,b)
+/*** IDirect3DRMDevice methods ***/
+#define IDirect3DRMDevice3_Init(p,a,b)                         (p)->Init(p,a,b)
+#define IDirect3DRMDevice3_InitFromD3D(p,a,b)                  (p)->InitFromD3D(p,a,b)
+#define IDirect3DRMDevice3_InitFromClipper(p,a,b,c,d)          (p)->InitFromClipper(p,a,b,c,d)
+#define IDirect3DRMDevice3_Update(p)                           (p)->Update(p)
+#define IDirect3DRMDevice3_AddUpdateCallback(p,a,b)            (p)->AddUpdateCallback(p,a,b)
+#define IDirect3DRMDevice3_DeleteUpdateCallback(p,a,b)         (p)->DeleteUpdateCallback(p,a,b,c)
+#define IDirect3DRMDevice3_SetBufferCount(p,a)                 (p)->SetBufferCount(p,a)
+#define IDirect3DRMDevice3_GetBufferCount(p)                   (p)->GetBufferCount(p)
+#define IDirect3DRMDevice3_SetDither(p,a)                      (p)->SetDither(p,a)
+#define IDirect3DRMDevice3_SetShades(p,a)                      (p)->SetShades(p,a)
+#define IDirect3DRMDevice3_SetQuality(p,a)                     (p)->SetQuality(p,a)
+#define IDirect3DRMDevice3_SetTextureQuality(p,a)              (p)->SetTextureQuality(p,a)
+#define IDirect3DRMDevice3_GetViewports(p,a)                   (p)->GetViewports(p,a)
+#define IDirect3DRMDevice3_GetDither(p)                        (p)->GetDither(p)
+#define IDirect3DRMDevice3_GetShades(p)                        (p)->GetShades(p)
+#define IDirect3DRMDevice3_GetHeight(p)                        (p)->GetHeight(p)
+#define IDirect3DRMDevice3_GetWidth(p)                         (p)->GetWidth(p)
+#define IDirect3DRMDevice3_GetTrianglesDrawn(p)                (p)->GetTrianglesDrawn(p)
+#define IDirect3DRMDevice3_GetWireframeOptions(p)              (p)->GetWireframeOptions(p)
+#define IDirect3DRMDevice3_GetQuality(p)                       (p)->GetQuality(p)
+#define IDirect3DRMDevice3_GetColorModel(p)                    (p)->GetColorModel(p)
+#define IDirect3DRMDevice3_GetTextureQuality(p)                (p)->GetTextureQuality(p)
+#define IDirect3DRMDevice3_GetDirect3DDevice(p,a)              (p)->GetDirect3DDevice(p,a)
+/*** IDirect3DRMDevice2 methods ***/
+#define IDirect3DRMDevice3_InitFromD3D2(p,a,b)                 (p)->InitFromD3D2(a,b)
+#define IDirect3DRMDevice3_InitFromSurface(p,a,b,c)            (p)->InitFromSurface(a,b,c)
+#define IDirect3DRMDevice3_SetRenderMode(p,a)                  (p)->SetRenderMode(a)
+#define IDirect3DRMDevice3_GetRenderMode(p)                    (p)->GetRenderMode()
+#define IDirect3DRMDevice3_GetDirect3DDevice2(p,a)             (p)->GetDirect3DDevice2(a)
+/*** IDirect3DRMDevice3 methods ***/
+#define IDirect3DRMDevice3_FindPreferredTextureFormat(p,a,b,c) (p)->FindPreferredTextureFormat(a,b,c)
+#define IDirect3DRMDevice3_RenderStateChange(p,a,b,c)          (p)->RenderStateChange(a,b,c)
+#define IDirect3DRMDevice3_LightStateChange(p,a,b,c)           (p)->LightStateChange(a,b,c)
+#define IDirect3DRMDevice3_GetStateChangeOptions(p,a,b,c)      (p)->GetStateChangeOptions(a,b,c)
+#define IDirect3DRMDevice3_SetStateChangeOptions(p,a,b,c)      (p)->SetStateChangeOptions(a,b,c)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMViewport interface
+ */
+#define INTERFACE IDirect3DRMViewport
+DECLARE_INTERFACE_(IDirect3DRMViewport,IDirect3DRMObject)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMViewport methods ***/
+    STDMETHOD(Init) (THIS_ LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMFRAME camera, DWORD xpos, DWORD ypos,
+        DWORD width, DWORD height) PURE;
+    STDMETHOD(Clear)(THIS) PURE;
+    STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(SetField)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE;
+    STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE;
+    STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE;
+    STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE;
+    STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE;
+    STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE;
+    STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE;
+    STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME *) PURE;
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE *) PURE;
+    STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE;
+    STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE;
+    STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE;
+    STDMETHOD_(LONG, GetX)(THIS) PURE;
+    STDMETHOD_(LONG, GetY)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWidth)(THIS) PURE;
+    STDMETHOD_(DWORD, GetHeight)(THIS) PURE;
+    STDMETHOD_(D3DVALUE, GetField)(THIS) PURE;
+    STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE;
+    STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE;
+    STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE;
+    STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMViewport_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMViewport_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMViewport_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMViewport_Clone(p,a,b,c)               (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMViewport_AddDestroyCallback(p,a,b)    (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMViewport_DeleteDestroyCallback(p,a,b) (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMViewport_SetAppData(p,a)              (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMViewport_GetAppData(p)                (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMViewport_SetName(p,a)                 (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMViewport_GetName(p,a,b)               (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMViewport_GetClassName(p,a,b)          (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMViewport methods ***/
+#define IDirect3DRMViewport_Init(p,a,b,c,d)              (p)->lpVtbl->Init(p,a,b,c,d)
+#define IDirect3DRMViewport_Clear(p)                     (p)->lpVtbl->Clear(p)
+#define IDirect3DRMViewport_Render(p,a)                  (p)->lpVtbl->Render(p,a)
+#define IDirect3DRMViewport_SetFront(p,a)                (p)->lpVtbl->SetFront(p,a)
+#define IDirect3DRMViewport_SetBack(p,a)                 (p)->lpVtbl->(p,a)
+#define IDirect3DRMViewport_SetField(p,a)                (p)->lpVtbl->(p,a)
+#define IDirect3DRMViewport_SetUniformScaling(p,a)       (p)->lpVtbl->SetUniformScaling(p,a)
+#define IDirect3DRMViewport_SetCamera(p,a)               (p)->lpVtbl->SetCamera(p,a)
+#define IDirect3DRMViewport_SetProjection(p,a)           (p)->lpVtbl->SetProjection(p,a)
+#define IDirect3DRMViewport_Transform(p,a,b)             (p)->lpVtbl->Transform(p,a,b)
+#define IDirect3DRMViewport_InverseTransform(p,a,b)      (p)->lpVtbl->(p,a,b)
+#define IDirect3DRMViewport_Configure(p,a,b,c,d)         (p)->lpVtbl->Configure(p,a,b,c,d)
+#define IDirect3DRMViewport_ForceUpdate(p,a,b,c,d)       (p)->lpVtbl->ForceUpdate(p,a,b,c,d)
+#define IDirect3DRMViewport_SetPlane(p,a,b,c,d)          (p)->lpVtbl->SetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport_GetCamera(p,a)               (p)->lpVtbl->(p,a)
+#define IDirect3DRMViewport_GetDevice(p,a)               (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DRMViewport_GetPlane(p,a,b,c,d)          (p)->lpVtbl->GetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport_Pick(p,a,b,c)                (p)->lpVtbl->Pick(p,a,b,c)
+#define IDirect3DRMViewport_GetUniformScaling(p)         (p)->lpVtbl->GetUniformScaling(p)
+#define IDirect3DRMViewport_GetX(p)                      (p)->lpVtbl->GetX(p)
+#define IDirect3DRMViewport_GetY(p)                      (p)->lpVtbl->GetY(p)
+#define IDirect3DRMViewport_GetWidth(p)                  (p)->lpVtbl->GetWidth(p)
+#define IDirect3DRMViewport_GetHeight(p)                 (p)->lpVtbl->GetHeight(p)
+#define IDirect3DRMViewport_GetField(p)                  (p)->lpVtbl->GetField(p)
+#define IDirect3DRMViewport_GetBack(p)                   (p)->lpVtbl->GetBack(p)
+#define IDirect3DRMViewport_GetFront(p)                  (p)->lpVtbl->GetFront(p)
+#define IDirect3DRMViewport_GetProjection(p)             (p)->lpVtbl->GetProjection(p)
+#define IDirect3DRMViewport_GetDirect3DViewport(p,a)     (p)->lpVtbl->GetDirect3DViewport(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMViewport_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirect3DRMViewport_AddRef(p)                    (p)->AddRef()
+#define IDirect3DRMViewport_Release(p)                   (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMViewport_Clone(p,a,b,c)               (p)->Clone(a,b,c)
+#define IDirect3DRMViewport_AddDestroyCallback(p,a,b)    (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMViewport_DeleteDestroyCallback(p,a,b) (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMViewport_SetAppData(p,a)              (p)->SetAppData(a)
+#define IDirect3DRMViewport_GetAppData(p)                (p)->GetAppData()
+#define IDirect3DRMViewport_SetName(p,a)                 (p)->SetName(a)
+#define IDirect3DRMViewport_GetName(p,a,b)               (p)->GetName(a,b)
+#define IDirect3DRMViewport_GetClassName(p,a,b)          (p)->GetClassName(a,b)
+/*** IDirect3DRMViewport methods ***/
+#define IDirect3DRMViewport_Init(p,a,b,c,d)              (p)->Init(p,a,b,c,d)
+#define IDirect3DRMViewport_Clear(p)                     (p)->Clear(p)
+#define IDirect3DRMViewport_Render(p,a)                  (p)->Render(p,a)
+#define IDirect3DRMViewport_SetFront(p,a)                (p)->SetFront(p,a)
+#define IDirect3DRMViewport_SetBack(p,a)                 (p)->(p,a)
+#define IDirect3DRMViewport_SetField(p,a)                (p)->(p,a)
+#define IDirect3DRMViewport_SetUniformScaling(p,a)       (p)->SetUniformScaling(p,a)
+#define IDirect3DRMViewport_SetCamera(p,a)               (p)->SetCamera(p,a)
+#define IDirect3DRMViewport_SetProjection(p,a)           (p)->SetProjection(p,a)
+#define IDirect3DRMViewport_Transform(p,a,b)             (p)->Transform(p,a,b)
+#define IDirect3DRMViewport_InverseTransform(p,a,b)      (p)->(p,a,b)
+#define IDirect3DRMViewport_Configure(p,a,b,c,d)         (p)->Configure(p,a,b,c,d)
+#define IDirect3DRMViewport_ForceUpdate(p,a,b,c,d)       (p)->ForceUpdate(p,a,b,c,d)
+#define IDirect3DRMViewport_SetPlane(p,a,b,c,d)          (p)->SetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport_GetCamera(p,a)               (p)->GetCamera(p,a)
+#define IDirect3DRMViewport_GetDevice(p,a)               (p)->GetDevice(p,a)
+#define IDirect3DRMViewport_GetPlane(p,a,b,c,d)          (p)->GetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport_Pick(p,a,b,c)                (p)->Pick(p,a,b,c)
+#define IDirect3DRMViewport_GetUniformScaling(p)         (p)->GetUniformScaling(p)
+#define IDirect3DRMViewport_GetX(p)                      (p)->GetX(p)
+#define IDirect3DRMViewport_GetY(p)                      (p)->GetY(p)
+#define IDirect3DRMViewport_GetWidth(p)                  (p)->GetWidth(p)
+#define IDirect3DRMViewport_GetHeight(p)                 (p)->GetHeight(p)
+#define IDirect3DRMViewport_GetField(p)                  (p)->GetField(p)
+#define IDirect3DRMViewport_GetBack(p)                   (p)->GetBack(p)
+#define IDirect3DRMViewport_GetFront(p)                  (p)->GetFront(p)
+#define IDirect3DRMViewport_GetProjection(p)             (p)->GetProjection(p)
+#define IDirect3DRMViewport_GetDirect3DViewport(p,a)     (p)->GetDirect3DViewport(p,a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMViewport2 interface
+ */
+#define INTERFACE IDirect3DRMViewport2
+DECLARE_INTERFACE_(IDirect3DRMViewport2,IDirect3DRMObject)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMViewport2 methods ***/
+    STDMETHOD(Init) (THIS_ LPDIRECT3DRMDEVICE3 dev, LPDIRECT3DRMFRAME3 camera, DWORD xpos, DWORD ypos,
+        DWORD width, DWORD height) PURE;
+    STDMETHOD(Clear)(THIS_ DWORD flags) PURE;
+    STDMETHOD(Render)(THIS_ LPDIRECT3DRMFRAME3) PURE;
+    STDMETHOD(SetFront)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(SetBack)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(SetField)(THIS_ D3DVALUE) PURE;
+    STDMETHOD(SetUniformScaling)(THIS_ BOOL) PURE;
+    STDMETHOD(SetCamera)(THIS_ LPDIRECT3DRMFRAME3) PURE;
+    STDMETHOD(SetProjection)(THIS_ D3DRMPROJECTIONTYPE) PURE;
+    STDMETHOD(Transform)(THIS_ D3DRMVECTOR4D *d, D3DVECTOR *s) PURE;
+    STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DRMVECTOR4D *s) PURE;
+    STDMETHOD(Configure)(THIS_ LONG x, LONG y, DWORD width, DWORD height) PURE;
+    STDMETHOD(ForceUpdate)(THIS_ DWORD x1, DWORD y1, DWORD x2, DWORD y2) PURE;
+    STDMETHOD(SetPlane)(THIS_ D3DVALUE left, D3DVALUE right, D3DVALUE bottom, D3DVALUE top) PURE;
+    STDMETHOD(GetCamera)(THIS_ LPDIRECT3DRMFRAME3 *) PURE;
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DRMDEVICE3 *) PURE;
+    STDMETHOD(GetPlane)(THIS_ D3DVALUE *left, D3DVALUE *right, D3DVALUE *bottom, D3DVALUE *top) PURE;
+    STDMETHOD(Pick)(THIS_ LONG x, LONG y, LPDIRECT3DRMPICKEDARRAY *return_visuals) PURE;
+    STDMETHOD_(BOOL, GetUniformScaling)(THIS) PURE;
+    STDMETHOD_(LONG, GetX)(THIS) PURE;
+    STDMETHOD_(LONG, GetY)(THIS) PURE;
+    STDMETHOD_(DWORD, GetWidth)(THIS) PURE;
+    STDMETHOD_(DWORD, GetHeight)(THIS) PURE;
+    STDMETHOD_(D3DVALUE, GetField)(THIS) PURE;
+    STDMETHOD_(D3DVALUE, GetBack)(THIS) PURE;
+    STDMETHOD_(D3DVALUE, GetFront)(THIS) PURE;
+    STDMETHOD_(D3DRMPROJECTIONTYPE, GetProjection)(THIS) PURE;
+    STDMETHOD(GetDirect3DViewport)(THIS_ LPDIRECT3DVIEWPORT *) PURE;
+    STDMETHOD(TransformVectors)(THIS_ DWORD NumVectors, LPD3DRMVECTOR4D pDstVectors,
+        LPD3DVECTOR pSrcVectors) PURE;
+    STDMETHOD(InverseTransformVectors)(THIS_ DWORD NumVectors, LPD3DVECTOR pDstVectors,
+        LPD3DRMVECTOR4D pSrcVectors) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMViewport2_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMViewport2_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMViewport2_Release(p)                       (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMViewport_2Clone(p,a,b,c)                   (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMViewport2_AddDestroyCallback(p,a,b)        (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMViewport2_DeleteDestroyCallback(p,a,b)     (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMViewport2_SetAppData(p,a)                  (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMViewport2_GetAppData(p)                    (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMViewport2_SetName(p,a)                     (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMViewport2_GetName(p,a,b)                   (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMViewport2_GetClassName(p,a,b)              (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMViewport2 methods ***/
+#define IDirect3DRMViewport2_Init(p,a,b,c,d,e,f)              (p)->lpVtbl->Init(p,a,b,c,d,e,f)
+#define IDirect3DRMViewport2_Clear(p,a)                       (p)->lpVtbl->Clear(p,a)
+#define IDirect3DRMViewport2_Render(p,a)                      (p)->lpVtbl->Render(p,a)
+#define IDirect3DRMViewport2_SetFront(p,a)                    (p)->lpVtbl->SetFront(p,a)
+#define IDirect3DRMViewport2_SetBack(p,a)                     (p)->lpVtbl->(p,a)
+#define IDirect3DRMViewport2_SetField(p,a)                    (p)->lpVtbl->(p,a)
+#define IDirect3DRMViewport2_SetUniformScaling(p,a)           (p)->lpVtbl->SetUniformScaling(p,a)
+#define IDirect3DRMViewport2_SetCamera(p,a)                   (p)->lpVtbl->SetCamera(p,a)
+#define IDirect3DRMViewport2_SetProjection(p,a)               (p)->lpVtbl->SetProjection(p,a)
+#define IDirect3DRMViewport2_Transform(p,a,b)                 (p)->lpVtbl->Transform(p,a,b)
+#define IDirect3DRMViewport2_InverseTransform(p,a,b)          (p)->lpVtbl->(p,a,b)
+#define IDirect3DRMViewport2_Configure(p,a,b,c,d)             (p)->lpVtbl->Configure(p,a,b,c,d)
+#define IDirect3DRMViewport2_ForceUpdate(p,a,b,c,d)           (p)->lpVtbl->ForceUpdate(p,a,b,c,d)
+#define IDirect3DRMViewport2_SetPlane(p,a,b,c,d)              (p)->lpVtbl->SetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport2_GetCamera(p,a)                   (p)->lpVtbl->(p,a)
+#define IDirect3DRMViewport2_GetDevice(p,a)                   (p)->lpVtbl->GetDevice(p,a)
+#define IDirect3DRMViewport2_GetPlane(p,a,b,c,d)              (p)->lpVtbl->GetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport2_Pick(p,a,b,c)                    (p)->lpVtbl->Pick(p,a,b,c)
+#define IDirect3DRMViewport2_GetUniformScaling(p)             (p)->lpVtbl->GetUniformScaling(p)
+#define IDirect3DRMViewport2_GetX(p)                          (p)->lpVtbl->GetX(p)
+#define IDirect3DRMViewport2_GetY(p)                          (p)->lpVtbl->GetY(p)
+#define IDirect3DRMViewport2_GetWidth(p)                      (p)->lpVtbl->GetWidth(p)
+#define IDirect3DRMViewport2_GetHeight(p)                     (p)->lpVtbl->GetHeight(p)
+#define IDirect3DRMViewport2_GetField(p)                      (p)->lpVtbl->GetField(p)
+#define IDirect3DRMViewport2_GetBack(p)                       (p)->lpVtbl->GetBack(p)
+#define IDirect3DRMViewport2_GetFront(p)                      (p)->lpVtbl->GetFront(p)
+#define IDirect3DRMViewport2_GetProjection(p)                 (p)->lpVtbl->GetProjection(p)
+#define IDirect3DRMViewport2_GetDirect3DViewport(p,a)         (p)->lpVtbl->GetDirect3DViewport(p,a)
+#define IDirect3DRMViewport2_TransformVectors(p,a,b,c)        (p)->lpVtbl->TransformVectors(p,a,b,c)
+#define IDirect3DRMViewport2_InverseTransformVectors(p,a,b,c) (p)->lpVtbl->InverseTransformVectors(p,ab,c)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMViewport2_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
+#define IDirect3DRMViewport2_AddRef(p)                        (p)->AddRef()
+#define IDirect3DRMViewport2_Release(p)                       (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMViewport2_Clone(p,a,b,c)                   (p)->Clone(a,b,c)
+#define IDirect3DRMViewport2_AddDestroyCallback(p,a,b)        (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMViewport2_DeleteDestroyCallback(p,a,b)     (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMViewport2_SetAppData(p,a)                  (p)->SetAppData(a)
+#define IDirect3DRMViewport2_GetAppData(p)                    (p)->GetAppData()
+#define IDirect3DRMViewport2_SetName(p,a)                     (p)->SetName(a)
+#define IDirect3DRMViewport2_GetName(p,a,b)                   (p)->GetName(a,b)
+#define IDirect3DRMViewport2_GetClassName(p,a,b)              (p)->GetClassName(a,b)
+/*** IDirect3DRMViewport2 methods ***/
+#define IDirect3DRMViewport2_Init(p,a,b,c,d)                  (p)->Init(p,a,b,c,d)
+#define IDirect3DRMViewport2_Clear(p)                         (p)->Clear(p)
+#define IDirect3DRMViewport2_Render(p,a)                      (p)->Render(p,a)
+#define IDirect3DRMViewport2_SetFront(p,a)                    (p)->SetFront(p,a)
+#define IDirect3DRMViewport2_SetBack(p,a)                     (p)->(p,a)
+#define IDirect3DRMViewport2_SetField(p,a)                    (p)->(p,a)
+#define IDirect3DRMViewport2_SetUniformScaling(p,a)           (p)->SetUniformScaling(p,a)
+#define IDirect3DRMViewport2_SetCamera(p,a)                   (p)->SetCamera(p,a)
+#define IDirect3DRMViewport2_SetProjection(p,a)               (p)->SetProjection(p,a)
+#define IDirect3DRMViewport2_Transform(p,a,b)                 (p)->Transform(p,a,b)
+#define IDirect3DRMViewport2_InverseTransform(p,a,b)          (p)->(p,a,b)
+#define IDirect3DRMViewport2_Configure(p,a,b,c,d)             (p)->Configure(p,a,b,c,d)
+#define IDirect3DRMViewport2_ForceUpdate(p,a,b,c,d)           (p)->ForceUpdate(p,a,b,c,d)
+#define IDirect3DRMViewport2_SetPlane(p,a,b,c,d)              (p)->SetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport2_GetCamera(p,a)                   (p)->GetCamera(p,a)
+#define IDirect3DRMViewport2_GetDevice(p,a)                   (p)->GetDevice(p,a)
+#define IDirect3DRMViewport2_GetPlane(p,a,b,c,d)              (p)->GetPlane(p,a,b,c,d)
+#define IDirect3DRMViewport2_Pick(p,a,b,c)                    (p)->Pick(p,a,b,c)
+#define IDirect3DRMViewport2_GetUniformScaling(p)             (p)->GetUniformScaling(p)
+#define IDirect3DRMViewport2_GetX(p)                          (p)->GetX(p)
+#define IDirect3DRMViewport2_GetY(p)                          (p)->GetY(p)
+#define IDirect3DRMViewport2_GetWidth(p)                      (p)->GetWidth(p)
+#define IDirect3DRMViewport2_GetHeight(p)                     (p)->GetHeight(p)
+#define IDirect3DRMViewport2_GetField(p)                      (p)->GetField(p)
+#define IDirect3DRMViewport2_GetBack(p)                       (p)->GetBack(p)
+#define IDirect3DRMViewport2_GetFront(p)                      (p)->GetFront(p)
+#define IDirect3DRMViewport2_GetProjection(p)                 (p)->GetProjection(p)
+#define IDirect3DRMViewport2_GetDirect3DViewport(p,a)         (p)->GetDirect3DViewport(p,a)
+#define IDirect3DRMViewport2_TransformVectors(p,a,b,c)        (p)->TransformVectors(a,b,c)
+#define IDirect3DRMViewport2_InverseTransformVectors(p,a,b,c) (p)->InverseTransformVectors(ab,c)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMFrame interface
+ */
+#define INTERFACE IDirect3DRMFrame
+DECLARE_INTERFACE_(IDirect3DRMFrame,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMFrame methods ***/
+    STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE;
+    STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE;
+    STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE;
+    STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE;
+    STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE;
+    STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE;
+    STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE;
+    STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE;
+    STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
+    STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE;
+    STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE;
+    STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE;
+    STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE;
+    STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE;
+    STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE;
+    STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE;
+    STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE;
+    STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE;
+    STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE;
+    STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE;
+    STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE;
+    STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE;
+    STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK,
+        LPVOID pArg)PURE;
+    STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE;
+    STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE;
+    STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE;
+    STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE;
+    STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE;
+    STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE;
+    STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE;
+    STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE;
+    STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE;
+    STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE;
+    STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE;
+    STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE;
+    STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE;
+    STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE;
+    STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE;
+    STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE;
+    STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE;
+    STDMETHOD(SetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
+        D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) PURE;
+    STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE;
+    STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE;
+    STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
+    STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE;
+    STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE;
+    STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMFrame_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMFrame_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMFrame_Release(p)                       (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFrame_Clone(p,a,b,c)                   (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMFrame_AddDestroyCallback(p,a,b)        (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMFrame_DeleteDestroyCallback(p,a,b)     (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMFrame_SetAppData(p,a)                  (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMFrame_GetAppData(p)                    (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMFrame_SetName(p,a)                     (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMFrame_GetName(p,a,b)                   (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMFrame_GetClassName(p,a,b)              (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMFrame methods ***/
+#define IDirect3DRMFrame_AddChild(p,a)                    (p)->lpVtbl->AddChild(p,a)
+#define IDirect3DRMFrame_AddLight(p,a)                    (p)->lpVtbl->AddLight(p,a)
+#define IDirect3DRMFrame_AddMoveCallback(p,a,b)           (p)->lpVtbl->AddMoveCallback(p,a,b)
+#define IDirect3DRMFrame_AddTransform(p,a,b)              (p)->lpVtbl->AddTransform(p,a,b)
+#define IDirect3DRMFrame_AddTranslation(p,a,b,c,d)        (p)->lpVtbl->AddTranslation(p,a,b,c,d)
+#define IDirect3DRMFrame_AddScale(p,a,b,c,d)              (p)->lpVtbl->AddScale(p,a,b,c,d)
+#define IDirect3DRMFrame_AddRotation(p,a,b,c,d,e)         (p)->lpVtbl->AddRotation(p,a,b,c,d,e)
+#define IDirect3DRMFrame_AddVisual(p,a)                   (p)->lpVtbl->AddVisual(p,a)
+#define IDirect3DRMFrame_GetChildren(p,a)                 (p)->lpVtbl->GetChildren(p,a)
+#define IDirect3DRMFrame_GetColor(p)                      (p)->lpVtbl->GetColor(p)
+#define IDirect3DRMFrame_GetLights(p,a)                   (p)->lpVtbl->GetLights(p,a)
+#define IDirect3DRMFrame_GetMaterialMode(p)               (p)->lpVtbl->GetMaterialMode(p)
+#define IDirect3DRMFrame_GetParent(p,a)                   (p)->lpVtbl->GetParent(p,a)
+#define IDirect3DRMFrame_GetPosition(p,a,b)               (p)->lpVtbl->GetPosition(p,a,b)
+#define IDirect3DRMFrame_GetRotation(p,a,b,c)             (p)->lpVtbl->GetRotation(p,a,b,c)
+#define IDirect3DRMFrame_GetScene(p,a)                    (p)->lpVtbl->GetScene(p,a)
+#define IDirect3DRMFrame_GetSortMode(p)                   (p)->lpVtbl->GetSortMode(p)
+#define IDirect3DRMFrame_GetTexture(p,a)                  (p)->lpVtbl->GetTexture(p,a)
+#define IDirect3DRMFrame_GetTransform(p,a)                (p)->lpVtbl->GetTransform(p,a)
+#define IDirect3DRMFrame_GetVelocity(p,a,b,c)             (p)->lpVtbl->GetVelocity(p,a,b,c)
+#define IDirect3DRMFrame_GetOrientation(p,a,b,c)          (p)->lpVtbl->GetOrientation(p,a,b,c)
+#define IDirect3DRMFrame_GetVisuals(p,a)                  (p)->lpVtbl->GetVisuals(p,a)
+#define IDirect3DRMFrame_GetTextureTopology(p,a,b)        (p)->lpVtbl->GetTextureTopology(p,a,b)
+#define IDirect3DRMFrame_InverseTransform(p,a,b)          (p)->lpVtbl->InverseTransform(p,a,b)
+#define IDirect3DRMFrame_Load(p,a,b,c,d,e)                (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DRMFrame_LookAt(p,a,b,c)                  (p)->lpVtbl->LookAt(p,a,b,c)
+#define IDirect3DRMFrame_Move(p,a)                        (p)->lpVtbl->Move(p,a)
+#define IDirect3DRMFrame_DeleteChild(p,a)                 (p)->lpVtbl->DeleteChild(p,a)
+#define IDirect3DRMFrame_DeleteLight(p,a)                 (p)->lpVtbl->DeleteLight(p,a)
+#define IDirect3DRMFrame_DeleteMoveCallback(p,a,b)        (p)->lpVtbl->DeleteMoveCallback(p,a,b)
+#define IDirect3DRMFrame_DeleteVisual(p,a)                (p)->lpVtbl->DeleteVisual(p,a)
+#define IDirect3DRMFrame_GetSceneBackground(p)            (p)->lpVtbl->GetSceneBackground(p)
+#define IDirect3DRMFrame_GetSceneBackgroundDepth(p,a)     (p)->lpVtbl->GetSceneBackgroundDepth(p,a)
+#define IDirect3DRMFrame_GetSceneFogColor(p)              (p)->lpVtbl->GetSceneFogColor(p)
+#define IDirect3DRMFrame_GetSceneFogEnable(p)             (p)->lpVtbl->GetSceneFogEnable(p)
+#define IDirect3DRMFrame_GetSceneFogMode(p)               (p)->lpVtbl->GetSceneFogMode(p)
+#define IDirect3DRMFrame_GetSceneFogParams(p,a,b,c)       (p)->lpVtbl->GetSceneFogParams(p,a,b,c)
+#define IDirect3DRMFrame_SetSceneBackground(p,a)          (p)->lpVtbl->SetSceneBackground(p,a)
+#define IDirect3DRMFrame_SetSceneBackgroundRGB(p,a,b,c)   (p)->lpVtbl->SetSceneBackgroundRGB(p,a,b,c)
+#define IDirect3DRMFrame_SetSceneBackgroundDepth(p,a)     (p)->lpVtbl->SetSceneBackgroundDepth(p,a)
+#define IDirect3DRMFrame_SetSceneBackgroundImage(p,a)     (p)->lpVtbl->SetSceneBackgroundImage(p,a)
+#define IDirect3DRMFrame_SetSceneFogEnable(p,a)           (p)->lpVtbl->SetSceneFogEnable(p,a)
+#define IDirect3DRMFrame_SetSceneFogColor(p,a)            (p)->lpVtbl->SetSceneFogColor(p,a)
+#define IDirect3DRMFrame_SetSceneFogMode(p,a)             (p)->lpVtbl->SetSceneFogMode(p,a)
+#define IDirect3DRMFrame_SetSceneFogParams(p,a,b,c)       (p)->lpVtbl->SetSceneFogParams(p,a,b,c)
+#define IDirect3DRMFrame_SetColor(p,a)                    (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMFrame_SetColorRGB(p,a,b,c)             (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMFrame_GetZbufferMode(p)                (p)->lpVtbl->GetZbufferMode(p)
+#define IDirect3DRMFrame_SetMaterialMode(p,a)             (p)->lpVtbl->SetMaterialMode(p,a)
+#define IDirect3DRMFrame_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
+#define IDirect3DRMFrame_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirect3DRMFrame_SetRotation(p,a,b,c,d,e)         (p)->lpVtbl->SetRotation(p,a,b,c,d,e)
+#define IDirect3DRMFrame_SetSortMode(p,a)                 (p)->lpVtbl->SetSortMode(p,a)
+#define IDirect3DRMFrame_SetTexture(p,a)                  (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMFrame_SetTextureTopology(p,a,b)        (p)->lpVtbl->SetTextureTopology(p,a,b)
+#define IDirect3DRMFrame_SetVelocity(p,a,b,c,d,e)         (p)->lpVtbl->SetVelocity(p,a,b,c,d,e)
+#define IDirect3DRMFrame_SetZbufferMode(p,a)              (p)->lpVtbl->SetZbufferMode(p,a)
+#define IDirect3DRMFrame_Transform(p,a,b)                 (p)->lpVtbl->Transform(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMFrame_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
+#define IDirect3DRMFrame_AddRef(p)                        (p)->AddRef()
+#define IDirect3DRMFrame_Release(p)                       (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFrame_Clone(p,a,b,c)                   (p)->Clone(a,b,c)
+#define IDirect3DRMFrame_AddDestroyCallback(p,a,b)        (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMFrame_DeleteDestroyCallback(p,a,b)     (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMFrame_SetAppData(p,a)                  (p)->SetAppData(a)
+#define IDirect3DRMFrame_GetAppData(p)                    (p)->GetAppData()
+#define IDirect3DRMFrame_SetName(p,a)                     (p)->SetName(a)
+#define IDirect3DRMFrame_GetName(p,a,b)                   (p)->GetName(a,b)
+#define IDirect3DRMFrame_GetClassName(p,a,b)              (p)->GetClassName(a,b)
+/*** IDirect3DRMFrame methods ***/
+#define IDirect3DRMFrame_AddChild(p,a)                    (p)->AddChild(a)
+#define IDirect3DRMFrame_AddLight(p,a)                    (p)->AddLight(a)
+#define IDirect3DRMFrame_AddMoveCallback(p,a,b)           (p)->AddMoveCallback(a,b)
+#define IDirect3DRMFrame_AddTransform(p,a,b)              (p)->AddTransform(a,b)
+#define IDirect3DRMFrame_AddTranslation(p,a,b,c,d)        (p)->AddTranslation(a,b,c,d)
+#define IDirect3DRMFrame_AddScale(p,a,b,c,d)              (p)->AddScale(a,b,c,d)
+#define IDirect3DRMFrame_AddRotation(p,a,b,c,d,e)         (p)->AddRotation(a,b,c,d,e)
+#define IDirect3DRMFrame_AddVisual(p,a)                   (p)->AddVisual(a)
+#define IDirect3DRMFrame_GetChildren(p,a)                 (p)->GetChildren(a)
+#define IDirect3DRMFrame_GetColor(p)                      (p)->GetColor()
+#define IDirect3DRMFrame_GetLights(p,a)                   (p)->GetLights(a)
+#define IDirect3DRMFrame_GetMaterialMode(p)               (p)->GetMaterialMode()
+#define IDirect3DRMFrame_GetParent(p,a)                   (p)->GetParent(a)
+#define IDirect3DRMFrame_GetPosition(p,a,b)               (p)->GetPosition(a,b)
+#define IDirect3DRMFrame_GetRotation(p,a,b,c)             (p)->GetRotation(a,b,c)
+#define IDirect3DRMFrame_GetScene(p,a)                    (p)->GetScene(a)
+#define IDirect3DRMFrame_GetSortMode(p)                   (p)->GetSortMode()
+#define IDirect3DRMFrame_GetTexture(p,a)                  (p)->GetTexture(a)
+#define IDirect3DRMFrame_GetTransform(p,a)                (p)->GetTransform(a)
+#define IDirect3DRMFrame_GetVelocity(p,a,b,c)             (p)->GetVelocity(a,b,c)
+#define IDirect3DRMFrame_GetOrientation(p,a,b,c)          (p)->GetOrientation(a,b,c)
+#define IDirect3DRMFrame_GetVisuals(p,a)                  (p)->GetVisuals(a)
+#define IDirect3DRMFrame_GetTextureTopology(p,a,b)        (p)->GetTextureTopology(a,b)
+#define IDirect3DRMFrame_InverseTransform(p,a,b)          (p)->InverseTransform(a,b)
+#define IDirect3DRMFrame_Load(p,a,b,c,d,e)                (p)->Load(a,b,c,d,e)
+#define IDirect3DRMFrame_LookAt(p,a,b,c)                  (p)->LookAt(a,b,c)
+#define IDirect3DRMFrame_Move(p,a)                        (p)->Move(a)
+#define IDirect3DRMFrame_DeleteChild(p,a)                 (p)->DeleteChild(a)
+#define IDirect3DRMFrame_DeleteLight(p,a)                 (p)->DeleteLight(a)
+#define IDirect3DRMFrame_DeleteMoveCallback(p,a,b)        (p)->DeleteMoveCallback(a,b)
+#define IDirect3DRMFrame_DeleteVisual(p,a)                (p)->DeleteVisual(a)
+#define IDirect3DRMFrame_GetSceneBackground(p)            (p)->GetSceneBackground()
+#define IDirect3DRMFrame_GetSceneBackgroundDepth(p,a)     (p)->GetSceneBackgroundDepth(a)
+#define IDirect3DRMFrame_GetSceneFogColor(p)              (p)->GetSceneFogColor()
+#define IDirect3DRMFrame_GetSceneFogEnable(p)             (p)->GetSceneFogEnable()
+#define IDirect3DRMFrame_GetSceneFogMode(p)               (p)->GetSceneFogMode()
+#define IDirect3DRMFrame_GetSceneFogParams(p,a,b,c)       (p)->GetSceneFogParams(a,b,c)
+#define IDirect3DRMFrame_SetSceneBackground(p,a)          (p)->SetSceneBackground(a)
+#define IDirect3DRMFrame_SetSceneBackgroundRGB(p,a,b,c)   (p)->SetSceneBackgroundRGB(a,b,c)
+#define IDirect3DRMFrame_SetSceneBackgroundDepth(p,a)     (p)->SetSceneBackgroundDepth(a)
+#define IDirect3DRMFrame_SetSceneBackgroundImage(p,a)     (p)->SetSceneBackgroundImage(a)
+#define IDirect3DRMFrame_SetSceneFogEnable(p,a)           (p)->SetSceneFogEnable(a)
+#define IDirect3DRMFrame_SetSceneFogColor(p,a)            (p)->SetSceneFogColor(a)
+#define IDirect3DRMFrame_SetSceneFogMode(p,a)             (p)->SetSceneFogMode(a)
+#define IDirect3DRMFrame_SetSceneFogParams(p,a,b,c)       (p)->SetSceneFogParams(a,b,c)
+#define IDirect3DRMFrame_SetColor(p,a)                    (p)->SetColor(a)
+#define IDirect3DRMFrame_SetColorRGB(p,a,b,c)             (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMFrame_GetZbufferMode(p)                (p)->GetZbufferMode()
+#define IDirect3DRMFrame_SetMaterialMode(p,a)             (p)->SetMaterialMode(a)
+#define IDirect3DRMFrame_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
+#define IDirect3DRMFrame_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
+#define IDirect3DRMFrame_SetRotation(p,a,b,c,d,e)         (p)->SetRotation(a,b,c,d,e)
+#define IDirect3DRMFrame_SetSortMode(p,a)                 (p)->SetSortMode(a)
+#define IDirect3DRMFrame_SetTexture(p,a)                  (p)->SetTexture(a)
+#define IDirect3DRMFrame_SetTextureTopology(p,a,b)        (p)->SetTextureTopology(a,b)
+#define IDirect3DRMFrame_SetVelocity(p,a,b,c,d,e)         (p)->SetVelocity(a,b,c,d,e)
+#define IDirect3DRMFrame_SetZbufferMode(p,a)              (p)->SetZbufferMode(a)
+#define IDirect3DRMFrame_Transform(p,a,b)                 (p)->Transform(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMFrame2 interface
+ */
+#define INTERFACE IDirect3DRMFrame2
+DECLARE_INTERFACE_(IDirect3DRMFrame2,IDirect3DRMFrame)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMFrame methods ***/
+    STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME child) PURE;
+    STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE;
+    STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE;
+    STDMETHOD(AddTransform)(THIS_ D3DRMCOMBINETYPE, D3DRMMATRIX4D) PURE;
+    STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE;
+    STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE;
+    STDMETHOD(AddVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE;
+    STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE;
+    STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
+    STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE;
+    STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE;
+    STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME *) PURE;
+    STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_position) PURE;
+    STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE;
+    STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME *) PURE;
+    STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE;
+    STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE;
+    STDMETHOD(GetTransform)(THIS_ D3DRMMATRIX4D return_matrix) PURE;
+    STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR return_velocity, BOOL with_rotation) PURE;
+    STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE;
+    STDMETHOD(GetVisuals)(THIS_ LPDIRECT3DRMVISUALARRAY *visuals) PURE;
+    STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE;
+    STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE;
+    STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK,
+        LPVOID pArg)PURE;
+    STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME target, LPDIRECT3DRMFRAME reference, D3DRMFRAMECONSTRAINT) PURE;
+    STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE;
+    STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE;
+    STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg) PURE;
+    STDMETHOD(DeleteVisual)(THIS_ LPDIRECT3DRMVISUAL) PURE;
+    STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE;
+    STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE;
+    STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE;
+    STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE;
+    STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE;
+    STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end, D3DVALUE *return_density) PURE;
+    STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE;
+    STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE) PURE;
+    STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE;
+    STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE;
+    STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE;
+    STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE;
+    STDMETHOD(SetOrientation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
+        D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) PURE;
+    STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE;
+    STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE;
+    STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
+    STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation) PURE;
+    STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE;
+    STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE;
+    /*** IDirect3DRMFrame2 methods ***/
+    STDMETHOD(AddMoveCallback2)(THIS_ D3DRMFRAMEMOVECALLBACK, VOID *arg, DWORD flags) PURE;
+    STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE;
+    STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE;
+    STDMETHOD(GetAxes)(THIS_ LPD3DVECTOR dir, LPD3DVECTOR up);
+    STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE;
+    STDMETHOD_(BOOL, GetInheritAxes)(THIS);
+    STDMETHOD(GetHierarchyBox)(THIS_ LPD3DRMBOX) PURE;
+    STDMETHOD(SetBox)(THIS_ LPD3DRMBOX) PURE;
+    STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE;
+    STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz);
+    STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent);
+    STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
+    STDMETHOD(SetQuaternion)(THIS_ LPDIRECT3DRMFRAME reference, D3DRMQUATERNION *q) PURE;
+    STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME reference, LPD3DRMRAY ray, DWORD flags,
+        LPDIRECT3DRMPICKED2ARRAY *return_visuals) PURE;
+    STDMETHOD(Save)(THIS_ LPCSTR filename, D3DRMXOFFORMAT d3dFormat, D3DRMSAVEOPTIONS d3dSaveFlags);
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMFrame2_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMFrame2_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMFrame2_Release(p)                       (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFrame2_Clone(p,a,b,c)                   (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMFrame2_AddDestroyCallback(p,a,b)        (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMFrame2_DeleteDestroyCallback(p,a,b)     (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMFrame2_SetAppData(p,a)                  (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMFrame2_GetAppData(p)                    (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMFrame2_SetName(p,a)                     (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMFrame2_GetName(p,a,b)                   (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMFrame2_GetClassName(p,a,b)              (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMFrame methods ***/
+#define IDirect3DRMFrame2_AddChild(p,a)                    (p)->lpVtbl->AddChild(p,a)
+#define IDirect3DRMFrame2_AddLight(p,a)                    (p)->lpVtbl->AddLight(p,a)
+#define IDirect3DRMFrame2_AddMoveCallback(p,a,b)           (p)->lpVtbl->AddMoveCallback(p,a,b)
+#define IDirect3DRMFrame2_AddTransform(p,a,b)              (p)->lpVtbl->AddTransform(p,a,b)
+#define IDirect3DRMFrame2_AddTranslation(p,a,b,c,d)        (p)->lpVtbl->AddTranslation(p,a,b,c,d)
+#define IDirect3DRMFrame2_AddScale(p,a,b,c,d)              (p)->lpVtbl->AddScale(p,a,b,c,d)
+#define IDirect3DRMFrame2_AddRotation(p,a,b,c,d,e)         (p)->lpVtbl->AddRotation(p,a,b,c,d,e)
+#define IDirect3DRMFrame2_AddVisual(p,a)                   (p)->lpVtbl->AddVisual(p,a)
+#define IDirect3DRMFrame2_GetChildren(p,a)                 (p)->lpVtbl->GetChildren(p,a)
+#define IDirect3DRMFrame2_GetColor(p)                      (p)->lpVtbl->GetColor(p)
+#define IDirect3DRMFrame2_GetLights(p,a)                   (p)->lpVtbl->GetLights(p,a)
+#define IDirect3DRMFrame2_GetMaterialMode(p)               (p)->lpVtbl->GetMaterialMode(p)
+#define IDirect3DRMFrame2_GetParent(p,a)                   (p)->lpVtbl->GetParent(p,a)
+#define IDirect3DRMFrame2_GetPosition(p,a,b)               (p)->lpVtbl->GetPosition(p,a,b)
+#define IDirect3DRMFrame2_GetRotation(p,a,b,c)             (p)->lpVtbl->GetRotation(p,a,b,c)
+#define IDirect3DRMFrame2_GetScene(p,a)                    (p)->lpVtbl->GetScene(p,a)
+#define IDirect3DRMFrame2_GetSortMode(p)                   (p)->lpVtbl->GetSortMode(p)
+#define IDirect3DRMFrame2_GetTexture(p,a)                  (p)->lpVtbl->GetTexture(p,a)
+#define IDirect3DRMFrame2_GetTransform(p,a)                (p)->lpVtbl->GetTransform(p,a)
+#define IDirect3DRMFrame2_GetVelocity(p,a,b,c)             (p)->lpVtbl->GetVelocity(p,a,b,c)
+#define IDirect3DRMFrame2_GetOrientation(p,a,b,c)          (p)->lpVtbl->GetOrientation(p,a,b,c)
+#define IDirect3DRMFrame2_GetVisuals(p,a)                  (p)->lpVtbl->GetVisuals(p,a)
+#define IDirect3DRMFrame2_GetTextureTopology(p,a,b)        (p)->lpVtbl->GetTextureTopology(p,a,b)
+#define IDirect3DRMFrame2_InverseTransform(p,a,b)          (p)->lpVtbl->InverseTransform(p,a,b)
+#define IDirect3DRMFrame2_Load(p,a,b,c,d,e)                (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DRMFrame2_LookAt(p,a,b,c)                  (p)->lpVtbl->LookAt(p,a,b,c)
+#define IDirect3DRMFrame2_Move(p,a)                        (p)->lpVtbl->Move(p,a)
+#define IDirect3DRMFrame2_DeleteChild(p,a)                 (p)->lpVtbl->DeleteChild(p,a)
+#define IDirect3DRMFrame2_DeleteLight(p,a)                 (p)->lpVtbl->DeleteLight(p,a)
+#define IDirect3DRMFrame2_DeleteMoveCallback(p,a,b)        (p)->lpVtbl->DeleteMoveCallback(p,a,b)
+#define IDirect3DRMFrame2_DeleteVisual(p,a)                (p)->lpVtbl->DeleteVisual(p,a)
+#define IDirect3DRMFrame2_GetSceneBackground(p)            (p)->lpVtbl->GetSceneBackground(p)
+#define IDirect3DRMFrame2_GetSceneBackgroundDepth(p,a)     (p)->lpVtbl->GetSceneBackgroundDepth(p,a)
+#define IDirect3DRMFrame2_GetSceneFogColor(p)              (p)->lpVtbl->GetSceneFogColor(p)
+#define IDirect3DRMFrame2_GetSceneFogEnable(p)             (p)->lpVtbl->GetSceneFogEnable(p)
+#define IDirect3DRMFrame2_GetSceneFogMode(p)               (p)->lpVtbl->GetSceneFogMode(p)
+#define IDirect3DRMFrame2_GetSceneFogParams(p,a,b,c)       (p)->lpVtbl->GetSceneFogParams(p,a,b,c)
+#define IDirect3DRMFrame2_SetSceneBackground(p,a)          (p)->lpVtbl->SetSceneBackground(p,a)
+#define IDirect3DRMFrame2_SetSceneBackgroundRGB(p,a,b,c)   (p)->lpVtbl->SetSceneBackgroundRGB(p,a,b,c)
+#define IDirect3DRMFrame2_SetSceneBackgroundDepth(p,a)     (p)->lpVtbl->SetSceneBackgroundDepth(p,a)
+#define IDirect3DRMFrame2_SetSceneBackgroundImage(p,a)     (p)->lpVtbl->SetSceneBackgroundImage(p,a)
+#define IDirect3DRMFrame2_SetSceneFogEnable(p,a)           (p)->lpVtbl->SetSceneFogEnable(p,a)
+#define IDirect3DRMFrame2_SetSceneFogColor(p,a)            (p)->lpVtbl->SetSceneFogColor(p,a)
+#define IDirect3DRMFrame2_SetSceneFogMode(p,a)             (p)->lpVtbl->SetSceneFogMode(p,a)
+#define IDirect3DRMFrame2_SetSceneFogParams(p,a,b,c)       (p)->lpVtbl->SetSceneFogParams(p,a,b,c)
+#define IDirect3DRMFrame2_SetColor(p,a)                    (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMFrame2_SetColorRGB(p,a,b,c)             (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMFrame2_GetZbufferMode(p)                (p)->lpVtbl->GetZbufferMode(p)
+#define IDirect3DRMFrame2_SetMaterialMode(p,a)             (p)->lpVtbl->SetMaterialMode(p,a)
+#define IDirect3DRMFrame2_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
+#define IDirect3DRMFrame2_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirect3DRMFrame2_SetRotation(p,a,b,c,d,e)         (p)->lpVtbl->SetRotation(p,a,b,c,d,e)
+#define IDirect3DRMFrame2_SetSortMode(p,a)                 (p)->lpVtbl->SetSortMode(p,a)
+#define IDirect3DRMFrame2_SetTexture(p,a)                  (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMFrame2_SetTextureTopology(p,a,b)        (p)->lpVtbl->SetTextureTopology(p,a,b)
+#define IDirect3DRMFrame2_SetVelocity(p,a,b,c,d,e)         (p)->lpVtbl->SetVelocity(p,a,b,c,d,e)
+#define IDirect3DRMFrame2_SetZbufferMode(p,a)              (p)->lpVtbl->SetZbufferMode(p,a)
+#define IDirect3DRMFrame2_Transform(p,a,b)                 (p)->lpVtbl->Transform(p,a,b)
+/*** IDirect3DRMFrame2 methods ***/
+#define IDirect3DRMFrame2_AddMoveCallback2(p,a,b,c)        (p)->lpVtbl->AddMoveCallback2(p,a,b,c)
+#define IDirect3DRMFrame2_GetBox(p,a)                      (p)->lpVtbl->GetBox(p,a)
+#define IDirect3DRMFrame2_GetBoxEnable(p)                  (p)->lpVtbl->GetBoxEnable(p)
+#define IDirect3DRMFrame2_GetAxes(p,a,b)                   (p)->lpVtbl->GetAxes(p,a,b)
+#define IDirect3DRMFrame2_GetMaterial(p,a)                 (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DRMFrame2_GetInheritAxes(p,a,b)            (p)->lpVtbl->GetInheritAxes(p,a,b)
+#define IDirect3DRMFrame2_GetHierarchyBox(p,a)             (p)->lpVtbl->GetHierarchyBox(p,a)
+#define IDirect3DRMFrame2_SetBox(p,a)                      (p)->lpVtbl->SetBox(p,a)
+#define IDirect3DRMFrame2_SetBoxEnable(p,a)                (p)->lpVtbl->SetBoxEnable(p,a)
+#define IDirect3DRMFrame2_SetAxes(p,a,b,c,d,e,f)           (p)->lpVtbl->SetAxes(p,a,b,c,d,e,f)
+#define IDirect3DRMFrame2_SetInheritAxes(p,a)              (p)->lpVtbl->SetInheritAxes(p,a)
+#define IDirect3DRMFrame2_SetMaterial(p,a)                 (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DRMFrame2_SetQuaternion(p,a,b)             (p)->lpVtbl->SetQuaternion(p,a,b)
+#define IDirect3DRMFrame2_RayPick(p,a,b,c,d)               (p)->lpVtbl->RayPick(p,a,b,c,d)
+#define IDirect3DRMFrame2_Save(p,a,b,c)                    (p)->lpVtbl->Save(p,a,b,c)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMFrame2_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
+#define IDirect3DRMFrame2_AddRef(p)                        (p)->AddRef()
+#define IDirect3DRMFrame2_Release(p)                       (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFrame2_Clone(p,a,b,c)                   (p)->Clone(a,b,c)
+#define IDirect3DRMFrame2_AddDestroyCallback(p,a,b)        (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMFrame2_DeleteDestroyCallback(p,a,b)     (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMFrame2_SetAppData(p,a)                  (p)->SetAppData(a)
+#define IDirect3DRMFrame2_GetAppData(p)                    (p)->GetAppData()
+#define IDirect3DRMFrame2_SetName(p,a)                     (p)->SetName(a)
+#define IDirect3DRMFrame2_GetName(p,a,b)                   (p)->GetName(a,b)
+#define IDirect3DRMFrame2_GetClassName(p,a,b)              (p)->GetClassName(a,b)
+/*** IDirect3DRMFrame methods ***/
+#define IDirect3DRMFrame2_AddChild(p,a)                    (p)->AddChild(a)
+#define IDirect3DRMFrame2_AddLight(p,a)                    (p)->AddLight(a)
+#define IDirect3DRMFrame2_AddMoveCallback(p,a,b)           (p)->AddMoveCallback(a,b)
+#define IDirect3DRMFrame2_AddTransform(p,a,b)              (p)->AddTransform(a,b)
+#define IDirect3DRMFrame2_AddTranslation(p,a,b,c,d)        (p)->AddTranslation(a,b,c,d)
+#define IDirect3DRMFrame2_AddScale(p,a,b,c,d)              (p)->AddScale(a,b,c,d)
+#define IDirect3DRMFrame2_AddRotation(p,a,b,c,d,e)         (p)->AddRotation(a,b,c,d,e)
+#define IDirect3DRMFrame2_AddVisual(p,a)                   (p)->AddVisual(a)
+#define IDirect3DRMFrame2_GetChildren(p,a)                 (p)->GetChildren(a)
+#define IDirect3DRMFrame2_GetColor(p)                      (p)->GetColor()
+#define IDirect3DRMFrame2_GetLights(p,a)                   (p)->GetLights(a)
+#define IDirect3DRMFrame2_GetMaterialMode(p)               (p)->GetMaterialMode()
+#define IDirect3DRMFrame2_GetParent(p,a)                   (p)->GetParent(a)
+#define IDirect3DRMFrame2_GetPosition(p,a,b)               (p)->GetPosition(a,b)
+#define IDirect3DRMFrame2_GetRotation(p,a,b,c)             (p)->GetRotation(a,b,c)
+#define IDirect3DRMFrame2_GetScene(p,a)                    (p)->GetScene(a)
+#define IDirect3DRMFrame2_GetSortMode(p)                   (p)->GetSortMode()
+#define IDirect3DRMFrame2_GetTexture(p,a)                  (p)->GetTexture(a)
+#define IDirect3DRMFrame2_GetTransform(p,a)                (p)->GetTransform(a)
+#define IDirect3DRMFrame2_GetVelocity(p,a,b,c)             (p)->GetVelocity(a,b,c)
+#define IDirect3DRMFrame2_GetOrientation(p,a,b,c)          (p)->GetOrientation(a,b,c)
+#define IDirect3DRMFrame2_GetVisuals(p,a)                  (p)->GetVisuals(a)
+#define IDirect3DRMFrame2_GetTextureTopology(p,a,b)        (p)->GetTextureTopology(a,b)
+#define IDirect3DRMFrame2_InverseTransform(p,a,b)          (p)->InverseTransform(a,b)
+#define IDirect3DRMFrame2_Load(p,a,b,c,d,e)                (p)->Load(a,b,c,d,e)
+#define IDirect3DRMFrame2_LookAt(p,a,b,c)                  (p)->LookAt(a,b,c)
+#define IDirect3DRMFrame2_Move(p,a)                        (p)->Move(a)
+#define IDirect3DRMFrame2_DeleteChild(p,a)                 (p)->DeleteChild(a)
+#define IDirect3DRMFrame2_DeleteLight(p,a)                 (p)->DeleteLight(a)
+#define IDirect3DRMFrame2_DeleteMoveCallback(p,a,b)        (p)->DeleteMoveCallback(a,b)
+#define IDirect3DRMFrame2_DeleteVisual(p,a)                (p)->DeleteVisual(a)
+#define IDirect3DRMFrame2_GetSceneBackground(p)            (p)->GetSceneBackground()
+#define IDirect3DRMFrame2_GetSceneBackgroundDepth(p,a)     (p)->GetSceneBackgroundDepth(a)
+#define IDirect3DRMFrame2_GetSceneFogColor(p)              (p)->GetSceneFogColor()
+#define IDirect3DRMFrame2_GetSceneFogEnable(p)             (p)->GetSceneFogEnable()
+#define IDirect3DRMFrame2_GetSceneFogMode(p)               (p)->GetSceneFogMode()
+#define IDirect3DRMFrame2_GetSceneFogParams(p,a,b,c)       (p)->GetSceneFogParams(a,b,c)
+#define IDirect3DRMFrame2_SetSceneBackground(p,a)          (p)->SetSceneBackground(a)
+#define IDirect3DRMFrame2_SetSceneBackgroundRGB(p,a,b,c)   (p)->SetSceneBackgroundRGB(a,b,c)
+#define IDirect3DRMFrame2_SetSceneBackgroundDepth(p,a)     (p)->SetSceneBackgroundDepth(a)
+#define IDirect3DRMFrame2_SetSceneBackgroundImage(p,a)     (p)->SetSceneBackgroundImage(a)
+#define IDirect3DRMFrame2_SetSceneFogEnable(p,a)           (p)->SetSceneFogEnable(a)
+#define IDirect3DRMFrame2_SetSceneFogColor(p,a)            (p)->SetSceneFogColor(a)
+#define IDirect3DRMFrame2_SetSceneFogMode(p,a)             (p)->SetSceneFogMode(a)
+#define IDirect3DRMFrame2_SetSceneFogParams(p,a,b,c)       (p)->SetSceneFogParams(a,b,c)
+#define IDirect3DRMFrame2_SetColor(p,a)                    (p)->SetColor(a)
+#define IDirect3DRMFrame2_SetColorRGB(p,a,b,c)             (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMFrame2_GetZbufferMode(p)                (p)->GetZbufferMode()
+#define IDirect3DRMFrame2_SetMaterialMode(p,a)             (p)->SetMaterialMode(a)
+#define IDirect3DRMFrame2_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
+#define IDirect3DRMFrame2_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
+#define IDirect3DRMFrame2_SetRotation(p,a,b,c,d,e)         (p)->SetRotation(a,b,c,d,e)
+#define IDirect3DRMFrame2_SetSortMode(p,a)                 (p)->SetSortMode(a)
+#define IDirect3DRMFrame2_SetTexture(p,a)                  (p)->SetTexture(a)
+#define IDirect3DRMFrame2_SetTextureTopology(p,a,b)        (p)->SetTextureTopology(a,b)
+#define IDirect3DRMFrame2_SetVelocity(p,a,b,c,d,e)         (p)->SetVelocity(a,b,c,d,e)
+#define IDirect3DRMFrame2_SetZbufferMode(p,a)              (p)->SetZbufferMode(a)
+#define IDirect3DRMFrame2_Transform(p,a,b)                 (p)->Transform(a,b)
+/*** IDirect3DRMFrame2 methods ***/
+#define IDirect3DRMFrame2_AddMoveCallback2(p,a,b,c)        (p)->AddMoveCallback2(a,b,c)
+#define IDirect3DRMFrame2_GetBox(p,a)                      (p)->GetBox(a)
+#define IDirect3DRMFrame2_GetBoxEnable(p)                  (p)->GetBoxEnable()
+#define IDirect3DRMFrame2_GetAxes(p,a,b)                   (p)->GetAxes(a,b)
+#define IDirect3DRMFrame2_GetMaterial(p,a)                 (p)->GetMaterial(a)
+#define IDirect3DRMFrame2_GetInheritAxes(p,a,b)            (p)->GetInheritAxes(a,b)
+#define IDirect3DRMFrame2_GetHierarchyBox(p,a)             (p)->GetHierarchyBox(a)
+#define IDirect3DRMFrame2_SetBox(p,a)                      (p)->SetBox(a)
+#define IDirect3DRMFrame2_SetBoxEnable(p,a)                (p)->SetBoxEnable(a)
+#define IDirect3DRMFrame2_SetAxes(p,a,b,c,d,e,f)           (p)->SetAxes(a,b,c,d,e,f)
+#define IDirect3DRMFrame2_SetInheritAxes(p,a)              (p)->SetInheritAxes(a)
+#define IDirect3DRMFrame2_SetMaterial(p,a)                 (p)->SetMaterial(a)
+#define IDirect3DRMFrame2_SetQuaternion(p,a,b)             (p)->SetQuaternion(a,b)
+#define IDirect3DRMFrame2_RayPick(p,a,b,c,d)               (p)->RayPick(a,b,c,d)
+#define IDirect3DRMFrame2_Save(p,a,b,c)                    (p)->Save(a,b,c)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMFrame3 interface
+ */
+#define INTERFACE IDirect3DRMFrame3
+DECLARE_INTERFACE_(IDirect3DRMFrame3,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMFrame3 methods ***/
+    STDMETHOD(AddChild)(THIS_ LPDIRECT3DRMFRAME3 child) PURE;
+    STDMETHOD(AddLight)(THIS_ LPDIRECT3DRMLIGHT) PURE;
+    STDMETHOD(AddMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK, VOID *arg, DWORD flags) PURE;
+    STDMETHOD(AddTranslation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(AddScale)(THIS_ D3DRMCOMBINETYPE, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE;
+    STDMETHOD(AddRotation)(THIS_ D3DRMCOMBINETYPE, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta) PURE;
+    STDMETHOD(AddVisual)(THIS_ LPUNKNOWN) PURE;
+    STDMETHOD(GetChildren)(THIS_ LPDIRECT3DRMFRAMEARRAY *children) PURE;
+    STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
+    STDMETHOD(GetLights)(THIS_ LPDIRECT3DRMLIGHTARRAY *lights) PURE;
+    STDMETHOD_(D3DRMMATERIALMODE, GetMaterialMode)(THIS) PURE;
+    STDMETHOD(GetParent)(THIS_ LPDIRECT3DRMFRAME3 *) PURE;
+    STDMETHOD(GetPosition)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return_position) PURE;
+    STDMETHOD(GetRotation)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR axis, LPD3DVALUE return_theta) PURE;
+    STDMETHOD(GetScene)(THIS_ LPDIRECT3DRMFRAME3 *) PURE;
+    STDMETHOD_(D3DRMSORTMODE, GetSortMode)(THIS) PURE;
+    STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE3 *) PURE;
+    STDMETHOD(GetTransform)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DRMMATRIX4D rmMatrix) PURE;
+    STDMETHOD(GetVelocity)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR return_velocity,
+        BOOL with_rotation) PURE;
+    STDMETHOD(GetOrientation)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DVECTOR dir, LPD3DVECTOR up) PURE;
+    STDMETHOD(GetVisuals)(THIS_ LPDWORD pCount, LPUNKNOWN *) PURE;
+    STDMETHOD(InverseTransform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE;
+    STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags,
+        D3DRMLOADTEXTURE3CALLBACK, LPVOID pArg) PURE;
+    STDMETHOD(LookAt)(THIS_ LPDIRECT3DRMFRAME3 target, LPDIRECT3DRMFRAME3 reference, D3DRMFRAMECONSTRAINT) PURE;
+    STDMETHOD(Move)(THIS_ D3DVALUE delta) PURE;
+    STDMETHOD(DeleteChild)(THIS_ LPDIRECT3DRMFRAME3) PURE;
+    STDMETHOD(DeleteLight)(THIS_ LPDIRECT3DRMLIGHT) PURE;
+    STDMETHOD(DeleteMoveCallback)(THIS_ D3DRMFRAME3MOVECALLBACK, VOID *arg) PURE;
+    STDMETHOD(DeleteVisual)(THIS_ LPUNKNOWN) PURE;
+    STDMETHOD_(D3DCOLOR, GetSceneBackground)(THIS) PURE;
+    STDMETHOD(GetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE *) PURE;
+    STDMETHOD_(D3DCOLOR, GetSceneFogColor)(THIS) PURE;
+    STDMETHOD_(BOOL, GetSceneFogEnable)(THIS) PURE;
+    STDMETHOD_(D3DRMFOGMODE, GetSceneFogMode)(THIS) PURE;
+    STDMETHOD(GetSceneFogParams)(THIS_ D3DVALUE *return_start, D3DVALUE *return_end,
+        D3DVALUE *return_density) PURE;
+    STDMETHOD(SetSceneBackground)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetSceneBackgroundRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(SetSceneBackgroundDepth)(THIS_ LPDIRECTDRAWSURFACE) PURE;
+    STDMETHOD(SetSceneBackgroundImage)(THIS_ LPDIRECT3DRMTEXTURE3) PURE;
+    STDMETHOD(SetSceneFogEnable)(THIS_ BOOL) PURE;
+    STDMETHOD(SetSceneFogColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetSceneFogMode)(THIS_ D3DRMFOGMODE) PURE;
+    STDMETHOD(SetSceneFogParams)(THIS_ D3DVALUE start, D3DVALUE end, D3DVALUE density) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD_(D3DRMZBUFFERMODE, GetZbufferMode)(THIS) PURE;
+    STDMETHOD(SetMaterialMode)(THIS_ D3DRMMATERIALMODE) PURE;
+    STDMETHOD(SetOrientation)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
+        D3DVALUE ux, D3DVALUE uy, D3DVALUE uz) PURE;
+    STDMETHOD(SetPosition)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetRotation)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z,
+        D3DVALUE theta) PURE;
+    STDMETHOD(SetSortMode)(THIS_ D3DRMSORTMODE) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE;
+    STDMETHOD(SetVelocity)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DVALUE x, D3DVALUE y, D3DVALUE z,
+        BOOL with_rotation) PURE;
+    STDMETHOD(SetZbufferMode)(THIS_ D3DRMZBUFFERMODE) PURE;
+    STDMETHOD(Transform)(THIS_ D3DVECTOR *d, D3DVECTOR *s) PURE;
+    STDMETHOD(GetBox)(THIS_ LPD3DRMBOX) PURE;
+    STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE;
+    STDMETHOD(GetAxes)(THIS_ LPD3DVECTOR dir, LPD3DVECTOR up);
+    STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2 *) PURE;
+    STDMETHOD_(BOOL, GetInheritAxes)(THIS);
+    STDMETHOD(GetHierarchyBox)(THIS_ LPD3DRMBOX) PURE;
+    STDMETHOD(SetBox)(THIS_ LPD3DRMBOX) PURE;
+    STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE;
+    STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz);
+    STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent);
+    STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE;
+    STDMETHOD(SetQuaternion)(THIS_ LPDIRECT3DRMFRAME3 reference, D3DRMQUATERNION *q) PURE;
+    STDMETHOD(RayPick)(THIS_ LPDIRECT3DRMFRAME3 reference, LPD3DRMRAY ray, DWORD flags,
+        LPDIRECT3DRMPICKED2ARRAY *return_visuals) PURE;
+    STDMETHOD(Save)(THIS_ LPCSTR filename, D3DRMXOFFORMAT d3dFormat, D3DRMSAVEOPTIONS d3dSaveFlags);
+    STDMETHOD(TransformVectors)(THIS_ LPDIRECT3DRMFRAME3 reference, DWORD NumVectors,
+        LPD3DVECTOR pDstVectors, LPD3DVECTOR pSrcVectors) PURE;
+    STDMETHOD(InverseTransformVectors)(THIS_ LPDIRECT3DRMFRAME3 reference, DWORD NumVectors,
+        LPD3DVECTOR pDstVectors, LPD3DVECTOR pSrcVectors) PURE;
+    STDMETHOD(SetTraversalOptions)(THIS_ DWORD flags) PURE;
+    STDMETHOD(GetTraversalOptions)(THIS_ LPDWORD pFlags) PURE;
+    STDMETHOD(SetSceneFogMethod)(THIS_ DWORD flags) PURE;
+    STDMETHOD(GetSceneFogMethod)(THIS_ LPDWORD pFlags) PURE;
+    STDMETHOD(SetMaterialOverride)(THIS_ LPD3DRMMATERIALOVERRIDE) PURE;
+    STDMETHOD(GetMaterialOverride)(THIS_ LPD3DRMMATERIALOVERRIDE) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMFrame3_QueryInterface(p,a,b)              (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMFrame3_AddRef(p)                          (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMFrame3_Release(p)                         (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFrame3_Clone(p,a,b,c)                     (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMFrame3_AddDestroyCallback(p,a,b)          (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMFrame3_DeleteDestroyCallback(p,a,b)       (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMFrame3_SetAppData(p,a)                    (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMFrame3_GetAppData(p)                      (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMFrame3_SetName(p,a)                       (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMFrame3_GetName(p,a,b)                     (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMFrame3_GetClassName(p,a,b)                (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMFrame3 methods ***/
+#define IDirect3DRMFrame3_AddChild(p,a)                      (p)->lpVtbl->AddChild(p,a)
+#define IDirect3DRMFrame3_AddLight(p,a)                      (p)->lpVtbl->AddLight(p,a)
+#define IDirect3DRMFrame3_AddMoveCallback(p,a,b,c)           (p)->lpVtbl->AddMoveCallback(p,a,b,c)
+#define IDirect3DRMFrame3_AddTransform(p,a,b)                (p)->lpVtbl->AddTransform(p,a,b)
+#define IDirect3DRMFrame3_AddTranslation(p,a,b,c,d)          (p)->lpVtbl->AddTranslation(p,a,b,c,d)
+#define IDirect3DRMFrame3_AddScale(p,a,b,c,d)                (p)->lpVtbl->AddScale(p,a,b,c,d)
+#define IDirect3DRMFrame3_AddRotation(p,a,b,c,d,e)           (p)->lpVtbl->AddRotation(p,a,b,c,d,e)
+#define IDirect3DRMFrame3_AddVisual(p,a)                     (p)->lpVtbl->AddVisual(p,a)
+#define IDirect3DRMFrame3_GetChildren(p,a)                   (p)->lpVtbl->GetChildren(p,a)
+#define IDirect3DRMFrame3_GetColor(p)                        (p)->lpVtbl->GetColor(p)
+#define IDirect3DRMFrame3_GetLights(p,a)                     (p)->lpVtbl->GetLights(p,a)
+#define IDirect3DRMFrame3_GetMaterialMode(p)                 (p)->lpVtbl->GetMaterialMode(p)
+#define IDirect3DRMFrame3_GetParent(p,a)                     (p)->lpVtbl->GetParent(p,a)
+#define IDirect3DRMFrame3_GetPosition(p,a,b)                 (p)->lpVtbl->GetPosition(p,a,b)
+#define IDirect3DRMFrame3_GetRotation(p,a,b,c)               (p)->lpVtbl->GetRotation(p,a,b,c)
+#define IDirect3DRMFrame3_GetScene(p,a)                      (p)->lpVtbl->GetScene(p,a)
+#define IDirect3DRMFrame3_GetSortMode(p)                     (p)->lpVtbl->GetSortMode(p)
+#define IDirect3DRMFrame3_GetTexture(p,a)                    (p)->lpVtbl->GetTexture(p,a)
+#define IDirect3DRMFrame3_GetTransform(p,a,b)                (p)->lpVtbl->GetTransform(p,a,b)
+#define IDirect3DRMFrame3_GetVelocity(p,a,b,c)               (p)->lpVtbl->GetVelocity(p,a,b,c)
+#define IDirect3DRMFrame3_GetOrientation(p,a,b,c)            (p)->lpVtbl->GetOrientation(p,a,b,c)
+#define IDirect3DRMFrame3_GetVisuals(p,a,b)                  (p)->lpVtbl->GetVisuals(p,a,b)
+#define IDirect3DRMFrame3_InverseTransform(p,a,b)            (p)->lpVtbl->InverseTransform(p,a,b)
+#define IDirect3DRMFrame3_Load(p,a,b,c,d,e)                  (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DRMFrame3_LookAt(p,a,b,c)                    (p)->lpVtbl->LookAt(p,a,b,c)
+#define IDirect3DRMFrame3_Move(p,a)                          (p)->lpVtbl->Move(p,a)
+#define IDirect3DRMFrame3_DeleteChild(p,a)                   (p)->lpVtbl->DeleteChild(p,a)
+#define IDirect3DRMFrame3_DeleteLight(p,a)                   (p)->lpVtbl->DeleteLight(p,a)
+#define IDirect3DRMFrame3_DeleteMoveCallback(p,a,b)          (p)->lpVtbl->DeleteMoveCallback(p,a,b)
+#define IDirect3DRMFrame3_DeleteVisual(p,a)                  (p)->lpVtbl->DeleteVisual(p,a)
+#define IDirect3DRMFrame3_GetSceneBackground(p)              (p)->lpVtbl->GetSceneBackground(p)
+#define IDirect3DRMFrame3_GetSceneBackgroundDepth(p,a)       (p)->lpVtbl->GetSceneBackgroundDepth(p,a)
+#define IDirect3DRMFrame3_GetSceneFogColor(p)                (p)->lpVtbl->GetSceneFogColor(p)
+#define IDirect3DRMFrame3_GetSceneFogEnable(p)               (p)->lpVtbl->GetSceneFogEnable(p)
+#define IDirect3DRMFrame3_GetSceneFogMode(p)                 (p)->lpVtbl->GetSceneFogMode(p)
+#define IDirect3DRMFrame3_GetSceneFogParams(p,a,b,c)         (p)->lpVtbl->GetSceneFogParams(p,a,b,c)
+#define IDirect3DRMFrame3_SetSceneBackground(p,a)            (p)->lpVtbl->SetSceneBackground(p,a)
+#define IDirect3DRMFrame3_SetSceneBackgroundRGB(p,a,b,c)     (p)->lpVtbl->SetSceneBackgroundRGB(p,a,b,c)
+#define IDirect3DRMFrame3_SetSceneBackgroundDepth(p,a)       (p)->lpVtbl->SetSceneBackgroundDepth(p,a)
+#define IDirect3DRMFrame3_SetSceneBackgroundImage(p,a)       (p)->lpVtbl->SetSceneBackgroundImage(p,a)
+#define IDirect3DRMFrame3_SetSceneFogEnable(p,a)             (p)->lpVtbl->SetSceneFogEnable(p,a)
+#define IDirect3DRMFrame3_SetSceneFogColor(p,a)              (p)->lpVtbl->SetSceneFogColor(p,a)
+#define IDirect3DRMFrame3_SetSceneFogMode(p,a)               (p)->lpVtbl->SetSceneFogMode(p,a)
+#define IDirect3DRMFrame3_SetSceneFogParams(p,a,b,c)         (p)->lpVtbl->SetSceneFogParams(p,a,b,c)
+#define IDirect3DRMFrame3_SetColor(p,a)                      (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMFrame3_SetColorRGB(p,a,b,c)               (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMFrame3_GetZbufferMode(p)                  (p)->lpVtbl->GetZbufferMode(p)
+#define IDirect3DRMFrame3_SetMaterialMode(p,a)               (p)->lpVtbl->SetMaterialMode(p,a)
+#define IDirect3DRMFrame3_SetOrientation(p,a,b,c,d,e,f,g)    (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
+#define IDirect3DRMFrame3_SetPosition(p,a,b,c,d)             (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirect3DRMFrame3_SetRotation(p,a,b,c,d,e)           (p)->lpVtbl->SetRotation(p,a,b,c,d,e)
+#define IDirect3DRMFrame3_SetSortMode(p,a)                   (p)->lpVtbl->SetSortMode(p,a)
+#define IDirect3DRMFrame3_SetTexture(p,a)                    (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMFrame3_SetVelocity(p,a,b,c,d,e)           (p)->lpVtbl->SetVelocity(p,a,b,c,d,e)
+#define IDirect3DRMFrame3_SetZbufferMode(p,a)                (p)->lpVtbl->SetZbufferMode(p,a)
+#define IDirect3DRMFrame3_Transform(p,a,b)                   (p)->lpVtbl->Transform(p,a,b)
+#define IDirect3DRMFrame3_GetBox(p,a)                        (p)->lpVtbl->GetBox(p,a)
+#define IDirect3DRMFrame3_GetBoxEnable(p)                    (p)->lpVtbl->GetBoxEnable(p)
+#define IDirect3DRMFrame3_GetAxes(p,a,b)                     (p)->lpVtbl->GetAxes(p,a,b)
+#define IDirect3DRMFrame3_GetMaterial(p,a)                   (p)->lpVtbl->GetMaterial(p,a)
+#define IDirect3DRMFrame3_GetInheritAxes(p)                  (p)->lpVtbl->GetInheritAxes(p)
+#define IDirect3DRMFrame3_GetHierarchyBox(p,a)               (p)->lpVtbl->GetHierarchyBox(p,a)
+#define IDirect3DRMFrame3_SetBox(p,a)                        (p)->lpVtbl->SetBox(p,a)
+#define IDirect3DRMFrame3_SetBoxEnable(p,a)                  (p)->lpVtbl->SetBoxEnable(p,a)
+#define IDirect3DRMFrame3_SetAxes(p,a,b,c,d,e,f)             (p)->lpVtbl->SetAxes(p,a,b,c,d,e,f)
+#define IDirect3DRMFrame3_SetInheritAxes(p,a)                (p)->lpVtbl->SetInheritAxes(p,a)
+#define IDirect3DRMFrame3_SetMaterial(p,a)                   (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DRMFrame3_SetQuaternion(p,a,b)               (p)->lpVtbl->SetQuaternion(p,a,b)
+#define IDirect3DRMFrame3_RayPick(p,a,b,c,d)                 (p)->lpVtbl->RayPick(p,a,b,c,d)
+#define IDirect3DRMFrame3_Save(p,a,b,c)                      (p)->lpVtbl->Save(p,a,b,c)
+#define IDirect3DRMFrame3_TransformVectors(p,a,b,c,d)        (p)->lpVtbl->TransformVectors(p,a,b,c,d)
+#define IDirect3DRMFrame3_InverseTransformVectors(p,a,b,c,d) (p)->lpVtbl->InverseTransformVectors(p,a,b,c,d)
+#define IDirect3DRMFrame3_SetTraversalOptions(p,a)           (p)->lpVtbl->SetTraversalOptions(p,a)
+#define IDirect3DRMFrame3_GetTraversalOptions(p,a)           (p)->lpVtbl->GetTraversalOptions(p,a)
+#define IDirect3DRMFrame3_SetSceneFogMethod(p,a)             (p)->lpVtbl->SetSceneFogMethod(p,a)
+#define IDirect3DRMFrame3_GetSceneFogMethod(p,a)             (p)->lpVtbl->GetSceneFogMethod(p,a)
+#define IDirect3DRMFrame3_SetMaterialOverride(p,a)           (p)->lpVtbl->SetMaterialOverride(p,a)
+#define IDirect3DRMFrame3_GetMaterialOverride(p,a)           (p)->lpVtbl->GetMaterialOverride(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMFrame3_QueryInterface(p,a,b)              (p)->QueryInterface(a,b)
+#define IDirect3DRMFrame3_AddRef(p)                          (p)->AddRef()
+#define IDirect3DRMFrame3_Release(p)                         (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFrame3_Clone(p,a,b,c)                     (p)->Clone(a,b,c)
+#define IDirect3DRMFrame3_AddDestroyCallback(p,a,b)          (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMFrame3_DeleteDestroyCallback(p,a,b)       (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMFrame3_SetAppData(p,a)                    (p)->SetAppData(a)
+#define IDirect3DRMFrame3_GetAppData(p)                      (p)->GetAppData()
+#define IDirect3DRMFrame3_SetName(p,a)                       (p)->SetName(a)
+#define IDirect3DRMFrame3_GetName(p,a,b)                     (p)->GetName(a,b)
+#define IDirect3DRMFrame3_GetClassName(p,a,b)                (p)->GetClassName(a,b)
+/*** IDirect3DRMFrame3 methods ***/
+#define IDirect3DRMFrame3_AddChild(p,a)                      (p)->AddChild(a)
+#define IDirect3DRMFrame3_AddLight(p,a)                      (p)->AddLight(a)
+#define IDirect3DRMFrame3_AddMoveCallback(p,a,b,c)           (p)->AddMoveCallback(a,b,c)
+#define IDirect3DRMFrame3_AddTransform(p,a,b)                (p)->AddTransform(a,b)
+#define IDirect3DRMFrame3_AddTranslation(p,a,b,c,d)          (p)->AddTranslation(a,b,c,d)
+#define IDirect3DRMFrame3_AddScale(p,a,b,c,d)                (p)->AddScale(a,b,c,d)
+#define IDirect3DRMFrame3_AddRotation(p,a,b,c,d,e)           (p)->AddRotation(a,b,c,d,e)
+#define IDirect3DRMFrame3_AddVisual(p,a)                     (p)->AddVisual(a)
+#define IDirect3DRMFrame3_GetChildren(p,a)                   (p)->GetChildren(a)
+#define IDirect3DRMFrame3_GetColor(p)                        (p)->GetColor()
+#define IDirect3DRMFrame3_GetLights(p,a)                     (p)->GetLights(a)
+#define IDirect3DRMFrame3_GetMaterialMode(p)                 (p)->GetMaterialMode()
+#define IDirect3DRMFrame3_GetParent(p,a)                     (p)->GetParent(a)
+#define IDirect3DRMFrame3_GetPosition(p,a,b)                 (p)->GetPosition(a,b)
+#define IDirect3DRMFrame3_GetRotation(p,a,b,c)               (p)->GetRotation(a,b,c)
+#define IDirect3DRMFrame3_GetScene(p,a)                      (p)->GetScene(a)
+#define IDirect3DRMFrame3_GetSortMode(p)                     (p)->GetSortMode()
+#define IDirect3DRMFrame3_GetTexture(p,a)                    (p)->GetTexture(a)
+#define IDirect3DRMFrame3_GetTransform(p,a,b)                (p)->GetTransform(a,b)
+#define IDirect3DRMFrame3_GetVelocity(p,a,b,c)               (p)->GetVelocity(a,b,c)
+#define IDirect3DRMFrame3_GetOrientation(p,a,b,c)            (p)->GetOrientation(a,b,c)
+#define IDirect3DRMFrame3_GetVisuals(p,a,b)                  (p)->GetVisuals(a,b)
+#define IDirect3DRMFrame3_InverseTransform(p,a,b)            (p)->InverseTransform(a,b)
+#define IDirect3DRMFrame3_Load(p,a,b,c,d,e)                  (p)->Load(a,b,c,d,e)
+#define IDirect3DRMFrame3_LookAt(p,a,b,c)                    (p)->LookAt(a,b,c)
+#define IDirect3DRMFrame3_Move(p,a)                          (p)->Move(a)
+#define IDirect3DRMFrame3_DeleteChild(p,a)                   (p)->DeleteChild(a)
+#define IDirect3DRMFrame3_DeleteLight(p,a)                   (p)->DeleteLight(a)
+#define IDirect3DRMFrame3_DeleteMoveCallback(p,a,b)          (p)->DeleteMoveCallback(a,b)
+#define IDirect3DRMFrame3_DeleteVisual(p,a)                  (p)->DeleteVisual(a)
+#define IDirect3DRMFrame3_GetSceneBackground(p)              (p)->GetSceneBackground()
+#define IDirect3DRMFrame3_GetSceneBackgroundDepth(p,a)       (p)->GetSceneBackgroundDepth(a)
+#define IDirect3DRMFrame3_GetSceneFogColor(p)                (p)->GetSceneFogColor()
+#define IDirect3DRMFrame3_GetSceneFogEnable(p)               (p)->GetSceneFogEnable()
+#define IDirect3DRMFrame3_GetSceneFogMode(p)                 (p)->GetSceneFogMode()
+#define IDirect3DRMFrame3_GetSceneFogParams(p,a,b,c)         (p)->GetSceneFogParams(a,b,c)
+#define IDirect3DRMFrame3_SetSceneBackground(p,a)            (p)->SetSceneBackground(a)
+#define IDirect3DRMFrame3_SetSceneBackgroundRGB(p,a,b,c)     (p)->SetSceneBackgroundRGB(a,b,c)
+#define IDirect3DRMFrame3_SetSceneBackgroundDepth(p,a)       (p)->SetSceneBackgroundDepth(a)
+#define IDirect3DRMFrame3_SetSceneBackgroundImage(p,a)       (p)->SetSceneBackgroundImage(a)
+#define IDirect3DRMFrame3_SetSceneFogEnable(p,a)             (p)->SetSceneFogEnable(a)
+#define IDirect3DRMFrame3_SetSceneFogColor(p,a)              (p)->SetSceneFogColor(a)
+#define IDirect3DRMFrame3_SetSceneFogMode(p,a)               (p)->SetSceneFogMode(a)
+#define IDirect3DRMFrame3_SetSceneFogParams(p,a,b,c)         (p)->SetSceneFogParams(a,b,c)
+#define IDirect3DRMFrame3_SetColor(p,a)                      (p)->SetColor(a)
+#define IDirect3DRMFrame3_SetColorRGB(p,a,b,c)               (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMFrame3_GetZbufferMode(p)                  (p)->GetZbufferMode()
+#define IDirect3DRMFrame3_SetMaterialMode(p,a)               (p)->SetMaterialMode(a)
+#define IDirect3DRMFrame3_SetOrientation(p,a,b,c,d,e,f,g)    (p)->SetOrientation(a,b,c,d,e,f,g)
+#define IDirect3DRMFrame3_SetPosition(p,a,b,c,d)             (p)->SetPosition(a,b,c,d)
+#define IDirect3DRMFrame3_SetRotation(p,a,b,c,d,e)           (p)->SetRotation(a,b,c,d,e)
+#define IDirect3DRMFrame3_SetSortMode(p,a)                   (p)->SetSortMode(a)
+#define IDirect3DRMFrame3_SetTexture(p,a)                    (p)->SetTexture(a)
+#define IDirect3DRMFrame3_SetVelocity(p,a,b,c,d,e)           (p)->SetVelocity(a,b,c,d,e)
+#define IDirect3DRMFrame3_SetZbufferMode(p,a)                (p)->SetZbufferMode(a)
+#define IDirect3DRMFrame3_Transform(p,a,b)                   (p)->Transform(a,b)
+#define IDirect3DRMFrame3_GetBox(p,a)                        (p)->GetBox(a)
+#define IDirect3DRMFrame3_GetBoxEnable(p)                    (p)->GetBoxEnable()
+#define IDirect3DRMFrame3_GetAxes(p,a,b)                     (p)->GetAxes(a,b)
+#define IDirect3DRMFrame3_GetMaterial(p,a)                   (p)->GetMaterial(a)
+#define IDirect3DRMFrame3_GetInheritAxes(p)                  (p)->GetInheritAxes()
+#define IDirect3DRMFrame3_GetHierarchyBox(p,a)               (p)->GetHierarchyBox(a)
+#define IDirect3DRMFrame3_SetBox(p,a)                        (p)->SetBox(a)
+#define IDirect3DRMFrame3_SetBoxEnable(p,a)                  (p)->SetBoxEnable(a)
+#define IDirect3DRMFrame3_SetAxes(p,a,b,c,d,e,f)             (p)->SetAxes(a,b,c,d,e,f)
+#define IDirect3DRMFrame3_SetInheritAxes(p,a)                (p)->SetInheritAxes(a)
+#define IDirect3DRMFrame3_SetMaterial(p,a)                   (p)->SetMaterial(a)
+#define IDirect3DRMFrame3_SetQuaternion(p,a,b)               (p)->SetQuaternion(a,b)
+#define IDirect3DRMFrame3_RayPick(p,a,b,c,d)                 (p)->RayPick(a,b,c,d)
+#define IDirect3DRMFrame3_Save(p,a,b,c)                      (p)->Save(a,b,c)
+#define IDirect3DRMFrame3_TransformVectors(p,a,b,c,d)        (p)->TransformVectors(a,b,c,d)
+#define IDirect3DRMFrame3_InverseTransformVectors(p,a,b,c,d) (p)->InverseTransformVectors(a,b,c,d)
+#define IDirect3DRMFrame3_SetTraversalOptions(p,a)           (p)->SetTraversalOptions(a)
+#define IDirect3DRMFrame3_GetTraversalOptions(p,a)           (p)->GetTraversalOptions(a)
+#define IDirect3DRMFrame3_SetSceneFogMethod(p,a)             (p)->SetSceneFogMethod(a)
+#define IDirect3DRMFrame3_GetSceneFogMethod(p,a)             (p)->GetSceneFogMethod(a)
+#define IDirect3DRMFrame3_SetMaterialOverride(p,a)           (p)->SetMaterialOverride(a)
+#define IDirect3DRMFrame3_GetMaterialOverride(p,a)           (p)->GetMaterialOverride(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMMesh interface
+ */
+#define INTERFACE IDirect3DRMMesh
+DECLARE_INTERFACE_(IDirect3DRMMesh,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMMesh methods ***/
+    STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE;
+    STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE;
+    STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE;
+    STDMETHOD(AddGroup)(THIS_ unsigned vCount, unsigned fCount, unsigned vPerFace, unsigned *fData,
+        D3DRMGROUPINDEX *returnId) PURE;
+    STDMETHOD(SetVertices)(THIS_ D3DRMGROUPINDEX id, unsigned index, unsigned count,
+        D3DRMVERTEX *values) PURE;
+    STDMETHOD(SetGroupColor)(THIS_ D3DRMGROUPINDEX id, D3DCOLOR value) PURE;
+    STDMETHOD(SetGroupColorRGB)(THIS_ D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(SetGroupMapping)(THIS_ D3DRMGROUPINDEX id, D3DRMMAPPING value) PURE;
+    STDMETHOD(SetGroupQuality)(THIS_ D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) PURE;
+    STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL value) PURE;
+    STDMETHOD(SetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE value) PURE;
+    STDMETHOD_(unsigned, GetGroupCount)(THIS) PURE;
+    STDMETHOD(GetGroup)(THIS_ D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace,
+        DWORD *fDataSize, unsigned *fData) PURE;
+    STDMETHOD(GetVertices)(THIS_ D3DRMGROUPINDEX id, DWORD index, DWORD count, D3DRMVERTEX *returnPtr) PURE;
+    STDMETHOD_(D3DCOLOR, GetGroupColor)(THIS_ D3DRMGROUPINDEX id) PURE;
+    STDMETHOD_(D3DRMMAPPING, GetGroupMapping)(THIS_ D3DRMGROUPINDEX id) PURE;
+    STDMETHOD_(D3DRMRENDERQUALITY, GetGroupQuality)(THIS_ D3DRMGROUPINDEX id) PURE;
+    STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr) PURE;
+    STDMETHOD(GetGroupTexture)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMTEXTURE *returnPtr) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMMesh_QueryInterface(p,a,b)              (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMMesh_AddRef(p)                          (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMMesh_Release(p)                         (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMesh_Clone(p,a,b,c)                     (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMMesh_AddDestroyCallback(p,a,b)          (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMMesh_DeleteDestroyCallback(p,a,b)       (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMMesh_SetAppData(p,a)                    (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMMesh_GetAppData(p)                      (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMMesh_SetName(p,a)                       (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMMesh_GetName(p,a,b)                     (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMMesh_GetClassName(p,a,b)                (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMMesh methods ***/
+#define IDirect3DRMMesh_Scale(p,a,b,c)                     (p)->lpVtbl->Scale(p,a,b,c)
+#define IDirect3DRMMesh_Translate(p,a,b,c)                 (p)->lpVtbl->Translate(p,a,b,c)
+#define IDirect3DRMMesh_GetBox(p,a)                        (p)->lpVtbl->GetBox(p,a)
+#define IDirect3DRMMesh_AddGroup(p,a,b,c,d,e)              (p)->lpVtbl->AddGroup(p,a,b,c,d,e)
+#define IDirect3DRMMesh_SetVertices(p,a,b,c,d)             (p)->lpVtbl->SetVertices(p,a,b,c,d)
+#define IDirect3DRMMesh_SetGroupColor(p,a,b)               (p)->lpVtbl->SetGroupColor(p,a,b)
+#define IDirect3DRMMesh_SetGroupColorRGB(p,a,b,c,d)        (p)->lpVtbl->SetGroupColorRGB(p,a,b,c,d)
+#define IDirect3DRMMesh_SetGroupMapping(p,a,b)             (p)->lpVtbl->SetGroupMapping(p,a,b)
+#define IDirect3DRMMesh_SetGroupQuality(p,a,b)             (p)->lpVtbl->SetGroupQuality(p,a,b)
+#define IDirect3DRMMesh_SetGroupMaterial(p,a,b)            (p)->lpVtbl->SetGroupMaterial(p,a,b)
+#define IDirect3DRMMesh_SetGroupTexture(p,a,b)             (p)->lpVtbl->SetGroupTexture(p,a,b)
+#define IDirect3DRMMesh_GetGroupCount(p)                   (p)->lpVtbl->GetGroupCount(p)
+#define IDirect3DRMMesh_GetGroup(p,a,b,c,d,e,f)            (p)->lpVtbl->GetGroup(p,a,b,c,d,e,f)
+#define IDirect3DRMMesh_GetVertices(p,a,b,c,d)             (p)->lpVtbl->GetVertices(p,a,b,c,d)
+#define IDirect3DRMMesh_GetGroupColor(p,a)                 (p)->lpVtbl->GetGroupColor(p,a)
+#define IDirect3DRMMesh_GetGroupMapping(p,a)               (p)->lpVtbl->GetGroupMapping(p,a)
+#define IDirect3DRMMesh_GetGroupQuality(p,a)               (p)->lpVtbl->GetGroupQuality(p,a)
+#define IDirect3DRMMesh_GetGroupMaterial(p,a,b)            (p)->lpVtbl->GetGroupMaterial(p,a,b)
+#define IDirect3DRMMesh_GetGroupTexture(p,a,b)             (p)->lpVtbl->GetGroupTexture(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMMesh_QueryInterface(p,a,b)              (p)->QueryInterface(a,b)
+#define IDirect3DRMMesh_AddRef(p)                          (p)->AddRef()
+#define IDirect3DRMMesh_Release(p)                         (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMesh_Clone(p,a,b,c)                     (p)->Clone(a,b,c)
+#define IDirect3DRMMesh_AddDestroyCallback(p,a,b)          (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMMesh_DeleteDestroyCallback(p,a,b)       (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMMesh_SetAppData(p,a)                    (p)->SetAppData(a)
+#define IDirect3DRMMesh_GetAppData(p)                      (p)->GetAppData()
+#define IDirect3DRMMesh_SetName(p,a)                       (p)->SetName(a)
+#define IDirect3DRMMesh_GetName(p,a,b)                     (p)->GetName(a,b)
+#define IDirect3DRMMesh_GetClassName(p,a,b)                (p)->GetClassName(a,b)
+/*** IDirect3DRMMesh methods ***/
+#define IDirect3DRMMesh_Scale(p,a,b,c)                     (p)->Scale(a,b,c)
+#define IDirect3DRMMesh_Translate(p,a,b,c)                 (p)->Translate(a,b,c)
+#define IDirect3DRMMesh_GetBox(p,a)                        (p)->GetBox(a)
+#define IDirect3DRMMesh_AddGroup(p,a,b,c,d,e)              (p)->AddGroup(a,b,c,d,e)
+#define IDirect3DRMMesh_SetVertices(p,a,b,c,d)             (p)->SetVertices(a,b,c,d)
+#define IDirect3DRMMesh_SetGroupColor(p,a,b)               (p)->SetGroupColor(a,b)
+#define IDirect3DRMMesh_SetGroupColorRGB(p,a,b,c,d)        (p)->SetGroupColorRGB(a,b,c,d)
+#define IDirect3DRMMesh_SetGroupMapping(p,a,b)             (p)->SetGroupMapping(a,b)
+#define IDirect3DRMMesh_SetGroupQuality(p,a,b)             (p)->SetGroupQuality(a,b)
+#define IDirect3DRMMesh_SetGroupMaterial(p,a,b)            (p)->SetGroupMaterial(a,b)
+#define IDirect3DRMMesh_SetGroupTexture(p,a,b)             (p)->SetGroupTexture(a,b)
+#define IDirect3DRMMesh_GetGroupCount(p)                   (p)->GetGroupCount()
+#define IDirect3DRMMesh_GetGroup(p,a,b,c,d,e,f)            (p)->GetGroup(a,b,c,d,e,f)
+#define IDirect3DRMMesh_GetVertices(p,a,b,c,d)             (p)->GetVertices(a,b,c,d)
+#define IDirect3DRMMesh_GetGroupColor(p,a)                 (p)->GetGroupColor(a)
+#define IDirect3DRMMesh_GetGroupMapping(p,a)               (p)->GetGroupMapping(a)
+#define IDirect3DRMMesh_GetGroupQuality(p,a)               (p)->GetGroupQuality(a)
+#define IDirect3DRMMesh_GetGroupMaterial(p,a,b)            (p)->lpVtbl->GetGroupMaterial(a,b)
+#define IDirect3DRMMesh_GetGroupTexture(p,a,b)             (p)->lpVtbl->GetGroupTexture(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMProgressiveMesh interface
+ */
+#define INTERFACE IDirect3DRMProgressiveMesh
+DECLARE_INTERFACE_(IDirect3DRMProgressiveMesh,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMProgressiveMesh methods ***/
+    STDMETHOD(Load) (THIS_ LPVOID pObjLocation, LPVOID pObjId, D3DRMLOADOPTIONS dloLoadflags,
+        D3DRMLOADTEXTURECALLBACK pCallback, LPVOID lpArg) PURE;
+    STDMETHOD(GetLoadStatus) (THIS_ LPD3DRMPMESHLOADSTATUS pStatus) PURE;
+    STDMETHOD(SetMinRenderDetail) (THIS_ D3DVALUE d3dVal) PURE;
+    STDMETHOD(Abort) (THIS_ DWORD flags) PURE;
+    STDMETHOD(GetFaceDetail) (THIS_ LPDWORD pCount) PURE;
+    STDMETHOD(GetVertexDetail) (THIS_ LPDWORD pCount) PURE;
+    STDMETHOD(SetFaceDetail) (THIS_ DWORD count) PURE;
+    STDMETHOD(SetVertexDetail) (THIS_ DWORD count) PURE;
+    STDMETHOD(GetFaceDetailRange) (THIS_ LPDWORD pMin, LPDWORD pMax) PURE;
+    STDMETHOD(GetVertexDetailRange) (THIS_ LPDWORD pMin, LPDWORD pMax) PURE;
+    STDMETHOD(GetDetail) (THIS_ D3DVALUE *pdvVal) PURE;
+    STDMETHOD(SetDetail) (THIS_ D3DVALUE d3dVal) PURE;
+    STDMETHOD(RegisterEvents) (THIS_ HANDLE event, DWORD flags, DWORD reserved) PURE;
+    STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *ppD3DRMMesh) PURE;
+    STDMETHOD(Duplicate) (THIS_ LPDIRECT3DRMPROGRESSIVEMESH *ppD3DRMPMesh) PURE;
+    STDMETHOD(GetBox) (THIS_ LPD3DRMBOX pBBox) PURE;
+    STDMETHOD(SetQuality) (THIS_ D3DRMRENDERQUALITY) PURE;
+    STDMETHOD(GetQuality) (THIS_ LPD3DRMRENDERQUALITY pQuality) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMProgressiveMesh_QueryInterface(p,a,b)          (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMProgressiveMesh_AddRef(p)                      (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMProgressiveMesh_Release(p)                     (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMProgressiveMesh_Clone(p,a,b,c)                 (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMProgressiveMesh_AddDestroyCallback(p,a,b)      (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMProgressiveMesh_DeleteDestroyCallback(p,a,b)   (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMProgressiveMesh_SetAppData(p,a)                (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMProgressiveMesh_GetAppData(p)                  (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMProgressiveMesh_SetName(p,a)                   (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMProgressiveMesh_GetName(p,a,b)                 (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMProgressiveMesh_GetClassName(p,a,b)            (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMProgressiveMesh methods ***/
+#define IDirect3DRMProgressiveMesh_Load(p,a,b,c,d,e)              (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DRMProgressiveMesh_GetLoadStatus(p,a)             (p)->lpVtbl->GetLoadStatus(p,a)
+#define IDirect3DRMProgressiveMesh_SetMinRenderDetail(p,a)        (p)->lpVtbl->SetMinRenderDetail(p,a)
+#define IDirect3DRMProgressiveMesh_Abort(p,a)                     (p)->lpVtbl->Abort(p,a)
+#define IDirect3DRMProgressiveMesh_GetFaceDetail(p,a)             (p)->lpVtbl->GetFaceDetail(p,a)
+#define IDirect3DRMProgressiveMesh_GetVertexDetail(p,a)           (p)->lpVtbl->GetVertexDetail(p,a)
+#define IDirect3DRMProgressiveMesh_SetFaceDetail(p,a)             (p)->lpVtbl->SetFaceDetail(p,a)
+#define IDirect3DRMProgressiveMesh_SetVertexDetail(p,a)           (p)->lpVtbl->SetVertexDetail(p,a)
+#define IDirect3DRMProgressiveMesh_GetFaceDetailRange(p,a,b)      (p)->lpVtbl->GetFaceDetailRange(p,a,b)
+#define IDirect3DRMProgressiveMesh_GetVertexDetailRange(p,a,b)    (p)->lpVtbl->GetVertexDetailRange(p,a,b)
+#define IDirect3DRMProgressiveMesh_GetDetail(p,a)                 (p)->lpVtbl->GetDetail(p,a)
+#define IDirect3DRMProgressiveMesh_SetDetail(p,a)                 (p)->lpVtbl->SetDetail(p,a)
+#define IDirect3DRMProgressiveMesh_RegisterEvents(p,a,b,c)        (p)->lpVtbl->RegisterEvents(p,a,b,c)
+#define IDirect3DRMProgressiveMesh_CreateMesh(p,a)                (p)->lpVtbl->CreateMesh(p,a)
+#define IDirect3DRMProgressiveMesh_Duplicate(p,a)                 (p)->lpVtbl->Duplicate(p,a)
+#define IDirect3DRMProgressiveMesh_GetBox(p,a)                    (p)->lpVtbl->GetBox(p,a)
+#define IDirect3DRMProgressiveMesh_SetQuality(p,a)                (p)->lpVtbl->SetQuality(p,a)
+#define IDirect3DRMProgressiveMesh_GetQuality(p,a)                (p)->lpVtbl->GetQuality(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMProgressiveMesh_QueryInterface(p,a,b)          (p)->QueryInterface(a,b)
+#define IDirect3DRMProgressiveMesh_AddRef(p)                      (p)->AddRef()
+#define IDirect3DRMProgressiveMesh_Release(p)                     (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMProgressiveMesh_Clone(p,a,b,c)                 (p)->Clone(a,b,c)
+#define IDirect3DRMProgressiveMesh_AddDestroyCallback(p,a,b)      (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMProgressiveMesh_DeleteDestroyCallback(p,a,b)   (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMProgressiveMesh_SetAppData(p,a)                (p)->SetAppData(a)
+#define IDirect3DRMProgressiveMesh_GetAppData(p)                  (p)->GetAppData()
+#define IDirect3DRMProgressiveMesh_SetName(p,a)                   (p)->SetName(a)
+#define IDirect3DRMProgressiveMesh_GetName(p,a,b)                 (p)->GetName(a,b)
+#define IDirect3DRMProgressiveMesh_GetClassName(p,a,b)            (p)->GetClassName(a,b)
+/*** IDirect3DRMProgressiveMesh methods ***/
+#define IDirect3DRMProgressiveMesh_Load(p,a,b,c,d,e)              (p)->Load(a,b,c,d,e)
+#define IDirect3DRMProgressiveMesh_GetLoadStatus(p,a)             (p)->GetLoadStatus(a)
+#define IDirect3DRMProgressiveMesh_SetMinRenderDetail(p,a)        (p)->SetMinRenderDetail(a)
+#define IDirect3DRMProgressiveMesh_Abort(p,a)                     (p)->Abort(a)
+#define IDirect3DRMProgressiveMesh_GetFaceDetail(p,a)             (p)->GetFaceDetail(a)
+#define IDirect3DRMProgressiveMesh_GetVertexDetail(p,a)           (p)->GetVertexDetail(a)
+#define IDirect3DRMProgressiveMesh_SetFaceDetail(p,a)             (p)->SetFaceDetail(a)
+#define IDirect3DRMProgressiveMesh_SetVertexDetail(p,a)           (p)->SetVertexDetail(a)
+#define IDirect3DRMProgressiveMesh_GetFaceDetailRange(p,a,b)      (p)->GetFaceDetailRange(a,b)
+#define IDirect3DRMProgressiveMesh_GetVertexDetailRange(p,a,b)    (p)->GetVertexDetailRange(a,b)
+#define IDirect3DRMProgressiveMesh_GetDetail(p,a)                 (p)->GetDetail(a)
+#define IDirect3DRMProgressiveMesh_SetDetail(p,a)                 (p)->SetDetail(a)
+#define IDirect3DRMProgressiveMesh_RegisterEvents(p,a,b,c)        (p)->RegisterEvents(a,b,c)
+#define IDirect3DRMProgressiveMesh_CreateMesh(p,a)                (p)->CreateMesh(a)
+#define IDirect3DRMProgressiveMesh_Duplicate(p,a)                 (p)->Duplicate(a)
+#define IDirect3DRMProgressiveMesh_GetBox(p,a)                    (p)->GetBox(a)
+#define IDirect3DRMProgressiveMesh_SetQuality(p,a)                (p)->SetQuality(a)
+#define IDirect3DRMProgressiveMesh_GetQuality(p,a)                (p)->GetQuality(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMShadow interface
+ */
+#define INTERFACE IDirect3DRMShadow
+DECLARE_INTERFACE_(IDirect3DRMShadow,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMShadow methods ***/
+    STDMETHOD(Init)(THIS_ LPDIRECT3DRMVISUAL visual, LPDIRECT3DRMLIGHT light,
+        D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMShadow_QueryInterface(p,a,b)          (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMShadow_AddRef(p)                      (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMShadow_Release(p)                     (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMShadow_Clone(p,a,b,c)                 (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMShadow_AddDestroyCallback(p,a,b)      (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMShadow_DeleteDestroyCallback(p,a,b)   (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMShadow_SetAppData(p,a)                (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMShadow_GetAppData(p)                  (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMShadow_SetName(p,a)                   (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMShadow_GetName(p,a,b)                 (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMShadow_GetClassName(p,a,b)            (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMShadow methods ***/
+#define IDirect3DRMShadow_Init(p,a,b,c,d,e,f,g)          (p)->lpVtbl->Load(p,a,b,c,d,e,f,g)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMShadow_QueryInterface(p,a,b)          (p)->QueryInterface(a,b)
+#define IDirect3DRMShadow_AddRef(p)                      (p)->AddRef()
+#define IDirect3DRMShadow_Release(p)                     (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMShadow_Clone(p,a,b,c)                 (p)->Clone(a,b,c)
+#define IDirect3DRMShadow_AddDestroyCallback(p,a,b)      (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMShadow_DeleteDestroyCallback(p,a,b)   (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMShadow_SetAppData(p,a)                (p)->SetAppData(a)
+#define IDirect3DRMShadow_GetAppData(p)                  (p)->GetAppData()
+#define IDirect3DRMShadow_SetName(p,a)                   (p)->SetName(a)
+#define IDirect3DRMShadow_GetName(p,a,b)                 (p)->GetName(a,b)
+#define IDirect3DRMShadow_GetClassName(p,a,b)            (p)->GetClassName(a,b)
+/*** IDirect3DRMShadow methods ***/
+#define IDirect3DRMShadow_Init(p,a,b,c,d,e,f,g)          (p)->Load(a,b,c,d,e,f,g)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMShadow2 interface
+ */
+#define INTERFACE IDirect3DRMShadow2
+DECLARE_INTERFACE_(IDirect3DRMShadow2,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMShadow methods ***/
+    STDMETHOD(Init)(THIS_ LPUNKNOWN pUNK, LPDIRECT3DRMLIGHT light,
+        D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz) PURE;
+    /*** IDirect3DRMShadow2 methods ***/
+    STDMETHOD(GetVisual)(THIS_ LPDIRECT3DRMVISUAL *) PURE;
+    STDMETHOD(SetVisual)(THIS_ LPUNKNOWN pUNK, DWORD) PURE;
+    STDMETHOD(GetLight)(THIS_ LPDIRECT3DRMLIGHT *) PURE;
+    STDMETHOD(SetLight)(THIS_ LPDIRECT3DRMLIGHT, DWORD) PURE;
+    STDMETHOD(GetPlane)(THIS_ LPD3DVALUE px, LPD3DVALUE py, LPD3DVALUE pz,
+        LPD3DVALUE nx, LPD3DVALUE ny, LPD3DVALUE nz) PURE;
+    STDMETHOD(SetPlane)(THIS_ D3DVALUE px, D3DVALUE py, D3DVALUE pz,
+        D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, DWORD) PURE;
+    STDMETHOD(GetOptions)(THIS_ LPDWORD) PURE;
+    STDMETHOD(SetOptions)(THIS_ DWORD) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMShadow2_QueryInterface(p,a,b)          (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMShadow2_AddRef(p)                      (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMShadow2_Release(p)                     (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMShadow2_Clone(p,a,b,c)                 (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMShadow2_AddDestroyCallback(p,a,b)      (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMShadow2_DeleteDestroyCallback(p,a,b)   (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMShadow2_SetAppData(p,a)                (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMShadow2_GetAppData(p)                  (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMShadow2_SetName(p,a)                   (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMShadow2_GetName(p,a,b)                 (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMShadow2_GetClassName(p,a,b)            (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMShadow methods ***/
+#define IDirect3DRMShadow2_Init(p,a,b,c,d,e,f,g)          (p)->lpVtbl->Init(p,a,b,c,d,e,f,g)
+/*** IDirect3DRMShadow2 methods ***/
+#define IDirect3DRMShadow2_GetVisual(p,a)                 (p)->lpVtbl->GetVisual(p,a)
+#define IDirect3DRMShadow2_SetVisual(p,a,b)               (p)->lpVtbl->SetVisual(p,a,b)
+#define IDirect3DRMShadow2_GetLight(p,a)                  (p)->lpVtbl->GetLight(p,a)
+#define IDirect3DRMShadow2_SetLight(p,a,b)                (p)->lpVtbl->SetLight(p,a,b)
+#define IDirect3DRMShadow2_GetPlane(p,a,b,c,d,e,f)        (p)->lpVtbl->GetPlane(p,a,b,c,d,e,f)
+#define IDirect3DRMShadow2_SetPlane(p,a,b,c,d,e,f)        (p)->lpVtbl->SetPlane(p,a,b,c,d,e,f)
+#define IDirect3DRMShadow2_GetOptions(p,a)                (p)->lpVtbl->GetOptions(p,a)
+#define IDirect3DRMShadow2_SetOptions(p,a)                (p)->lpVtbl->SetOptions(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMShadow2_QueryInterface(p,a,b)          (p)->QueryInterface(a,b)
+#define IDirect3DRMShadow2_AddRef(p)                      (p)->AddRef()
+#define IDirect3DRMShadow2_Release(p)                     (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMShadow2_Clone(p,a,b,c)                 (p)->Clone(a,b,c)
+#define IDirect3DRMShadow2_AddDestroyCallback(p,a,b)      (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMShadow2_DeleteDestroyCallback(p,a,b)   (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMShadow2_SetAppData(p,a)                (p)->SetAppData(a)
+#define IDirect3DRMShadow2_GetAppData(p)                  (p)->GetAppData()
+#define IDirect3DRMShadow2_SetName(p,a)                   (p)->SetName(a)
+#define IDirect3DRMShadow2_GetName(p,a,b)                 (p)->GetName(a,b)
+#define IDirect3DRMShadow2_GetClassName(p,a,b)            (p)->GetClassName(a,b)
+/*** IDirect3DRMShadow methods ***/
+#define IDirect3DRMShadow2_Init(p,a,b,c,d,e,f,g)          (p)->Init(a,b,c,d,e,f,g)
+/*** IDirect3DRMShadow2 methods ***/
+#define IDirect3DRMShadow2_GetVisual(p,a)                 (p)->GetVisual(a)
+#define IDirect3DRMShadow2_SetVisual(p,a,b)               (p)->SetVisual(a,b)
+#define IDirect3DRMShadow2_GetLight(p,a)                  (p)->GetLight(a)
+#define IDirect3DRMShadow2_SetLight(p,a,b)                (p)->SetLight(a,b)
+#define IDirect3DRMShadow2_GetPlane(p,a,b,c,d,e,f)        (p)->GetPlane(a,b,c,d,e,f)
+#define IDirect3DRMShadow2_SetPlane(p,a,b,c,d,e,f)        (p)->SetPlane(a,b,c,d,e,f)
+#define IDirect3DRMShadow2_GetOptions(p,a)                (p)->GetOptions(a)
+#define IDirect3DRMShadow2_SetOptions(p,a)                (p)->lpVtbl->SetOptions(p,a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMFace interface
+ */
+#define INTERFACE IDirect3DRMFace
+DECLARE_INTERFACE_(IDirect3DRMFace,IDirect3DRMObject)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMFace methods ***/
+    STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE;
+    STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE;
+    STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
+    STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
+    STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE;
+    STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals);
+    STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE;
+    STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE;
+    STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE;
+    STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE *) PURE;
+    STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE;
+    STDMETHOD_(int, GetVertexCount)(THIS) PURE;
+    STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE;
+    STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE;
+    STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMFace_QueryInterface(p,a,b)             (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMFace_AddRef(p)                         (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMFace_Release(p)                        (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFace_Clone(p,a,b,c)                    (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMFace_AddDestroyCallback(p,a,b)         (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMFace_DeleteDestroyCallback(p,a,b)      (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMFace_SetAppData(p,a)                   (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMFace_GetAppData(p)                     (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMFace_SetName(p,a)                      (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMFace_GetName(p,a,b)                    (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMFace_GetClassName(p,a,b)               (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMFace methods ***/
+#define IDirect3DRMFace_AddVertex(p,a,b,c)                (p)->lpVtbl->AddVertex(p,a,b,c)
+#define IDirect3DRMFace_AddVertexAndNormalIndexed(p,a,b)  (p)->lpVtbl->AddVertexAndNormalIndexed(p,a,b)
+#define IDirect3DRMFace_SetColorRGB(p,a,b,c)              (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMFace_SetColor(p,a)                     (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMFace_SetTexture(p,a)                   (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMFace_SetTextureCoordinates(p,a,b,c)    (p)->lpVtbl->SetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMFace_SetMaterial(p,a)                  (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DRMFace_SetTextureTopology(p,a,b)         (p)->lpVtbl->SetTextureTopology(p,a,b)
+#define IDirect3DRMFace_GetVertex(p,a,b,c)                (p)->lpVtbl->GetVertex(p,a,b,c)
+#define IDirect3DRMFace_GetVertices(p,a,b,c)              (p)->lpVtbl->GetVertices(p,a,b,c)
+#define IDirect3DRMFace_GetTextureCoordinates(p,a,b,c)    (p)->lpVtbl->GetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMFace_GetTextureTopology(p,a,b)         (p)->lpVtbl->GetTextureTopology(p,a,b)
+#define IDirect3DRMFace_GetNormal(p,a)                    (p)->lpVtbl->GetNormal(p,a)
+#define IDirect3DRMFace_GetTexture(p,a)                   (p)->lpVtbl->GetTexture(p,a)
+#define IDirect3DRMFace_GetVertexCount(p)                 (p)->lpVtbl->GetVertexCount(p)
+#define IDirect3DRMFace_GetVertexIndex(p,a)               (p)->lpVtbl->GetVertexIndex(p,a)
+#define IDirect3DRMFace_GetTextureCoordinateIndex(p,a)    (p)->lpVtbl->GetTextureCoordinateIndex(p,a)
+#define IDirect3DRMFace_GetColor(p,a)                     (p)->lpVtbl->GetColor(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMFace_QueryInterface(p,a,b)             (p)->QueryInterface(a,b)
+#define IDirect3DRMFace_AddRef(p)                         (p)->AddRef()
+#define IDirect3DRMFace_Release(p)                        (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFace_Clone(p,a,b,c)                    (p)->Clone(a,b,c)
+#define IDirect3DRMFace_AddDestroyCallback(p,a,b)         (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMFace_DeleteDestroyCallback(p,a,b)      (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMFace_SetAppData(p,a)                   (p)->SetAppData(a)
+#define IDirect3DRMFace_GetAppData(p)                     (p)->GetAppData()
+#define IDirect3DRMFace_SetName(p,a)                      (p)->SetName(a)
+#define IDirect3DRMFace_GetName(p,a,b)                    (p)->GetName(a,b)
+#define IDirect3DRMFace_GetClassName(p,a,b)               (p)->GetClassName(a,b)
+/*** IDirect3DRMFace methods ***/
+#define IDirect3DRMFace_AddVertex(p,a,b,c)                (p)->AddVertex(a,b,c)
+#define IDirect3DRMFace_AddVertexAndNormalIndexed(p,a,b)  (p)->AddVertexAndNormalIndexed(a,b)
+#define IDirect3DRMFace_SetColorRGB(p,a,b,c)              (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMFace_SetColor(p,a)                     (p)->SetColor(a)
+#define IDirect3DRMFace_SetTexture(p,a)                   (p)->SetTexture(a)
+#define IDirect3DRMFace_SetTextureCoordinates(p,a,b,c)    (p)->SetTextureCoordinates(a,b,c)
+#define IDirect3DRMFace_SetMaterial(p,a)                  (p)->SetMaterial(a)
+#define IDirect3DRMFace_SetTextureTopology(p,a,b)         (p)->SetTextureTopology(a,b)
+#define IDirect3DRMFace_GetVertex(p,a,b,c)                (p)->GetVertex(a,b,c)
+#define IDirect3DRMFace_GetVertices(p,a,b,c)              (p)->GetVertices(a,b,c)
+#define IDirect3DRMFace_GetTextureCoordinates(p,a,b,c)    (p)->GetTextureCoordinates(a,b,c)
+#define IDirect3DRMFace_GetTextureTopology(p,a,b)         (p)->GetTextureTopology(a,b)
+#define IDirect3DRMFace_GetNormal(p,a)                    (p)->GetNormal(a)
+#define IDirect3DRMFace_GetTexture(p,a)                   (p)->GetTexture(a)
+#define IDirect3DRMFace_GetVertexCount(p)                 (p)->GetVertexCount()
+#define IDirect3DRMFace_GetVertexIndex(p,a)               (p)->GetVertexIndex(a)
+#define IDirect3DRMFace_GetTextureCoordinateIndex(p,a)    (p)->GetTextureCoordinateIndex(a)
+#define IDirect3DRMFace_GetColor(p,a)                     (p)->GetColor(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMFace2 interface
+ */
+#define INTERFACE IDirect3DRMFace2
+DECLARE_INTERFACE_(IDirect3DRMFace2,IDirect3DRMObject)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMFace methods ***/
+    STDMETHOD(AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(AddVertexAndNormalIndexed)(THIS_ DWORD vertex, DWORD normal) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE, D3DVALUE, D3DVALUE) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE;
+    STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE;
+    STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE;
+    STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
+    STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE;
+    STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals);
+    STDMETHOD(GetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE *u, D3DVALUE *v) PURE;
+    STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE;
+    STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE;
+    STDMETHOD(GetTexture)(THIS_ LPDIRECT3DRMTEXTURE3 *) PURE;
+    STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2 *) PURE;
+    STDMETHOD_(int, GetVertexCount)(THIS) PURE;
+    STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE;
+    STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE;
+    STDMETHOD_(D3DCOLOR, GetColor)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMFace2_QueryInterface(p,a,b)             (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMFace2_AddRef(p)                         (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMFace2_Release(p)                        (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFace2_Clone(p,a,b,c)                    (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMFace2_AddDestroyCallback(p,a,b)         (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMFace2_DeleteDestroyCallback(p,a,b)      (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMFace2_SetAppData(p,a)                   (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMFace2_GetAppData(p)                     (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMFace2_SetName(p,a)                      (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMFace2_GetName(p,a,b)                    (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMFace2_GetClassName(p,a,b)               (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMFace methods ***/
+#define IDirect3DRMFace2_AddVertex(p,a,b,c)                (p)->lpVtbl->AddVertex(p,a,b,c)
+#define IDirect3DRMFace2_AddVertexAndNormalIndexed(p,a,b)  (p)->lpVtbl->AddVertexAndNormalIndexed(p,a,b)
+#define IDirect3DRMFace2_SetColorRGB(p,a,b,c)              (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMFace2_SetColor(p,a)                     (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMFace2_SetTexture(p,a)                   (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMFace2_SetTextureCoordinates(p,a,b,c)    (p)->lpVtbl->SetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMFace2_SetMaterial(p,a)                  (p)->lpVtbl->SetMaterial(p,a)
+#define IDirect3DRMFace2_SetTextureTopology(p,a,b)         (p)->lpVtbl->SetTextureTopology(p,a,b)
+#define IDirect3DRMFace2_GetVertex(p,a,b,c)                (p)->lpVtbl->GetVertex(p,a,b,c)
+#define IDirect3DRMFace2_GetVertices(p,a,b,c)              (p)->lpVtbl->GetVertices(p,a,b,c)
+#define IDirect3DRMFace2_GetTextureCoordinates(p,a,b,c)    (p)->lpVtbl->GetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMFace2_GetTextureTopology(p,a,b)         (p)->lpVtbl->GetTextureTopology(p,a,b)
+#define IDirect3DRMFace2_GetNormal(p,a)                    (p)->lpVtbl->GetNormal(p,a)
+#define IDirect3DRMFace2_GetTexture(p,a)                   (p)->lpVtbl->GetTexture(p,a)
+#define IDirect3DRMFace2_GetVertexCount(p)                 (p)->lpVtbl->GetVertexCount(p)
+#define IDirect3DRMFace2_GetVertexIndex(p,a)               (p)->lpVtbl->GetVertexIndex(p,a)
+#define IDirect3DRMFace2_GetTextureCoordinateIndex(p,a)    (p)->lpVtbl->GetTextureCoordinateIndex(p,a)
+#define IDirect3DRMFace2_GetColor(p,a)                     (p)->lpVtbl->GetColor(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMFace2_QueryInterface(p,a,b)             (p)->QueryInterface(a,b)
+#define IDirect3DRMFace2_AddRef(p)                         (p)->AddRef()
+#define IDirect3DRMFace2_Release(p)                        (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMFace2_Clone(p,a,b,c)                    (p)->Clone(a,b,c)
+#define IDirect3DRMFace2_AddDestroyCallback(p,a,b)         (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMFace2_DeleteDestroyCallback(p,a,b)      (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMFace2_SetAppData(p,a)                   (p)->SetAppData(a)
+#define IDirect3DRMFace2_GetAppData(p)                     (p)->GetAppData()
+#define IDirect3DRMFace2_SetName(p,a)                      (p)->SetName(a)
+#define IDirect3DRMFace2_GetName(p,a,b)                    (p)->GetName(a,b)
+#define IDirect3DRMFace2_GetClassName(p,a,b)               (p)->GetClassName(a,b)
+/*** IDirect3DRMFace methods ***/
+#define IDirect3DRMFace2_AddVertex(p,a,b,c)                (p)->AddVertex(a,b,c)
+#define IDirect3DRMFace2_AddVertexAndNormalIndexed(p,a,b)  (p)->AddVertexAndNormalIndexed(a,b)
+#define IDirect3DRMFace2_SetColorRGB(p,a,b,c)              (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMFace2_SetColor(p,a)                     (p)->SetColor(a)
+#define IDirect3DRMFace2_SetTexture(p,a)                   (p)->SetTexture(a)
+#define IDirect3DRMFace2_SetTextureCoordinates(p,a,b,c)    (p)->SetTextureCoordinates(a,b,c)
+#define IDirect3DRMFace2_SetMaterial(p,a)                  (p)->SetMaterial(a)
+#define IDirect3DRMFace2_SetTextureTopology(p,a,b)         (p)->SetTextureTopology(a,b)
+#define IDirect3DRMFace2_GetVertex(p,a,b,c)                (p)->GetVertex(a,b,c)
+#define IDirect3DRMFace2_GetVertices(p,a,b,c)              (p)->GetVertices(a,b,c)
+#define IDirect3DRMFace2_GetTextureCoordinates(p,a,b,c)    (p)->GetTextureCoordinates(a,b,c)
+#define IDirect3DRMFace2_GetTextureTopology(p,a,b)         (p)->GetTextureTopology(a,b)
+#define IDirect3DRMFace2_GetNormal(p,a)                    (p)->GetNormal(a)
+#define IDirect3DRMFace2_GetTexture(p,a)                   (p)->GetTexture(a)
+#define IDirect3DRMFace2_GetVertexCount(p)                 (p)->GetVertexCount()
+#define IDirect3DRMFace2_GetVertexIndex(p,a)               (p)->GetVertexIndex(a)
+#define IDirect3DRMFace2_GetTextureCoordinateIndex(p,a)    (p)->GetTextureCoordinateIndex(a)
+#define IDirect3DRMFace2_GetColor(p,a)                     (p)->GetColor(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMMeshBuilder interface
+ */
+#define INTERFACE IDirect3DRMMeshBuilder
+DECLARE_INTERFACE_(IDirect3DRMMeshBuilder,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMMeshBuilder methods ***/
+    STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID pArg) PURE;
+    STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE;
+    STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE;
+    STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE;
+    STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE;
+    STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE;
+    STDMETHOD(GenerateNormals)(THIS) PURE;
+    STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE;
+    STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE;
+    STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE;
+    STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE;
+    STDMETHOD(AddFaces)(THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, DWORD *data,
+        LPDIRECT3DRMFACEARRAY*) PURE;
+    STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE;
+    STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
+    STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
+    STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
+    STDMETHOD(SetPerspective)(THIS_ BOOL) PURE;
+    STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE;
+    STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE;
+    STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE;
+    STDMETHOD(GetVertices)(THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals,
+        DWORD *face_data_size, DWORD *face_data) PURE;
+    STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE;
+    STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE;
+    STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE;
+    STDMETHOD_(BOOL, GetPerspective)(THIS) PURE;
+    STDMETHOD_(int, GetFaceCount)(THIS) PURE;
+    STDMETHOD_(int, GetVertexCount)(THIS) PURE;
+    STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE;
+    STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMMeshBuilder_QueryInterface(p,a,b)             (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMMeshBuilder_AddRef(p)                         (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMMeshBuilder_Release(p)                        (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMeshBuilder_Clone(p,a,b,c)                    (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMMeshBuilder_AddDestroyCallback(p,a,b)         (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMMeshBuilder_DeleteDestroyCallback(p,a,b)      (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMMeshBuilder_SetAppData(p,a)                   (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMMeshBuilder_GetAppData(p)                     (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMMeshBuilder_SetName(p,a)                      (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMMeshBuilder_GetName(p,a,b)                    (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMMeshBuilder_GetClassName(p,a,b)               (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMMeshBuilder methods ***/
+#define IDirect3DRMMeshBuilder_Load(p,a,b,c,d,e)                 (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DRMMeshBuilder_Save(p,a,b,c)                     (p)->lpVtbl->Save(p,a,b,c)
+#define IDirect3DRMMeshBuilder_Scale(p,a,b,c)                    (p)->lpVtbl->Scale(p,a,b,c)
+#define IDirect3DRMMeshBuilder_Translate(p,a,b,c)                (p)->lpVtbl->Translate(p,a)
+#define IDirect3DRMMeshBuilder_SetColorSource(p,a)               (p)->lpVtbl->SetColorSource(p,a,b,c)
+#define IDirect3DRMMeshBuilder_GetBox(p,a)                       (p)->lpVtbl->GetBox(p,a)
+#define IDirect3DRMMeshBuilder_GenerateNormals(p)                (p)->lpVtbl->GenerateNormals(p)
+#define IDirect3DRMMeshBuilder_GetColorSource(p)                 (p)->lpVtbl->GetColorSource(p)
+#define IDirect3DRMMeshBuilder_AddMesh(p,a)                      (p)->lpVtbl->AddMesh(p,a)
+#define IDirect3DRMMeshBuilder_AddMeshBuilder(p,a)               (p)->lpVtbl->AddMeshBuilder(p,a)
+#define IDirect3DRMMeshBuilder_AddFrame(p,a)                     (p)->lpVtbl->AddFrame(p,a)
+#define IDirect3DRMMeshBuilder_AddFace(p,a)                      (p)->lpVtbl->AddFace(p,a)
+#define IDirect3DRMMeshBuilder_AddFaces(p,a,b,c,d,e,f)           (p)->lpVtbl->AddFaces(p,a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder_ReserveSpace(p,a,b,c)             (p)->lpVtbl->ReserveSpace(p,a,b,c)
+#define IDirect3DRMMeshBuilder_SetColorRGB(p,a,b,c)              (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMMeshBuilder_SetColor(p,a)                     (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMMeshBuilder_SetTexture(p,a)                   (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMMeshBuilder_SetMateria(p,a)                   (p)->lpVtbl->SetMateria(p,a)
+#define IDirect3DRMMeshBuilder_SetTextureTopology(p,a,b)         (p)->lpVtbl->SetTextureTopology(p,a,b)
+#define IDirect3DRMMeshBuilder_SetQuality(p,a)                   (p)->lpVtbl->SetQuality(p,a)
+#define IDirect3DRMMeshBuilder_SetPerspective(p,a)               (p)->lpVtbl->SetPerspective(p,a)
+#define IDirect3DRMMeshBuilder_SetVertex(p,a,b,c,d)              (p)->lpVtbl->SetVertex(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder_SetNormal(p,a,b,c,d)              (p)->lpVtbl->SetNormal(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder_SetTextureCoordinates(p,a,b,c)    (p)->lpVtbl->SetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMMeshBuilder_SetVertexColor(p,a,b)             (p)->lpVtbl->SetVertexColor(p,a,b)
+#define IDirect3DRMMeshBuilder_SetVertexColorRGB(p,a,b,c,d)      (p)->lpVtbl->SetVertexColorRGB(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder_GetFaces(p,a)                     (p)->lpVtbl->GetFaces(p,a)
+#define IDirect3DRMMeshBuilder_GetVertices(p,a,b,c,d,e,f)        (p)->lpVtbl->GetVertices(p,a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder_GetTextureCoordinates(p,a,b,c)    (p)->lpVtbl->GetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMMeshBuilder_AddVertex(p,a,b,c)                (p)->lpVtbl->AddVertex(p,a,b,c)
+#define IDirect3DRMMeshBuilder_AddNormal(p,a,b,c)                (p)->lpVtbl->AddNormal(p,a,b,c)
+#define IDirect3DRMMeshBuilder_CreateFace(p,a)                   (p)->lpVtbl->CreateFace(p,a)
+#define IDirect3DRMMeshBuilder_GetQuality(p)                     (p)->lpVtbl->GetQuality(p)
+#define IDirect3DRMMeshBuilder_GetPerspective(p)                 (p)->lpVtbl->GetPerspective(p)
+#define IDirect3DRMMeshBuilder_GetFaceCount(p)                   (p)->lpVtbl->GetFaceCount(p)
+#define IDirect3DRMMeshBuilder_GetVertexCount(p)                 (p)->lpVtbl->GetVertexCount(p)
+#define IDirect3DRMMeshBuilder_GetVertexColor(p,a)               (p)->lpVtbl->GetVertexColor(p,a)
+#define IDirect3DRMMeshBuilder_CreateMesh(p,a)                   (p)->lpVtbl->CreateMesh(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMMeshBuilder_QueryInterface(p,a,b)             (p)->QueryInterface(a,b)
+#define IDirect3DRMMeshBuilder_AddRef(p)                         (p)->AddRef()
+#define IDirect3DRMMeshBuilder_Release(p)                        (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMeshBuilder_Clone(p,a,b,c)                    (p)->Clone(a,b,c)
+#define IDirect3DRMMeshBuilder_AddDestroyCallback(p,a,b)         (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMMeshBuilder_DeleteDestroyCallback(p,a,b)      (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMMeshBuilder_SetAppData(p,a)                   (p)->SetAppData(a)
+#define IDirect3DRMMeshBuilder_GetAppData(p)                     (p)->GetAppData()
+#define IDirect3DRMMeshBuilder_SetName(p,a)                      (p)->SetName(a)
+#define IDirect3DRMMeshBuilder_GetName(p,a,b)                    (p)->GetName(a,b)
+#define IDirect3DRMMeshBuilder_GetClassName(p,a,b)               (p)->GetClassName(a,b)
+/*** IDirect3DRMMeshBuilder methods ***/
+#define IDirect3DRMMeshBuilder_Load(p,a,b,c,d,e)                 (p)->Load(a,b,c,d,e)
+#define IDirect3DRMMeshBuilder_Save(p,a,b,c)                     (p)->Save(a,b,c)
+#define IDirect3DRMMeshBuilder_Scale(p,a,b,c)                    (p)->Scale(a,b,c)
+#define IDirect3DRMMeshBuilder_Translate(p,a,b,c)                (p)->Translate(a)
+#define IDirect3DRMMeshBuilder_SetColorSource(p,a)               (p)->SetColorSource(a,b,c)
+#define IDirect3DRMMeshBuilder_GetBox(p,a)                       (p)->GetBox(a)
+#define IDirect3DRMMeshBuilder_GenerateNormals(p)                (p)->GenerateNormals()
+#define IDirect3DRMMeshBuilder_GetColorSource(p)                 (p)->GetColorSource()
+#define IDirect3DRMMeshBuilder_AddMesh(p,a)                      (p)-->AddMesh(a)
+#define IDirect3DRMMeshBuilder_AddMeshBuilder(p,a)               (p)->AddMeshBuilder(a)
+#define IDirect3DRMMeshBuilder_AddFrame(p,a)                     (p)->AddFrame(a)
+#define IDirect3DRMMeshBuilder_AddFace(p,a)                      (p)->AddFace(a)
+#define IDirect3DRMMeshBuilder_AddFaces(p,a,b,c,d,e,f)           (p)->AddFaces(a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder_ReserveSpace(p,a,b,c)             (p)->ReserveSpace(a,b,c)
+#define IDirect3DRMMeshBuilder_SetColorRGB(p,a,b,c)              (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMMeshBuilder_SetColor(p,a)                     (p)->SetColor(a)
+#define IDirect3DRMMeshBuilder_SetTexture(p,a)                   (p)->SetTexture(a)
+#define IDirect3DRMMeshBuilder_SetMateria(p,a)                   (p)->SetMateria(a)
+#define IDirect3DRMMeshBuilder_SetTextureTopology(p,a,b)         (p)->SetTextureTopology(a,b)
+#define IDirect3DRMMeshBuilder_SetQuality(p,a)                   (p)->SetQuality(a)
+#define IDirect3DRMMeshBuilder_SetPerspective(p,a)               (p)->SetPerspective(a)
+#define IDirect3DRMMeshBuilder_SetVertex(p,a,b,c,d)              (p)->SetVertex(a,b,c,d)
+#define IDirect3DRMMeshBuilder_SetNormal(p,a,b,c,d)              (p)->SetNormal(a,b,c,d)
+#define IDirect3DRMMeshBuilder_SetTextureCoordinates(p,a,b,c)    (p)->SetTextureCoordinates(a,b,c)
+#define IDirect3DRMMeshBuilder_SetVertexColor(p,a,b)             (p)->SetVertexColor(a,b)
+#define IDirect3DRMMeshBuilder_SetVertexColorRGB(p,a,b,c,d)      (p)->SetVertexColorRGB(a,b,c,d)
+#define IDirect3DRMMeshBuilder_GetFaces(p,a)                     (p)->GetFaces(a)
+#define IDirect3DRMMeshBuilder_GetVertices(p,a,b,c,d,e,f)        (p)->GetVertices(a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder_GetTextureCoordinates(p,a,b,c)    (p)->GetTextureCoordinates(a,b,c)
+#define IDirect3DRMMeshBuilder_AddVertex(p,a,b,c)                (p)->AddVertex(a,b,c)
+#define IDirect3DRMMeshBuilder_AddNormal(p,a,b,c)                (p)->AddNormal(a,b,c)
+#define IDirect3DRMMeshBuilder_CreateFace(p,a)                   (p)->CreateFace(a)
+#define IDirect3DRMMeshBuilder_GetQuality(p)                     (p)->GetQuality()
+#define IDirect3DRMMeshBuilder_GetPerspective(p)                 (p)->GetPerspective()
+#define IDirect3DRMMeshBuilder_GetFaceCount(p)                   (p)->GetFaceCount()
+#define IDirect3DRMMeshBuilder_GetVertexCount(p)                 (p)->GetVertexCount()
+#define IDirect3DRMMeshBuilder_GetVertexColor(p,a)               (p)->GetVertexColor(a)
+#define IDirect3DRMMeshBuilder_CreateMesh(p,a)                   (p)->CreateMesh(a)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMMeshBuilder2 interface
+ */
+#define INTERFACE IDirect3DRMMeshBuilder2
+DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2,IDirect3DRMMeshBuilder)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMMeshBuilder methods ***/
+    STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURECALLBACK, LPVOID pArg) PURE;
+    STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE;
+    STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE;
+    STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE;
+    STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE;
+    STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE;
+    STDMETHOD(GenerateNormals)(THIS) PURE;
+    STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE;
+    STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE;
+    STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE;
+    STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME) PURE;
+    STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE;
+    STDMETHOD(AddFaces)(THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, DWORD *data,
+        LPDIRECT3DRMFACEARRAY*) PURE;
+    STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE) PURE;
+    STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
+    STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
+    STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
+    STDMETHOD(SetPerspective)(THIS_ BOOL) PURE;
+    STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE;
+    STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE;
+    STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE;
+    STDMETHOD(GetVertices)(THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals,
+        DWORD *face_data_size, DWORD *face_data) PURE;
+    STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE;
+    STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE*) PURE;
+    STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE;
+    STDMETHOD_(BOOL, GetPerspective)(THIS) PURE;
+    STDMETHOD_(int, GetFaceCount)(THIS) PURE;
+    STDMETHOD_(int, GetVertexCount)(THIS) PURE;
+    STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE;
+    STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE;
+    /*** IDirect3DRMMeshBuilder2 methods ***/
+    STDMETHOD(GenerateNormals2)(THIS_ D3DVALUE crease, DWORD flags) PURE;
+    STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE*) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMMeshBuilder2_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMMeshBuilder2_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMMeshBuilder2_Release(p)                       (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMeshBuilder2_Clone(p,a,b,c)                   (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_AddDestroyCallback(p,a,b)        (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMMeshBuilder2_DeleteDestroyCallback(p,a,b)     (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMMeshBuilder2_SetAppData(p,a)                  (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMMeshBuilder2_GetAppData(p)                    (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMMeshBuilder2_SetName(p,a)                     (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMMeshBuilder2_GetName(p,a,b)                   (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMMeshBuilder2_GetClassName(p,a,b)              (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMMeshBuilder methods ***/
+#define IDirect3DRMMeshBuilder2_Load(p,a,b,c,d,e)                (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DRMMeshBuilder2_Save(p,a,b,c)                    (p)->lpVtbl->Save(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_Scale(p,a,b,c)                   (p)->lpVtbl->Scale(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_Translate(p,a,b,c)               (p)->lpVtbl->Translate(p,a)
+#define IDirect3DRMMeshBuilder2_SetColorSource(p,a)              (p)->lpVtbl->SetColorSource(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_GetBox(p,a)                      (p)->lpVtbl->GetBox(p,a)
+#define IDirect3DRMMeshBuilder2_GenerateNormals(p)               (p)->lpVtbl->GenerateNormals(p)
+#define IDirect3DRMMeshBuilder2_GetColorSource(p)                (p)->lpVtbl->GetColorSource(p)
+#define IDirect3DRMMeshBuilder2_AddMesh(p,a)                     (p)->lpVtbl->AddMesh(p,a)
+#define IDirect3DRMMeshBuilder2_AddMeshBuilder(p,a)              (p)->lpVtbl->AddMeshBuilder(p,a)
+#define IDirect3DRMMeshBuilder2_AddFrame(p,a)                    (p)->lpVtbl->AddFrame(p,a)
+#define IDirect3DRMMeshBuilder2_AddFace(p,a)                     (p)->lpVtbl->AddFace(p,a)
+#define IDirect3DRMMeshBuilder2_AddFaces(p,a,b,c,d,e,f)          (p)->lpVtbl->AddFaces(p,a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder2_ReserveSpace(p,a,b,c)            (p)->lpVtbl->ReserveSpace(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_SetColorRGB(p,a,b,c)             (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_SetColor(p,a)                    (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMMeshBuilder2_SetTexture(p,a)                  (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMMeshBuilder2_SetMateria(p,a)                  (p)->lpVtbl->SetMateria(p,a)
+#define IDirect3DRMMeshBuilder2_SetTextureTopology(p,a,b)        (p)->lpVtbl->SetTextureTopology(p,a,b)
+#define IDirect3DRMMeshBuilder2_SetQuality(p,a)                  (p)->lpVtbl->SetQuality(p,a)
+#define IDirect3DRMMeshBuilder2_SetPerspective(p,a)              (p)->lpVtbl->SetPerspective(p,a)
+#define IDirect3DRMMeshBuilder2_SetVertex(p,a,b,c,d)             (p)->lpVtbl->SetVertex(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder2_SetNormal(p,a,b,c,d)             (p)->lpVtbl->SetNormal(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder2_SetTextureCoordinates(p,a,b,c)   (p)->lpVtbl->SetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_SetVertexColor(p,a,b)            (p)->lpVtbl->SetVertexColor(p,a,b)
+#define IDirect3DRMMeshBuilder2_SetVertexColorRGB(p,a,b,c,d)     (p)->lpVtbl->SetVertexColorRGB(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder2_GetFaces(p,a)                    (p)->lpVtbl->GetFaces(p,a)
+#define IDirect3DRMMeshBuilder2_GetVertices(p,a,b,c,d,e,f)       (p)->lpVtbl->GetVertices(p,a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder2_GetTextureCoordinates(p,a,b,c)   (p)->lpVtbl->GetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_AddVertex(p,a,b,c)               (p)->lpVtbl->AddVertex(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_AddNormal(p,a,b,c)               (p)->lpVtbl->AddNormal(p,a,b,c)
+#define IDirect3DRMMeshBuilder2_CreateFace(p,a)                  (p)->lpVtbl->CreateFace(p,a)
+#define IDirect3DRMMeshBuilder2_GetQuality(p)                    (p)->lpVtbl->GetQuality(p)
+#define IDirect3DRMMeshBuilder2_GetPerspective(p)                (p)->lpVtbl->GetPerspective(p)
+#define IDirect3DRMMeshBuilder2_GetFaceCount(p)                  (p)->lpVtbl->GetFaceCount(p)
+#define IDirect3DRMMeshBuilder2_GetVertexCount(p)                (p)->lpVtbl->GetVertexCount(p)
+#define IDirect3DRMMeshBuilder2_GetVertexColor(p,a)              (p)->lpVtbl->GetVertexColor(p,a)
+#define IDirect3DRMMeshBuilder2_CreateMesh(p,a)                  (p)->lpVtbl->CreateMesh(p,a)
+/*** IDirect3DRMMeshBuilder2 methods ***/
+#define IDirect3DRMMeshBuilder2_GenerateNormals2(p,a,b)          (p)->lpVtbl->GenerateNormals2(p,a,b)
+#define IDirect3DRMMeshBuilder2_GetFace(p,a,b)                   (p)->lpVtbl->GetFace(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMMeshBuilder2_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
+#define IDirect3DRMMeshBuilder2_AddRef(p)                        (p)->AddRef()
+#define IDirect3DRMMeshBuilder2_Release(p)                       (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMeshBuilder2_Clone(p,a,b,c)                   (p)->Clone(a,b,c)
+#define IDirect3DRMMeshBuilder2_AddDestroyCallback(p,a,b)        (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMMeshBuilder2_DeleteDestroyCallback(p,a,b)     (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMMeshBuilder2_SetAppData(p,a)                  (p)->SetAppData(a)
+#define IDirect3DRMMeshBuilder2_GetAppData(p)                    (p)->GetAppData()
+#define IDirect3DRMMeshBuilder2_SetName(p,a)                     (p)->SetName(a)
+#define IDirect3DRMMeshBuilder2_GetName(p,a,b)                   (p)->GetName(a,b)
+#define IDirect3DRMMeshBuilder2_GetClassName(p,a,b)              (p)->GetClassName(a,b)
+/*** IDirect3DRMMeshBuilder methods ***/
+#define IDirect3DRMMeshBuilder2_Load(p,a,b,c,d,e)                (p)->Load(a,b,c,d,e)
+#define IDirect3DRMMeshBuilder2_Save(p,a,b,c)                    (p)->Save(a,b,c)
+#define IDirect3DRMMeshBuilder2_Scale(p,a,b,c)                   (p)->Scale(a,b,c)
+#define IDirect3DRMMeshBuilder2_Translate(p,a,b,c)               (p)->Translate(a)
+#define IDirect3DRMMeshBuilder2_SetColorSource(p,a)              (p)->SetColorSource(a,b,c)
+#define IDirect3DRMMeshBuilder2_GetBox(p,a)                      (p)->GetBox(a)
+#define IDirect3DRMMeshBuilder2_GenerateNormals(p)               (p)->GenerateNormals()
+#define IDirect3DRMMeshBuilder2_GetColorSource(p)                (p)->GetColorSource()
+#define IDirect3DRMMeshBuilder2_AddMesh(p,a)                     (p)-->AddMesh(a)
+#define IDirect3DRMMeshBuilder2_AddMeshBuilder(p,a)              (p)->AddMeshBuilder(a)
+#define IDirect3DRMMeshBuilder2_AddFrame(p,a)                    (p)->AddFrame(a)
+#define IDirect3DRMMeshBuilder2_AddFace(p,a)                     (p)->AddFace(a)
+#define IDirect3DRMMeshBuilder2_AddFaces(p,a,b,c,d,e,f)          (p)->AddFaces(a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder2_ReserveSpace(p,a,b,c)            (p)->ReserveSpace(a,b,c)
+#define IDirect3DRMMeshBuilder2_SetColorRGB(p,a,b,c)             (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMMeshBuilder2_SetColor(p,a)                    (p)->SetColor(a)
+#define IDirect3DRMMeshBuilder2_SetTexture(p,a)                  (p)->SetTexture(a)
+#define IDirect3DRMMeshBuilder2_SetMateria(p,a)                  (p)->SetMateria(a)
+#define IDirect3DRMMeshBuilder2_SetTextureTopology(p,a,b)        (p)->SetTextureTopology(a,b)
+#define IDirect3DRMMeshBuilder2_SetQuality(p,a)                  (p)->SetQuality(a)
+#define IDirect3DRMMeshBuilder2_SetPerspective(p,a)              (p)->SetPerspective(a)
+#define IDirect3DRMMeshBuilder2_SetVertex(p,a,b,c,d)             (p)->SetVertex(a,b,c,d)
+#define IDirect3DRMMeshBuilder2_SetNormal(p,a,b,c,d)             (p)->SetNormal(a,b,c,d)
+#define IDirect3DRMMeshBuilder2_SetTextureCoordinates(p,a,b,c)   (p)->SetTextureCoordinates(a,b,c)
+#define IDirect3DRMMeshBuilder2_SetVertexColor(p,a,b)            (p)->SetVertexColor(a,b)
+#define IDirect3DRMMeshBuilder2_SetVertexColorRGB(p,a,b,c,d)     (p)->SetVertexColorRGB(a,b,c,d)
+#define IDirect3DRMMeshBuilder2_GetFaces(p,a)                    (p)->GetFaces(a)
+#define IDirect3DRMMeshBuilder2_GetVertices(p,a,b,c,d,e,f)       (p)->GetVertices(a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder2_GetTextureCoordinates(p,a,b,c)   (p)->GetTextureCoordinates(a,b,c)
+#define IDirect3DRMMeshBuilder2_AddVertex(p,a,b,c)               (p)->AddVertex(a,b,c)
+#define IDirect3DRMMeshBuilder2_AddNormal(p,a,b,c)               (p)->AddNormal(a,b,c)
+#define IDirect3DRMMeshBuilder2_CreateFace(p,a)                  (p)->CreateFace(a)
+#define IDirect3DRMMeshBuilder2_GetQuality(p)                    (p)->GetQuality()
+#define IDirect3DRMMeshBuilder2_GetPerspective(p)                (p)->GetPerspective()
+#define IDirect3DRMMeshBuilder2_GetFaceCount(p)                  (p)->GetFaceCount()
+#define IDirect3DRMMeshBuilder2_GetVertexCount(p)                (p)->GetVertexCount()
+#define IDirect3DRMMeshBuilder2_GetVertexColor(p,a)              (p)->GetVertexColor(a)
+#define IDirect3DRMMeshBuilder2_CreateMesh(p,a)                  (p)->CreateMesh(a)
+/*** IDirect3DRMMeshBuilder2 methods ***/
+#define IDirect3DRMMeshBuilder2_GenerateNormals2(p,a,b)          (p)->GenerateNormals2(a,b)
+#define IDirect3DRMMeshBuilder2_GetFace(p,a,b)                   (p)->GetFace(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirect3DRMMeshBuilder3 interface
+ */
+#define INTERFACE IDirect3DRMMeshBuilder3
+DECLARE_INTERFACE_(IDirect3DRMMeshBuilder3,IDirect3DRMVisual)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirect3DRMObject methods ***/
+    STDMETHOD(Clone)(THIS_ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
+    STDMETHOD(AddDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(DeleteDestroyCallback)(THIS_ D3DRMOBJECTCALLBACK, LPVOID argument) PURE;
+    STDMETHOD(SetAppData)(THIS_ DWORD data) PURE;
+    STDMETHOD_(DWORD, GetAppData)(THIS) PURE;
+    STDMETHOD(SetName)(THIS_ LPCSTR) PURE;
+    STDMETHOD(GetName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    STDMETHOD(GetClassName)(THIS_ LPDWORD lpdwSize, LPSTR lpName) PURE;
+    /*** IDirect3DRMMeshBuilder3 methods ***/
+    STDMETHOD(Load)(THIS_ LPVOID filename, LPVOID name, D3DRMLOADOPTIONS loadflags, D3DRMLOADTEXTURE3CALLBACK, LPVOID pArg) PURE;
+    STDMETHOD(Save)(THIS_ const char *filename, D3DRMXOFFORMAT, D3DRMSAVEOPTIONS save) PURE;
+    STDMETHOD(Scale)(THIS_ D3DVALUE sx, D3DVALUE sy, D3DVALUE sz) PURE;
+    STDMETHOD(Translate)(THIS_ D3DVALUE tx, D3DVALUE ty, D3DVALUE tz) PURE;
+    STDMETHOD(SetColorSource)(THIS_ D3DRMCOLORSOURCE) PURE;
+    STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE;
+    STDMETHOD(GenerateNormals)(THIS_ D3DVALUE crease, DWORD flags) PURE;
+    STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE;
+    STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE;
+    STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3) PURE;
+    STDMETHOD(AddFrame)(THIS_ LPDIRECT3DRMFRAME3) PURE;
+    STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE2) PURE;
+    STDMETHOD(AddFaces)(THIS_ DWORD vcount, D3DVECTOR *vertices, DWORD ncount, D3DVECTOR *normals, DWORD *data,
+        LPDIRECT3DRMFACEARRAY*) PURE;
+    STDMETHOD(ReserveSpace)(THIS_ DWORD vertex_Count, DWORD normal_count, DWORD face_count) PURE;
+    STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
+    STDMETHOD(SetTexture)(THIS_ LPDIRECT3DRMTEXTURE3) PURE;
+    STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL2) PURE;
+    STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
+    STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
+    STDMETHOD(SetPerspective)(THIS_ BOOL) PURE;
+    STDMETHOD(SetVertex)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetNormal)(THIS_ DWORD index, D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(SetTextureCoordinates)(THIS_ DWORD index, D3DVALUE u, D3DVALUE v) PURE;
+    STDMETHOD(SetVertexColor)(THIS_ DWORD index, D3DCOLOR) PURE;
+    STDMETHOD(SetVertexColorRGB)(THIS_ DWORD index, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
+    STDMETHOD(GetFaces)(THIS_ LPDIRECT3DRMFACEARRAY*) PURE;
+    STDMETHOD(GetGeometry)(THIS_ DWORD *vcount, D3DVECTOR *vertices, DWORD *ncount, D3DVECTOR *normals,
+        DWORD *face_data_size, DWORD *face_data) PURE;
+    STDMETHOD(GetTextureCoordinates)(THIS_ DWORD index, D3DVALUE *u, D3DVALUE *v) PURE;
+    STDMETHOD_(int, AddVertex)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD_(int, AddNormal)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z) PURE;
+    STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE2*) PURE;
+    STDMETHOD_(D3DRMRENDERQUALITY, GetQuality)(THIS) PURE;
+    STDMETHOD_(BOOL, GetPerspective)(THIS) PURE;
+    STDMETHOD_(int, GetFaceCount)(THIS) PURE;
+    STDMETHOD_(int, GetVertexCount)(THIS) PURE;
+    STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE;
+    STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE;
+    STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE2 *) PURE;
+    STDMETHOD(GetVertex)(THIS_ DWORD index, LPD3DVECTOR pVector) PURE;
+    STDMETHOD(GetNormal)(THIS_ DWORD index, LPD3DVECTOR pVector) PURE;
+    STDMETHOD(DeleteVertices)(THIS_ DWORD IndexFirst, DWORD count) PURE;
+    STDMETHOD(DeleteNormals)(THIS_ DWORD IndexFirst, DWORD count) PURE;
+    STDMETHOD(DeleteFace)(THIS_ LPDIRECT3DRMFACE2) PURE;
+    STDMETHOD(Empty)(THIS_ DWORD flags) PURE;
+    STDMETHOD(Optimize)(THIS_ DWORD flags) PURE;
+    STDMETHOD(AddFacesIndexed)(THIS_ DWORD flags, DWORD *pvIndices, DWORD *pIndexFirst, DWORD *pCount) PURE;
+    STDMETHOD(CreateSubMesh)(THIS_ LPUNKNOWN *) PURE;
+    STDMETHOD(GetParentMesh)(THIS_ DWORD, LPUNKNOWN *) PURE;
+    STDMETHOD(GetSubMeshes)(THIS_ LPDWORD pCount, LPUNKNOWN *) PURE;
+    STDMETHOD(DeleteSubMesh)(THIS_ LPUNKNOWN) PURE;
+    STDMETHOD(Enable)(THIS_ DWORD) PURE;
+    STDMETHOD(GetEnable)(THIS_ DWORD *) PURE;
+    STDMETHOD(AddTriangles)(THIS_ DWORD flags, DWORD format, DWORD VertexCount, LPVOID pvData) PURE;
+    STDMETHOD(SetVertices)(THIS_ DWORD IndexFirst, DWORD count, LPD3DVECTOR) PURE;
+    STDMETHOD(GetVertices)(THIS_ DWORD IndexFirst, LPDWORD pCount, LPD3DVECTOR) PURE;
+    STDMETHOD(SetNormals)(THIS_ DWORD IndexFirst, DWORD count, LPD3DVECTOR) PURE;
+    STDMETHOD(GetNormals)(THIS_ DWORD IndexFirst, LPDWORD pCount, LPD3DVECTOR) PURE;
+    STDMETHOD_(int, GetNormalCount)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirect3DRMMeshBuilder3_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DRMMeshBuilder3_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define IDirect3DRMMeshBuilder3_Release(p)                       (p)->lpVtbl->Release(p)
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMeshBuilder3_Clone(p,a,b,c)                   (p)->lpVtbl->Clone(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_AddDestroyCallback(p,a,b)        (p)->lpVtbl->AddDestroyCallback(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteDestroyCallback(p,a,b)     (p)->lpVtbl->DeleteDestroyCallback(p,a,b)
+#define IDirect3DRMMeshBuilder3_SetAppData(p,a)                  (p)->lpVtbl->SetAppData(p,a)
+#define IDirect3DRMMeshBuilder3_GetAppData(p)                    (p)->lpVtbl->GetAppData(p)
+#define IDirect3DRMMeshBuilder3_SetName(p,a)                     (p)->lpVtbl->SetName(p,a)
+#define IDirect3DRMMeshBuilder3_GetName(p,a,b)                   (p)->lpVtbl->GetName(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetClassName(p,a,b)              (p)->lpVtbl->GetClassName(p,a,b)
+/*** IDirect3DRMMeshBuilder3 methods ***/
+#define IDirect3DRMMeshBuilder3_Load(p,a,b,c,d,e)                (p)->lpVtbl->Load(p,a,b,c,d,e)
+#define IDirect3DRMMeshBuilder3_Save(p,a,b,c)                    (p)->lpVtbl->Save(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_Scale(p,a,b,c)                   (p)->lpVtbl->Scale(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_Translate(p,a,b,c)               (p)->lpVtbl->Translate(p,a)
+#define IDirect3DRMMeshBuilder3_SetColorSource(p,a)              (p)->lpVtbl->SetColorSource(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_GetBox(p,a)                      (p)->lpVtbl->GetBox(p,a)
+#define IDirect3DRMMeshBuilder3_GenerateNormals(p,a,b)           (p)->lpVtbl->GenerateNormals(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetColorSource(p)                (p)->lpVtbl->GetColorSource(p)
+#define IDirect3DRMMeshBuilder3_AddMesh(p,a)                     (p)->lpVtbl->AddMesh(p,a)
+#define IDirect3DRMMeshBuilder3_AddMeshBuilder(p,a)              (p)->lpVtbl->AddMeshBuilder(p,a)
+#define IDirect3DRMMeshBuilder3_AddFrame(p,a)                    (p)->lpVtbl->AddFrame(p,a)
+#define IDirect3DRMMeshBuilder3_AddFace(p,a)                     (p)->lpVtbl->AddFace(p,a)
+#define IDirect3DRMMeshBuilder3_AddFaces(p,a,b,c,d,e,f)          (p)->lpVtbl->AddFaces(p,a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder3_ReserveSpace(p,a,b,c)            (p)->lpVtbl->ReserveSpace(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_SetColorRGB(p,a,b,c)             (p)->lpVtbl->SetColorRGB(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_SetColor(p,a)                    (p)->lpVtbl->SetColor(p,a)
+#define IDirect3DRMMeshBuilder3_SetTexture(p,a)                  (p)->lpVtbl->SetTexture(p,a)
+#define IDirect3DRMMeshBuilder3_SetMateria(p,a)                  (p)->lpVtbl->SetMateria(p,a)
+#define IDirect3DRMMeshBuilder3_SetTextureTopology(p,a,b)        (p)->lpVtbl->SetTextureTopology(p,a,b)
+#define IDirect3DRMMeshBuilder3_SetQuality(p,a)                  (p)->lpVtbl->SetQuality(p,a)
+#define IDirect3DRMMeshBuilder3_SetPerspective(p,a)              (p)->lpVtbl->SetPerspective(p,a)
+#define IDirect3DRMMeshBuilder3_SetVertex(p,a,b,c,d)             (p)->lpVtbl->SetVertex(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder3_SetNormal(p,a,b,c,d)             (p)->lpVtbl->SetNormal(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder3_SetTextureCoordinates(p,a,b,c)   (p)->lpVtbl->SetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_SetVertexColor(p,a,b)            (p)->lpVtbl->SetVertexColor(p,a,b)
+#define IDirect3DRMMeshBuilder3_SetVertexColorRGB(p,a,b,c,d)     (p)->lpVtbl->SetVertexColorRGB(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder3_GetFaces(p,a)                    (p)->lpVtbl->GetFaces(p,a)
+#define IDirect3DRMMeshBuilder3_GetGeometry(p,a,b,c,d,e,f)       (p)->lpVtbl->GetGeometry(p,a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder3_GetTextureCoordinates(p,a,b,c)   (p)->lpVtbl->GetTextureCoordinates(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_AddVertex(p,a,b,c)               (p)->lpVtbl->AddVertex(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_AddNormal(p,a,b,c)               (p)->lpVtbl->AddNormal(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_CreateFace(p,a)                  (p)->lpVtbl->CreateFace(p,a)
+#define IDirect3DRMMeshBuilder3_GetQuality(p)                    (p)->lpVtbl->GetQuality(p)
+#define IDirect3DRMMeshBuilder3_GetPerspective(p)                (p)->lpVtbl->GetPerspective(p)
+#define IDirect3DRMMeshBuilder3_GetFaceCount(p)                  (p)->lpVtbl->GetFaceCount(p)
+#define IDirect3DRMMeshBuilder3_GetVertexCount(p)                (p)->lpVtbl->GetVertexCount(p)
+#define IDirect3DRMMeshBuilder3_GetVertexColor(p,a)              (p)->lpVtbl->GetVertexColor(p,a)
+#define IDirect3DRMMeshBuilder3_CreateMesh(p,a)                  (p)->lpVtbl->CreateMesh(p,a)
+#define IDirect3DRMMeshBuilder3_GetFace(p,a,b)                   (p)->lpVtbl->GetFace(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetVertex(p,a,b)                 (p)->lpVtbl->GetVertex(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetNormal(p,a,b)                 (p)->lpVtbl->GetNormal(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteVertices(p,a,b)            (p)->lpVtbl->DeleteVertices(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteNormals(p,a,b)             (p)->lpVtbl->DeleteNormals(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteFace(p,a)                  (p)->lpVtbl->DeleteFace(p,a)
+#define IDirect3DRMMeshBuilder3_Empty(p,a)                       (p)->lpVtbl->Empty(p,a)
+#define IDirect3DRMMeshBuilder3_Optimize(p,a)                    (p)->lpVtbl->Optimize(p,a)
+#define IDirect3DRMMeshBuilder3_AddFacesIndexed(p,a,b,c,d)       (p)->lpVtbl->AddFacesIndexed(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder3_CreateSubMesh(p,a)               (p)->lpVtbl->CreateSubMesh(p,a)
+#define IDirect3DRMMeshBuilder3_GetParentMesh(p,a,b)             (p)->lpVtbl->GetParentMesh(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetSubMeshes(p,a,b)              (p)->lpVtbl->GetSubMeshes(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteSubMesh(p,a)               (p)->lpVtbl->DeleteSubMesh(p,a)
+#define IDirect3DRMMeshBuilder3_Enable(p,a)                      (p)->lpVtbl->Enable(p,a)
+#define IDirect3DRMMeshBuilder3_AddTriangles(p,a,b,c,d)          (p)->lpVtbl->AddTriangles(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder3_SetVertices(p,a,b,c)             (p)->lpVtbl->SetVertices(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_GetVertices(p,a,b,c)             (p)->lpVtbl->GetVertices(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_SetNormals(p,a,b,c)              (p)->lpVtbl->SetNormals(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_GetNormals(p,a,b,c)              (p)->lpVtbl->GetNormals(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_GetNormalCount(p)                (p)->lpVtbl->GetNormalCount(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirect3DRMMeshBuilder3_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
+#define IDirect3DRMMeshBuilder3_AddRef(p)                        (p)->AddRef()
+#define IDirect3DRMMeshBuilder3_Release(p)                       (p)->Release()
+/*** IDirect3DRMObject methods ***/
+#define IDirect3DRMMeshBuilder3_Clone(p,a,b,c)                   (p)->Clone(a,b,c)
+#define IDirect3DRMMeshBuilder3_AddDestroyCallback(p,a,b)        (p)->AddDestroyCallback(a,b)
+#define IDirect3DRMMeshBuilder3_DeleteDestroyCallback(p,a,b)     (p)->DeleteDestroyCallback(a,b)
+#define IDirect3DRMMeshBuilder3_SetAppData(p,a)                  (p)->SetAppData(a)
+#define IDirect3DRMMeshBuilder3_GetAppData(p)                    (p)->GetAppData()
+#define IDirect3DRMMeshBuilder3_SetName(p,a)                     (p)->SetName(a)
+#define IDirect3DRMMeshBuilder3_GetName(p,a,b)                   (p)->GetName(a,b)
+#define IDirect3DRMMeshBuilder3_GetClassName(p,a,b)              (p)->GetClassName(a,b)
+/*** IDirect3DRMMeshBuilder3 methods ***/
+#define IDirect3DRMMeshBuilder3_Load(p,a,b,c,d,e)                (p)->Load(a,b,c,d,e)
+#define IDirect3DRMMeshBuilder3_Save(p,a,b,c)                    (p)->Save(a,b,c)
+#define IDirect3DRMMeshBuilder3_Scale(p,a,b,c)                   (p)->Scale(a,b,c)
+#define IDirect3DRMMeshBuilder3_Translate(p,a,b,c)               (p)->Translate(a)
+#define IDirect3DRMMeshBuilder3_SetColorSource(p,a)              (p)->SetColorSource(a,b,c)
+#define IDirect3DRMMeshBuilder3_GetBox(p,a)                      (p)->GetBox(a)
+#define IDirect3DRMMeshBuilder3_GenerateNormals(p,a,b)           (p)->GenerateNormals(a,b)
+#define IDirect3DRMMeshBuilder3_GetColorSource(p)                (p)->GetColorSource()
+#define IDirect3DRMMeshBuilder3_AddMesh(p,a)                     (p)-->AddMesh(a)
+#define IDirect3DRMMeshBuilder3_AddMeshBuilder(p,a)              (p)->AddMeshBuilder(a)
+#define IDirect3DRMMeshBuilder3_AddFrame(p,a)                    (p)->AddFrame(a)
+#define IDirect3DRMMeshBuilder3_AddFace(p,a)                     (p)->AddFace(a)
+#define IDirect3DRMMeshBuilder3_AddFaces(p,a,b,c,d,e,f)          (p)->AddFaces(a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder3_ReserveSpace(p,a,b,c)            (p)->ReserveSpace(a,b,c)
+#define IDirect3DRMMeshBuilder3_SetColorRGB(p,a,b,c)             (p)->SetColorRGB(a,b,c)
+#define IDirect3DRMMeshBuilder3_SetColor(p,a)                    (p)->SetColor(a)
+#define IDirect3DRMMeshBuilder3_SetTexture(p,a)                  (p)->SetTexture(a)
+#define IDirect3DRMMeshBuilder3_SetMateria(p,a)                  (p)->SetMateria(a)
+#define IDirect3DRMMeshBuilder3_SetTextureTopology(p,a,b)        (p)->SetTextureTopology(a,b)
+#define IDirect3DRMMeshBuilder3_SetQuality(p,a)                  (p)->SetQuality(a)
+#define IDirect3DRMMeshBuilder3_SetPerspective(p,a)              (p)->SetPerspective(a)
+#define IDirect3DRMMeshBuilder3_SetVertex(p,a,b,c,d)             (p)->SetVertex(a,b,c,d)
+#define IDirect3DRMMeshBuilder3_SetNormal(p,a,b,c,d)             (p)->SetNormal(a,b,c,d)
+#define IDirect3DRMMeshBuilder3_SetTextureCoordinates(p,a,b,c)   (p)->SetTextureCoordinates(a,b,c)
+#define IDirect3DRMMeshBuilder3_SetVertexColor(p,a,b)            (p)->SetVertexColor(a,b)
+#define IDirect3DRMMeshBuilder3_SetVertexColorRGB(p,a,b,c,d)     (p)->SetVertexColorRGB(a,b,c,d)
+#define IDirect3DRMMeshBuilder3_GetFaces(p,a)                    (p)->GetFaces(a)
+#define IDirect3DRMMeshBuilder3_GetGeometry(p,a,b,c,d,e,f)       (p)->GetGeometry(a,b,c,d,e,f)
+#define IDirect3DRMMeshBuilder3_GetTextureCoordinates(p,a,b,c)   (p)->GetTextureCoordinates(a,b,c)
+#define IDirect3DRMMeshBuilder3_AddVertex(p,a,b,c)               (p)->AddVertex(a,b,c)
+#define IDirect3DRMMeshBuilder3_AddNormal(p,a,b,c)               (p)->AddNormal(a,b,c)
+#define IDirect3DRMMeshBuilder3_CreateFace(p,a)                  (p)->CreateFace(a)
+#define IDirect3DRMMeshBuilder3_GetQuality(p)                    (p)->GetQuality()
+#define IDirect3DRMMeshBuilder3_GetPerspective(p)                (p)->GetPerspective()
+#define IDirect3DRMMeshBuilder3_GetFaceCount(p)                  (p)->GetFaceCount()
+#define IDirect3DRMMeshBuilder3_GetVertexCount(p)                (p)->GetVertexCount()
+#define IDirect3DRMMeshBuilder3_GetVertexColor(p,a)              (p)->GetVertexColor(a)
+#define IDirect3DRMMeshBuilder3_CreateMesh(p,a)                  (p)->CreateMesh(a)
+#define IDirect3DRMMeshBuilder3_GetFace(p,a,b)                   (p)->GetFace(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetVertex(p,a,b)                 (p)->GetVertex(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetNormal(p,a,b)                 (p)->GetNormal(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteVertices(p,a,b)            (p)->DeleteVertices(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteNormals(p,a,b)             (p)->DeleteNormals(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteFace(p,a)                  (p)->DeleteFace(p,a)
+#define IDirect3DRMMeshBuilder3_Empty(p,a)                       (p)->Empty(p,a)
+#define IDirect3DRMMeshBuilder3_Optimize(p,a)                    (p)->Optimize(p,a)
+#define IDirect3DRMMeshBuilder3_AddFacesIndexed(p,a,b,c,d)       (p)->AddFacesIndexed(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder3_CreateSubMesh(p,a)               (p)->CreateSubMesh(p,a)
+#define IDirect3DRMMeshBuilder3_GetParentMesh(p,a,b)             (p)->GetParentMesh(p,a,b)
+#define IDirect3DRMMeshBuilder3_GetSubMeshes(p,a,b)              (p)->GetSubMeshes(p,a,b)
+#define IDirect3DRMMeshBuilder3_DeleteSubMesh(p,a)               (p)->DeleteSubMesh(p,a)
+#define IDirect3DRMMeshBuilder3_Enable(p,a)                      (p)->Enable(p,a)
+#define IDirect3DRMMeshBuilder3_AddTriangles(p,a,b,c,d)          (p)->AddTriangles(p,a,b,c,d)
+#define IDirect3DRMMeshBuilder3_SetVertices(p,a,b,c)             (p)->SetVertices(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_GetVertices(p,a,b,c)             (p)->GetVertices(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_SetNormals(p,a,b,c)              (p)->SetNormals(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_GetNormals(p,a,b,c)              (p)->GetNormals(p,a,b,c)
+#define IDirect3DRMMeshBuilder3_GetNormalCount(p)                (p)->GetNormalCount(p,a)
+#endif
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __D3DRMOBJ_H__ */
index e2e4a1a03b54cacc89f2c857480134c24b690fc0..2ac2cff8863d263fba6d7e34b652e406beb27964 100644 (file)
@@ -1,44 +1,48 @@
-/*==========================================================================;
+/*
+ * Copyright (C) 2000 Peter Hunnisett
  *
- *  Copyright (C) 1995-1998 Microsoft Corporation.  All Rights Reserved.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- *  File:   d3dtypes.h
- *  Content:    Direct3D types include file
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- ***************************************************************************/
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
 
-#ifndef _D3DTYPES_H_
-#define _D3DTYPES_H_
+/* FIXME: Need to add C++ code for certain structs for headers - this is going to be a problem
+          if WINE continues to only use C code  - I suppose that we could always inline in
+          the header file to get around that little problem... */
+/* FIXME: We need to implement versioning on everything directx 5 and up if these headers
+          are going to be generically useful for directx stuff */
 
-#include <windows.h>
+#ifndef __WINE_D3DTYPES_H
+#define __WINE_D3DTYPES_H
 
-#include <float.h>
-#include <ddraw.h>
+#include <_mingw_dxhelper.h>
 
-#ifndef DIRECT3D_VERSION
-#define DIRECT3D_VERSION         0x0600
+#ifndef __WINESRC__
+# include <windows.h>
 #endif
 
-#pragma pack(4)
-
-
-/* D3DVALUE is the fundamental Direct3D fractional data type */
+#include <float.h>
+#include <ddraw.h>
 
-#define D3DVALP(val, prec) ((float)(val))
-#define D3DVAL(val) ((float)(val))
-typedef float D3DVALUE, *LPD3DVALUE;
-#define D3DDivide(a, b)    (float)((double) (a) / (double) (b))
-#define D3DMultiply(a, b)    ((a) * (b))
+#define D3DVALP(val, prec)      ((float)(val))
+#define D3DVAL(val)             ((float)(val))
+#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)
@@ -46,34 +50,19 @@ typedef LONG D3DFIXED;
 #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))
+    (0xff000000 | ( ((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) \
+    (   (((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)
@@ -84,903 +73,655 @@ typedef LONG D3DFIXED;
 
 #endif
 
-/*
- * Flags for Enumerate functions
- */
-
-/*
- * Stop the enumeration
- */
 #define D3DENUMRET_CANCEL                        DDENUMRET_CANCEL
-
-/*
- * Continue the enumeration
- */
 #define D3DENUMRET_OK                            DDENUMRET_OK
 
-typedef HRESULT (CALLBACKLPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
-typedef HRESULT (CALLBACKLPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
-typedef HRESULT (CALLBACKLPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext);
+typedef HRESULT (CALLBACK *LPD3DVALIDATECALLBACK)(LPVOID lpUserArg, DWORD dwOffset);
+typedef HRESULT (CALLBACK *LPD3DENUMTEXTUREFORMATSCALLBACK)(LPDDSURFACEDESC lpDdsd, LPVOID lpContext);
+typedef HRESULT (CALLBACK *LPD3DENUMPIXELFORMATSCALLBACK)(LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext);
 
-typedef DWORD D3DCOLOR, *LPD3DCOLOR;
+#ifndef DX_SHARED_DEFINES
 
-typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
-typedef DWORD D3DTEXTUREHANDLE, *LPD3DTEXTUREHANDLE;
-typedef DWORD D3DMATRIXHANDLE, *LPD3DMATRIXHANDLE;
+typedef float D3DVALUE,*LPD3DVALUE;
 
-typedef struct _D3DCOLORVALUE {
-    union {
-    D3DVALUE r;
-    D3DVALUE dvR;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
+#ifndef D3DCOLOR_DEFINED
+typedef DWORD D3DCOLOR, *LPD3DCOLOR;
+#define D3DCOLOR_DEFINED
 #endif
-    union {
-    D3DVALUE g;
-    D3DVALUE dvG;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
+
+#ifndef D3DVECTOR_DEFINED
+typedef struct _D3DVECTOR {
+  union {
+        D3DVALUE        x;
+    D3DVALUE dvX;
+  } DUMMYUNIONNAME1;
+  union {
+        D3DVALUE        y;
+    D3DVALUE dvY;
+  } DUMMYUNIONNAME2;
+  union {
+        D3DVALUE        z;
+    D3DVALUE dvZ;
+  } DUMMYUNIONNAME3;
+#if defined(__cplusplus) && defined(D3D_OVERLOADS)
+  /* the definitions for these methods are in d3dvec.inl */
+public:
+  /*** constructors ***/
+  _D3DVECTOR() {}
+  _D3DVECTOR(D3DVALUE f);
+  _D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z);
+  _D3DVECTOR(const D3DVALUE f[3]);
+
+  /*** 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 ***/
+  friend _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+  friend _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+
+  friend _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s);
+  friend _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v);
+  friend _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s);
+
+  friend D3DVALUE SquareMagnitude(const _D3DVECTOR& v);
+  friend D3DVALUE Magnitude(const _D3DVECTOR& v);
+
+  friend _D3DVECTOR Normalize(const _D3DVECTOR& v);
+
+  friend D3DVALUE DotProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2);
+  friend _D3DVECTOR CrossProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2);
 #endif
-    union {
-    D3DVALUE b;
-    D3DVALUE dvB;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
+} D3DVECTOR;
+#define D3DVECTOR_DEFINED
 #endif
-    union {
-    D3DVALUE a;
-    D3DVALUE dvA;
-#if defined(NONAMELESSUNION)
-    } u4;
-#else
-    };
+
+#ifndef LPD3DVECTOR_DEFINED
+typedef D3DVECTOR *LPD3DVECTOR;
+#define LPD3DVECTOR_DEFINED
 #endif
-} D3DCOLORVALUE, *LPD3DCOLORVALUE;
+
+#define DX_SHARED_DEFINES
+#endif /* DX_SHARED_DEFINES */
+
+typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
+typedef DWORD D3DTEXTUREHANDLE,  *LPD3DTEXTUREHANDLE;
+typedef DWORD D3DMATRIXHANDLE,   *LPD3DMATRIXHANDLE;
+
+typedef struct _D3DCOLORVALUE {
+        union {
+                D3DVALUE r;
+                D3DVALUE dvR;
+        } DUMMYUNIONNAME1;
+        union {
+                D3DVALUE g;
+                D3DVALUE dvG;
+        } DUMMYUNIONNAME2;
+        union {
+                D3DVALUE b;
+                D3DVALUE dvB;
+        } DUMMYUNIONNAME3;
+        union {
+                D3DVALUE a;
+                D3DVALUE dvA;
+        } DUMMYUNIONNAME4;
+} D3DCOLORVALUE,*LPD3DCOLORVALUE;
 
 typedef struct _D3DRECT {
-    union {
+  union {
     LONG x1;
     LONG lX1;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME1;
+  union {
     LONG y1;
     LONG lY1;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME2;
+  union {
     LONG x2;
     LONG lX2;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME3;
+  union {
     LONG y2;
     LONG lY2;
-#if defined(NONAMELESSUNION)
-    } u4;
-#else
-    };
-#endif
+  } DUMMYUNIONNAME4;
 } D3DRECT, *LPD3DRECT;
 
-typedef struct _D3DVECTOR {
-    union {
-    D3DVALUE x;
-    D3DVALUE dvX;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
-    D3DVALUE y;
-    D3DVALUE dvY;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
-    D3DVALUE z;
-    D3DVALUE dvZ;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
-#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
-} D3DVECTOR, *LPD3DVECTOR;
-
-/*
- * Vertex data types supported in an ExecuteBuffer.
- */
-
-/*
- * Homogeneous vertices
- */
-
 typedef struct _D3DHVERTEX {
-    DWORD           dwFlags;        /* Homogeneous clipping flags */
   union {
+    DWORD         dwFlags;
+ union {
     D3DVALUE    hx;
     D3DVALUE    dvHX;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME1;
+  union {
     D3DVALUE    hy;
     D3DVALUE    dvHY;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME2;
+  union {
     D3DVALUE    hz;
     D3DVALUE    dvHZ;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
+  } DUMMYUNIONNAME3;
 } D3DHVERTEX, *LPD3DHVERTEX;
 
 /*
  * Transformed/lit vertices
  */
 typedef struct _D3DTLVERTEX {
-    union {
-    D3DVALUE    sx;             /* Screen coordinates */
+  union {
+    D3DVALUE    sx;
     D3DVALUE    dvSX;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME1;
+  union {
     D3DVALUE    sy;
     D3DVALUE    dvSY;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME2;
+  union {
     D3DVALUE    sz;
     D3DVALUE    dvSZ;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
-    union {
-    D3DVALUE    rhw;        /* Reciprocal of homogeneous w */
+  } DUMMYUNIONNAME3;
+  union {
+    D3DVALUE    rhw;
     D3DVALUE    dvRHW;
-#if defined(NONAMELESSUNION)
-    } u4;
-#else
-    };
-#endif
-    union {
-    D3DCOLOR    color;          /* Vertex color */
+  } DUMMYUNIONNAME4;
+  union {
+    D3DCOLOR    color;
     D3DCOLOR    dcColor;
-#if defined(NONAMELESSUNION)
-    } u5;
-#else
-    };
-#endif
-    union {
-    D3DCOLOR    specular;       /* Specular component of vertex */
+  } DUMMYUNIONNAME5;
+  union {
+    D3DCOLOR    specular;
     D3DCOLOR    dcSpecular;
-#if defined(NONAMELESSUNION)
-    } u6;
-#else
-    };
-#endif
-    union {
-    D3DVALUE    tu;             /* Texture coordinates */
+  } DUMMYUNIONNAME6;
+  union {
+    D3DVALUE    tu;
     D3DVALUE    dvTU;
-#if defined(NONAMELESSUNION)
-    } u7;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME7;
+  union {
     D3DVALUE    tv;
     D3DVALUE    dvTV;
-#if defined(NONAMELESSUNION)
-    } u8;
-#else
-    };
-#endif
-#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;
-        }
+  } DUMMYUNIONNAME8;
+#if defined(__cplusplus) && defined(D3D_OVERLOADS)
+public:
+  _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
 } D3DTLVERTEX, *LPD3DTLVERTEX;
 
-/*
- * Untransformed/lit vertices
- */
 typedef struct _D3DLVERTEX {
-    union {
-    D3DVALUE     x;             /* Homogeneous coordinates */
-    D3DVALUE     dvX;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
-    D3DVALUE     y;
-    D3DVALUE     dvY;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
-    D3DVALUE     z;
-    D3DVALUE     dvZ;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
-    DWORD            dwReserved;
-    union {
-    D3DCOLOR     color;         /* Vertex color */
+  union {
+    D3DVALUE x;
+    D3DVALUE dvX;
+  } DUMMYUNIONNAME1;
+  union {
+    D3DVALUE y;
+    D3DVALUE dvY;
+  } DUMMYUNIONNAME2;
+  union {
+    D3DVALUE z;
+    D3DVALUE dvZ;
+  } DUMMYUNIONNAME3;
+  DWORD            dwReserved;
+  union {
+    D3DCOLOR     color;
     D3DCOLOR     dcColor;
-#if defined(NONAMELESSUNION)
-    } u4;
-#else
-    };
-#endif
-    union {
-    D3DCOLOR     specular;      /* Specular component of vertex */
+  } DUMMYUNIONNAME4;
+  union {
+    D3DCOLOR     specular;
     D3DCOLOR     dcSpecular;
-#if defined(NONAMELESSUNION)
-    } u5;
-#else
-    };
-#endif
-    union {
-    D3DVALUE     tu;            /* Texture coordinates */
+  } DUMMYUNIONNAME5;
+  union {
+    D3DVALUE     tu;
     D3DVALUE     dvTU;
-#if defined(NONAMELESSUNION)
-    } u6;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME6;
+  union {
     D3DVALUE     tv;
     D3DVALUE     dvTV;
-#if defined(NONAMELESSUNION)
-    } u7;
-#else
-    };
-#endif
-#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
+  } DUMMYUNIONNAME7;
 } D3DLVERTEX, *LPD3DLVERTEX;
 
-/*
- * Untransformed/unlit vertices
- */
-
 typedef struct _D3DVERTEX {
-    union {
-    D3DVALUE     x;             /* Homogeneous coordinates */
+  union {
+    D3DVALUE     x;
     D3DVALUE     dvX;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME1;
+  union {
     D3DVALUE     y;
     D3DVALUE     dvY;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME2;
+  union {
     D3DVALUE     z;
     D3DVALUE     dvZ;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
-    union {
-    D3DVALUE     nx;            /* Normal */
+  } DUMMYUNIONNAME3;
+  union {
+    D3DVALUE     nx;
     D3DVALUE     dvNX;
-#if defined(NONAMELESSUNION)
-    } u4;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME4;
+  union {
     D3DVALUE     ny;
     D3DVALUE     dvNY;
-#if defined(NONAMELESSUNION)
-    } u5;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME5;
+  union {
     D3DVALUE     nz;
     D3DVALUE     dvNZ;
-#if defined(NONAMELESSUNION)
-    } u6;
-#else
-    };
-#endif
-    union {
-    D3DVALUE     tu;            /* Texture coordinates */
+  } DUMMYUNIONNAME6;
+  union {
+    D3DVALUE     tu;
     D3DVALUE     dvTU;
-#if defined(NONAMELESSUNION)
-    } u7;
-#else
-    };
-#endif
-    union {
+  } DUMMYUNIONNAME7;
+  union {
     D3DVALUE     tv;
     D3DVALUE     dvTV;
-#if defined(NONAMELESSUNION)
-    } u8;
-#else
-    };
-#endif
-#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;
-        }
+  } DUMMYUNIONNAME8;
+#if defined(__cplusplus) && defined(D3D_OVERLOADS)
+public:
+  _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
 } D3DVERTEX, *LPD3DVERTEX;
 
-
-/*
- * Matrix, viewport, and tranformation structures and definitions.
- */
-
 typedef struct _D3DMATRIX {
-#if (defined __cplusplus) && (defined D3D_OVERLOADS)
-    union {
-        struct {
-#endif
-
-            D3DVALUE        _11, _12, _13, _14;
-            D3DVALUE        _21, _22, _23, _24;
-            D3DVALUE        _31, _32, _33, _34;
-            D3DVALUE        _41, _42, _43, _44;
-
-#if (defined __cplusplus) && (defined D3D_OVERLOADS)
-#if defined(NONAMELESSUNION)
-        } u1;
-#else
-        };
-#endif
-        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]; }
-    friend _D3DMATRIX operator* (const _D3DMATRIX&, const _D3DMATRIX&);
+  D3DVALUE        _11, _12, _13, _14;
+  D3DVALUE        _21, _22, _23, _24;
+  D3DVALUE        _31, _32, _33, _34;
+  D3DVALUE        _41, _42, _43, _44;
+#if defined(__cplusplus) && defined(D3D_OVERLOADS)
+  _D3DMATRIX() { }
+
+    /* This is different from MS, but avoids anonymous structs. */
+    D3DVALUE &operator () (int r, int c)
+       { return ((D3DVALUE [4][4])&_11)[r][c]; }
+    const D3DVALUE &operator() (int r, int c) const
+       { return ((const D3DVALUE [4][4])&_11)[r][c]; }
 #endif
 } D3DMATRIX, *LPD3DMATRIX;
 
-#if (defined __cplusplus) && (defined D3D_OVERLOADS)
-#include "d3dvec.inl"
+#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 */
+  DWORD       dwSize;
+  DWORD       dwX;
+  DWORD       dwY;
+  DWORD       dwWidth;
+  DWORD       dwHeight;
+  D3DVALUE    dvScaleX;
+  D3DVALUE    dvScaleY;
+  D3DVALUE    dvMaxX;
+  D3DVALUE    dvMaxY;
+  D3DVALUE    dvMinZ;
+  D3DVALUE    dvMaxZ;
 } D3DVIEWPORT, *LPD3DVIEWPORT;
 
 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;
+  DWORD       dwSize;
+  DWORD       dwX;
+  DWORD       dwY;
+  DWORD       dwWidth;
+  DWORD       dwHeight;
+  D3DVALUE    dvClipX;
+  D3DVALUE    dvClipY;
+  D3DVALUE    dvClipWidth;
+  D3DVALUE    dvClipHeight;
+  D3DVALUE    dvMinZ;
+  D3DVALUE    dvMaxZ;
 } D3DVIEWPORT2, *LPD3DVIEWPORT2;
 
-/*
- * Values for clip fields.
- */
-#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 _D3DVIEWPORT7 {
+  DWORD       dwX;
+  DWORD       dwY;
+  DWORD       dwWidth;
+  DWORD       dwHeight;
+  D3DVALUE    dvMinZ;
+  D3DVALUE    dvMaxZ;
+} D3DVIEWPORT7, *LPD3DVIEWPORT7;
+
+#define D3DMAXUSERCLIPPLANES 32
+
+#define D3DCLIPPLANE0 (1 << 0)
+#define D3DCLIPPLANE1 (1 << 1)
+#define D3DCLIPPLANE2 (1 << 2)
+#define D3DCLIPPLANE3 (1 << 3)
+#define D3DCLIPPLANE4 (1 << 4)
+#define D3DCLIPPLANE5 (1 << 5)
+
+#define D3DCLIP_LEFT     0x00000001
+#define D3DCLIP_RIGHT    0x00000002
+#define D3DCLIP_TOP      0x00000004
+#define D3DCLIP_BOTTOM   0x00000008
+#define D3DCLIP_FRONT    0x00000010
+#define D3DCLIP_BACK     0x00000020
+#define D3DCLIP_GEN0     0x00000040
+#define D3DCLIP_GEN1     0x00000080
+#define D3DCLIP_GEN2     0x00000100
+#define D3DCLIP_GEN3     0x00000200
+#define D3DCLIP_GEN4     0x00000400
+#define D3DCLIP_GEN5     0x00000800
+
+#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          0x00001000
+#define D3DSTATUS_CLIPINTERSECTIONRIGHT         0x00002000
+#define D3DSTATUS_CLIPINTERSECTIONTOP           0x00004000
+#define D3DSTATUS_CLIPINTERSECTIONBOTTOM        0x00008000
+#define D3DSTATUS_CLIPINTERSECTIONFRONT         0x00010000
+#define D3DSTATUS_CLIPINTERSECTIONBACK          0x00020000
+#define D3DSTATUS_CLIPINTERSECTIONGEN0          0x00040000
+#define D3DSTATUS_CLIPINTERSECTIONGEN1          0x00080000
+#define D3DSTATUS_CLIPINTERSECTIONGEN2          0x00100000
+#define D3DSTATUS_CLIPINTERSECTIONGEN3          0x00200000
+#define D3DSTATUS_CLIPINTERSECTIONGEN4          0x00400000
+#define D3DSTATUS_CLIPINTERSECTIONGEN5          0x00800000
+#define D3DSTATUS_ZNOTVISIBLE                   0x01000000
+
+#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)
+
+#define D3DTRANSFORM_CLIPPED       0x00000001
+#define D3DTRANSFORM_UNCLIPPED     0x00000002
 
 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 */
+  DWORD           dwSize;
+  LPVOID          lpIn;
+  DWORD           dwInSize;
+  LPVOID          lpOut;
+  DWORD           dwOutSize;
+  LPD3DHVERTEX    lpHOut;
+  DWORD           dwClip;
+  DWORD           dwClipIntersection;
+  DWORD           dwClipUnion;
+  D3DRECT         drExtent;
 } 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 */
+  D3DVECTOR dvPosition;
+  D3DVECTOR dvNormal;
 } D3DLIGHTINGELEMENT, *LPD3DLIGHTINGELEMENT;
 
-/*
- * Structure defining material properties for lighting.
- */
 typedef struct _D3DMATERIAL {
-    DWORD           dwSize;
-    union {
-    D3DCOLORVALUE   diffuse;        /* Diffuse color RGBA */
+  DWORD               dwSize;
+  union {
+    D3DCOLORVALUE   diffuse;
     D3DCOLORVALUE   dcvDiffuse;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
-    D3DCOLORVALUE   ambient;        /* Ambient color RGB */
+  } DUMMYUNIONNAME;
+  union {
+    D3DCOLORVALUE   ambient;
     D3DCOLORVALUE   dcvAmbient;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
-    D3DCOLORVALUE   specular;       /* Specular 'shininess' */
+  } DUMMYUNIONNAME1;
+  union {
+    D3DCOLORVALUE   specular;
     D3DCOLORVALUE   dcvSpecular;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
-    union {
-    D3DCOLORVALUE   emissive;       /* Emissive color RGB */
+  } DUMMYUNIONNAME2;
+  union {
+    D3DCOLORVALUE   emissive;
     D3DCOLORVALUE   dcvEmissive;
-#if defined(NONAMELESSUNION)
-    } u4;
-#else
-    };
-#endif
-    union {
-    D3DVALUE        power;          /* Sharpness if specular highlight */
+  } DUMMYUNIONNAME3;
+  union {
+    D3DVALUE        power;
     D3DVALUE        dvPower;
-#if defined(NONAMELESSUNION)
-    } u5;
-#else
-    };
-#endif
-    D3DTEXTUREHANDLE    hTexture;       /* Handle to texture map */
-    DWORD           dwRampSize;
+  } DUMMYUNIONNAME4;
+  D3DTEXTUREHANDLE    hTexture;
+  DWORD               dwRampSize;
 } D3DMATERIAL, *LPD3DMATERIAL;
 
-typedef enum _D3DLIGHTTYPE {
-    D3DLIGHT_POINT          = 1,
-    D3DLIGHT_SPOT           = 2,
-    D3DLIGHT_DIRECTIONAL    = 3,
-    D3DLIGHT_PARALLELPOINT  = 4,
-#if(DIRECT3D_VERSION < 0x0500) // For backward compatible headers
-    D3DLIGHT_GLSPOT         = 5,
-#endif
-    D3DLIGHT_FORCE_DWORD    = 0x7fffffff, /* force 32-bit size enum */
+typedef struct _D3DMATERIAL7 {
+  union {
+    D3DCOLORVALUE   diffuse;
+    D3DCOLORVALUE   dcvDiffuse;
+  } DUMMYUNIONNAME;
+  union {
+    D3DCOLORVALUE   ambient;
+    D3DCOLORVALUE   dcvAmbient;
+  } DUMMYUNIONNAME1;
+  union {
+    D3DCOLORVALUE   specular;
+    D3DCOLORVALUE   dcvSpecular;
+  } DUMMYUNIONNAME2;
+  union {
+    D3DCOLORVALUE   emissive;
+    D3DCOLORVALUE   dcvEmissive;
+  } DUMMYUNIONNAME3;
+  union {
+    D3DVALUE        power;
+    D3DVALUE        dvPower;
+  } DUMMYUNIONNAME4;
+} D3DMATERIAL7, *LPD3DMATERIAL7;
+
+typedef enum {
+  D3DLIGHT_POINT          = 1,
+  D3DLIGHT_SPOT           = 2,
+  D3DLIGHT_DIRECTIONAL    = 3,
+  D3DLIGHT_PARALLELPOINT  = 4,
+  D3DLIGHT_GLSPOT         = 5,
+  D3DLIGHT_FORCE_DWORD    = 0x7fffffff
 } D3DLIGHTTYPE;
 
-/*
- * 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;
-
-/*
- * Structure defining a light source and its properties.
- */
+    D3DLIGHTTYPE    dltType;
+    D3DCOLORVALUE   dcvColor;
+    D3DVECTOR       dvPosition;
+    D3DVECTOR       dvDirection;
+    D3DVALUE        dvRange;
+    D3DVALUE        dvFalloff;
+    D3DVALUE        dvAttenuation0;
+    D3DVALUE        dvAttenuation1;
+    D3DVALUE        dvAttenuation2;
+    D3DVALUE        dvTheta;
+    D3DVALUE        dvPhi;
+} D3DLIGHT,*LPD3DLIGHT;
+
+typedef struct _D3DLIGHT7 {
+    D3DLIGHTTYPE    dltType;
+    D3DCOLORVALUE   dcvDiffuse;
+    D3DCOLORVALUE   dcvSpecular;
+    D3DCOLORVALUE   dcvAmbient;
+    D3DVECTOR       dvPosition;
+    D3DVECTOR       dvDirection;
+    D3DVALUE        dvRange;
+    D3DVALUE        dvFalloff;
+    D3DVALUE        dvAttenuation0;
+    D3DVALUE        dvAttenuation1;
+    D3DVALUE        dvAttenuation2;
+    D3DVALUE        dvTheta;
+    D3DVALUE        dvPhi;
+} D3DLIGHT7, *LPD3DLIGHT7;
 
-/* flags bits */
 #define D3DLIGHT_ACTIVE         0x00000001
 #define D3DLIGHT_NO_SPECULAR    0x00000002
+#define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR) /* 0x3 */
 
-/* maximum valid light range */
-#define D3DLIGHT_RANGE_MAX      ((float)sqrt(FLT_MAX))
+#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;
+  DWORD           dwSize;
+  D3DLIGHTTYPE    dltType;
+  D3DCOLORVALUE   dcvColor;
+  D3DVECTOR       dvPosition;
+  D3DVECTOR       dvDirection;
+  D3DVALUE        dvRange;
+  D3DVALUE        dvFalloff;
+  D3DVALUE        dvAttenuation0;
+  D3DVALUE        dvAttenuation1;
+  D3DVALUE        dvAttenuation2;
+  D3DVALUE        dvTheta;
+  D3DVALUE        dvPhi;
+  DWORD           dwFlags;
 } D3DLIGHT2, *LPD3DLIGHT2;
 
 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 */
+  DWORD                dwSize;
+  LPD3DLIGHTINGELEMENT lpIn;
+  DWORD                dwInSize;
+  LPD3DTLVERTEX        lpOut;
+  DWORD                dwOutSize;
 } D3DLIGHTDATA, *LPD3DLIGHTDATA;
 
-/*
- * 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;
 
-/*
- * Options for clearing
- */
-#define D3DCLEAR_TARGET            0x00000001l  /* Clear target surface */
-#define D3DCLEAR_ZBUFFER           0x00000002l  /* Clear target z buffer */
-#define D3DCLEAR_STENCIL           0x00000004l  /* Clear stencil planes */
 
-/*
- * Execute buffers are allocated via Direct3D.  These buffers may then
- * be filled by the application with instructions to execute along with
- * vertex data.
- */
+#ifndef D3DCLEAR_TARGET
+#define D3DCLEAR_TARGET   0x00000001
+#endif
+#ifndef D3DCLEAR_ZBUFFER
+#define D3DCLEAR_ZBUFFER  0x00000002
+#endif
+#ifndef D3DCLEAR_STENCIL
+#define D3DCLEAR_STENCIL  0x00000004
+#endif
 
-/*
- * 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,
-    D3DOP_FORCE_DWORD           = 0x7fffffff, /* force 32-bit size enum */
+  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,
+
+  D3DOP_FORCE_DWORD     = 0x7fffffff
 } 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 */
+  BYTE bOpcode;
+  BYTE bSize;
+  WORD wCount;
 } D3DINSTRUCTION, *LPD3DINSTRUCTION;
 
-/*
- * Structure for texture loads
- */
 typedef struct _D3DTEXTURELOAD {
-    D3DTEXTUREHANDLE hDestTexture;
-    D3DTEXTUREHANDLE hSrcTexture;
+  D3DTEXTUREHANDLE hDestTexture;
+  D3DTEXTUREHANDLE hSrcTexture;
 } D3DTEXTURELOAD, *LPD3DTEXTURELOAD;
 
-/*
- * Structure for picking
- */
 typedef struct _D3DPICKRECORD {
-    BYTE     bOpcode;
-    BYTE     bPad;
-    DWORD    dwOffset;
-    D3DVALUE dvZ;
+  BYTE     bOpcode;
+  BYTE     bPad;
+  DWORD    dwOffset;
+  D3DVALUE dvZ;
 } D3DPICKRECORD, *LPD3DPICKRECORD;
 
-/*
- * The following defines the rendering states which can be set in the
- * execute buffer.
- */
-
-typedef enum _D3DSHADEMODE {
-    D3DSHADE_FLAT              = 1,
-    D3DSHADE_GOURAUD           = 2,
-    D3DSHADE_PHONG             = 3,
-    D3DSHADE_FORCE_DWORD       = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DSHADE_FLAT         = 1,
+  D3DSHADE_GOURAUD      = 2,
+  D3DSHADE_PHONG        = 3,
+  D3DSHADE_FORCE_DWORD  = 0x7fffffff
 } D3DSHADEMODE;
 
-typedef enum _D3DFILLMODE {
-    D3DFILL_POINT          = 1,
-    D3DFILL_WIREFRAME          = 2,
-    D3DFILL_SOLID          = 3,
-    D3DFILL_FORCE_DWORD        = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DFILL_POINT         = 1,
+  D3DFILL_WIREFRAME     = 2,
+  D3DFILL_SOLID         = 3,
+  D3DFILL_FORCE_DWORD   = 0x7fffffff
 } D3DFILLMODE;
 
 typedef struct _D3DLINEPATTERN {
-    WORD    wRepeatFactor;
-    WORD    wLinePattern;
+  WORD    wRepeatFactor;
+  WORD    wLinePattern;
 } D3DLINEPATTERN;
 
-typedef enum _D3DTEXTUREFILTER {
-    D3DFILTER_NEAREST          = 1,
-    D3DFILTER_LINEAR           = 2,
-    D3DFILTER_MIPNEAREST       = 3,
-    D3DFILTER_MIPLINEAR        = 4,
-    D3DFILTER_LINEARMIPNEAREST = 5,
-    D3DFILTER_LINEARMIPLINEAR  = 6,
-    D3DFILTER_FORCE_DWORD      = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DFILTER_NEAREST          = 1,
+  D3DFILTER_LINEAR           = 2,
+  D3DFILTER_MIPNEAREST       = 3,
+  D3DFILTER_MIPLINEAR        = 4,
+  D3DFILTER_LINEARMIPNEAREST = 5,
+  D3DFILTER_LINEARMIPLINEAR  = 6,
+  D3DFILTER_FORCE_DWORD      = 0x7fffffff
 } D3DTEXTUREFILTER;
 
-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,
-    D3DBLEND_FORCE_DWORD       = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  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,
+  D3DBLEND_FORCE_DWORD     = 0x7fffffff
 } D3DBLEND;
 
-typedef enum _D3DTEXTUREBLEND {
-    D3DTBLEND_DECAL            = 1,
-    D3DTBLEND_MODULATE         = 2,
-    D3DTBLEND_DECALALPHA       = 3,
-    D3DTBLEND_MODULATEALPHA    = 4,
-    D3DTBLEND_DECALMASK        = 5,
-    D3DTBLEND_MODULATEMASK     = 6,
-    D3DTBLEND_COPY             = 7,
-    D3DTBLEND_ADD              = 8,
-    D3DTBLEND_FORCE_DWORD      = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DTBLEND_DECAL         = 1,
+  D3DTBLEND_MODULATE      = 2,
+  D3DTBLEND_DECALALPHA    = 3,
+  D3DTBLEND_MODULATEALPHA = 4,
+  D3DTBLEND_DECALMASK     = 5,
+  D3DTBLEND_MODULATEMASK  = 6,
+  D3DTBLEND_COPY          = 7,
+  D3DTBLEND_ADD           = 8,
+  D3DTBLEND_FORCE_DWORD   = 0x7fffffff
 } D3DTEXTUREBLEND;
 
 typedef enum _D3DTEXTUREADDRESS {
@@ -988,641 +729,543 @@ typedef enum _D3DTEXTUREADDRESS {
     D3DTADDRESS_MIRROR         = 2,
     D3DTADDRESS_CLAMP          = 3,
     D3DTADDRESS_BORDER         = 4,
-    D3DTADDRESS_FORCE_DWORD    = 0x7fffffff, /* force 32-bit size enum */
+    D3DTADDRESS_FORCE_DWORD    = 0x7fffffff
 } D3DTEXTUREADDRESS;
 
-typedef enum _D3DCULL {
-    D3DCULL_NONE               = 1,
-    D3DCULL_CW                 = 2,
-    D3DCULL_CCW                = 3,
-    D3DCULL_FORCE_DWORD        = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DCULL_NONE        = 1,
+  D3DCULL_CW          = 2,
+  D3DCULL_CCW         = 3,
+  D3DCULL_FORCE_DWORD = 0x7fffffff
 } 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,
-    D3DCMP_FORCE_DWORD         = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DCMP_NEVER        = 1,
+  D3DCMP_LESS         = 2,
+  D3DCMP_EQUAL        = 3,
+  D3DCMP_LESSEQUAL    = 4,
+  D3DCMP_GREATER      = 5,
+  D3DCMP_NOTEQUAL     = 6,
+  D3DCMP_GREATEREQUAL = 7,
+  D3DCMP_ALWAYS       = 8,
+  D3DCMP_FORCE_DWORD  = 0x7fffffff
 } D3DCMPFUNC;
 
 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_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
 } D3DSTENCILOP;
 
 typedef enum _D3DFOGMODE {
-    D3DFOG_NONE                = 0,
-    D3DFOG_EXP                 = 1,
-    D3DFOG_EXP2                = 2,
-    D3DFOG_LINEAR              = 3,
-    D3DFOG_FORCE_DWORD         = 0x7fffffff, /* force 32-bit size enum */
+  D3DFOG_NONE         = 0,
+  D3DFOG_EXP          = 1,
+  D3DFOG_EXP2         = 2,
+  D3DFOG_LINEAR       = 3,
+  D3DFOG_FORCE_DWORD  = 0x7fffffff
 } D3DFOGMODE;
 
 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 */
+  D3DZB_FALSE        = 0,
+  D3DZB_TRUE         = 1,
+  D3DZB_USEW         = 2,
+  D3DZB_FORCE_DWORD  = 0x7fffffff
 } D3DZBUFFERTYPE;
 
 typedef enum _D3DANTIALIASMODE {
-    D3DANTIALIAS_NONE          = 0,
-    D3DANTIALIAS_SORTDEPENDENT = 1,
-    D3DANTIALIAS_SORTINDEPENDENT = 2,
-    D3DANTIALIAS_FORCE_DWORD   = 0x7fffffff, /* force 32-bit size enum */
+  D3DANTIALIAS_NONE            = 0,
+  D3DANTIALIAS_SORTDEPENDENT   = 1,
+  D3DANTIALIAS_SORTINDEPENDENT = 2,
+  D3DANTIALIAS_FORCE_DWORD     = 0x7fffffff
 } 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 */
+typedef enum {
+  D3DVT_VERTEX        = 1,
+  D3DVT_LVERTEX       = 2,
+  D3DVT_TLVERTEX      = 3,
+  D3DVT_FORCE_DWORD   = 0x7fffffff
 } D3DVERTEXTYPE;
 
-// 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 */
+typedef enum {
+  D3DPT_POINTLIST     = 1,
+  D3DPT_LINELIST      = 2,
+  D3DPT_LINESTRIP     = 3,
+  D3DPT_TRIANGLELIST  = 4,
+  D3DPT_TRIANGLESTRIP = 5,
+  D3DPT_TRIANGLEFAN   = 6,
+  D3DPT_FORCE_DWORD   = 0x7fffffff
 } D3DPRIMITIVETYPE;
 
-/*
- * 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))
 
 typedef enum _D3DTRANSFORMSTATETYPE {
-    D3DTRANSFORMSTATE_WORLD           = 1,
-    D3DTRANSFORMSTATE_VIEW            = 2,
-    D3DTRANSFORMSTATE_PROJECTION      = 3,
-    D3DTRANSFORMSTATE_FORCE_DWORD     = 0x7fffffff, /* force 32-bit size enum */
+    D3DTRANSFORMSTATE_WORLD         = 1,
+    D3DTRANSFORMSTATE_VIEW          = 2,
+    D3DTRANSFORMSTATE_PROJECTION    = 3,
+    D3DTRANSFORMSTATE_WORLD1        = 4,
+    D3DTRANSFORMSTATE_WORLD2        = 5,
+    D3DTRANSFORMSTATE_WORLD3        = 6,
+    D3DTRANSFORMSTATE_TEXTURE0      = 16,
+    D3DTRANSFORMSTATE_TEXTURE1      = 17,
+    D3DTRANSFORMSTATE_TEXTURE2      = 18,
+    D3DTRANSFORMSTATE_TEXTURE3      = 19,
+    D3DTRANSFORMSTATE_TEXTURE4      = 20,
+    D3DTRANSFORMSTATE_TEXTURE5      = 21,
+    D3DTRANSFORMSTATE_TEXTURE6      = 22,
+    D3DTRANSFORMSTATE_TEXTURE7      = 23,
+    D3DTRANSFORMSTATE_FORCE_DWORD   = 0x7fffffff
 } D3DTRANSFORMSTATETYPE;
 
-typedef enum _D3DLIGHTSTATETYPE {
-    D3DLIGHTSTATE_MATERIAL          = 1,
-    D3DLIGHTSTATE_AMBIENT           = 2,
-    D3DLIGHTSTATE_COLORMODEL        = 3,
-    D3DLIGHTSTATE_FOGMODE           = 4,
-    D3DLIGHTSTATE_FOGSTART          = 5,
-    D3DLIGHTSTATE_FOGEND            = 6,
-    D3DLIGHTSTATE_FOGDENSITY        = 7,
-    D3DLIGHTSTATE_COLORVERTEX       = 8,
-    D3DLIGHTSTATE_FORCE_DWORD         = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DLIGHTSTATE_MATERIAL      = 1,
+  D3DLIGHTSTATE_AMBIENT       = 2,
+  D3DLIGHTSTATE_COLORMODEL    = 3,
+  D3DLIGHTSTATE_FOGMODE       = 4,
+  D3DLIGHTSTATE_FOGSTART      = 5,
+  D3DLIGHTSTATE_FOGEND        = 6,
+  D3DLIGHTSTATE_FOGDENSITY    = 7,
+  D3DLIGHTSTATE_COLORVERTEX   = 8,
+  D3DLIGHTSTATE_FORCE_DWORD   = 0x7fffffff
 } D3DLIGHTSTATETYPE;
 
-typedef enum _D3DRENDERSTATETYPE {
-    D3DRENDERSTATE_TEXTUREHANDLE      = 1,    /* Texture handle for legacy interfaces (Texture,Texture2) */
-    D3DRENDERSTATE_ANTIALIAS          = 2,    /* D3DANTIALIASMODE */
-    D3DRENDERSTATE_TEXTUREADDRESS     = 3,    /* D3DTEXTUREADDRESS  */
-    D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4,    /* TRUE for perspective correction */
-    D3DRENDERSTATE_WRAPU          = 5,    /* TRUE for wrapping in u */
-    D3DRENDERSTATE_WRAPV          = 6,    /* TRUE for wrapping in v */
-    D3DRENDERSTATE_ZENABLE            = 7,    /* D3DZBUFFERTYPE (or TRUE/FALSE for legacy) */
-    D3DRENDERSTATE_FILLMODE           = 8,    /* D3DFILL_MODE        */
-    D3DRENDERSTATE_SHADEMODE          = 9,    /* D3DSHADEMODE */
-    D3DRENDERSTATE_LINEPATTERN        = 10,   /* D3DLINEPATTERN */
-    D3DRENDERSTATE_MONOENABLE         = 11,   /* TRUE to enable mono rasterization */
-    D3DRENDERSTATE_ROP2               = 12,   /* ROP2 */
-    D3DRENDERSTATE_PLANEMASK          = 13,   /* DWORD physical plane mask */
-    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_TEXTUREMAG         = 17,   /* D3DTEXTUREFILTER */
-    D3DRENDERSTATE_TEXTUREMIN         = 18,   /* D3DTEXTUREFILTER */
-    D3DRENDERSTATE_SRCBLEND           = 19,   /* D3DBLEND */
-    D3DRENDERSTATE_DESTBLEND          = 20,   /* D3DBLEND */
-    D3DRENDERSTATE_TEXTUREMAPBLEND    = 21,   /* D3DTEXTUREBLEND */
-    D3DRENDERSTATE_CULLMODE           = 22,   /* D3DCULL */
-    D3DRENDERSTATE_ZFUNC              = 23,   /* D3DCMPFUNC */
-    D3DRENDERSTATE_ALPHAREF           = 24,   /* D3DFIXED */
-    D3DRENDERSTATE_ALPHAFUNC          = 25,   /* D3DCMPFUNC */
-    D3DRENDERSTATE_DITHERENABLE       = 26,   /* TRUE to enable dithering */
-    D3DRENDERSTATE_ALPHABLENDENABLE        = 27,   /* TRUE to enable alpha blending */
-    D3DRENDERSTATE_FOGENABLE          = 28,   /* TRUE to enable fog */
-    D3DRENDERSTATE_SPECULARENABLE     = 29,   /* TRUE to enable specular */
-    D3DRENDERSTATE_ZVISIBLE           = 30,   /* TRUE to enable z checking */
-    D3DRENDERSTATE_SUBPIXEL       = 31,   /* TRUE to enable subpixel correction */
-    D3DRENDERSTATE_SUBPIXELX          = 32,   /* TRUE to enable correction in X only */
-    D3DRENDERSTATE_STIPPLEDALPHA      = 33,   /* TRUE to enable stippled alpha */
-    D3DRENDERSTATE_FOGCOLOR           = 34,   /* D3DCOLOR */
-    D3DRENDERSTATE_FOGTABLEMODE       = 35,   /* D3DFOGMODE */
-    D3DRENDERSTATE_FOGTABLESTART      = 36,   /* Fog table start    */
-    D3DRENDERSTATE_FOGTABLEEND        = 37,   /* Fog table end      */
-    D3DRENDERSTATE_FOGTABLEDENSITY    = 38,   /* Fog table density  */
-    D3DRENDERSTATE_STIPPLEENABLE      = 39,   /* TRUE to enable stippling */
-    D3DRENDERSTATE_EDGEANTIALIAS      = 40,   /* TRUE to enable edge antialiasing */
-    D3DRENDERSTATE_COLORKEYENABLE     = 41,   /* TRUE to enable source colorkeyed textures */
-    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_ZBIAS              = 47,   /* LONG Z bias */
-    D3DRENDERSTATE_RANGEFOGENABLE     = 48,   /* Enables range-based fog */
-    D3DRENDERSTATE_ANISOTROPY         = 49,   /* Max. anisotropy. 1 = no anisotropy */
-    D3DRENDERSTATE_FLUSHBATCH         = 50,   /* Explicit flush for DP batching (DX5 Only) */
-    D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, /* BOOL enable sort-independent transparency */
-    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 */
-    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,
-
-    /*
-     * 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 */
-    D3DRENDERSTATE_FORCE_DWORD        = 0x7fffffff, /* force 32-bit size enum */
+typedef enum {
+  D3DRENDERSTATE_TEXTUREHANDLE      = 1,
+  D3DRENDERSTATE_ANTIALIAS          = 2,
+  D3DRENDERSTATE_TEXTUREADDRESS     = 3,
+  D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4,
+  D3DRENDERSTATE_WRAPU              = 5,
+  D3DRENDERSTATE_WRAPV              = 6,
+  D3DRENDERSTATE_ZENABLE            = 7,
+  D3DRENDERSTATE_FILLMODE           = 8,
+  D3DRENDERSTATE_SHADEMODE          = 9,
+  D3DRENDERSTATE_LINEPATTERN        = 10,
+  D3DRENDERSTATE_MONOENABLE         = 11,
+  D3DRENDERSTATE_ROP2               = 12,
+  D3DRENDERSTATE_PLANEMASK          = 13,
+  D3DRENDERSTATE_ZWRITEENABLE       = 14,
+  D3DRENDERSTATE_ALPHATESTENABLE    = 15,
+  D3DRENDERSTATE_LASTPIXEL          = 16,
+  D3DRENDERSTATE_TEXTUREMAG         = 17,
+  D3DRENDERSTATE_TEXTUREMIN         = 18,
+  D3DRENDERSTATE_SRCBLEND           = 19,
+  D3DRENDERSTATE_DESTBLEND          = 20,
+  D3DRENDERSTATE_TEXTUREMAPBLEND    = 21,
+  D3DRENDERSTATE_CULLMODE           = 22,
+  D3DRENDERSTATE_ZFUNC              = 23,
+  D3DRENDERSTATE_ALPHAREF           = 24,
+  D3DRENDERSTATE_ALPHAFUNC          = 25,
+  D3DRENDERSTATE_DITHERENABLE       = 26,
+  D3DRENDERSTATE_ALPHABLENDENABLE   = 27,
+  D3DRENDERSTATE_FOGENABLE          = 28,
+  D3DRENDERSTATE_SPECULARENABLE     = 29,
+  D3DRENDERSTATE_ZVISIBLE           = 30,
+  D3DRENDERSTATE_SUBPIXEL           = 31,
+  D3DRENDERSTATE_SUBPIXELX          = 32,
+  D3DRENDERSTATE_STIPPLEDALPHA      = 33,
+  D3DRENDERSTATE_FOGCOLOR           = 34,
+  D3DRENDERSTATE_FOGTABLEMODE       = 35,
+  D3DRENDERSTATE_FOGTABLESTART      = 36,
+  D3DRENDERSTATE_FOGTABLEEND        = 37,
+  D3DRENDERSTATE_FOGTABLEDENSITY    = 38,
+  D3DRENDERSTATE_FOGSTART           = 36,
+  D3DRENDERSTATE_FOGEND             = 37,
+  D3DRENDERSTATE_FOGDENSITY         = 38,
+  D3DRENDERSTATE_STIPPLEENABLE      = 39,
+  D3DRENDERSTATE_EDGEANTIALIAS      = 40,
+  D3DRENDERSTATE_COLORKEYENABLE     = 41,
+  D3DRENDERSTATE_BORDERCOLOR        = 43,
+  D3DRENDERSTATE_TEXTUREADDRESSU    = 44,
+  D3DRENDERSTATE_TEXTUREADDRESSV    = 45,
+  D3DRENDERSTATE_MIPMAPLODBIAS      = 46,
+  D3DRENDERSTATE_ZBIAS              = 47,
+  D3DRENDERSTATE_RANGEFOGENABLE     = 48,
+  D3DRENDERSTATE_ANISOTROPY         = 49,
+  D3DRENDERSTATE_FLUSHBATCH         = 50,
+  D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT = 51,
+
+  D3DRENDERSTATE_STENCILENABLE      = 52,
+  D3DRENDERSTATE_STENCILFAIL        = 53,
+  D3DRENDERSTATE_STENCILZFAIL       = 54,
+  D3DRENDERSTATE_STENCILPASS        = 55,
+  D3DRENDERSTATE_STENCILFUNC        = 56,
+  D3DRENDERSTATE_STENCILREF         = 57,
+  D3DRENDERSTATE_STENCILMASK        = 58,
+  D3DRENDERSTATE_STENCILWRITEMASK   = 59,
+  D3DRENDERSTATE_TEXTUREFACTOR      = 60,
+
+  D3DRENDERSTATE_STIPPLEPATTERN00   = 64,
+  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,
+
+  D3DRENDERSTATE_WRAP0              = 128,
+  D3DRENDERSTATE_WRAP1              = 129,
+  D3DRENDERSTATE_WRAP2              = 130,
+  D3DRENDERSTATE_WRAP3              = 131,
+  D3DRENDERSTATE_WRAP4              = 132,
+  D3DRENDERSTATE_WRAP5              = 133,
+  D3DRENDERSTATE_WRAP6              = 134,
+  D3DRENDERSTATE_WRAP7              = 135,
+  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,
+
+  D3DRENDERSTATE_FORCE_DWORD        = 0x7fffffff
+
+  /* FIXME: We have some retired values that are being reused for DirectX 7 */
 } D3DRENDERSTATETYPE;
 
-// For back-compatibility with legacy compilations
-#define D3DRENDERSTATE_BLENDENABLE      D3DRENDERSTATE_ALPHABLENDENABLE
-
+typedef enum _D3DMATERIALCOLORSOURCE
+{
+    D3DMCS_MATERIAL = 0,
+    D3DMCS_COLOR1   = 1,
+    D3DMCS_COLOR2   = 2,
+    D3DMCS_FORCE_DWORD = 0x7fffffff
+} D3DMATERIALCOLORSOURCE;
 
-// Bias to apply to the texture coordinate set to apply a wrap to.
+#define D3DRENDERSTATE_BLENDENABLE      D3DRENDERSTATE_ALPHABLENDENABLE
 #define D3DRENDERSTATE_WRAPBIAS                 128UL
-
-/* Flags to construct the WRAP render states */
 #define D3DWRAP_U   0x00000001L
 #define D3DWRAP_V   0x00000002L
 
+#define D3DWRAPCOORD_0   0x00000001L
+#define D3DWRAPCOORD_1   0x00000002L
+#define D3DWRAPCOORD_2   0x00000004L
+#define D3DWRAPCOORD_3   0x00000008L
 
 #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
 
 typedef struct _D3DSTATE {
-    union {
-    D3DTRANSFORMSTATETYPE   dtstTransformStateType;
-    D3DLIGHTSTATETYPE   dlstLightStateType;
-    D3DRENDERSTATETYPE  drstRenderStateType;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
-    DWORD           dwArg[1];
-    D3DVALUE        dvArg[1];
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
+  union {
+    D3DTRANSFORMSTATETYPE dtstTransformStateType;
+    D3DLIGHTSTATETYPE     dlstLightStateType;
+    D3DRENDERSTATETYPE    drstRenderStateType;
+  } DUMMYUNIONNAME1;
+  union {
+    DWORD                 dwArg[1];
+    D3DVALUE              dvArg[1];
+  } DUMMYUNIONNAME2;
 } D3DSTATE, *LPD3DSTATE;
 
-/*
- * Operation used to load matrices
- * hDstMat = hSrcMat
- */
 typedef struct _D3DMATRIXLOAD {
-    D3DMATRIXHANDLE hDestMatrix;   /* Destination matrix */
-    D3DMATRIXHANDLE hSrcMatrix;   /* Source matrix */
+  D3DMATRIXHANDLE hDestMatrix;
+  D3DMATRIXHANDLE hSrcMatrix;
 } 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 */
+  D3DMATRIXHANDLE hDestMatrix;
+  D3DMATRIXHANDLE hSrcMatrix1;
+  D3DMATRIXHANDLE hSrcMatrix2;
 } 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 */
+  DWORD dwFlags;
+  WORD  wStart;
+  WORD  wDest;
+  DWORD dwCount;
+  DWORD dwReserved;
 } 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
-
-
+#define D3DPROCESSVERTICES_TRANSFORMLIGHT       0x00000000L
+#define D3DPROCESSVERTICES_TRANSFORM            0x00000001L
+#define D3DPROCESSVERTICES_COPY                 0x00000002L
+#define D3DPROCESSVERTICES_OPMASK               0x00000007L
 
+#define D3DPROCESSVERTICES_UPDATEEXTENTS        0x00000008L
+#define D3DPROCESSVERTICES_NOCOLOR              0x00000010L
 
-/*
- * 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 */
-    D3DTSS_FORCE_DWORD   = 0x7fffffff, /* force 32-bit size enum */
+    D3DTSS_COLOROP        =  1,
+    D3DTSS_COLORARG1      =  2,
+    D3DTSS_COLORARG2      =  3,
+    D3DTSS_ALPHAOP        =  4,
+    D3DTSS_ALPHAARG1      =  5,
+    D3DTSS_ALPHAARG2      =  6,
+    D3DTSS_BUMPENVMAT00   =  7,
+    D3DTSS_BUMPENVMAT01   =  8,
+    D3DTSS_BUMPENVMAT10   =  9,
+    D3DTSS_BUMPENVMAT11   = 10,
+    D3DTSS_TEXCOORDINDEX  = 11,
+    D3DTSS_ADDRESS        = 12,
+    D3DTSS_ADDRESSU       = 13,
+    D3DTSS_ADDRESSV       = 14,
+    D3DTSS_BORDERCOLOR    = 15,
+    D3DTSS_MAGFILTER      = 16,
+    D3DTSS_MINFILTER      = 17,
+    D3DTSS_MIPFILTER      = 18,
+    D3DTSS_MIPMAPLODBIAS  = 19,
+    D3DTSS_MAXMIPLEVEL    = 20,
+    D3DTSS_MAXANISOTROPY  = 21,
+    D3DTSS_BUMPENVLSCALE  = 22,
+    D3DTSS_BUMPENVLOFFSET = 23,
+    D3DTSS_TEXTURETRANSFORMFLAGS = 24,
+    D3DTSS_FORCE_DWORD   = 0x7fffffff
 } D3DTEXTURESTAGESTATETYPE;
 
-/*
- * Enumerations for COLOROP and ALPHAOP texture blending operations set in
- * texture processing stage controls in D3DRENDERSTATE.
- */
+#define D3DTSS_TCI_PASSTHRU                             0x00000000
+#define D3DTSS_TCI_CAMERASPACENORMAL                    0x00010000
+#define D3DTSS_TCI_CAMERASPACEPOSITION                  0x00020000
+#define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR          0x00030000
+
 typedef enum _D3DTEXTUREOP
 {
-// Control
-    D3DTOP_DISABLE    = 1,      // disables stage
-    D3DTOP_SELECTARG1 = 2,      // the default
+    D3DTOP_DISABLE    = 1,
+    D3DTOP_SELECTARG1 = 2,
     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_MODULATE   = 4,
+    D3DTOP_MODULATE2X = 5,
+    D3DTOP_MODULATE4X = 6,
+
+    D3DTOP_ADD          =  7,
+    D3DTOP_ADDSIGNED    =  8,
+    D3DTOP_ADDSIGNED2X  =  9,
+    D3DTOP_SUBTRACT     = 10,
+    D3DTOP_ADDSMOOTH    = 11,
+
+    D3DTOP_BLENDDIFFUSEALPHA    = 12,
+    D3DTOP_BLENDTEXTUREALPHA    = 13,
+    D3DTOP_BLENDFACTORALPHA     = 14,
+    D3DTOP_BLENDTEXTUREALPHAPM  = 15,
+    D3DTOP_BLENDCURRENTALPHA    = 16,
+
+    D3DTOP_PREMODULATE            = 17,
+    D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
+    D3DTOP_MODULATECOLOR_ADDALPHA = 19,
+    D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
+    D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
+
+    D3DTOP_BUMPENVMAP           = 22,
+    D3DTOP_BUMPENVMAPLUMINANCE  = 23,
     D3DTOP_DOTPRODUCT3          = 24,
 
-    D3DTOP_FORCE_DWORD = 0x7fffffff,
+    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
-
-#define D3DTA_COMPLEMENT        0x00000010  // take 1.0 - x
-#define D3DTA_ALPHAREPLICATE    0x00000020  // replicate alpha to color components
+#define D3DTA_SELECTMASK        0x0000000f
+#define D3DTA_DIFFUSE           0x00000000
+#define D3DTA_CURRENT           0x00000001
+#define D3DTA_TEXTURE           0x00000002
+#define D3DTA_TFACTOR           0x00000003
+#define D3DTA_SPECULAR          0x00000004
+#define D3DTA_COMPLEMENT        0x00000010
+#define D3DTA_ALPHAREPLICATE    0x00000020
 
-/*
- *  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,    //
-    D3DTFG_FORCE_DWORD  = 0x7fffffff,   // force 32-bit size enum
+    D3DTFG_POINT        = 1,
+    D3DTFG_LINEAR       = 2,
+    D3DTFG_FLATCUBIC    = 3,
+    D3DTFG_GAUSSIANCUBIC = 4,
+    D3DTFG_ANISOTROPIC  = 5,
+    D3DTFG_FORCE_DWORD  = 0x7fffffff
 } 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
+    D3DTFN_POINT        = 1,
+    D3DTFN_LINEAR       = 2,
+    D3DTFN_ANISOTROPIC  = 3,
+    D3DTFN_FORCE_DWORD  = 0x7fffffff
 } 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
+    D3DTFP_NONE         = 1,
+    D3DTFP_POINT        = 2,
+    D3DTFP_LINEAR       = 3,
+    D3DTFP_FORCE_DWORD  = 0x7fffffff
 } D3DTEXTUREMIPFILTER;
 
+#define D3DTRIFLAG_START                        0x00000000L
+#define D3DTRIFLAG_STARTFLAT(len) (len)
+#define D3DTRIFLAG_ODD                          0x0000001eL
+#define D3DTRIFLAG_EVEN                         0x0000001fL
 
-/*
- * 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_EDGEENABLE1                  0x00000100L
+#define D3DTRIFLAG_EDGEENABLE2                  0x00000200L
+#define D3DTRIFLAG_EDGEENABLE3                  0x00000400L
 #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;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
-    WORD    v2;
-    WORD    wV2;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
-    union {
-    WORD    v3;
-    WORD    wV3;
-#if defined(NONAMELESSUNION)
-    } u3;
-#else
-    };
-#endif
-    WORD        wFlags;       /* Edge (and other) flags */
+  union {
+    WORD v1;
+    WORD wV1;
+  } DUMMYUNIONNAME1;
+  union {
+    WORD v2;
+    WORD wV2;
+  } DUMMYUNIONNAME2;
+  union {
+    WORD v3;
+    WORD wV3;
+  } DUMMYUNIONNAME3;
+  WORD     wFlags;
 } D3DTRIANGLE, *LPD3DTRIANGLE;
 
-/*
- * Line list structure.
- * The instruction count defines the number of line segments.
- */
 typedef struct _D3DLINE {
-    union {
-    WORD    v1;            /* Vertex indices */
-    WORD    wV1;
-#if defined(NONAMELESSUNION)
-    } u1;
-#else
-    };
-#endif
-    union {
-    WORD    v2;
-    WORD    wV2;
-#if defined(NONAMELESSUNION)
-    } u2;
-#else
-    };
-#endif
+  union {
+    WORD v1;
+    WORD wV1;
+  } DUMMYUNIONNAME1;
+  union {
+    WORD v2;
+    WORD wV2;
+  } DUMMYUNIONNAME2;
 } 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 */
+  WORD wCount;
+  WORD wFirst;
 } D3DSPAN, *LPD3DSPAN;
 
-/*
- * Point structure
- */
 typedef struct _D3DPOINT {
-    WORD    wCount;     /* number of points     */
-    WORD    wFirst;     /* index to first vertex    */
+  WORD wCount;
+  WORD wFirst;
 } 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)*/
+  DWORD dwMask;
+  DWORD dwValue;
+  BOOL  bNegate;
+  DWORD dwOffset;
 } 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;
+  DWORD   dwFlags;
+  DWORD   dwStatus;
+  D3DRECT drExtent;
 } D3DSTATUS, *LPD3DSTATUS;
 
-#define D3DSETSTATUS_STATUS     0x00000001L
-#define D3DSETSTATUS_EXTENTS        0x00000002L
-#define D3DSETSTATUS_ALL    (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
+#define D3DSETSTATUS_STATUS   0x00000001L
+#define D3DSETSTATUS_EXTENTS  0x00000002L
+#define D3DSETSTATUS_ALL      (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
 
 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 */
+  DWORD dwFlags;
+  DWORD dwStatus;
+  float minx, maxx;
+  float miny, maxy;
+  float minz, maxz;
 } D3DCLIPSTATUS, *LPD3DCLIPSTATUS;
 
 #define D3DCLIPSTATUS_STATUS        0x00000001L
 #define D3DCLIPSTATUS_EXTENTS2      0x00000002L
 #define D3DCLIPSTATUS_EXTENTS3      0x00000004L
 
-/*
- * Statistics structure
- */
-typedef struct _D3DSTATS {
-    DWORD        dwSize;
-    DWORD        dwTrianglesDrawn;
-    DWORD        dwLinesDrawn;
-    DWORD        dwPointsDrawn;
-    DWORD        dwSpansDrawn;
-    DWORD        dwVerticesProcessed;
+typedef struct {
+  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 */
+  DWORD     dwSize;
+  DWORD     dwVertexOffset;
+  DWORD     dwVertexCount;
+  DWORD     dwInstructionOffset;
+  DWORD     dwInstructionLength;
+  DWORD     dwHVertexOffset;
+  D3DSTATUS dsStatus;
 } 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 */
-
-
+#define D3DPAL_FREE 0x00
+#define D3DPAL_READONLY 0x40
+#define D3DPAL_RESERVED 0x80
 
 typedef struct _D3DVERTEXBUFFERDESC {
-    DWORD dwSize;
-    DWORD dwCaps;
-    DWORD dwFVF;
-    DWORD dwNumVertices;
+  DWORD dwSize;
+  DWORD dwCaps;
+  DWORD dwFVF;
+  DWORD dwNumVertices;
 } D3DVERTEXBUFFERDESC, *LPD3DVERTEXBUFFERDESC;
 
-/* These correspond to DDSCAPS_* flags */
 #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)
 
-//-------------------------------------------------------------------
+#define D3DMAXNUMVERTICES    ((1<<16) - 1)
+
+#define D3DMAXNUMPRIMITIVES  ((1<<16) - 1)
+
+#define D3DPV_DONOTCOPYDATA (1 << 0)
 
-// Flexible vertex format bits
-//
 #define D3DFVF_RESERVED0        0x001
 #define D3DFVF_POSITION_MASK    0x00E
 #define D3DFVF_XYZ              0x002
 #define D3DFVF_XYZRHW           0x004
+#define D3DFVF_XYZB1            0x006
+#define D3DFVF_XYZB2            0x008
+#define D3DFVF_XYZB3            0x00a
+#define D3DFVF_XYZB4            0x00c
+#define D3DFVF_XYZB5            0x00e
+
 #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
@@ -1635,7 +1278,7 @@ typedef struct _D3DVERTEXBUFFERDESC {
 #define D3DFVF_TEX7             0x700
 #define D3DFVF_TEX8             0x800
 
-#define D3DFVF_RESERVED2        0xf000  // 4 reserved bits
+#define D3DFVF_RESERVED2        0xf000
 
 #define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
 #define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
@@ -1643,25 +1286,21 @@ typedef struct _D3DVERTEXBUFFERDESC {
 #define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
                           D3DFVF_TEX1 )
 
-typedef struct _D3DDP_PTRSTRIDE
-{
-    LPVOID lpvData;
-    DWORD  dwStride;
+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
-//
+typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA  {
+  D3DDP_PTRSTRIDE position;
+  D3DDP_PTRSTRIDE normal;
+  D3DDP_PTRSTRIDE diffuse;
+  D3DDP_PTRSTRIDE specular;
+  D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD];
+} D3DDRAWPRIMITIVESTRIDEDDATA ,*LPD3DDRAWPRIMITIVESTRIDEDDATA;
+
 #define D3DVIS_INSIDE_FRUSTUM       0
 #define D3DVIS_INTERSECT_FRUSTUM    1
 #define D3DVIS_OUTSIDE_FRUSTUM      2
@@ -1692,7 +1331,44 @@ typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA
 #define D3DVIS_MASK_NEAR            (3 << 10)
 #define D3DVIS_MASK_FAR             (3 << 12)
 
+#define D3DDEVINFOID_TEXTUREMANAGER    1
+#define D3DDEVINFOID_D3DTEXTUREMANAGER 2
+#define D3DDEVINFOID_TEXTURING         3
 
-#pragma pack()
-#endif /* _D3DTYPES_H_ */
+typedef enum _D3DSTATEBLOCKTYPE
+{
+    D3DSBT_ALL           = 1,
+    D3DSBT_PIXELSTATE    = 2,
+    D3DSBT_VERTEXSTATE   = 3,
+    D3DSBT_FORCE_DWORD   = 0xffffffff
+} D3DSTATEBLOCKTYPE;
+
+typedef enum _D3DVERTEXBLENDFLAGS
+{
+    D3DVBLEND_DISABLE  = 0,
+    D3DVBLEND_1WEIGHT  = 1,
+    D3DVBLEND_2WEIGHTS = 2,
+    D3DVBLEND_3WEIGHTS = 3,
+} D3DVERTEXBLENDFLAGS;
+
+typedef enum _D3DTEXTURETRANSFORMFLAGS {
+    D3DTTFF_DISABLE         = 0,
+    D3DTTFF_COUNT1          = 1,
+    D3DTTFF_COUNT2          = 2,
+    D3DTTFF_COUNT3          = 3,
+    D3DTTFF_COUNT4          = 4,
+    D3DTTFF_PROJECTED       = 256,
+    D3DTTFF_FORCE_DWORD     = 0x7fffffff
+} D3DTEXTURETRANSFORMFLAGS;
+
+#define D3DFVF_TEXTUREFORMAT2 0
+#define D3DFVF_TEXTUREFORMAT1 3
+#define D3DFVF_TEXTUREFORMAT3 1
+#define D3DFVF_TEXTUREFORMAT4 2
+
+#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
diff --git a/misc/builddeps/dp.win32/include/d3dvec.inl b/misc/builddeps/dp.win32/include/d3dvec.inl
new file mode 100644 (file)
index 0000000..9418dd2
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2000 Ove Kaaven
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3DVEC_INL
+#define __WINE_D3DVEC_INL
+
+/*** constructors ***/
+
+inline _D3DVECTOR::_D3DVECTOR(D3DVALUE f)
+{
+  x = y = z = f;
+}
+
+inline _D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z)
+{
+  x = _x; y = _y; z = _z;
+}
+
+/*** assignment operators ***/
+
+inline _D3DVECTOR& _D3DVECTOR::operator += (const _D3DVECTOR& v)
+{
+  x += v.x; y += v.y; z += v.z;
+  return *this;
+}
+
+inline _D3DVECTOR& _D3DVECTOR::operator -= (const _D3DVECTOR& v)
+{
+  x -= v.x; y -= v.y; z -= v.z;
+  return *this;
+}
+
+inline _D3DVECTOR& _D3DVECTOR::operator *= (const _D3DVECTOR& v)
+{
+  x *= v.x; y *= v.y; z *= v.z;
+  return *this;
+}
+
+inline _D3DVECTOR& _D3DVECTOR::operator /= (const _D3DVECTOR& v)
+{
+  x /= v.x; y /= v.y; z /= v.z;
+  return *this;
+}
+
+inline _D3DVECTOR& _D3DVECTOR::operator *= (D3DVALUE s)
+{
+  x *= s; y *= s; z *= s;
+  return *this;
+}
+
+inline _D3DVECTOR& _D3DVECTOR::operator /= (D3DVALUE s)
+{
+  x /= s; y /= s; z /= s;
+  return *this;
+}
+
+/*** unary operators ***/
+
+inline _D3DVECTOR operator + (const _D3DVECTOR& v)
+{
+  return v;
+}
+
+inline _D3DVECTOR operator - (const _D3DVECTOR& v)
+{
+  return _D3DVECTOR(-v.x, -v.y, -v.z);
+}
+
+/*** binary operators ***/
+
+inline _D3DVECTOR operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
+{
+  return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
+}
+
+inline _D3DVECTOR operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2)
+{
+  return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
+}
+
+inline _D3DVECTOR operator * (const _D3DVECTOR& v, D3DVALUE s)
+{
+  return _D3DVECTOR(v.x*s, v.y*s, v.z*s);
+}
+
+inline _D3DVECTOR operator * (D3DVALUE s, const _D3DVECTOR& v)
+{
+  return _D3DVECTOR(v.x*s, v.y*s, v.z*s);
+}
+
+inline _D3DVECTOR operator / (const _D3DVECTOR& v, D3DVALUE s)
+{
+  return _D3DVECTOR(v.x/s, v.y/s, v.z/s);
+}
+
+inline D3DVALUE SquareMagnitude(const _D3DVECTOR& v)
+{
+  return v.x*v.x + v.y*v.y + v.z*v.z; /* DotProduct(v, v) */
+}
+
+inline D3DVALUE Magnitude(const _D3DVECTOR& v)
+{
+  return sqrt(SquareMagnitude(v));
+}
+
+inline _D3DVECTOR Normalize(const _D3DVECTOR& v)
+{
+  return v / Magnitude(v);
+}
+
+inline D3DVALUE DotProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2)
+{
+  return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
+}
+
+inline _D3DVECTOR CrossProduct(const _D3DVECTOR& v1, const _D3DVECTOR& v2)
+{
+  _D3DVECTOR res;
+  /* this is a left-handed cross product, right? */
+  res.x = v1.y * v2.z - v1.z * v2.y;
+  res.y = v1.z * v2.x - v1.x * v2.z;
+  res.z = v1.x * v2.y - v1.y * v2.x;
+  return res;
+}
+
+#endif
diff --git a/misc/builddeps/dp.win32/include/d3dx9.h b/misc/builddeps/dp.win32/include/d3dx9.h
new file mode 100644 (file)
index 0000000..09ae553
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007 David Adam
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __D3DX9_H__
+#define __D3DX9_H__
+
+#include <limits.h>
+
+#define D3DX_DEFAULT         ((UINT)-1)
+#define D3DX_DEFAULT_NONPOW2 ((UINT)-2)
+#define D3DX_DEFAULT_FLOAT   FLT_MAX
+#define D3DX_FROM_FILE       ((UINT)-3)
+#define D3DFMT_FROM_FILE     ((D3DFORMAT)-3)
+
+#include "d3d9.h"
+#include "d3dx9math.h"
+#include "d3dx9core.h"
+#include "d3dx9mesh.h"
+#include "d3dx9shader.h"
+#include "d3dx9effect.h"
+#include "d3dx9shape.h"
+#include "d3dx9tex.h"
+
+#define _FACDD 0x876
+#define MAKE_DDHRESULT(code) MAKE_HRESULT(1, _FACDD, code)
+
+enum _D3DXERR {
+    D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900),
+    D3DXERR_INVALIDMESH             = MAKE_DDHRESULT(2901),
+    D3DXERR_CANNOTATTRSORT          = MAKE_DDHRESULT(2902),
+    D3DXERR_SKINNINGNOTSUPPORTED    = MAKE_DDHRESULT(2903),
+    D3DXERR_TOOMANYINFLUENCES       = MAKE_DDHRESULT(2904),
+    D3DXERR_INVALIDDATA             = MAKE_DDHRESULT(2905),
+    D3DXERR_LOADEDMESHASNODATA      = MAKE_DDHRESULT(2906),
+    D3DXERR_DUPLICATENAMEDFRAGMENT  = MAKE_DDHRESULT(2907),
+    D3DXERR_CANNOTREMOVELASTITEM    = MAKE_DDHRESULT(2908),
+};
+
+#endif
diff --git a/misc/builddeps/dp.win32/include/d3dx9core.h b/misc/builddeps/dp.win32/include/d3dx9core.h
new file mode 100644 (file)
index 0000000..c1b948e
--- /dev/null
@@ -0,0 +1,496 @@
+/*
+ * Copyright (C) 2007, 2008 Tony Wasserka
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <_mingw_dxhelper.h>
+#include <d3dx9.h>
+
+#ifndef __WINE_D3DX9CORE_H
+#define __WINE_D3DX9CORE_H
+
+/**********************************************
+ ***************** Definitions ****************
+ **********************************************/
+/* D3DX_VERSION will be completely ignored since we are
+    implementing all dlls from d3dx9_24 to d3dx9_36 */
+#define D3DX_VERSION 0x0902
+#define D3DX_SDK_VERSION 36
+#define D3DXSPRITE_DONOTSAVESTATE           1
+#define D3DXSPRITE_DONOTMODIFY_RENDERSTATE  2
+#define D3DXSPRITE_OBJECTSPACE              4
+#define D3DXSPRITE_BILLBOARD                8
+#define D3DXSPRITE_ALPHABLEND              16
+#define D3DXSPRITE_SORT_TEXTURE            32
+#define D3DXSPRITE_SORT_DEPTH_FRONTTOBACK  64
+#define D3DXSPRITE_SORT_DEPTH_BACKTOFRONT 128
+#define D3DXSPRITE_DO_NOT_ADDREF_TEXTURE  256
+
+/**********************************************
+ ******************** GUIDs *******************
+ **********************************************/
+DEFINE_GUID(IID_ID3DXBuffer, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
+DEFINE_GUID(IID_ID3DXFont, 0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
+DEFINE_GUID(IID_ID3DXLine, 0xd379ba7f, 0x9042, 0x4ac4, 0x9f, 0x5e, 0x58, 0x19, 0x2a, 0x4c, 0x6b, 0xd8);
+DEFINE_GUID(IID_ID3DXRenderToEnvMap, 0x313f1b4b, 0xc7b0, 0x4fa2, 0x9d, 0x9d, 0x8d, 0x38, 0xb, 0x64, 0x38, 0x5e);
+DEFINE_GUID(IID_ID3DXRenderToSurface, 0x6985f346, 0x2c3d, 0x43b3, 0xbe, 0x8b, 0xda, 0xae, 0x8a, 0x3, 0xd8, 0x94);
+DEFINE_GUID(IID_ID3DXSprite, 0xba0b762d, 0x7d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
+
+/**********************************************
+ ****************** typedefs ******************
+ **********************************************/
+typedef struct ID3DXBuffer *LPD3DXBUFFER;
+typedef struct ID3DXFont *LPD3DXFONT;
+typedef struct ID3DXLine *LPD3DXLINE;
+typedef struct ID3DXRenderToEnvMap *LPD3DXRenderToEnvMap;
+typedef struct ID3DXRenderToSurface *LPD3DXRENDERTOSURFACE;
+typedef struct ID3DXSprite *LPD3DXSPRITE;
+
+/**********************************************
+ *********** interface declarations ***********
+ **********************************************/
+#define INTERFACE ID3DXBuffer
+DECLARE_INTERFACE_(ID3DXBuffer, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXBuffer methods ***/
+    STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
+    STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define ID3DXBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define ID3DXBuffer_Release(p)            (p)->lpVtbl->Release(p)
+/*** ID3DXBuffer methods ***/
+#define ID3DXBuffer_GetBufferPointer(p)   (p)->lpVtbl->GetBufferPointer(p)
+#define ID3DXBuffer_GetBufferSize(p)      (p)->lpVtbl->GetBufferSize(p)
+#else
+/*** IUnknown methods ***/
+#define ID3DXBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define ID3DXBuffer_AddRef(p)             (p)->AddRef()
+#define ID3DXBuffer_Release(p)            (p)->Release()
+/*** ID3DXBuffer methods ***/
+#define ID3DXBuffer_GetBufferPointer(p)   (p)->GetBufferPointer()
+#define ID3DXBuffer_GetBufferSize(p)      (p)->GetBufferSize()
+#endif
+
+typedef struct _D3DXFONT_DESCA
+{
+    INT Height;
+    UINT Width;
+    UINT Weight;
+    UINT MipLevels;
+    BOOL Italic;
+    BYTE CharSet;
+    BYTE OutputPrecision;
+    BYTE Quality;
+    BYTE PitchAndFamily;
+    CHAR FaceName[LF_FACESIZE];
+} D3DXFONT_DESCA, *LPD3DXFONT_DESCA;
+
+typedef struct _D3DXFONT_DESCW
+{
+    INT Height;
+    UINT Width;
+    UINT Weight;
+    UINT MipLevels;
+    BOOL Italic;
+    BYTE CharSet;
+    BYTE OutputPrecision;
+    BYTE Quality;
+    BYTE PitchAndFamily;
+    WCHAR FaceName[LF_FACESIZE];
+} D3DXFONT_DESCW, *LPD3DXFONT_DESCW;
+
+DECL_WINELIB_TYPE_AW(D3DXFONT_DESC)
+DECL_WINELIB_TYPE_AW(LPD3DXFONT_DESC)
+
+#define INTERFACE ID3DXFont
+DECLARE_INTERFACE_(ID3DXFont, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXFont methods ***/
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
+    STDMETHOD(GetDescA)(THIS_ D3DXFONT_DESCA *desc) PURE;
+    STDMETHOD(GetDescW)(THIS_ D3DXFONT_DESCW *desc) PURE;
+    STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *metrics) PURE;
+    STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *metrics) PURE;
+
+    STDMETHOD_(HDC, GetDC)(THIS) PURE;
+    STDMETHOD(GetGlyphData)(THIS_ UINT glyph, LPDIRECT3DTEXTURE9 *texture, RECT *blackbox, POINT *cellinc) PURE;
+
+    STDMETHOD(PreloadCharacters)(THIS_ UINT first, UINT last) PURE;
+    STDMETHOD(PreloadGlyphs)(THIS_ UINT first, UINT last) PURE;
+    STDMETHOD(PreloadTextA)(THIS_ LPCSTR string, INT count) PURE;
+    STDMETHOD(PreloadTextW)(THIS_ LPCWSTR string, INT count) PURE;
+
+    STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DXSPRITE sprite, LPCSTR string, INT count, LPRECT rect, DWORD format, D3DCOLOR color) PURE;
+    STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DXSPRITE sprite, LPCWSTR string, INT count, LPRECT rect, DWORD format, D3DCOLOR color) PURE;
+
+    STDMETHOD(OnLostDevice)(THIS) PURE;
+    STDMETHOD(OnResetDevice)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+
+/*** IUnknown methods ***/
+#define ID3DXFont_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXFont_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define ID3DXFont_Release(p)               (p)->lpVtbl->Release(p)
+/*** ID3DXFont methods ***/
+#define ID3DXFont_GetDevice(p,a)           (p)->lpVtbl->GetDevice(p,a)
+#define ID3DXFont_GetDescA(p,a)            (p)->lpVtbl->GetDescA(p,a)
+#define ID3DXFont_GetDescW(p,a)            (p)->lpVtbl->GetDescW(p,a)
+#define ID3DXFont_GetTextMetricsA(p,a)     (p)->lpVtbl->GetTextMetricsA(p,a)
+#define ID3DXFont_GetTextMetricsW(p,a)     (p)->lpVtbl->GetTextMetricsW(p,a)
+#define ID3DXFont_GetDC(p)                 (p)->lpVtbl->GetDC(p)
+#define ID3DXFont_GetGlyphData(p,a,b,c,d)  (p)->lpVtbl->GetGlyphData(p,a,b,c,d)
+#define ID3DXFont_PreloadCharacters(p,a,b) (p)->lpVtbl->PreloadCharacters(p,a,b)
+#define ID3DXFont_PreloadGlyphs(p,a,b)     (p)->lpVtbl->PreloadGlyphs(p,a,b)
+#define ID3DXFont_PreloadTextA(p,a,b)      (p)->lpVtbl->PreloadTextA(p,a,b)
+#define ID3DXFont_PreloadTextW(p,a,b)      (p)->lpVtbl->PreloadTextW(p,a,b)
+#define ID3DXFont_DrawTextA(p,a,b,c,d,e,f) (p)->lpVtbl->DrawTextA(p,a,b,c,d,e,f)
+#define ID3DXFont_DrawTextW(p,a,b,c,d,e,f) (p)->lpVtbl->DrawTextW(p,a,b,c,d,e,f)
+#define ID3DXFont_OnLostDevice(p)          (p)->lpVtbl->OnLostDevice(p)
+#define ID3DXFont_OnResetDevice(p)         (p)->lpVtbl->OnResetDevice(p)
+#else
+/*** IUnknown methods ***/
+#define ID3DXFont_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
+#define ID3DXFont_AddRef(p)                (p)->AddRef()
+#define ID3DXFont_Release(p)               (p)->Release()
+/*** ID3DXFont methods ***/
+#define ID3DXFont_GetDevice(p,a)           (p)->GetDevice(a)
+#define ID3DXFont_GetDescA(p,a)            (p)->GetDescA(a)
+#define ID3DXFont_GetDescW(p,a)            (p)->GetDescW(a)
+#define ID3DXFont_GetTextMetricsA(p,a)     (p)->GetTextMetricsA(a)
+#define ID3DXFont_GetTextMetricsW(p,a)     (p)->GetTextMetricsW(a)
+#define ID3DXFont_GetDC(p)                 (p)->GetDC()
+#define ID3DXFont_GetGlyphData(p,a,b,c,d)  (p)->GetGlyphData(a,b,c,d)
+#define ID3DXFont_PreloadCharacters(p,a,b) (p)->PreloadCharacters(a,b)
+#define ID3DXFont_PreloadGlyphs(p,a,b)     (p)->PreloadGlyphs(a,b)
+#define ID3DXFont_PreloadTextA(p,a,b)      (p)->PreloadTextA(a,b)
+#define ID3DXFont_PreloadTextW(p,a,b)      (p)->PreloadTextW(a,b)
+#define ID3DXFont_DrawTextA(p,a,b,c,d,e,f) (p)->DrawTextA(a,b,c,d,e,f)
+#define ID3DXFont_DrawTextW(p,a,b,c,d,e,f) (p)->DrawTextW(a,b,c,d,e,f)
+#define ID3DXFont_OnLostDevice(p)          (p)->OnLostDevice()
+#define ID3DXFont_OnResetDevice(p)         (p)->OnResetDevice()
+#endif
+#define ID3DXFont_DrawText       WINELIB_NAME_AW(ID3DXFont_DrawText)
+#define ID3DXFont_GetDesc        WINELIB_NAME_AW(ID3DXFont_GetDesc)
+#define ID3DXFont_GetTextMetrics WINELIB_NAME_AW(ID3DXFont_GetTextMetrics)
+#define ID3DXFont_PreloadText    WINELIB_NAME_AW(ID3DXFont_PreloadText)
+
+#define INTERFACE ID3DXLine
+DECLARE_INTERFACE_(ID3DXLine, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+    /*** ID3DXLine methods ***/
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
+
+    STDMETHOD(Begin)(THIS) PURE;
+    STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *vertexlist, DWORD vertexlistcount, D3DCOLOR color) PURE;
+    STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *vertexlist, DWORD vertexlistcount,
+                             CONST D3DXMATRIX *transform, D3DCOLOR color) PURE;
+    STDMETHOD(SetPattern)(THIS_ DWORD pattern) PURE;
+    STDMETHOD_(DWORD, GetPattern)(THIS) PURE;
+    STDMETHOD(SetPatternScale)(THIS_ FLOAT scale) PURE;
+    STDMETHOD_(FLOAT, GetPatternScale)(THIS) PURE;
+    STDMETHOD(SetWidth)(THIS_ FLOAT width) PURE;
+    STDMETHOD_(FLOAT, GetWidth)(THIS) PURE;
+    STDMETHOD(SetAntialias)(THIS_ BOOL antialias) PURE;
+    STDMETHOD_(BOOL, GetAntialias)(THIS) PURE;
+    STDMETHOD(SetGLLines)(THIS_ BOOL gl_lines) PURE;
+    STDMETHOD_(BOOL, GetGLLines)(THIS) PURE;
+    STDMETHOD(End)(THIS) PURE;
+
+    STDMETHOD(OnLostDevice)(THIS) PURE;
+    STDMETHOD(OnResetDevice)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define ID3DXLine_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXLine_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define ID3DXLine_Release(p)               (p)->lpVtbl->Release(p)
+/*** ID3DXLine methods ***/
+#define ID3DXLine_GetDevice(p,a)           (p)->lpVtbl->GetDevice(p,a)
+#define ID3DXLine_Begin(p)                 (p)->lpVtbl->Begin(p)
+#define ID3DXLine_Draw(p,a,b,c)            (p)->lpVtbl->Draw(p,a,b,c)
+#define ID3DXLine_DrawTransform(p,a,b,c,d) (p)->lpVtbl->DrawTransform(p,a,b,c,d)
+#define ID3DXLine_SetPattern(p,a)          (p)->lpVtbl->SetPattern(p,a)
+#define ID3DXLine_GetPattern(p)            (p)->lpVtbl->GetPattern(p)
+#define ID3DXLine_SetPatternScale(p,a)     (p)->lpVtbl->SetPatternScale(p,a)
+#define ID3DXLine_GetPatternScale(p)       (p)->lpVtbl->GetPatternScale(p)
+#define ID3DXLine_SetWidth(p,a)            (p)->lpVtbl->SetWidth(p,a)
+#define ID3DXLine_GetWidth(p)              (p)->lpVtbl->GetWidth(p)
+#define ID3DXLine_SetAntialias(p,a)        (p)->lpVtbl->SetAntialias(p,a)
+#define ID3DXLine_GetAntialias(p)          (p)->lpVtbl->GetAntialias(p)
+#define ID3DXLine_SetGLLines(p,a)          (p)->lpVtbl->SetGLLines(p,a)
+#define ID3DXLine_GetGLLines(p)            (p)->lpVtbl->GetGLLines(p)
+#define ID3DXLine_End(p)                   (p)->lpVtbl->End(p)
+#define ID3DXLine_OnLostDevice(p)          (p)->lpVtbl->OnLostDevice(p)
+#define ID3DXLine_OnResetDevice(p)         (p)->lpVtbl->OnResetDevice(p)
+#else
+/*** IUnknown methods ***/
+#define ID3DXLine_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
+#define ID3DXLine_AddRef(p)                (p)->AddRef()
+#define ID3DXLine_Release(p)               (p)->Release()
+/*** ID3DXLine methods ***/
+#define ID3DXLine_GetDevice(p,a)           (p)->GetDevice(a)
+#define ID3DXLine_Begin(p)                 (p)->Begin()
+#define ID3DXLine_Draw(p,a,b,c)            (p)->Draw(a,b,c)
+#define ID3DXLine_DrawTransform(p,a,b,c,d) (p)->DrawTransform(a,b,c,d)
+#define ID3DXLine_SetPattern(p,a)          (p)->SetPattern(a)
+#define ID3DXLine_GetPattern(p)            (p)->GetPattern()
+#define ID3DXLine_SetPatternScale(p,a)     (p)->SetPatternScale(a)
+#define ID3DXLine_GetPatternScale(p)       (p)->GetPatternScale()
+#define ID3DXLine_SetWidth(p,a)            (p)->SetWidth(a)
+#define ID3DXLine_GetWidth(p)              (p)->GetWidth()
+#define ID3DXLine_SetAntialias(p,a)        (p)->SetAntialias(a)
+#define ID3DXLine_GetAntialias(p)          (p)->GetAntialias()
+#define ID3DXLine_SetGLLines(p,a)          (p)->SetGLLines(a)
+#define ID3DXLine_GetGLLines(p)            (p)->GetGLLines()
+#define ID3DXLine_End(p)                   (p)->End()
+#define ID3DXLine_OnLostDevice(p)          (p)->OnLostDevice()
+#define ID3DXLine_OnResetDevice(p)         (p)->OnResetDevice()
+#endif
+
+typedef struct _D3DXRTE_DESC
+{
+    UINT Size;
+    UINT MipLevels;
+    D3DFORMAT Format;
+    BOOL DepthStencil;
+    D3DFORMAT DepthStencilFormat;
+} D3DXRTE_DESC;
+
+#define INTERFACE ID3DXRenderToEnvMap
+DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+    /*** ID3DXRenderToEnvMap methods ***/
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DXRTE_DESC *desc) PURE;
+
+    STDMETHOD(BeginCube)(THIS_ LPDIRECT3DCUBETEXTURE9 cubetex) PURE;
+    STDMETHOD(BeginSphere)(THIS_ LPDIRECT3DTEXTURE9 tex) PURE;
+    STDMETHOD(BeginHemisphere)(THIS_ LPDIRECT3DTEXTURE9 texzpos, LPDIRECT3DTEXTURE9 texzneg) PURE;
+    STDMETHOD(BeginParabolic)(THIS_ LPDIRECT3DTEXTURE9 texzpos, LPDIRECT3DTEXTURE9 texzneg) PURE;
+
+    STDMETHOD(Face)(THIS_ D3DCUBEMAP_FACES face, DWORD mipfilter) PURE;
+    STDMETHOD(End)(THIS_ DWORD mipfilter) PURE;
+
+    STDMETHOD(OnLostDevice)(THIS) PURE;
+    STDMETHOD(OnResetDevice)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define ID3DXRenderToEnvMap_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXRenderToEnvMap_AddRef(p)              (p)->lpVtbl->AddRef(p)
+#define ID3DXRenderToEnvMap_Release(p)             (p)->lpVtbl->Release(p)
+/*** ID3DXRenderToEnvMap methods ***/
+#define ID3DXRenderToEnvMap_GetDevice(p,a)         (p)->lpVtbl->GetDevice(p,a)
+#define ID3DXRenderToEnvMap_GetDesc(p,a)           (p)->lpVtbl->GetDesc(p,a)
+#define ID3DXRenderToEnvMap_BeginCube(p,a)         (p)->lpVtbl->BeginCube(p,a)
+#define ID3DXRenderToEnvMap_BeginSphere(p,a)       (p)->lpVtbl->BeginSphere(p,a)
+#define ID3DXRenderToEnvMap_BeginHemisphere(p,a,b) (p)->lpVtbl->BeginHemisphere(p,a,b)
+#define ID3DXRenderToEnvMap_BeginParabolic(p,a,b)  (p)->lpVtbl->BeginParabolic(p,a,b)
+#define ID3DXRenderToEnvMap_Face(p,a,b)            (p)->lpVtbl->Face(p,a,b)
+#define ID3DXRenderToEnvMap_End(p,a)               (p)->lpVtbl->End(p,a)
+#define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->lpVtbl->OnLostDevice(p)
+#define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->lpVtbl->OnLostDevice(p)
+#else
+/*** IUnknown methods ***/
+#define ID3DXRenderToEnvMap_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
+#define ID3DXRenderToEnvMap_AddRef(p)              (p)->AddRef()
+#define ID3DXRenderToEnvMap_Release(p)             (p)->Release()
+/*** ID3DXRenderToEnvMap methods ***/
+#define ID3DXRenderToEnvMap_GetDevice(p,a)         (p)->GetDevice(a)
+#define ID3DXRenderToEnvMap_GetDesc(p,a)           (p)->GetDesc(a)
+#define ID3DXRenderToEnvMap_BeginCube(p,a)         (p)->BeginCube(a)
+#define ID3DXRenderToEnvMap_BeginSphere(p,a)       (p)->BeginSphere(a)
+#define ID3DXRenderToEnvMap_BeginHemisphere(p,a,b) (p)->BeginHemisphere(a,b)
+#define ID3DXRenderToEnvMap_BeginParabolic(p,a,b)  (p)->BeginParabolic(a,b)
+#define ID3DXRenderToEnvMap_Face(p,a,b)            (p)->Face(a,b)
+#define ID3DXRenderToEnvMap_End(p,a)               (p)->End(a)
+#define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->OnLostDevice()
+#define ID3DXRenderToEnvMap_OnLostDevice(p)        (p)->OnLostDevice()
+#endif
+
+typedef struct _D3DXRTS_DESC
+{
+    UINT Width;
+    UINT Height;
+    D3DFORMAT Format;
+    BOOL DepthStencil;
+    D3DFORMAT DepthStencilFormat;
+} D3DXRTS_DESC;
+
+#define INTERFACE ID3DXRenderToSurface
+DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXRenderToSurface methods ***/
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
+    STDMETHOD(GetDesc)(THIS_ D3DXRTS_DESC *desc) PURE;
+
+    STDMETHOD(BeginScene)(THIS_ LPDIRECT3DSURFACE9 surface, CONST D3DVIEWPORT9 *viewport) PURE;
+    STDMETHOD(EndScene)(THIS_ DWORD mipfilter) PURE;
+
+    STDMETHOD(OnLostDevice)(THIS) PURE;
+    STDMETHOD(OnResetDevice)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define ID3DXRenderToSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXRenderToSurface_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define ID3DXRenderToSurface_Release(p)            (p)->lpVtbl->Release(p)
+/*** ID3DXRenderToSurface methods ***/
+#define ID3DXRenderToSurface_GetDevice(p,a)        (p)->lpVtbl->GetDevice(p,a)
+#define ID3DXRenderToSurface_GetDesc(p,a)          (p)->lpVtbl->GetDesc(p,a)
+#define ID3DXRenderToSurface_BeginScene(p,a,b)     (p)->lpVtbl->BeginScene(p,a,b)
+#define ID3DXRenderToSurface_EndScene(p,a)         (p)->lpVtbl->EndScene(p,a)
+#define ID3DXRenderToSurface_OnLostDevice(p)       (p)->lpVtbl->OnLostDevice(p)
+#define ID3DXRenderToSurface_OnResetDevice(p)      (p)->lpVtbl->OnResetDevice(p)
+#else
+/*** IUnknown methods ***/
+#define ID3DXRenderToSurface_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define ID3DXRenderToSurface_AddRef(p)             (p)->AddRef()
+#define ID3DXRenderToSurface_Release(p)            (p)->Release()
+/*** ID3DXRenderToSurface methods ***/
+#define ID3DXRenderToSurface_GetDevice(p,a)        (p)->GetDevice(a)
+#define ID3DXRenderToSurface_GetDesc(p,a)          (p)->GetDesc(a)
+#define ID3DXRenderToSurface_BeginScene(p,a,b)     (p)->BeginScene(a,b)
+#define ID3DXRenderToSurface_EndScene(p,a)         (p)->EndScene(a)
+#define ID3DXRenderToSurface_OnLostDevice(p)       (p)->OnLostDevice()
+#define ID3DXRenderToSurface_OnResetDevice(p)      (p)->OnResetDevice()
+#endif
+
+#define INTERFACE ID3DXSprite
+DECLARE_INTERFACE_(ID3DXSprite, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXSprite methods ***/
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9 *device) PURE;
+
+    STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *transform) PURE;
+    STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *transform) PURE;
+    STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *world, CONST D3DXMATRIX *view) PURE;
+    STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *world, CONST D3DXMATRIX *view) PURE;
+
+    STDMETHOD(Begin)(THIS_ DWORD flags) PURE;
+    STDMETHOD(Draw)(THIS_ LPDIRECT3DTEXTURE9 texture, CONST RECT *rect, CONST D3DXVECTOR3 *center, CONST D3DXVECTOR3 *position, D3DCOLOR color) PURE;
+    STDMETHOD(Flush)(THIS) PURE;
+    STDMETHOD(End)(THIS) PURE;
+
+    STDMETHOD(OnLostDevice)(THIS) PURE;
+    STDMETHOD(OnResetDevice)(THIS) PURE;
+};
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define ID3DXSprite_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXSprite_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define ID3DXSprite_Release(p)            (p)->lpVtbl->Release(p)
+/*** ID3DXSprite methods ***/
+#define ID3DXSprite_GetDevice(p,a)        (p)->lpVtbl->GetDevice(p,a)
+#define ID3DXSprite_GetTransform(p,a)     (p)->lpVtbl->GetTransform(p,a)
+#define ID3DXSprite_SetTransform(p,a)     (p)->lpVtbl->SetTransform(p,a)
+#define ID3DXSprite_SetWorldViewRH(p,a,b) (p)->lpVtbl->SetWorldViewRH(p,a,b)
+#define ID3DXSprite_SetWorldViewLH(p,a,b) (p)->lpVtbl->SetWorldViewLH(p,a,b)
+#define ID3DXSprite_Begin(p,a)            (p)->lpVtbl->Begin(p,a)
+#define ID3DXSprite_Draw(p,a,b,c,d,e)     (p)->lpVtbl->Draw(p,a,b,c,d,e)
+#define ID3DXSprite_Flush(p)              (p)->lpVtbl->Flush(p)
+#define ID3DXSprite_End(p)                (p)->lpVtbl->End(p)
+#define ID3DXSprite_OnLostDevice(p)       (p)->lpVtbl->OnLostDevice(p)
+#define ID3DXSprite_OnResetDevice(p)      (p)->lpVtbl->OnResetDevice(p)
+#else
+/*** IUnknown methods ***/
+#define ID3DXSprite_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
+#define ID3DXSprite_AddRef(p)                (p)->AddRef()
+#define ID3DXSprite_Release(p)               (p)->Release()
+/*** ID3DXSprite methods ***/
+#define ID3DXSprite_GetDevice(p,a)        (p)->GetDevice(a)
+#define ID3DXSprite_GetTransform(p,a)     (p)->GetTransform(a)
+#define ID3DXSprite_SetTransform(p,a)     (p)->SetTransform(a)
+#define ID3DXSprite_SetWorldViewRH(p,a,b) (p)->SetWorldViewRH(a,b)
+#define ID3DXSprite_SetWorldViewLH(p,a,b) (p)->SetWorldViewLH(a,b)
+#define ID3DXSprite_Begin(p,a)            (p)->Begin(a)
+#define ID3DXSprite_Draw(p,a,b,c,d,e)     (p)->Draw(a,b,c,d,e)
+#define ID3DXSprite_Flush(p)              (p)->Flush()
+#define ID3DXSprite_End(p)                (p)->End()
+#define ID3DXSprite_OnLostDevice(p)       (p)->OnLostDevice()
+#define ID3DXSprite_OnResetDevice(p)      (p)->OnResetDevice()
+#endif
+
+/**********************************************
+ ****************** functions *****************
+ **********************************************/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+BOOL    WINAPI D3DXCheckVersion(UINT d3dsdkvers, UINT d3dxsdkvers);
+HRESULT WINAPI D3DXCreateFontA(LPDIRECT3DDEVICE9 device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset,
+                               DWORD precision, DWORD quality, DWORD pitchandfamily, LPCSTR facename, LPD3DXFONT *font);
+HRESULT WINAPI D3DXCreateFontW(LPDIRECT3DDEVICE9 device, INT height, UINT width, UINT weight, UINT miplevels, BOOL italic, DWORD charset,
+                               DWORD precision, DWORD quality, DWORD pitchandfamily, LPCWSTR facename, LPD3DXFONT *font);
+#define        D3DXCreateFont WINELIB_NAME_AW(D3DXCreateFont)
+HRESULT WINAPI D3DXCreateFontIndirectA(LPDIRECT3DDEVICE9 device, CONST D3DXFONT_DESCA *desc, LPD3DXFONT *font);
+HRESULT WINAPI D3DXCreateFontIndirectW(LPDIRECT3DDEVICE9 device, CONST D3DXFONT_DESCW *desc, LPD3DXFONT *font);
+#define        D3DXCreateFontIndirect WINELIB_NAME_AW(D3DXCreateFontIndirect)
+HRESULT WINAPI D3DXCreateLine(LPDIRECT3DDEVICE9 device, LPD3DXLINE *line);
+HRESULT WINAPI D3DXCreateRenderToEnvMap(LPDIRECT3DDEVICE9 device, UINT size, UINT miplevels, D3DFORMAT format, BOOL stencil, D3DFORMAT stencil_format, LPD3DXRenderToEnvMap *rtem);
+HRESULT WINAPI D3DXCreateRenderToSurface(LPDIRECT3DDEVICE9 device, UINT width, UINT height, D3DFORMAT format, BOOL stencil, D3DFORMAT stencil_format, LPD3DXRENDERTOSURFACE *rts);
+HRESULT WINAPI D3DXCreateSprite(LPDIRECT3DDEVICE9 device, LPD3DXSPRITE *sprite);
+BOOL    WINAPI D3DXDebugMute(BOOL mute);
+UINT    WINAPI D3DXGetDriverLevel(LPDIRECT3DDEVICE9 device);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_D3DX9CORE_H */
diff --git a/misc/builddeps/dp.win32/include/d3dx9effect.h b/misc/builddeps/dp.win32/include/d3dx9effect.h
new file mode 100644 (file)
index 0000000..3bb2878
--- /dev/null
@@ -0,0 +1,394 @@
+/*
+ * Copyright 2010 Christian Costa
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <d3dx9.h>
+
+#ifndef __D3DX9EFFECT_H__
+#define __D3DX9EFFECT_H__
+
+typedef struct _D3DXEFFECT_DESC {
+    LPCSTR Creator;
+    UINT Parameters;
+    UINT Techniques;
+    UINT Functions;
+} D3DXEFFECT_DESC;
+
+typedef struct _D3DXPARAMETER_DESC {
+    LPCSTR Name;
+    LPCSTR Semantic;
+    D3DXPARAMETER_CLASS Class;
+    D3DXPARAMETER_TYPE Type;
+    UINT Rows;
+    UINT Columns;
+    UINT Elements;
+    UINT Annotations;
+    UINT StructMembers;
+    DWORD Flags;
+    UINT Bytes;
+} D3DXPARAMETER_DESC;
+
+typedef struct _D3DXTECHNIQUE_DESC {
+    LPCSTR Name;
+    UINT Passes;
+    UINT Annotations;
+} D3DXTECHNIQUE_DESC;
+
+typedef struct _D3DXPASS_DESC {
+    LPCSTR Name;
+    UINT Annotations;
+    CONST DWORD *pVertexShaderFunction;
+    CONST DWORD *pPixelShaderFunction;
+} D3DXPASS_DESC;
+
+typedef struct _D3DXFUNCTION_DESC {
+    LPCSTR Name;
+    UINT Annotations;
+} D3DXFUNCTION_DESC;
+
+typedef struct ID3DXEffectPool *LPD3DXEFFECTPOOL;
+
+DEFINE_GUID(IID_ID3DXEffectPool, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
+
+#undef INTERFACE
+#define INTERFACE ID3DXEffectPool
+
+DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+};
+
+typedef struct ID3DXBaseEffect *LPD3DXBASEEFFECT;
+
+DEFINE_GUID(IID_ID3DXBaseEffect, 0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0xf6, 0xef, 0x1e, 0x56, 0xbe);
+
+#undef INTERFACE
+#define INTERFACE ID3DXBaseEffect
+
+DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXBaseEffect methods ***/
+    STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* desc) PURE;
+    STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE parameter, D3DXPARAMETER_DESC* desc) PURE;
+    STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE technique, D3DXTECHNIQUE_DESC* desc) PURE;
+    STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE pass, D3DXPASS_DESC* desc) PURE;
+    STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE shader, D3DXFUNCTION_DESC* desc) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE parameter, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, LPCSTR semantic) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE parameter, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE technique, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT index);
+    STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR name);
+    STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE object, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, LPCSTR name) PURE;
+    STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT bytes) PURE;
+    STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, LPVOID data, UINT bytes) PURE;
+    STDMETHOD(SetBool)(THIS_ D3DXHANDLE parameter, BOOL b) PURE;
+    STDMETHOD(GetBool)(THIS_ D3DXHANDLE parameter, BOOL* b) PURE;
+    STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, CONST BOOL* b, UINT count) PURE;
+    STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE parameter, BOOL* b, UINT count) PURE;
+    STDMETHOD(SetInt)(THIS_ D3DXHANDLE parameter, INT n) PURE;
+    STDMETHOD(GetInt)(THIS_ D3DXHANDLE parameter, INT* n) PURE;
+    STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, CONST INT* n, UINT count) PURE;
+    STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE parameter, INT* n, UINT count) PURE;
+    STDMETHOD(SetFloat)(THIS_ D3DXHANDLE parameter, FLOAT f) PURE;
+    STDMETHOD(GetFloat)(THIS_ D3DXHANDLE parameter, FLOAT* f) PURE;
+    STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, CONST FLOAT* f, UINT count) PURE;
+    STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE parameter, FLOAT* f, UINT count) PURE;
+    STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector) PURE;
+    STDMETHOD(GetVector)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector) PURE;
+    STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count) PURE;
+    STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count) PURE;
+    STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE;
+    STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE;
+    STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE;
+    STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE;
+    STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE;
+    STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
+    STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
+    STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
+    STDMETHOD(SetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9 pshader) PURE;
+    STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader) PURE;
+    STDMETHOD(SetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9 vshader) PURE;
+    STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader) PURE;
+    STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
+};
+
+typedef struct ID3DXEffectStateManager *LPD3DXEFFECTSTATEMANAGER;
+
+DEFINE_GUID(IID_ID3DXEffectStateManager, 0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, 0x37, 0xfa, 0x17, 0x81, 0xc5, 0xce);
+
+#undef INTERFACE
+#define INTERFACE ID3DXEffectStateManager
+
+DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXEffectStateManager methods ***/
+    STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE state, CONST D3DMATRIX* matrix) PURE;
+    STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* material) PURE;
+    STDMETHOD(SetLight)(THIS_ DWORD index, CONST D3DLIGHT9* light) PURE;
+    STDMETHOD(LightEnable)(THIS_ DWORD index, BOOL enable) PURE;
+    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE state, DWORD value) PURE;
+    STDMETHOD(SetTexture)(THIS_ DWORD stage, LPDIRECT3DBASETEXTURE9 texture) PURE;
+    STDMETHOD(SetTextureStageState)(THIS_ DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value) PURE;
+    STDMETHOD(SetSamplerState)(THIS_ DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value) PURE;
+    STDMETHOD(SetNPatchMode)(THIS_ FLOAT num_segments) PURE;
+    STDMETHOD(SetFVF)(THIS_ DWORD format) PURE;
+    STDMETHOD(SetVertexShader)(THIS_ LPDIRECT3DVERTEXSHADER9 shader) PURE;
+    STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT register_index, CONST FLOAT* constant_data, UINT register_count) PURE;
+    STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT register_index, CONST INT* constant_data, UINT register_count) PURE;
+    STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT register_index, CONST BOOL* constant_data, UINT register_count) PURE;
+    STDMETHOD(SetPixelShader)(THIS_ LPDIRECT3DPIXELSHADER9 shader) PURE;
+    STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT register_index, CONST FLOAT* constant_data, UINT register_count) PURE;
+    STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT register_index, CONST INT * constant_data, UINT register_count) PURE;
+    STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT register_index, CONST BOOL* constant_data, UINT register_count) PURE;
+};
+
+typedef struct ID3DXEffect *LPD3DXEFFECT;
+
+DEFINE_GUID(IID_ID3DXEffect, 0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, 0xe5, 0xea, 0xc, 0xd5);
+
+#undef INTERFACE
+#define INTERFACE ID3DXEffect
+
+DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXBaseEffect methods ***/
+    STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* desc) PURE;
+    STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE parameter, D3DXPARAMETER_DESC* desc) PURE;
+    STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE technique, D3DXTECHNIQUE_DESC* desc) PURE;
+    STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE pass, D3DXPASS_DESC* desc) PURE;
+    STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE shader, D3DXFUNCTION_DESC* desc) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE parameter, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, LPCSTR semantic) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE parameter, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE technique, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT index);
+    STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR name);
+    STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE object, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, LPCSTR name) PURE;
+    STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT bytes) PURE;
+    STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, LPVOID data, UINT bytes) PURE;
+    STDMETHOD(SetBool)(THIS_ D3DXHANDLE parameter, BOOL b) PURE;
+    STDMETHOD(GetBool)(THIS_ D3DXHANDLE parameter, BOOL* b) PURE;
+    STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, CONST BOOL* b, UINT count) PURE;
+    STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE parameter, BOOL* b, UINT count) PURE;
+    STDMETHOD(SetInt)(THIS_ D3DXHANDLE parameter, INT n) PURE;
+    STDMETHOD(GetInt)(THIS_ D3DXHANDLE parameter, INT* n) PURE;
+    STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, CONST INT* n, UINT count) PURE;
+    STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE parameter, INT* n, UINT count) PURE;
+    STDMETHOD(SetFloat)(THIS_ D3DXHANDLE parameter, FLOAT f) PURE;
+    STDMETHOD(GetFloat)(THIS_ D3DXHANDLE parameter, FLOAT* f) PURE;
+    STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, CONST FLOAT* f, UINT count) PURE;
+    STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE parameter, FLOAT* f, UINT count) PURE;
+    STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector) PURE;
+    STDMETHOD(GetVector)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector) PURE;
+    STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count) PURE;
+    STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count) PURE;
+    STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE;
+    STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE;
+    STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE;
+    STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE;
+    STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE;
+    STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
+    STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
+    STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
+    STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader) PURE;
+    STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader) PURE;
+    STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
+    /*** ID3DXEffect methods ***/
+    STDMETHOD(GetPool)(THIS_ LPD3DXEFFECTPOOL* pool) PURE;
+    STDMETHOD(SetTechnique)(THIS_ D3DXHANDLE technique) PURE;
+    STDMETHOD_(D3DXHANDLE, GetCurrentTechnique)(THIS) PURE;
+    STDMETHOD(ValidateTechnique)(THIS_ D3DXHANDLE technique) PURE;
+    STDMETHOD(FindNextValidTechnique)(THIS_ D3DXHANDLE technique, D3DXHANDLE* next_technique) PURE;
+    STDMETHOD_(BOOL, IsParameterUsed)(THIS_ D3DXHANDLE parameter, D3DXHANDLE technique) PURE;
+    STDMETHOD(Begin)(THIS_ UINT *passes, DWORD flags) PURE;
+    STDMETHOD(BeginPass)(THIS_ UINT pass) PURE;
+    STDMETHOD(CommitChanges)(THIS) PURE;
+    STDMETHOD(EndPass)(THIS) PURE;
+    STDMETHOD(End)(THIS) PURE;
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* device) PURE;
+    STDMETHOD(OnLostDevice)(THIS) PURE;
+    STDMETHOD(OnResetDevice)(THIS) PURE;
+    STDMETHOD(SetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER manager) PURE;
+    STDMETHOD(GetStateManager)(THIS_ LPD3DXEFFECTSTATEMANAGER* manager) PURE;
+    STDMETHOD(BeginParameterBlock)(THIS) PURE;
+    STDMETHOD_(D3DXHANDLE, EndParameterBlock)(THIS) PURE;
+    STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE;
+    STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE;
+    STDMETHOD(CloneEffect)(THIS_ LPDIRECT3DDEVICE9 device, LPD3DXEFFECT* effect) PURE;
+    STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT byte_offset, UINT bytes) PURE;
+};
+
+typedef struct ID3DXEffectCompiler *LPD3DXEFFECTCOMPILER;
+
+DEFINE_GUID(IID_ID3DXEffectCompiler, 0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4b, 0x30, 0xdb, 0x53, 0xf1, 0xe0);
+
+#undef INTERFACE
+#define INTERFACE ID3DXEffectCompiler
+
+DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXBaseEffect methods ***/
+    STDMETHOD(GetDesc)(THIS_ D3DXEFFECT_DESC* desc) PURE;
+    STDMETHOD(GetParameterDesc)(THIS_ D3DXHANDLE parameter, D3DXPARAMETER_DESC* desc) PURE;
+    STDMETHOD(GetTechniqueDesc)(THIS_ D3DXHANDLE technique, D3DXTECHNIQUE_DESC* desc) PURE;
+    STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE pass, D3DXPASS_DESC* desc) PURE;
+    STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE shader, D3DXFUNCTION_DESC* desc) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE parameter, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, LPCSTR semantic) PURE;
+    STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE parameter, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE technique, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, LPCSTR name) PURE;
+    STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT index);
+    STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR name);
+    STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE object, UINT index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, LPCSTR name) PURE;
+    STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT bytes) PURE;
+    STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, LPVOID data, UINT bytes) PURE;
+    STDMETHOD(SetBool)(THIS_ D3DXHANDLE parameter, BOOL b) PURE;
+    STDMETHOD(GetBool)(THIS_ D3DXHANDLE parameter, BOOL* b) PURE;
+    STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, CONST BOOL* b, UINT count) PURE;
+    STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE parameter, BOOL* b, UINT count) PURE;
+    STDMETHOD(SetInt)(THIS_ D3DXHANDLE parameter, INT n) PURE;
+    STDMETHOD(GetInt)(THIS_ D3DXHANDLE parameter, INT* n) PURE;
+    STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, CONST INT* n, UINT count) PURE;
+    STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE parameter, INT* n, UINT count) PURE;
+    STDMETHOD(SetFloat)(THIS_ D3DXHANDLE parameter, FLOAT f) PURE;
+    STDMETHOD(GetFloat)(THIS_ D3DXHANDLE parameter, FLOAT* f) PURE;
+    STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, CONST FLOAT* f, UINT count) PURE;
+    STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE parameter, FLOAT* f, UINT count) PURE;
+    STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector) PURE;
+    STDMETHOD(GetVector)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector) PURE;
+    STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count) PURE;
+    STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count) PURE;
+    STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE;
+    STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE;
+    STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE;
+    STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE;
+    STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE;
+    STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE;
+    STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE;
+    STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE;
+    STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9 texture) PURE;
+    STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, LPDIRECT3DBASETEXTURE9* texture) PURE;
+    STDMETHOD(SetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9 pshader) PURE;
+    STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DPIXELSHADER9* pshader) PURE;
+    STDMETHOD(SetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9 vshader) PURE;
+    STDMETHOD(GetVertexShader)(THIS_ D3DXHANDLE parameter, LPDIRECT3DVERTEXSHADER9* vshader) PURE;
+    STDMETHOD(SetArrayRange)(THIS_ D3DXHANDLE parameter, UINT start, UINT end) PURE;
+    /*** ID3DXEffectCompiler methods ***/
+    STDMETHOD(SetLiteral)(THIS_ D3DXHANDLE parameter, BOOL literal) PURE;
+    STDMETHOD(GetLiteral)(THIS_ D3DXHANDLE parameter, BOOL* literal) PURE;
+    STDMETHOD(CompileEffect)(THIS_ DWORD flags, LPD3DXBUFFER* effect, LPD3DXBUFFER* error_msgs) PURE;
+    STDMETHOD(CompileShader)(THIS_ D3DXHANDLE function, LPCSTR target, DWORD flags, LPD3DXBUFFER* shader,
+        LPD3DXBUFFER* error_msgs, LPD3DXCONSTANTTABLE* constant_table) PURE;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HRESULT WINAPI D3DXCreateEffectPool(LPD3DXEFFECTPOOL* pool);
+
+HRESULT WINAPI D3DXCreateEffect(LPDIRECT3DDEVICE9 device,
+                                LPCVOID srcdata,
+                                UINT srcdatalen,
+                                CONST D3DXMACRO* defines,
+                                LPD3DXINCLUDE include,
+                                DWORD flags,
+                                LPD3DXEFFECTPOOL pool,
+                                LPD3DXEFFECT* effect,
+                                LPD3DXBUFFER* compilation_errors);
+
+HRESULT WINAPI D3DXCreateEffectEx(LPDIRECT3DDEVICE9 device,
+                                  LPCVOID srcdata,
+                                  UINT srcdatalen,
+                                  CONST D3DXMACRO* defines,
+                                  LPD3DXINCLUDE include,
+                                  LPCSTR skip_constants,
+                                  DWORD flags,
+                                  LPD3DXEFFECTPOOL pool,
+                                  LPD3DXEFFECT* effect,
+                                  LPD3DXBUFFER* compilation_errors);
+
+HRESULT WINAPI D3DXCreateEffectCompiler(LPCSTR srcdata,
+                                        UINT srcdatalen,
+                                        CONST D3DXMACRO* defines,
+                                        LPD3DXINCLUDE include,
+                                        DWORD flags,
+                                        LPD3DXEFFECTCOMPILER* compiler,
+                                        LPD3DXBUFFER* parse_errors);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __D3DX9EFFECT_H__ */
diff --git a/misc/builddeps/dp.win32/include/d3dx9math.h b/misc/builddeps/dp.win32/include/d3dx9math.h
new file mode 100644 (file)
index 0000000..f842e3e
--- /dev/null
@@ -0,0 +1,432 @@
+/*
+ * Copyright (C) 2007 David Adam
+ * Copyright (C) 2007 Tony Wasserka
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <d3dx9.h>
+
+#ifndef __D3DX9MATH_H__
+#define __D3DX9MATH_H__
+
+#include <math.h>
+
+#define D3DX_PI    ((FLOAT)3.141592654)
+#define D3DX_1BYPI ((FLOAT)0.318309886)
+
+#define D3DXToRadian(degree) ((degree) * (D3DX_PI / 180.0f))
+#define D3DXToDegree(radian) ((radian) * (180.0f / D3DX_PI))
+
+
+
+typedef struct D3DXVECTOR2
+{
+#ifdef __cplusplus
+    D3DXVECTOR2();
+    D3DXVECTOR2(CONST FLOAT *pf);
+    D3DXVECTOR2(FLOAT fx, FLOAT fy);
+
+    operator FLOAT* ();
+    operator CONST FLOAT* () const;
+
+    D3DXVECTOR2& operator += (CONST D3DXVECTOR2&);
+    D3DXVECTOR2& operator -= (CONST D3DXVECTOR2&);
+    D3DXVECTOR2& operator *= (FLOAT);
+    D3DXVECTOR2& operator /= (FLOAT);
+
+    D3DXVECTOR2 operator + () const;
+    D3DXVECTOR2 operator - () const;
+
+    D3DXVECTOR2 operator + (CONST D3DXVECTOR2&) const;
+    D3DXVECTOR2 operator - (CONST D3DXVECTOR2&) const;
+    D3DXVECTOR2 operator * (FLOAT) const;
+    D3DXVECTOR2 operator / (FLOAT) const;
+
+    friend D3DXVECTOR2 operator * (FLOAT, CONST D3DXVECTOR2&);
+
+    BOOL operator == (CONST D3DXVECTOR2&) const;
+    BOOL operator != (CONST D3DXVECTOR2&) const;
+#endif /* __cplusplus */
+    FLOAT x, y;
+} D3DXVECTOR2, *LPD3DXVECTOR2;
+
+#ifdef __cplusplus
+typedef struct D3DXVECTOR3 : public D3DVECTOR
+{
+    D3DXVECTOR3();
+    D3DXVECTOR3(CONST FLOAT *pf);
+    D3DXVECTOR3(CONST D3DVECTOR& v);
+    D3DXVECTOR3(FLOAT fx, FLOAT fy, FLOAT fz);
+
+    operator FLOAT* ();
+    operator CONST FLOAT* () const;
+
+    D3DXVECTOR3& operator += (CONST D3DXVECTOR3&);
+    D3DXVECTOR3& operator -= (CONST D3DXVECTOR3&);
+    D3DXVECTOR3& operator *= (FLOAT);
+    D3DXVECTOR3& operator /= (FLOAT);
+
+    D3DXVECTOR3 operator + () const;
+    D3DXVECTOR3 operator - () const;
+
+    D3DXVECTOR3 operator + (CONST D3DXVECTOR3&) const;
+    D3DXVECTOR3 operator - (CONST D3DXVECTOR3&) const;
+    D3DXVECTOR3 operator * (FLOAT) const;
+    D3DXVECTOR3 operator / (FLOAT) const;
+
+    friend D3DXVECTOR3 operator * (FLOAT, CONST struct D3DXVECTOR3&);
+
+    BOOL operator == (CONST D3DXVECTOR3&) const;
+    BOOL operator != (CONST D3DXVECTOR3&) const;
+} D3DXVECTOR3, *LPD3DXVECTOR3;
+#else /* !__cplusplus */
+typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
+#endif /* !__cplusplus */
+
+typedef struct D3DXVECTOR4
+{
+#ifdef __cplusplus
+    D3DXVECTOR4();
+    D3DXVECTOR4(CONST FLOAT *pf);
+    D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
+
+    operator FLOAT* ();
+    operator CONST FLOAT* () const;
+
+    D3DXVECTOR4& operator += (CONST D3DXVECTOR4&);
+    D3DXVECTOR4& operator -= (CONST D3DXVECTOR4&);
+    D3DXVECTOR4& operator *= (FLOAT);
+    D3DXVECTOR4& operator /= (FLOAT);
+
+    D3DXVECTOR4 operator + () const;
+    D3DXVECTOR4 operator - () const;
+
+    D3DXVECTOR4 operator + (CONST D3DXVECTOR4&) const;
+    D3DXVECTOR4 operator - (CONST D3DXVECTOR4&) const;
+    D3DXVECTOR4 operator * (FLOAT) const;
+    D3DXVECTOR4 operator / (FLOAT) const;
+
+    friend D3DXVECTOR4 operator * (FLOAT, CONST D3DXVECTOR4&);
+
+    BOOL operator == (CONST D3DXVECTOR4&) const;
+    BOOL operator != (CONST D3DXVECTOR4&) const;
+#endif /* __cplusplus */
+    FLOAT x, y, z, w;
+} D3DXVECTOR4, *LPD3DXVECTOR4;
+
+#ifdef __cplusplus
+typedef struct D3DXMATRIX : public D3DMATRIX
+{
+    D3DXMATRIX();
+    D3DXMATRIX(CONST FLOAT *pf);
+    D3DXMATRIX(CONST D3DMATRIX& mat);
+    D3DXMATRIX(FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14,
+               FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24,
+               FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34,
+               FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44);
+
+    FLOAT& operator () (UINT row, UINT col);
+    FLOAT operator () (UINT row, UINT col) const;
+
+    operator FLOAT* ();
+    operator CONST FLOAT* () const;
+
+    D3DXMATRIX& operator *= (CONST D3DXMATRIX&);
+    D3DXMATRIX& operator += (CONST D3DXMATRIX&);
+    D3DXMATRIX& operator -= (CONST D3DXMATRIX&);
+    D3DXMATRIX& operator *= (FLOAT);
+    D3DXMATRIX& operator /= (FLOAT);
+
+    D3DXMATRIX operator + () const;
+    D3DXMATRIX operator - () const;
+
+    D3DXMATRIX operator * (CONST D3DXMATRIX&) const;
+    D3DXMATRIX operator + (CONST D3DXMATRIX&) const;
+    D3DXMATRIX operator - (CONST D3DXMATRIX&) const;
+    D3DXMATRIX operator * (FLOAT) const;
+    D3DXMATRIX operator / (FLOAT) const;
+
+    friend D3DXMATRIX operator * (FLOAT, CONST D3DXMATRIX&);
+
+    BOOL operator == (CONST D3DXMATRIX&) const;
+    BOOL operator != (CONST D3DXMATRIX&) const;
+} D3DXMATRIX, *LPD3DXMATRIX;
+#else /* !__cplusplus */
+typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
+#endif /* !__cplusplus */
+
+typedef struct D3DXQUATERNION
+{
+#ifdef __cplusplus
+    D3DXQUATERNION();
+    D3DXQUATERNION(CONST FLOAT *pf);
+    D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw);
+
+    operator FLOAT* ();
+    operator CONST FLOAT* () const;
+
+    D3DXQUATERNION& operator += (CONST D3DXQUATERNION&);
+    D3DXQUATERNION& operator -= (CONST D3DXQUATERNION&);
+    D3DXQUATERNION& operator *= (CONST D3DXQUATERNION&);
+    D3DXQUATERNION& operator *= (FLOAT);
+    D3DXQUATERNION& operator /= (FLOAT);
+
+    D3DXQUATERNION  operator + () const;
+    D3DXQUATERNION  operator - () const;
+
+    D3DXQUATERNION operator + (CONST D3DXQUATERNION&) const;
+    D3DXQUATERNION operator - (CONST D3DXQUATERNION&) const;
+    D3DXQUATERNION operator * (CONST D3DXQUATERNION&) const;
+    D3DXQUATERNION operator * (FLOAT) const;
+    D3DXQUATERNION operator / (FLOAT) const;
+
+    friend D3DXQUATERNION operator * (FLOAT, CONST D3DXQUATERNION&);
+
+    BOOL operator == (CONST D3DXQUATERNION&) const;
+    BOOL operator != (CONST D3DXQUATERNION&) const;
+#endif /* __cplusplus */
+    FLOAT x, y, z, w;
+} D3DXQUATERNION, *LPD3DXQUATERNION;
+
+typedef struct D3DXPLANE
+{
+#ifdef __cplusplus
+    D3DXPLANE();
+    D3DXPLANE(CONST FLOAT *pf);
+    D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd);
+
+    operator FLOAT* ();
+    operator CONST FLOAT* () const;
+
+    D3DXPLANE operator + () const;
+    D3DXPLANE operator - () const;
+
+    BOOL operator == (CONST D3DXPLANE&) const;
+    BOOL operator != (CONST D3DXPLANE&) const;
+#endif /* __cplusplus */
+    FLOAT a, b, c, d;
+} D3DXPLANE, *LPD3DXPLANE;
+
+typedef struct D3DXCOLOR
+{
+#ifdef __cplusplus
+    D3DXCOLOR();
+    D3DXCOLOR(DWORD col);
+    D3DXCOLOR(CONST FLOAT *pf);
+    D3DXCOLOR(CONST D3DCOLORVALUE& col);
+    D3DXCOLOR(FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa);
+
+    operator DWORD () const;
+
+    operator FLOAT* ();
+    operator CONST FLOAT* () const;
+
+    operator D3DCOLORVALUE* ();
+    operator CONST D3DCOLORVALUE* () const;
+
+    operator D3DCOLORVALUE& ();
+    operator CONST D3DCOLORVALUE& () const;
+
+    D3DXCOLOR& operator += (CONST D3DXCOLOR&);
+    D3DXCOLOR& operator -= (CONST D3DXCOLOR&);
+    D3DXCOLOR& operator *= (FLOAT);
+    D3DXCOLOR& operator /= (FLOAT);
+
+    D3DXCOLOR operator + () const;
+    D3DXCOLOR operator - () const;
+
+    D3DXCOLOR operator + (CONST D3DXCOLOR&) const;
+    D3DXCOLOR operator - (CONST D3DXCOLOR&) const;
+    D3DXCOLOR operator * (FLOAT) const;
+    D3DXCOLOR operator / (FLOAT) const;
+
+    friend D3DXCOLOR operator * (FLOAT, CONST D3DXCOLOR&);
+
+    BOOL operator == (CONST D3DXCOLOR&) const;
+    BOOL operator != (CONST D3DXCOLOR&) const;
+#endif /* __cplusplus */
+    FLOAT r, g, b, a;
+} D3DXCOLOR, *LPD3DXCOLOR;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
+D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s);
+
+FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex);
+
+D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR3 *rotationcenter, CONST D3DXQUATERNION *rotation, CONST D3DXVECTOR3 *translation);
+D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX *pout, FLOAT scaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation);
+HRESULT WINAPI D3DXMatrixDecompose(D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, CONST D3DXMATRIX *pm);
+FLOAT WINAPI D3DXMatrixDeterminant(CONST D3DXMATRIX *pm);
+D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm);
+D3DXMATRIX* WINAPI D3DXMatrixLookAtLH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
+D3DXMATRIX* WINAPI D3DXMatrixLookAtRH(D3DXMATRIX *pout, CONST D3DXVECTOR3 *peye, CONST D3DXVECTOR3 *pat, CONST D3DXVECTOR3 *pup);
+D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
+D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2);
+D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixOrthoRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH(D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf);
+D3DXMATRIX* WINAPI D3DXMatrixReflect(D3DXMATRIX *pout, CONST D3DXPLANE *pplane);
+D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
+D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pout, CONST D3DXQUATERNION *pq);
+D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle);
+D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle);
+D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
+D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle);
+D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz);
+D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight, CONST D3DXPLANE *pPlane);
+D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pscalingcenter, CONST D3DXQUATERNION *pscalingrotation, CONST D3DXVECTOR3 *pscaling, CONST D3DXVECTOR3 *protationcenter, CONST D3DXQUATERNION *protation, CONST D3DXVECTOR3 *ptranslation);
+D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pout, CONST D3DXVECTOR2 *pscalingcenter, FLOAT scalingrotation, CONST D3DXVECTOR2 *pscaling, CONST D3DXVECTOR2 *protationcenter, FLOAT rotation, CONST D3DXVECTOR2 *ptranslation);
+D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z);
+D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
+
+D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *pvpoint, CONST D3DXVECTOR3 *pvnormal);
+D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3);
+D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2);
+D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp);
+D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm);
+D3DXPLANE* WINAPI D3DXPlaneTransformArray(D3DXPLANE *pout, UINT outstride, CONST D3DXPLANE *pplane, UINT pstride, CONST D3DXMATRIX *pm, UINT n);
+
+D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g);
+D3DXQUATERNION* WINAPI D3DXQuaternionExp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
+D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
+D3DXQUATERNION* WINAPI D3DXQuaternionLn(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
+D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2);
+D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
+D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *pout, CONST D3DXVECTOR3 *pv, FLOAT angle);
+D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *pout, CONST D3DXMATRIX *pm);
+D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pout, FLOAT yaw, FLOAT pitch, FLOAT roll);
+D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t);
+D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t);
+void WINAPI D3DXQuaternionToAxisAngle(CONST D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle);
+
+D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g);
+D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s);
+D3DXVECTOR2* WINAPI D3DXVec2Hermite(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pt1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pt2, FLOAT s);
+D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv);
+D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
+D3DXVECTOR4* WINAPI D3DXVec2TransformArray(D3DXVECTOR4 *pout, UINT outstride, CONST D3DXVECTOR2 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
+D3DXVECTOR2* WINAPI D3DXVec2TransformCoord(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
+D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray(D3DXVECTOR2 *pout, UINT outstride, CONST D3DXVECTOR2 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
+D3DXVECTOR2* WINAPI D3DXVec2TransformNormal(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, CONST D3DXMATRIX *pm);
+D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray(D3DXVECTOR2 *pout, UINT outstride, CONST D3DXVECTOR2 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
+
+D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT f, FLOAT g);
+D3DXVECTOR3* WINAPI D3DXVec3CatmullRom( D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv0, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3, FLOAT s);
+D3DXVECTOR3* WINAPI D3DXVec3Hermite(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pt1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pt2, FLOAT s);
+D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv);
+D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
+D3DXVECTOR3* WINAPI D3DXVec3ProjectArray(D3DXVECTOR3 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld, UINT n);
+D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
+D3DXVECTOR4* WINAPI D3DXVec3TransformArray(D3DXVECTOR4 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
+D3DXVECTOR3* WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
+D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray(D3DXVECTOR3 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
+D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DXMATRIX *pm);
+D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray(D3DXVECTOR3 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
+D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld);
+D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray(D3DXVECTOR3 *pout, UINT outstride, CONST D3DXVECTOR3 *pv, UINT vstride, CONST D3DVIEWPORT9 *pviewport, CONST D3DXMATRIX *pprojection, CONST D3DXMATRIX *pview, CONST D3DXMATRIX *pworld, UINT n);
+
+D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT f, FLOAT g);
+D3DXVECTOR4* WINAPI D3DXVec4CatmullRom(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv0, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3, FLOAT s);
+D3DXVECTOR4* WINAPI D3DXVec4Cross(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pv3);
+D3DXVECTOR4* WINAPI D3DXVec4Hermite(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pt1, CONST D3DXVECTOR4 *pv2, CONST D3DXVECTOR4 *pt2, FLOAT s);
+D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv);
+D3DXVECTOR4* WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, CONST D3DXMATRIX *pm);
+D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4 *pout, UINT outstride, CONST D3DXVECTOR4 *pv, UINT vstride, CONST D3DXMATRIX *pm, UINT n);
+
+#ifdef __cplusplus
+}
+#endif
+
+typedef interface ID3DXMatrixStack *LPD3DXMATRIXSTACK;
+
+DEFINE_GUID(IID_ID3DXMatrixStack,
+0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85);
+
+#undef INTERFACE
+#define INTERFACE ID3DXMatrixStack
+
+DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown)
+{
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    STDMETHOD(Pop)(THIS) PURE;
+    STDMETHOD(Push)(THIS) PURE;
+    STDMETHOD(LoadIdentity)(THIS) PURE;
+    STDMETHOD(LoadMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
+    STDMETHOD(MultMatrix)(THIS_ CONST D3DXMATRIX* pM ) PURE;
+    STDMETHOD(MultMatrixLocal)(THIS_ CONST D3DXMATRIX* pM ) PURE;
+    STDMETHOD(RotateAxis)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
+    STDMETHOD(RotateAxisLocal)(THIS_ CONST D3DXVECTOR3* pV, FLOAT Angle) PURE;
+    STDMETHOD(RotateYawPitchRoll)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
+    STDMETHOD(RotateYawPitchRollLocal)(THIS_ FLOAT Yaw, FLOAT Pitch, FLOAT Roll) PURE;
+    STDMETHOD(Scale)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
+    STDMETHOD(ScaleLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
+    STDMETHOD(Translate)(THIS_ FLOAT x, FLOAT y, FLOAT z ) PURE;
+    STDMETHOD(TranslateLocal)(THIS_ FLOAT x, FLOAT y, FLOAT z) PURE;
+    STDMETHOD_(D3DXMATRIX*, GetTop)(THIS) PURE;
+};
+
+#undef INTERFACE
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+
+#define ID3DXMatrixStack_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXMatrixStack_AddRef(p)                        (p)->lpVtbl->AddRef(p)
+#define ID3DXMatrixStack_Release(p)                       (p)->lpVtbl->Release(p)
+#define ID3DXMatrixStack_Pop(p)                           (p)->lpVtbl->Pop(p)
+#define ID3DXMatrixStack_Push(p)                          (p)->lpVtbl->Push(p)
+#define ID3DXMatrixStack_LoadIdentity(p)                  (p)->lpVtbl->LoadIdentity(p)
+#define ID3DXMatrixStack_LoadMatrix(p,a)                  (p)->lpVtbl->LoadMatrix(p,a)
+#define ID3DXMatrixStack_MultMatrix(p,a)                  (p)->lpVtbl->MultMatrix(p,a)
+#define ID3DXMatrixStack_MultMatrixLocal(p,a)             (p)->lpVtbl->MultMatrixLocal(p,a)
+#define ID3DXMatrixStack_RotateAxis(p,a,b)                (p)->lpVtbl->RotateAxis(p,a,b)
+#define ID3DXMatrixStack_RotateAxisLocal(p,a,b)           (p)->lpVtbl->RotateAxisLocal(p,a,b)
+#define ID3DXMatrixStack_RotateYawPitchRoll(p,a,b,c)      (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c)
+#define ID3DXMatrixStack_RotateYawPitchRollLocal(p,a,b,c) (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c)
+#define ID3DXMatrixStack_Scale(p,a,b,c)                   (p)->lpVtbl->Scale(p,a,b,c)
+#define ID3DXMatrixStack_ScaleLocal(p,a,b,c)              (p)->lpVtbl->ScaleLocal(p,a,b,c)
+#define ID3DXMatrixStack_Translate(p,a,b,c)               (p)->lpVtbl->Translate(p,a,b,c)
+#define ID3DXMatrixStack_TranslateLocal(p,a,b,c)          (p)->lpVtbl->TranslateLocal(p,a,b,c)
+#define ID3DXMatrixStack_GetTop(p)                        (p)->lpVtbl->GetTop(p)
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack);
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <d3dx9math.inl>
+
+#endif /* __D3DX9MATH_H__ */
diff --git a/misc/builddeps/dp.win32/include/d3dx9math.inl b/misc/builddeps/dp.win32/include/d3dx9math.inl
new file mode 100644 (file)
index 0000000..3cd078a
--- /dev/null
@@ -0,0 +1,1268 @@
+/*
+ * Copyright (C) 2007 David Adam
+ * Copyright (C) 2007 Tony Wasserka
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __D3DX9MATH_INL__
+#define __D3DX9MATH_INL__
+
+/* constructors & operators */
+#ifdef __cplusplus
+
+inline D3DXVECTOR2::D3DXVECTOR2()
+{
+}
+
+inline D3DXVECTOR2::D3DXVECTOR2(CONST FLOAT *pf)
+{
+    if(!pf) return;
+    x = pf[0];
+    y = pf[1];
+}
+
+inline D3DXVECTOR2::D3DXVECTOR2(FLOAT fx, FLOAT fy)
+{
+    x = fx;
+    y = fy;
+}
+
+inline D3DXVECTOR2::operator FLOAT* ()
+{
+    return (FLOAT*)&x;
+}
+
+inline D3DXVECTOR2::operator CONST FLOAT* () const
+{
+    return (CONST FLOAT*)&x;
+}
+
+inline D3DXVECTOR2& D3DXVECTOR2::operator += (CONST D3DXVECTOR2& v)
+{
+    x += v.x;
+    y += v.y;
+    return *this;
+}
+
+inline D3DXVECTOR2& D3DXVECTOR2::operator -= (CONST D3DXVECTOR2& v)
+{
+    x -= v.x;
+    y -= v.y;
+    return *this;
+}
+
+inline D3DXVECTOR2& D3DXVECTOR2::operator *= (FLOAT f)
+{
+    x *= f;
+    y *= f;
+    return *this;
+}
+
+inline D3DXVECTOR2& D3DXVECTOR2::operator /= (FLOAT f)
+{
+    x /= f;
+    y /= f;
+    return *this;
+}
+
+inline D3DXVECTOR2 D3DXVECTOR2::operator + () const
+{
+    return *this;
+}
+
+inline D3DXVECTOR2 D3DXVECTOR2::operator - () const
+{
+    return D3DXVECTOR2(-x, -y);
+}
+
+inline D3DXVECTOR2 D3DXVECTOR2::operator + (CONST D3DXVECTOR2& v) const
+{
+    return D3DXVECTOR2(x + v.x, y + v.y);
+}
+
+inline D3DXVECTOR2 D3DXVECTOR2::operator - (CONST D3DXVECTOR2& v) const
+{
+    return D3DXVECTOR2(x - v.x, y - v.y);
+}
+
+inline D3DXVECTOR2 D3DXVECTOR2::operator * (FLOAT f) const
+{
+    return D3DXVECTOR2(x * f, y * f);
+}
+
+inline D3DXVECTOR2 D3DXVECTOR2::operator / (FLOAT f) const
+{
+    return D3DXVECTOR2(x / f, y / f);
+}
+
+inline D3DXVECTOR2 operator * (FLOAT f, CONST D3DXVECTOR2& v)
+{
+    return D3DXVECTOR2(f * v.x, f * v.y);
+}
+
+inline BOOL D3DXVECTOR2::operator == (CONST D3DXVECTOR2& v) const
+{
+    return x == v.x && y == v.y;
+}
+
+inline BOOL D3DXVECTOR2::operator != (CONST D3DXVECTOR2& v) const
+{
+    return x != v.x || y != v.y;
+}
+
+inline D3DXVECTOR3::D3DXVECTOR3()
+{
+}
+
+inline D3DXVECTOR3::D3DXVECTOR3(CONST FLOAT *pf)
+{
+    if(!pf) return;
+    x = pf[0];
+    y = pf[1];
+    z = pf[2];
+}
+
+inline D3DXVECTOR3::D3DXVECTOR3(CONST D3DVECTOR& v)
+{
+    x = v.x;
+    y = v.y;
+    z = v.z;
+}
+
+inline D3DXVECTOR3::D3DXVECTOR3(FLOAT fx, FLOAT fy, FLOAT fz)
+{
+    x = fx;
+    y = fy;
+    z = fz;
+}
+
+inline D3DXVECTOR3::operator FLOAT* ()
+{
+    return (FLOAT*)&x;
+}
+
+inline D3DXVECTOR3::operator CONST FLOAT* () const
+{
+    return (CONST FLOAT*)&x;
+}
+
+inline D3DXVECTOR3& D3DXVECTOR3::operator += (CONST D3DXVECTOR3& v)
+{
+    x += v.x;
+    y += v.y;
+    z += v.z;
+    return *this;
+}
+
+inline D3DXVECTOR3& D3DXVECTOR3::operator -= (CONST D3DXVECTOR3& v)
+{
+    x -= v.x;
+    y -= v.y;
+    z -= v.z;
+    return *this;
+}
+
+inline D3DXVECTOR3& D3DXVECTOR3::operator *= (FLOAT f)
+{
+    x *= f;
+    y *= f;
+    z *= f;
+    return *this;
+}
+
+inline D3DXVECTOR3& D3DXVECTOR3::operator /= (FLOAT f)
+{
+    x /= f;
+    y /= f;
+    z /= f;
+    return *this;
+}
+
+inline D3DXVECTOR3 D3DXVECTOR3::operator + () const
+{
+    return *this;
+}
+
+inline D3DXVECTOR3 D3DXVECTOR3::operator - () const
+{
+    return D3DXVECTOR3(-x, -y, -z);
+}
+
+inline D3DXVECTOR3 D3DXVECTOR3::operator + (CONST D3DXVECTOR3& v) const
+{
+    return D3DXVECTOR3(x + v.x, y + v.y, z + v.z);
+}
+
+inline D3DXVECTOR3 D3DXVECTOR3::operator - (CONST D3DXVECTOR3& v) const
+{
+    return D3DXVECTOR3(x - v.x, y - v.y, z - v.z);
+}
+
+inline D3DXVECTOR3 D3DXVECTOR3::operator * (FLOAT f) const
+{
+    return D3DXVECTOR3(x * f, y * f, z * f);
+}
+
+inline D3DXVECTOR3 D3DXVECTOR3::operator / (FLOAT f) const
+{
+    return D3DXVECTOR3(x / f, y / f, z / f);
+}
+
+inline D3DXVECTOR3 operator * (FLOAT f, CONST D3DXVECTOR3& v)
+{
+    return D3DXVECTOR3(f * v.x, f * v.y, f * v.z);
+}
+
+inline BOOL D3DXVECTOR3::operator == (CONST D3DXVECTOR3& v) const
+{
+    return x == v.x && y == v.y && z == v.z;
+}
+
+inline BOOL D3DXVECTOR3::operator != (CONST D3DXVECTOR3& v) const
+{
+    return x != v.x || y != v.y || z != v.z;
+}
+
+inline D3DXVECTOR4::D3DXVECTOR4()
+{
+}
+
+inline D3DXVECTOR4::D3DXVECTOR4(CONST FLOAT *pf)
+{
+    if(!pf) return;
+    x = pf[0];
+    y = pf[1];
+    z = pf[2];
+    w = pf[3];
+}
+
+inline D3DXVECTOR4::D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw)
+{
+    x = fx;
+    y = fy;
+    z = fz;
+    w = fw;
+}
+
+inline D3DXVECTOR4::operator FLOAT* ()
+{
+    return (FLOAT*)&x;
+}
+
+inline D3DXVECTOR4::operator CONST FLOAT* () const
+{
+    return (CONST FLOAT*)&x;
+}
+
+inline D3DXVECTOR4& D3DXVECTOR4::operator += (CONST D3DXVECTOR4& v)
+{
+    x += v.x;
+    y += v.y;
+    z += v.z;
+    w += v.w;
+    return *this;
+}
+
+inline D3DXVECTOR4& D3DXVECTOR4::operator -= (CONST D3DXVECTOR4& v)
+{
+    x -= v.x;
+    y -= v.y;
+    z -= v.z;
+    w -= v.w;
+    return *this;
+}
+
+inline D3DXVECTOR4& D3DXVECTOR4::operator *= (FLOAT f)
+{
+    x *= f;
+    y *= f;
+    z *= f;
+    w *= f;
+    return *this;
+}
+
+inline D3DXVECTOR4& D3DXVECTOR4::operator /= (FLOAT f)
+{
+    x /= f;
+    y /= f;
+    z /= f;
+    w /= f;
+    return *this;
+}
+
+inline D3DXVECTOR4 D3DXVECTOR4::operator + () const
+{
+    return *this;
+}
+
+inline D3DXVECTOR4 D3DXVECTOR4::operator - () const
+{
+    return D3DXVECTOR4(-x, -y, -z, -w);
+}
+
+inline D3DXVECTOR4 D3DXVECTOR4::operator + (CONST D3DXVECTOR4& v) const
+{
+    return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w);
+}
+
+inline D3DXVECTOR4 D3DXVECTOR4::operator - (CONST D3DXVECTOR4& v) const
+{
+    return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w);
+}
+
+inline D3DXVECTOR4 D3DXVECTOR4::operator * (FLOAT f) const
+{
+    return D3DXVECTOR4(x * f, y * f, z * f, w * f);
+}
+
+inline D3DXVECTOR4 D3DXVECTOR4::operator / (FLOAT f) const
+{
+    return D3DXVECTOR4(x / f, y / f, z / f, w / f);
+}
+
+inline D3DXVECTOR4 operator * (FLOAT f, CONST D3DXVECTOR4& v)
+{
+    return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w);
+}
+
+inline BOOL D3DXVECTOR4::operator == (CONST D3DXVECTOR4& v) const
+{
+    return x == v.x && y == v.y && z == v.z && w == v.w;
+}
+
+inline BOOL D3DXVECTOR4::operator != (CONST D3DXVECTOR4& v) const
+{
+    return x != v.x || y != v.y || z != v.z || w != v.w;
+}
+
+inline D3DXMATRIX::D3DXMATRIX()
+{
+}
+
+inline D3DXMATRIX::D3DXMATRIX(CONST FLOAT *pf)
+{
+    if(!pf) return;
+    memcpy(&_11, pf, sizeof(D3DXMATRIX));
+}
+
+inline D3DXMATRIX::D3DXMATRIX(CONST D3DMATRIX& mat)
+{
+    memcpy(&_11, &mat, sizeof(D3DXMATRIX));
+}
+
+inline D3DXMATRIX::D3DXMATRIX(FLOAT f11, FLOAT f12, FLOAT f13, FLOAT f14,
+                              FLOAT f21, FLOAT f22, FLOAT f23, FLOAT f24,
+                              FLOAT f31, FLOAT f32, FLOAT f33, FLOAT f34,
+                              FLOAT f41, FLOAT f42, FLOAT f43, FLOAT f44)
+{
+    _11 = f11; _12 = f12; _13 = f13; _14 = f14;
+    _21 = f21; _22 = f22; _23 = f23; _24 = f24;
+    _31 = f31; _32 = f32; _33 = f33; _34 = f34;
+    _41 = f41; _42 = f42; _43 = f43; _44 = f44;
+}
+
+inline FLOAT& D3DXMATRIX::operator () (UINT row, UINT col)
+{
+    return m[row][col];
+}
+
+inline FLOAT D3DXMATRIX::operator () (UINT row, UINT col) const
+{
+    return m[row][col];
+}
+
+inline D3DXMATRIX::operator FLOAT* ()
+{
+    return (FLOAT*)&_11;
+}
+
+inline D3DXMATRIX::operator CONST FLOAT* () const
+{
+    return (CONST FLOAT*)&_11;
+}
+
+inline D3DXMATRIX& D3DXMATRIX::operator *= (CONST D3DXMATRIX& mat)
+{
+    D3DXMatrixMultiply(this, this, &mat);
+    return *this;
+}
+
+inline D3DXMATRIX& D3DXMATRIX::operator += (CONST D3DXMATRIX& mat)
+{
+    _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14;
+    _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24;
+    _31 += mat._31; _32 += mat._32; _33 += mat._33; _34 += mat._34;
+    _41 += mat._41; _42 += mat._42; _43 += mat._43; _44 += mat._44;
+    return *this;
+}
+
+inline D3DXMATRIX& D3DXMATRIX::operator -= (CONST D3DXMATRIX& mat)
+{
+    _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14;
+    _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24;
+    _31 -= mat._31; _32 -= mat._32; _33 -= mat._33; _34 -= mat._34;
+    _41 -= mat._41; _42 -= mat._42; _43 -= mat._43; _44 -= mat._44;
+    return *this;
+}
+
+inline D3DXMATRIX& D3DXMATRIX::operator *= (FLOAT f)
+{
+    _11 *= f; _12 *= f; _13 *= f; _14 *= f;
+    _21 *= f; _22 *= f; _23 *= f; _24 *= f;
+    _31 *= f; _32 *= f; _33 *= f; _34 *= f;
+    _41 *= f; _42 *= f; _43 *= f; _44 *= f;
+    return *this;
+}
+
+inline D3DXMATRIX& D3DXMATRIX::operator /= (FLOAT f)
+{
+    FLOAT inv = 1.0f / f;
+    _11 *= inv; _12 *= inv; _13 *= inv; _14 *= inv;
+    _21 *= inv; _22 *= inv; _23 *= inv; _24 *= inv;
+    _31 *= inv; _32 *= inv; _33 *= inv; _34 *= inv;
+    _41 *= inv; _42 *= inv; _43 *= inv; _44 *= inv;
+    return *this;
+}
+
+inline D3DXMATRIX D3DXMATRIX::operator + () const
+{
+    return *this;
+}
+
+inline D3DXMATRIX D3DXMATRIX::operator - () const
+{
+    return D3DXMATRIX(-_11, -_12, -_13, -_14,
+                      -_21, -_22, -_23, -_24,
+                      -_31, -_32, -_33, -_34,
+                      -_41, -_42, -_43, -_44);
+}
+
+inline D3DXMATRIX D3DXMATRIX::operator * (CONST D3DXMATRIX& mat) const
+{
+    D3DXMATRIX buf;
+    D3DXMatrixMultiply(&buf, this, &mat);
+    return buf;
+}
+
+inline D3DXMATRIX D3DXMATRIX::operator + (CONST D3DXMATRIX& mat) const
+{
+    return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14,
+                      _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24,
+                      _31 + mat._31, _32 + mat._32, _33 + mat._33, _34 + mat._34,
+                      _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44);
+}
+
+inline D3DXMATRIX D3DXMATRIX::operator - (CONST D3DXMATRIX& mat) const
+{
+    return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14,
+                      _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24,
+                      _31 - mat._31, _32 - mat._32, _33 - mat._33, _34 - mat._34,
+                      _41 - mat._41, _42 - mat._42, _43 - mat._43, _44 - mat._44);
+}
+
+inline D3DXMATRIX D3DXMATRIX::operator * (FLOAT f) const
+{
+    return D3DXMATRIX(_11 * f, _12 * f, _13 * f, _14 * f,
+                      _21 * f, _22 * f, _23 * f, _24 * f,
+                      _31 * f, _32 * f, _33 * f, _34 * f,
+                      _41 * f, _42 * f, _43 * f, _44 * f);
+}
+
+inline D3DXMATRIX D3DXMATRIX::operator / (FLOAT f) const
+{
+    FLOAT inv = 1.0f / f;
+    return D3DXMATRIX(_11 * inv, _12 * inv, _13 * inv, _14 * inv,
+                      _21 * inv, _22 * inv, _23 * inv, _24 * inv,
+                      _31 * inv, _32 * inv, _33 * inv, _34 * inv,
+                      _41 * inv, _42 * inv, _43 * inv, _44 * inv);
+}
+
+inline D3DXMATRIX operator * (FLOAT f, CONST D3DXMATRIX& mat)
+{
+    return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14,
+                      f * mat._21, f * mat._22, f * mat._23, f * mat._24,
+                      f * mat._31, f * mat._32, f * mat._33, f * mat._34,
+                      f * mat._41, f * mat._42, f * mat._43, f * mat._44);
+}
+
+inline BOOL D3DXMATRIX::operator == (CONST D3DXMATRIX& mat) const
+{
+    return (memcmp(this, &mat, sizeof(D3DXMATRIX)) == 0);
+}
+
+inline BOOL D3DXMATRIX::operator != (CONST D3DXMATRIX& mat) const
+{
+    return (memcmp(this, &mat, sizeof(D3DXMATRIX)) != 0);
+}
+
+inline D3DXQUATERNION::D3DXQUATERNION()
+{
+}
+
+inline D3DXQUATERNION::D3DXQUATERNION(CONST FLOAT *pf)
+{
+    if(!pf) return;
+    x = pf[0];
+    y = pf[1];
+    z = pf[2];
+    w = pf[3];
+}
+
+inline D3DXQUATERNION::D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw)
+{
+    x = fx;
+    y = fy;
+    z = fz;
+    w = fw;
+}
+
+inline D3DXQUATERNION::operator FLOAT* ()
+{
+    return (FLOAT*)&x;
+}
+
+inline D3DXQUATERNION::operator CONST FLOAT* () const
+{
+    return (CONST FLOAT*)&x;
+}
+
+inline D3DXQUATERNION& D3DXQUATERNION::operator += (CONST D3DXQUATERNION& quat)
+{
+    x += quat.x;
+    y += quat.y;
+    z += quat.z;
+    w += quat.w;
+    return *this;
+}
+
+inline D3DXQUATERNION& D3DXQUATERNION::operator -= (CONST D3DXQUATERNION& quat)
+{
+    x -= quat.x;
+    y -= quat.y;
+    z -= quat.z;
+    w -= quat.w;
+    return *this;
+}
+
+/* TODO: uncomment this when D3DXQuaternionMultiply has been implemented
+inline D3DXQUATERNION& D3DXQUATERNION::operator *= (CONST D3DXQUATERNION& quat)
+{
+    D3DXQuaternionMultiply(this, this, &quat);
+    return *this;
+}
+*/
+
+inline D3DXQUATERNION& D3DXQUATERNION::operator *= (FLOAT f)
+{
+    x *= f;
+    y *= f;
+    z *= f;
+    w *= f;
+    return *this;
+}
+
+inline D3DXQUATERNION& D3DXQUATERNION::operator /= (FLOAT f)
+{
+    FLOAT inv = 1.0f / f;
+    x *= inv;
+    y *= inv;
+    z *= inv;
+    w *= inv;
+    return *this;
+}
+
+inline D3DXQUATERNION D3DXQUATERNION::operator + () const
+{
+    return *this;
+}
+
+inline D3DXQUATERNION D3DXQUATERNION::operator - () const
+{
+    return D3DXQUATERNION(-x, -y, -z, -w);
+}
+
+inline D3DXQUATERNION D3DXQUATERNION::operator + (CONST D3DXQUATERNION& quat) const
+{
+    return D3DXQUATERNION(x + quat.x, y + quat.y, z + quat.z, w + quat.w);
+}
+
+inline D3DXQUATERNION D3DXQUATERNION::operator - (CONST D3DXQUATERNION& quat) const
+{
+    return D3DXQUATERNION(x - quat.x, y - quat.y, z - quat.z, w - quat.w);
+}
+
+/* TODO: uncomment this when D3DXQuaternionMultiply has been implemented
+inline D3DXQUATERNION D3DXQUATERNION::operator * (CONST D3DXQUATERNION& quat) const
+{
+    D3DXQUATERNION buf;
+    D3DXQuaternionMultiply(&buf, this, &quat);
+    return buf;
+}
+*/
+
+inline D3DXQUATERNION D3DXQUATERNION::operator * (FLOAT f) const
+{
+    return D3DXQUATERNION(x * f, y * f, z * f, w * f);
+}
+
+inline D3DXQUATERNION D3DXQUATERNION::operator / (FLOAT f) const
+{
+    FLOAT inv = 1.0f / f;
+    return D3DXQUATERNION(x * inv, y * inv, z * inv, w * inv);
+}
+
+inline D3DXQUATERNION operator * (FLOAT f, CONST D3DXQUATERNION& quat)
+{
+    return D3DXQUATERNION(f * quat.x, f * quat.y, f * quat.z, f * quat.w);
+}
+
+inline BOOL D3DXQUATERNION::operator == (CONST D3DXQUATERNION& quat) const
+{
+    return x == quat.x && y == quat.y && z == quat.z && w == quat.w;
+}
+
+inline BOOL D3DXQUATERNION::operator != (CONST D3DXQUATERNION& quat) const
+{
+    return x != quat.x || y != quat.y || z != quat.z || w != quat.w;
+}
+
+inline D3DXPLANE::D3DXPLANE()
+{
+}
+
+inline D3DXPLANE::D3DXPLANE(CONST FLOAT *pf)
+{
+    if(!pf) return;
+    a = pf[0];
+    b = pf[1];
+    c = pf[2];
+    d = pf[3];
+}
+
+inline D3DXPLANE::D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd)
+{
+    a = fa;
+    b = fb;
+    c = fc;
+    d = fd;
+}
+
+inline D3DXPLANE::operator FLOAT* ()
+{
+    return (FLOAT*)&a;
+}
+
+inline D3DXPLANE::operator CONST FLOAT* () const
+{
+    return (CONST FLOAT*)&a;
+}
+
+inline D3DXPLANE D3DXPLANE::operator + () const
+{
+    return *this;
+}
+
+inline D3DXPLANE D3DXPLANE::operator - () const
+{
+    return D3DXPLANE(-a, -b, -c, -d);
+}
+
+inline BOOL D3DXPLANE::operator == (CONST D3DXPLANE& pl) const
+{
+    return a == pl.a && b == pl.b && c == pl.c && d == pl.d;
+}
+
+inline BOOL D3DXPLANE::operator != (CONST D3DXPLANE& pl) const
+{
+    return a != pl.a || b != pl.b || c != pl.c || d != pl.d;
+}
+
+inline D3DXCOLOR::D3DXCOLOR()
+{
+}
+
+inline D3DXCOLOR::D3DXCOLOR(DWORD col)
+{
+    CONST FLOAT f = 1.0f / 255.0f;
+    r = f * (FLOAT)(unsigned char)(col >> 16);
+    g = f * (FLOAT)(unsigned char)(col >>  8);
+    b = f * (FLOAT)(unsigned char)col;
+    a = f * (FLOAT)(unsigned char)(col >> 24);
+}
+
+inline D3DXCOLOR::D3DXCOLOR(CONST FLOAT *pf)
+{
+    if(!pf) return;
+    r = pf[0];
+    g = pf[1];
+    b = pf[2];
+    a = pf[3];
+}
+
+inline D3DXCOLOR::D3DXCOLOR(CONST D3DCOLORVALUE& col)
+{
+    r = col.r;
+    g = col.g;
+    b = col.b;
+    a = col.a;
+}
+
+inline D3DXCOLOR::D3DXCOLOR(FLOAT fr, FLOAT fg, FLOAT fb, FLOAT fa)
+{
+    r = fr;
+    g = fg;
+    b = fb;
+    a = fa;
+}
+
+inline D3DXCOLOR::operator DWORD () const
+{
+    DWORD _r = r >= 1.0f ? 0xff : r <= 0.0f ? 0x00 : (DWORD)(r * 255.0f + 0.5f);
+    DWORD _g = g >= 1.0f ? 0xff : g <= 0.0f ? 0x00 : (DWORD)(g * 255.0f + 0.5f);
+    DWORD _b = b >= 1.0f ? 0xff : b <= 0.0f ? 0x00 : (DWORD)(b * 255.0f + 0.5f);
+    DWORD _a = a >= 1.0f ? 0xff : a <= 0.0f ? 0x00 : (DWORD)(a * 255.0f + 0.5f);
+
+    return (_a << 24) | (_r << 16) | (_g << 8) | _b;
+}
+
+inline D3DXCOLOR::operator FLOAT * ()
+{
+    return (FLOAT*)&r;
+}
+
+inline D3DXCOLOR::operator CONST FLOAT * () const
+{
+    return (CONST FLOAT*)&r;
+}
+
+inline D3DXCOLOR::operator D3DCOLORVALUE * ()
+{
+    return (D3DCOLORVALUE*)&r;
+}
+
+inline D3DXCOLOR::operator CONST D3DCOLORVALUE * () const
+{
+    return (CONST D3DCOLORVALUE*)&r;
+}
+
+inline D3DXCOLOR::operator D3DCOLORVALUE& ()
+{
+    return *((D3DCOLORVALUE*)&r);
+}
+
+inline D3DXCOLOR::operator CONST D3DCOLORVALUE& () const
+{
+    return *((CONST D3DCOLORVALUE*)&r);
+}
+
+inline D3DXCOLOR& D3DXCOLOR::operator += (CONST D3DXCOLOR& col)
+{
+    r += col.r;
+    g += col.g;
+    b += col.b;
+    a += col.a;
+    return *this;
+}
+
+inline D3DXCOLOR& D3DXCOLOR::operator -= (CONST D3DXCOLOR& col)
+{
+    r -= col.r;
+    g -= col.g;
+    b -= col.b;
+    a -= col.a;
+    return *this;
+}
+
+inline D3DXCOLOR& D3DXCOLOR::operator *= (FLOAT f)
+{
+    r *= f;
+    g *= f;
+    b *= f;
+    a *= f;
+    return *this;
+}
+
+inline D3DXCOLOR& D3DXCOLOR::operator /= (FLOAT f)
+{
+    FLOAT inv = 1.0f / f;
+    r *= inv;
+    g *= inv;
+    b *= inv;
+    a *= inv;
+    return *this;
+}
+
+inline D3DXCOLOR D3DXCOLOR::operator + () const
+{
+    return *this;
+}
+
+inline D3DXCOLOR D3DXCOLOR::operator - () const
+{
+    return D3DXCOLOR(-r, -g, -b, -a);
+}
+
+inline D3DXCOLOR D3DXCOLOR::operator + (CONST D3DXCOLOR& col) const
+{
+    return D3DXCOLOR(r + col.r, g + col.g, b + col.b, a + col.a);
+}
+
+inline D3DXCOLOR D3DXCOLOR::operator - (CONST D3DXCOLOR& col) const
+{
+    return D3DXCOLOR(r - col.r, g - col.g, b - col.b, a - col.a);
+}
+
+inline D3DXCOLOR D3DXCOLOR::operator * (FLOAT f) const
+{
+    return D3DXCOLOR(r * f, g * f, b * f, a * f);
+}
+
+inline D3DXCOLOR D3DXCOLOR::operator / (FLOAT f) const
+{
+    FLOAT inv = 1.0f / f;
+    return D3DXCOLOR(r * inv, g * inv, b * inv, a * inv);
+}
+
+inline D3DXCOLOR operator * (FLOAT f, CONST D3DXCOLOR& col)
+{
+    return D3DXCOLOR(f * col.r, f * col.g, f * col.b, f * col.a);
+}
+
+inline BOOL D3DXCOLOR::operator == (CONST D3DXCOLOR& col) const
+{
+    return r == col.r && g == col.g && b == col.b && a == col.a;
+}
+
+inline BOOL D3DXCOLOR::operator != (CONST D3DXCOLOR& col) const
+{
+    return r != col.r || g != col.g || b != col.b || a != col.a;
+}
+
+#endif /* __cplusplus */
+
+/*_______________D3DXCOLOR_____________________*/
+
+static inline D3DXCOLOR* D3DXColorAdd(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2)
+{
+    if ( !pout || !pc1 || !pc2 ) return NULL;
+    pout->r = (pc1->r) + (pc2->r);
+    pout->g = (pc1->g) + (pc2->g);
+    pout->b = (pc1->b) + (pc2->b);
+    pout->a = (pc1->a) + (pc2->a);
+    return pout;
+}
+
+static inline D3DXCOLOR* D3DXColorLerp(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2, FLOAT s)
+{
+    if ( !pout || !pc1 || !pc2 ) return NULL;
+    pout->r = (1-s) * (pc1->r) + s *(pc2->r);
+    pout->g = (1-s) * (pc1->g) + s *(pc2->g);
+    pout->b = (1-s) * (pc1->b) + s *(pc2->b);
+    pout->a = (1-s) * (pc1->a) + s *(pc2->a);
+    return pout;
+}
+
+static inline D3DXCOLOR* D3DXColorModulate(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2)
+{
+    if ( !pout || !pc1 || !pc2 ) return NULL;
+    pout->r = (pc1->r) * (pc2->r);
+    pout->g = (pc1->g) * (pc2->g);
+    pout->b = (pc1->b) * (pc2->b);
+    pout->a = (pc1->a) * (pc2->a);
+    return pout;
+}
+
+static inline D3DXCOLOR* D3DXColorNegative(D3DXCOLOR *pout, CONST D3DXCOLOR *pc)
+{
+    if ( !pout || !pc ) return NULL;
+    pout->r = 1.0f - pc->r;
+    pout->g = 1.0f - pc->g;
+    pout->b = 1.0f - pc->b;
+    pout->a = pc->a;
+    return pout;
+}
+
+static inline D3DXCOLOR* D3DXColorScale(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s)
+{
+    if ( !pout || !pc ) return NULL;
+    pout->r = s* (pc->r);
+    pout->g = s* (pc->g);
+    pout->b = s* (pc->b);
+    pout->a = s* (pc->a);
+    return pout;
+}
+
+static inline D3DXCOLOR* D3DXColorSubtract(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2)
+{
+    if ( !pout || !pc1 || !pc2 ) return NULL;
+    pout->r = (pc1->r) - (pc2->r);
+    pout->g = (pc1->g) - (pc2->g);
+    pout->b = (pc1->b) - (pc2->b);
+    pout->a = (pc1->a) - (pc2->a);
+    return pout;
+}
+
+/*_______________D3DXVECTOR2________________________*/
+
+static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = pv1->x + pv2->x;
+    pout->y = pv1->y + pv2->y;
+    return pout;
+}
+
+static inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
+{
+    if ( !pv1 || !pv2) return 0.0f;
+    return ( (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x) );
+}
+
+static inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
+{
+    if ( !pv1 || !pv2) return 0.0f;
+    return ( (pv1->x * pv2->x + pv1->y * pv2->y) );
+}
+
+static inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv)
+{
+    if (!pv) return 0.0f;
+    return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) );
+}
+
+static inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv)
+{
+    if (!pv) return 0.0f;
+    return( (pv->x) * (pv->x) + (pv->y) * (pv->y) );
+}
+
+static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = (1-s) * (pv1->x) + s * (pv2->x);
+    pout->y = (1-s) * (pv1->y) + s * (pv2->y);
+    return pout;
+}
+
+static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = max(pv1->x , pv2->x);
+    pout->y = max(pv1->y , pv2->y);
+    return pout;
+}
+
+static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = min(pv1->x , pv2->x);
+    pout->y = min(pv1->y , pv2->y);
+    return pout;
+}
+
+static inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s)
+{
+    if ( !pout || !pv) return NULL;
+    pout->x = s * (pv->x);
+    pout->y = s * (pv->y);
+    return pout;
+}
+
+static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = pv1->x - pv2->x;
+    pout->y = pv1->y - pv2->y;
+    return pout;
+}
+
+/*__________________D3DXVECTOR3_______________________*/
+
+static inline D3DXVECTOR3* D3DXVec3Add(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = pv1->x + pv2->x;
+    pout->y = pv1->y + pv2->y;
+    pout->z = pv1->z + pv2->z;
+    return pout;
+}
+
+static inline D3DXVECTOR3* D3DXVec3Cross(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = (pv1->y) * (pv2->z) - (pv1->z) * (pv2->y);
+    pout->y = (pv1->z) * (pv2->x) - (pv1->x) * (pv2->z);
+    pout->z = (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x);
+    return pout;
+}
+
+static inline FLOAT D3DXVec3Dot(CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
+{
+    if ( !pv1 || !pv2 ) return 0.0f;
+    return (pv1->x) * (pv2->x) + (pv1->y) * (pv2->y) + (pv1->z) * (pv2->z);
+}
+
+static inline FLOAT D3DXVec3Length(CONST D3DXVECTOR3 *pv)
+{
+    if (!pv) return 0.0f;
+    return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z) );
+}
+
+static inline FLOAT D3DXVec3LengthSq(CONST D3DXVECTOR3 *pv)
+{
+    if (!pv) return 0.0f;
+    return (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z);
+}
+
+static inline D3DXVECTOR3* D3DXVec3Lerp(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, FLOAT s)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = (1-s) * (pv1->x) + s * (pv2->x);
+    pout->y = (1-s) * (pv1->y) + s * (pv2->y);
+    pout->z = (1-s) * (pv1->z) + s * (pv2->z);
+    return pout;
+}
+
+static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = max(pv1->x , pv2->x);
+    pout->y = max(pv1->y , pv2->y);
+    pout->z = max(pv1->z , pv2->z);
+    return pout;
+}
+
+static inline D3DXVECTOR3* D3DXVec3Minimize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = min(pv1->x , pv2->x);
+    pout->y = min(pv1->y , pv2->y);
+    pout->z = min(pv1->z , pv2->z);
+    return pout;
+}
+
+static inline D3DXVECTOR3* D3DXVec3Scale(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, FLOAT s)
+{
+    if ( !pout || !pv) return NULL;
+    pout->x = s * (pv->x);
+    pout->y = s * (pv->y);
+    pout->z = s * (pv->z);
+    return pout;
+}
+
+static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = pv1->x - pv2->x;
+    pout->y = pv1->y - pv2->y;
+    pout->z = pv1->z - pv2->z;
+    return pout;
+}
+/*__________________D3DXVECTOR4_______________________*/
+
+static inline D3DXVECTOR4* D3DXVec4Add(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = pv1->x + pv2->x;
+    pout->y = pv1->y + pv2->y;
+    pout->z = pv1->z + pv2->z;
+    pout->w = pv1->w + pv2->w;
+    return pout;
+}
+
+static inline FLOAT D3DXVec4Dot(CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
+{
+    if (!pv1 || !pv2 ) return 0.0f;
+    return (pv1->x) * (pv2->x) + (pv1->y) * (pv2->y) + (pv1->z) * (pv2->z) + (pv1->w) * (pv2->w);
+}
+
+static inline FLOAT D3DXVec4Length(CONST D3DXVECTOR4 *pv)
+{
+    if (!pv) return 0.0f;
+    return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z) + (pv->w) * (pv->w) );
+}
+
+static inline FLOAT D3DXVec4LengthSq(CONST D3DXVECTOR4 *pv)
+{
+    if (!pv) return 0.0f;
+    return (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z) + (pv->w) * (pv->w);
+}
+
+static inline D3DXVECTOR4* D3DXVec4Lerp(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, FLOAT s)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = (1-s) * (pv1->x) + s * (pv2->x);
+    pout->y = (1-s) * (pv1->y) + s * (pv2->y);
+    pout->z = (1-s) * (pv1->z) + s * (pv2->z);
+    pout->w = (1-s) * (pv1->w) + s * (pv2->w);
+    return pout;
+}
+
+
+static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = max(pv1->x , pv2->x);
+    pout->y = max(pv1->y , pv2->y);
+    pout->z = max(pv1->z , pv2->z);
+    pout->w = max(pv1->w , pv2->w);
+    return pout;
+}
+
+static inline D3DXVECTOR4* D3DXVec4Minimize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = min(pv1->x , pv2->x);
+    pout->y = min(pv1->y , pv2->y);
+    pout->z = min(pv1->z , pv2->z);
+    pout->w = min(pv1->w , pv2->w);
+    return pout;
+}
+
+static inline D3DXVECTOR4* D3DXVec4Scale(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, FLOAT s)
+{
+    if ( !pout || !pv) return NULL;
+    pout->x = s * (pv->x);
+    pout->y = s * (pv->y);
+    pout->z = s * (pv->z);
+    pout->w = s * (pv->w);
+    return pout;
+}
+
+static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
+{
+    if ( !pout || !pv1 || !pv2) return NULL;
+    pout->x = pv1->x - pv2->x;
+    pout->y = pv1->y - pv2->y;
+    pout->z = pv1->z - pv2->z;
+    pout->w = pv1->w - pv2->w;
+    return pout;
+}
+
+/*__________________D3DXMatrix____________________*/
+#ifdef NONAMELESSUNION
+# define D3DX_U(x)  (x).u
+#else
+# define D3DX_U(x)  (x)
+#endif
+
+static inline D3DXMATRIX* D3DXMatrixIdentity(D3DXMATRIX *pout)
+{
+    if ( !pout ) return NULL;
+    D3DX_U(*pout).m[0][1] = 0.0f;
+    D3DX_U(*pout).m[0][2] = 0.0f;
+    D3DX_U(*pout).m[0][3] = 0.0f;
+    D3DX_U(*pout).m[1][0] = 0.0f;
+    D3DX_U(*pout).m[1][2] = 0.0f;
+    D3DX_U(*pout).m[1][3] = 0.0f;
+    D3DX_U(*pout).m[2][0] = 0.0f;
+    D3DX_U(*pout).m[2][1] = 0.0f;
+    D3DX_U(*pout).m[2][3] = 0.0f;
+    D3DX_U(*pout).m[3][0] = 0.0f;
+    D3DX_U(*pout).m[3][1] = 0.0f;
+    D3DX_U(*pout).m[3][2] = 0.0f;
+    D3DX_U(*pout).m[0][0] = 1.0f;
+    D3DX_U(*pout).m[1][1] = 1.0f;
+    D3DX_U(*pout).m[2][2] = 1.0f;
+    D3DX_U(*pout).m[3][3] = 1.0f;
+    return pout;
+}
+
+static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm)
+{
+    int i,j;
+    D3DXMATRIX testmatrix;
+
+    if ( !pm ) return FALSE;
+    D3DXMatrixIdentity(&testmatrix);
+    for (i=0; i<4; i++)
+    {
+     for (j=0; j<4; j++)
+     {
+      if ( D3DX_U(*pm).m[i][j] != D3DX_U(testmatrix).m[i][j] ) return FALSE;
+     }
+    }
+    return TRUE;
+}
+#undef D3DX_U
+
+/*__________________D3DXPLANE____________________*/
+
+static inline FLOAT D3DXPlaneDot(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv)
+{
+    if ( !pp || !pv ) return 0.0f;
+    return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) * (pv->w) );
+}
+
+static inline FLOAT D3DXPlaneDotCoord(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv)
+{
+    if ( !pp || !pv ) return 0.0f;
+    return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) );
+}
+
+static inline FLOAT D3DXPlaneDotNormal(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv)
+{
+    if ( !pp || !pv ) return 0.0f;
+    return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) );
+}
+
+/*__________________D3DXQUATERNION____________________*/
+
+static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq)
+{
+    if ( !pout || !pq) return NULL;
+    pout->x = -pq->x;
+    pout->y = -pq->y;
+    pout->z = -pq->z;
+    pout->w = pq->w;
+    return pout;
+}
+
+static inline FLOAT D3DXQuaternionDot(CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2)
+{
+    if ( !pq1 || !pq2 ) return 0.0f;
+    return (pq1->x) * (pq2->x) + (pq1->y) * (pq2->y) + (pq1->z) * (pq2->z) + (pq1->w) * (pq2->w);
+}
+
+static inline D3DXQUATERNION* D3DXQuaternionIdentity(D3DXQUATERNION *pout)
+{
+    if ( !pout) return NULL;
+    pout->x = 0.0f;
+    pout->y = 0.0f;
+    pout->z = 0.0f;
+    pout->w = 1.0f;
+    return pout;
+}
+
+static inline BOOL D3DXQuaternionIsIdentity(D3DXQUATERNION *pq)
+{
+    if ( !pq) return FALSE;
+    return ( (pq->x == 0.0f) && (pq->y == 0.0f) && (pq->z == 0.0f) && (pq->w == 1.0f) );
+}
+
+static inline FLOAT D3DXQuaternionLength(CONST D3DXQUATERNION *pq)
+{
+    if (!pq) return 0.0f;
+    return sqrt( (pq->x) * (pq->x) + (pq->y) * (pq->y) + (pq->z) * (pq->z) + (pq->w) * (pq->w) );
+}
+
+static inline FLOAT D3DXQuaternionLengthSq(CONST D3DXQUATERNION *pq)
+{
+    if (!pq) return 0.0f;
+    return (pq->x) * (pq->x) + (pq->y) * (pq->y) + (pq->z) * (pq->z) + (pq->w) * (pq->w);
+}
+
+#endif
diff --git a/misc/builddeps/dp.win32/include/d3dx9mesh.h b/misc/builddeps/dp.win32/include/d3dx9mesh.h
new file mode 100644 (file)
index 0000000..5773d24
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2009 David Adam
+ * Copyright (C) 2010 Tony Wasserka
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <d3dx9.h>
+
+#ifndef __WINE_D3DX9MESH_H
+#define __WINE_D3DX9MESH_H
+
+DEFINE_GUID(IID_ID3DXBaseMesh, 0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30);
+DEFINE_GUID(IID_ID3DXMesh,     0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95);
+
+enum _MAX_FVF_DECL_SIZE
+{
+    MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1
+};
+
+typedef struct ID3DXBaseMesh* LPD3DXBASEMESH;
+typedef struct ID3DXMesh* LPD3DXMESH;
+
+typedef struct _D3DXATTRIBUTERANGE {
+    DWORD AttribId;
+    DWORD FaceStart;
+    DWORD FaceCount;
+    DWORD VertexStart;
+    DWORD VertexCount;
+} D3DXATTRIBUTERANGE;
+
+typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE;
+
+#undef INTERFACE
+#define INTERFACE ID3DXBaseMesh
+
+DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXBaseMesh ***/
+    STDMETHOD(DrawSubset)(THIS_ DWORD attrib_id) PURE;
+    STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
+    STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
+    STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
+    STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
+    STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE;
+    STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* device) PURE;
+    STDMETHOD(CloneMeshFVF)(THIS_ DWORD options, DWORD fvf, LPDIRECT3DDEVICE9 device, LPD3DXMESH* clone_mesh) PURE;
+    STDMETHOD(CloneMesh)(THIS_ DWORD options, CONST D3DVERTEXELEMENT9* declaration, LPDIRECT3DDEVICE9 device,
+        LPD3DXMESH* clone_mesh) PURE;
+    STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* vertex_buffer) PURE;
+    STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* index_buffer) PURE;
+    STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE;
+    STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
+    STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE;
+    STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
+    STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE;
+    STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* point_reps, DWORD* adjacency) PURE;
+    STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* adjacency, DWORD* point_reps) PURE;
+    STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE;
+    STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
+};
+
+
+#undef INTERFACE
+#define INTERFACE ID3DXMesh
+
+DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXBaseMesh ***/
+    STDMETHOD(DrawSubset)(THIS_ DWORD attrib_id) PURE;
+    STDMETHOD_(DWORD, GetNumFaces)(THIS) PURE;
+    STDMETHOD_(DWORD, GetNumVertices)(THIS) PURE;
+    STDMETHOD_(DWORD, GetFVF)(THIS) PURE;
+    STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
+    STDMETHOD_(DWORD, GetNumBytesPerVertex)(THIS) PURE;
+    STDMETHOD_(DWORD, GetOptions)(THIS) PURE;
+    STDMETHOD(GetDevice)(THIS_ LPDIRECT3DDEVICE9* device) PURE;
+    STDMETHOD(CloneMeshFVF)(THIS_ DWORD options, DWORD fvf, LPDIRECT3DDEVICE9 device, LPD3DXMESH* clone_mesh) PURE;
+    STDMETHOD(CloneMesh)(THIS_ DWORD options, CONST D3DVERTEXELEMENT9* declaration, LPDIRECT3DDEVICE9 device,
+        LPD3DXMESH* clone_mesh) PURE;
+    STDMETHOD(GetVertexBuffer)(THIS_ LPDIRECT3DVERTEXBUFFER9* vertex_buffer) PURE;
+    STDMETHOD(GetIndexBuffer)(THIS_ LPDIRECT3DINDEXBUFFER9* index_buffer) PURE;
+    STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE;
+    STDMETHOD(UnlockVertexBuffer)(THIS) PURE;
+    STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE;
+    STDMETHOD(UnlockIndexBuffer)(THIS) PURE;
+    STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE;
+    STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* point_reps, DWORD* adjacency) PURE;
+    STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* adjacency, DWORD* point_reps) PURE;
+    STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE;
+    STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE;
+    /*** ID3DXMesh ***/
+    STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** data) PURE;
+    STDMETHOD(UnlockAttributeBuffer)(THIS) PURE;
+    STDMETHOD(Optimize)(THIS_ DWORD flags, CONST DWORD* adjacency_in, DWORD* adjacency_out,
+        DWORD* face_remap, LPD3DXBUFFER* vertex_remap, LPD3DXMESH* opt_mesh) PURE;
+    STDMETHOD(OptimizeInplace)(THIS_ DWORD flags, CONST DWORD* adjacency_in, DWORD* adjacency_out,
+                     DWORD* face_remap, LPD3DXBUFFER* vertex_remap) PURE;
+    STDMETHOD(SetAttributeTable)(THIS_ CONST D3DXATTRIBUTERANGE* attrib_table, DWORD attrib_table_size) PURE;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HRESULT WINAPI D3DXCreateBuffer(DWORD, LPD3DXBUFFER*);
+UINT    WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx);
+UINT    WINAPI D3DXGetFVFVertexSize(DWORD);
+BOOL    WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *);
+BOOL    WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *,FLOAT,CONST D3DXVECTOR3 *,CONST D3DXVECTOR3 *);
+HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *, DWORD, DWORD, D3DXVECTOR3 *, D3DXVECTOR3 *);
+HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3 *, DWORD, DWORD, D3DXVECTOR3 *, FLOAT *);
+HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD, D3DVERTEXELEMENT9[MAX_FVF_DECL_SIZE]);
+BOOL    WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3*, FLOAT *, FLOAT *, FLOAT *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_D3DX9MESH_H */
diff --git a/misc/builddeps/dp.win32/include/d3dx9shader.h b/misc/builddeps/dp.win32/include/d3dx9shader.h
new file mode 100644 (file)
index 0000000..c8380bc
--- /dev/null
@@ -0,0 +1,349 @@
+/*
+ * Copyright 2008 Luis Busquets
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "d3dx9.h"
+
+#ifndef __D3DX9SHADER_H__
+#define __D3DX9SHADER_H__
+
+#define D3DXSHADER_DEBUG                          0x1
+#define D3DXSHADER_SKIPVALIDATION                 0x2
+#define D3DXSHADER_SKIPOPTIMIZATION               0x4
+#define D3DXSHADER_PACKMATRIX_ROWMAJOR            0x8
+#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR         0x10
+#define D3DXSHADER_PARTIALPRECISION               0x20
+#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT        0x40
+#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT        0x80
+#define D3DXSHADER_NO_PRESHADER                   0x100
+#define D3DXSHADER_AVOID_FLOW_CONTROL             0x200
+#define D3DXSHADER_PREFER_FLOW_CONTROL            0x400
+#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000
+#define D3DXSHADER_IEEE_STRICTNESS                0x2000
+
+#define D3DXSHADER_OPTIMIZATION_LEVEL0            0x4000
+#define D3DXSHADER_OPTIMIZATION_LEVEL1            0x0
+#define D3DXSHADER_OPTIMIZATION_LEVEL2            0xC000
+#define D3DXSHADER_OPTIMIZATION_LEVEL3            0x8000
+
+#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL        0x10000
+
+typedef LPCSTR D3DXHANDLE;
+
+typedef enum _D3DXREGISTER_SET
+{
+    D3DXRS_BOOL,
+    D3DXRS_INT4,
+    D3DXRS_FLOAT4,
+    D3DXRS_SAMPLER,
+    D3DXRS_FORCE_DWORD = 0x7fffffff
+} D3DXREGISTER_SET, *LPD3DXREGISTER_SET;
+
+typedef enum D3DXPARAMETER_CLASS
+{
+    D3DXPC_SCALAR,
+    D3DXPC_VECTOR,
+    D3DXPC_MATRIX_ROWS,
+    D3DXPC_MATRIX_COLUMNS,
+    D3DXPC_OBJECT,
+    D3DXPC_STRUCT,
+    D3DXPC_FORCE_DWORD = 0x7fffffff,
+} D3DXPARAMETER_CLASS, *LPD3DXPARAMETER_CLASS;
+
+typedef enum D3DXPARAMETER_TYPE
+{
+    D3DXPT_VOID,
+    D3DXPT_BOOL,
+    D3DXPT_INT,
+    D3DXPT_FLOAT,
+    D3DXPT_STRING,
+    D3DXPT_TEXTURE,
+    D3DXPT_TEXTURE1D,
+    D3DXPT_TEXTURE2D,
+    D3DXPT_TEXTURE3D,
+    D3DXPT_TEXTURECUBE,
+    D3DXPT_SAMPLER,
+    D3DXPT_SAMPLER1D,
+    D3DXPT_SAMPLER2D,
+    D3DXPT_SAMPLER3D,
+    D3DXPT_SAMPLERCUBE,
+    D3DXPT_PIXELSHADER,
+    D3DXPT_VERTEXSHADER,
+    D3DXPT_PIXELFRAGMENT,
+    D3DXPT_VERTEXFRAGMENT,
+    D3DXPT_UNSUPPORTED,
+    D3DXPT_FORCE_DWORD = 0x7fffffff,
+} D3DXPARAMETER_TYPE, *LPD3DXPARAMETER_TYPE;
+
+typedef struct _D3DXCONSTANTTABLE_DESC
+{
+    LPCSTR Creator;
+    DWORD Version;
+    UINT Constants;
+} D3DXCONSTANTTABLE_DESC, *LPD3DXCONSTANTTABLE_DESC;
+
+typedef struct _D3DXCONSTANT_DESC
+{
+    LPCSTR Name;
+    D3DXREGISTER_SET RegisterSet;
+    UINT RegisterIndex;
+    UINT RegisterCount;
+    D3DXPARAMETER_CLASS Class;
+    D3DXPARAMETER_TYPE Type;
+    UINT Rows;
+    UINT Columns;
+    UINT Elements;
+    UINT StructMembers;
+    UINT Bytes;
+    LPCVOID DefaultValue;
+} D3DXCONSTANT_DESC, *LPD3DXCONSTANT_DESC;
+
+DEFINE_GUID(IID_ID3DXConstantTable, 0x9dca3190, 0x38b9, 0x4fc3, 0x92, 0xe3, 0x39, 0xc6, 0xdd, 0xfb, 0x35, 0x8b);
+
+#undef INTERFACE
+#define INTERFACE ID3DXConstantTable
+
+DECLARE_INTERFACE_(ID3DXConstantTable, ID3DXBuffer)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
+    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG, Release)(THIS) PURE;
+    /*** ID3DXBuffer methods ***/
+    STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE;
+    STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
+    /*** ID3DXConstantTable methods ***/
+    STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE;
+    STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE;
+    STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE;
+    STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
+    STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE;
+    STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
+    STDMETHOD(SetDefaults)(THIS_ LPDIRECT3DDEVICE9 pDevice) PURE;
+    STDMETHOD(SetValue)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, LPCVOID pData, UINT Bytes) PURE;
+    STDMETHOD(SetBool)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, BOOL b) PURE;
+    STDMETHOD(SetBoolArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST BOOL* pb, UINT Count) PURE;
+    STDMETHOD(SetInt)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, INT n) PURE;
+    STDMETHOD(SetIntArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST INT* pn, UINT Count) PURE;
+    STDMETHOD(SetFloat)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, FLOAT f) PURE;
+    STDMETHOD(SetFloatArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST FLOAT* pf, UINT Count) PURE;
+    STDMETHOD(SetVector)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector) PURE;
+    STDMETHOD(SetVectorArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXVECTOR4* pVector, UINT Count) PURE;
+    STDMETHOD(SetMatrix)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
+    STDMETHOD(SetMatrixArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
+    STDMETHOD(SetMatrixPointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
+    STDMETHOD(SetMatrixTranspose)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix) PURE;
+    STDMETHOD(SetMatrixTransposeArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX* pMatrix, UINT Count) PURE;
+    STDMETHOD(SetMatrixTransposePointerArray)(THIS_ LPDIRECT3DDEVICE9 pDevice, D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
+};
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define ID3DXConstantTable_QueryInterface(p,a,b)                      (p)->lpVtbl->QueryInterface(p,a,b)
+#define ID3DXConstantTable_AddRef(p)                                  (p)->lpVtbl->AddRef(p)
+#define ID3DXConstantTable_Release(p)                                 (p)->lpVtbl->Release(p)
+/*** ID3DXBuffer methods ***/
+#define ID3DXConstantTable_GetBufferPointer(p)                        (p)->lpVtbl->GetBufferPointer(p)
+#define ID3DXConstantTable_GetBufferSize(p)                           (p)->lpVtbl->GetBufferSize(p)
+/*** ID3DXConstantTable methods ***/
+#define ID3DXConstantTable_GetDesc(p,a)                               (p)->lpVtbl->GetDesc(p,a)
+#define ID3DXConstantTable_GetConstantDesc(p,a,b,c)                   (p)->lpVtbl->GetConstantDesc(p,a,b,c)
+#define ID3DXConstantTable_GetSamplerIndex(p,a)                       (p)->lpVtbl->GetSamplerIndex(p,a)
+#define ID3DXConstantTable_GetConstant(p,a,b)                         (p)->lpVtbl->GetConstant(p,a,b)
+#define ID3DXConstantTable_GetConstantByName(p,a,b)                   (p)->lpVtbl->GetConstantByName(p,a,b)
+#define ID3DXConstantTable_GetConstantElement(p,a,b)                  (p)->lpVtbl->GetConstantElement(p,a,b)
+#define ID3DXConstantTable_SetDefaults(p,a)                           (p)->lpVtbl->SetDefaults(p,a)
+#define ID3DXConstantTable_SetValue(p,a,b,c,d)                        (p)->lpVtbl->SetValue(p,a,b,c,d)
+#define ID3DXConstantTable_SetBool(p,a,b,c)                           (p)->lpVtbl->SetBool(p,a,b,c)
+#define ID3DXConstantTable_SetBoolArray(p,a,b,c,d)                    (p)->lpVtbl->SetBoolArray(p,a,b,c,d)
+#define ID3DXConstantTable_SetInt(p,a,b,c)                            (p)->lpVtbl->SetInt(p,a,b,c)
+#define ID3DXConstantTable_SetIntArray(p,a,b,c,d)                     (p)->lpVtbl->SetIntArray(p,a,b,c,d)
+#define ID3DXConstantTable_SetFloat(p,a,b,c)                          (p)->lpVtbl->SetFloat(p,a,b,c)
+#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d)                   (p)->lpVtbl->SetFloatArray(p,a,b,c,d)
+#define ID3DXConstantTable_SetVector(p,a,b,c)                         (p)->lpVtbl->SetVector(p,a,b,c)
+#define ID3DXConstantTable_SetVectorArray(p,a,b,c,d)                  (p)->lpVtbl->SetVectorArray(p,a,b,c,d)
+#define ID3DXConstantTable_SetMatrix(p,a,b,c)                         (p)->lpVtbl->SetMatrix(p,a,b,c)
+#define ID3DXConstantTable_SetMatrixArray(p,a,b,c,d)                  (p)->lpVtbl->SetMatrixArray(p,a,b,c,d)
+#define ID3DXConstantTable_SetMatrixPointerArray(p,a,b,c,d)           (p)->lpVtbl->SetMatrixPointerArray(p,a,b,c,d)
+#define ID3DXConstantTable_SetMatrixTranspose(p,a,b,c)                (p)->lpVtbl->SetMatrixTranspose(p,a,b,c)
+#define ID3DXConstantTable_SetMatrixTransposeArray(p,a,b,c,d)         (p)->lpVtbl->SetMatrixTransposeArray(p,a,b,c,d)
+#define ID3DXConstantTable_SetMatrixTransposePointerArray(p,a,b,c,d)  (p)->lpVtbl->SetMatrixTransposePointerArray(p,a,b,c,d)
+#else
+/*** IUnknown methods ***/
+#define ID3DXConstantTable_QueryInterface(p,a,b)                      (p)->QueryInterface(a,b)
+#define ID3DXConstantTable_AddRef(p)                                  (p)->AddRef()
+#define ID3DXConstantTable_Release(p)                                 (p)->Release()
+/*** ID3DXBuffer methods ***/
+#define ID3DXConstantTable_GetBufferPointer(p)                        (p)->GetBufferPointer()
+#define ID3DXConstantTable_GetBufferSize(p)                           (p)->GetBufferSize()
+/*** ID3DXConstantTable methods ***/
+#define ID3DXConstantTable_GetDesc(p,a)                               (p)->GetDesc(a)
+#define ID3DXConstantTable_GetConstantDesc(p,a,b,c)                   (p)->GetConstantDesc(a,b,c)
+#define ID3DXConstantTable_GetSamplerIndex(p,a)                       (p)->GetConstantDesc(a)
+#define ID3DXConstantTable_GetConstant(p,a,b)                         (p)->GetConstant(a,b)
+#define ID3DXConstantTable_GetConstantByName(p,a,b)                   (p)->GetConstantByName(a,b)
+#define ID3DXConstantTable_GetConstantElement(p,a,b)                  (p)->GetConstantElement(a,b)
+#define ID3DXConstantTable_SetDefaults(p,a)                           (p)->SetDefaults(a)
+#define ID3DXConstantTable_SetValue(p,a,b,c,d)                        (p)->SetValue(a,b,c,d)
+#define ID3DXConstantTable_SetBool(p,a,b,c)                           (p)->SetBool(a,b,c)
+#define ID3DXConstantTable_SetBoolArray(p,a,b,c,d)                    (p)->SetBoolArray(a,b,c,d)
+#define ID3DXConstantTable_SetInt(p,a,b,c)                            (p)->SetInt(a,b,c)
+#define ID3DXConstantTable_SetIntArray(p,a,b,c,d)                     (p)->SetIntArray(a,b,c,d)
+#define ID3DXConstantTable_SetFloat(p,a,b,c)                          (p)->SetFloat(a,b,c)
+#define ID3DXConstantTable_SetFloatArray(p,a,b,c,d)                   (p)->SetFloatArray(a,b,c,d)
+#define ID3DXConstantTable_SetVector(p,a,b,c)                         (p)->SetVector(a,b,c)
+#define ID3DXConstantTable_SetVectorArray(p,a,b,c,d)                  (p)->SetVectorArray(a,b,c,d)
+#define ID3DXConstantTable_SetMatrix(p,a,b,c)                         (p)->SetMatrix(a,b,c)
+#define ID3DXConstantTable_SetMatrixArray(p,a,b,c,d)                  (p)->SetMatrixArray(a,b,c,d)
+#define ID3DXConstantTable_SetMatrixPointerArray(p,a,b,c,d)           (p)->SetMatrixPointerArray(a,b,c,d)
+#define ID3DXConstantTable_SetMatrixTranspose(p,a,b,c)                (p)->SetMatrixTranspose(a,b,c)
+#define ID3DXConstantTable_SetMatrixTransposeArray(p,a,b,c,d)         (p)->SetMatrixTransposeArray(a,b,c,d)
+#define ID3DXConstantTable_SetMatrixTransposePointerArray(p,a,b,c,d)  (p)->SetMatrixTransposePointerArray(a,b,c,d)
+#endif
+
+typedef struct ID3DXConstantTable *LPD3DXCONSTANTTABLE;
+
+typedef struct _D3DXMACRO {
+    LPCSTR Name;
+    LPCSTR Definition;
+} D3DXMACRO, *LPD3DXMACRO;
+
+typedef struct _D3DXSEMANTIC {
+    UINT Usage;
+    UINT UsageIndex;
+} D3DXSEMANTIC, *LPD3DXSEMANTIC;
+
+typedef enum _D3DXINCLUDE_TYPE
+{
+    D3DXINC_LOCAL,
+    D3DXINC_SYSTEM,
+    D3DXINC_FORCE_DWORD = 0x7fffffff,
+} D3DXINCLUDE_TYPE, *LPD3DXINCLUDE_TYPE;
+
+#undef INTERFACE
+#define INTERFACE ID3DXInclude
+
+DECLARE_INTERFACE(ID3DXInclude)
+{
+    STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE include_type, LPCSTR filename, LPCVOID parent_data, LPCVOID *data, UINT *bytes) PURE;
+    STDMETHOD(Close)(THIS_ LPCVOID data) PURE;
+};
+
+#define ID3DXInclude_Open(p,a,b,c,d,e)  (p)->lpVtbl->Open(p,a,b,c,d,e)
+#define ID3DXInclude_Close(p,a)         (p)->lpVtbl->Close(p,a)
+
+typedef struct ID3DXInclude *LPD3DXINCLUDE;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LPCSTR WINAPI D3DXGetPixelShaderProfile(LPDIRECT3DDEVICE9 device);
+UINT WINAPI D3DXGetShaderSize(const DWORD *byte_code);
+DWORD WINAPI D3DXGetShaderVersion(const DWORD *byte_code);
+LPCSTR WINAPI D3DXGetVertexShaderProfile(LPDIRECT3DDEVICE9 device);
+HRESULT WINAPI D3DXFindShaderComment(CONST DWORD* byte_code, DWORD fourcc, LPCVOID* data, UINT* size);
+
+HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR filename,
+                                           CONST D3DXMACRO* defines,
+                                           LPD3DXINCLUDE include,
+                                           DWORD flags,
+                                           LPD3DXBUFFER* shader,
+                                           LPD3DXBUFFER* error_messages);
+
+HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR filename,
+                                           CONST D3DXMACRO* defines,
+                                           LPD3DXINCLUDE include,
+                                           DWORD flags,
+                                           LPD3DXBUFFER* shader,
+                                           LPD3DXBUFFER* error_messages);
+
+HRESULT WINAPI D3DXAssembleShaderFromResourceA(HMODULE module,
+                                               LPCSTR resource,
+                                               CONST D3DXMACRO* defines,
+                                               LPD3DXINCLUDE include,
+                                               DWORD flags,
+                                               LPD3DXBUFFER* shader,
+                                               LPD3DXBUFFER* error_messages);
+
+HRESULT WINAPI D3DXAssembleShaderFromResourceW(HMODULE module,
+                                               LPCWSTR resource,
+                                               CONST D3DXMACRO* defines,
+                                               LPD3DXINCLUDE include,
+                                               DWORD flags,
+                                               LPD3DXBUFFER* shader,
+                                               LPD3DXBUFFER* error_messages);
+
+HRESULT WINAPI D3DXAssembleShader(LPCSTR data,
+                                  UINT data_len,
+                                  CONST D3DXMACRO* defines,
+                                  LPD3DXINCLUDE include,
+                                  DWORD flags,
+                                  LPD3DXBUFFER* shader,
+                                  LPD3DXBUFFER* error_messages);
+
+HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD* byte_code,
+                                            DWORD flags,
+                                            LPD3DXCONSTANTTABLE* constant_table);
+
+HRESULT WINAPI D3DXGetShaderConstantTable(CONST DWORD* byte_code,
+                                          LPD3DXCONSTANTTABLE* constant_table);
+
+#ifdef __cplusplus
+}
+#endif
+
+typedef struct _D3DXSHADER_CONSTANTTABLE
+{
+    DWORD Size;
+    DWORD Creator;
+    DWORD Version;
+    DWORD Constants;
+    DWORD ConstantInfo;
+    DWORD Flags;
+    DWORD Target;
+} D3DXSHADER_CONSTANTTABLE, *LPD3DXSHADER_CONSTANTTABLE;
+
+typedef struct _D3DXSHADER_CONSTANTINFO
+{
+    DWORD Name;
+    WORD  RegisterSet;
+    WORD  RegisterIndex;
+    WORD  RegisterCount;
+    WORD  Reserved;
+    DWORD TypeInfo;
+    DWORD DefaultValue;
+} D3DXSHADER_CONSTANTINFO, *LPD3DXSHADER_CONSTANTINFO;
+
+typedef struct _D3DXSHADER_TYPEINFO
+{
+    WORD  Class;
+    WORD  Type;
+    WORD  Rows;
+    WORD  Columns;
+    WORD  Elements;
+    WORD  StructMembers;
+    DWORD StructMemberInfo;
+} D3DXSHADER_TYPEINFO, *LPD3DXSHADER_TYPEINFO;
+
+typedef struct _D3DXSHADER_STRUCTMEMBERINFO
+{
+    DWORD Name;
+    DWORD TypeInfo;
+} D3DXSHADER_STRUCTMEMBERINFO, *LPD3DXSHADER_STRUCTMEMBERINFO;
+
+#endif /* __D3DX9SHADER_H__ */
diff --git a/misc/builddeps/dp.win32/include/d3dx9shape.h b/misc/builddeps/dp.win32/include/d3dx9shape.h
new file mode 100644 (file)
index 0000000..e1bf231
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2010 Christian Costa
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "d3dx9.h"
+
+#ifndef __D3DX9SHAPE_H__
+#define __D3DX9SHAPE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HRESULT WINAPI D3DXCreateBox(LPDIRECT3DDEVICE9 device,
+                             FLOAT width,
+                             FLOAT height,
+                             FLOAT depth,
+                             LPD3DXMESH* mesh,
+                             LPD3DXBUFFER* adjacency);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __D3DX9SHAPE_H__ */
diff --git a/misc/builddeps/dp.win32/include/d3dx9tex.h b/misc/builddeps/dp.win32/include/d3dx9tex.h
new file mode 100644 (file)
index 0000000..019a4da
--- /dev/null
@@ -0,0 +1,698 @@
+/*
+ * Copyright (C) 2008 Tony Wasserka
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <_mingw_dxhelper.h>
+#include <d3dx9.h>
+
+#ifndef __WINE_D3DX9TEX_H
+#define __WINE_D3DX9TEX_H
+
+/**********************************************
+ ***************** Definitions ****************
+ **********************************************/
+#define D3DX_FILTER_NONE                 0x00000001
+#define D3DX_FILTER_POINT                0x00000002
+#define D3DX_FILTER_LINEAR               0x00000003
+#define D3DX_FILTER_TRIANGLE             0x00000004
+#define D3DX_FILTER_BOX                  0x00000005
+#define D3DX_FILTER_MIRROR_U             0x00010000
+#define D3DX_FILTER_MIRROR_V             0x00020000
+#define D3DX_FILTER_MIRROR_W             0x00040000
+#define D3DX_FILTER_MIRROR               0x00070000
+#define D3DX_FILTER_DITHER               0x00080000
+#define D3DX_FILTER_DITHER_DIFFUSION     0x00100000
+#define D3DX_FILTER_SRGB_IN              0x00200000
+#define D3DX_FILTER_SRGB_OUT             0x00400000
+#define D3DX_FILTER_SRGB                 0x00600000
+
+#define D3DX_NORMALMAP_MIRROR_U          0x00010000
+#define D3DX_NORMALMAP_MIRROR_V          0x00020000
+#define D3DX_NORMALMAP_MIRROR            0x00030000
+#define D3DX_NORMALMAP_INVERTSIGN        0x00080000
+#define D3DX_NORMALMAP_COMPUTE_OCCLUSION 0x00100000
+
+#define D3DX_CHANNEL_RED                 0x00000001
+#define D3DX_CHANNEL_BLUE                0x00000002
+#define D3DX_CHANNEL_GREEN               0x00000004
+#define D3DX_CHANNEL_ALPHA               0x00000008
+#define D3DX_CHANNEL_LUMINANCE           0x00000010
+
+/**********************************************
+ **************** Typedefs ****************
+ **********************************************/
+typedef enum _D3DXIMAGE_FILEFORMAT
+{
+    D3DXIFF_BMP,
+    D3DXIFF_JPG,
+    D3DXIFF_TGA,
+    D3DXIFF_PNG,
+    D3DXIFF_DDS,
+    D3DXIFF_PPM,
+    D3DXIFF_DIB,
+    D3DXIFF_FORCE_DWORD = 0x7fffffff
+} D3DXIMAGE_FILEFORMAT;
+
+typedef struct _D3DXIMAGE_INFO
+{
+    UINT Width;
+    UINT Height;
+    UINT Depth;
+    UINT MipLevels;
+    D3DFORMAT Format;
+    D3DRESOURCETYPE ResourceType;
+    D3DXIMAGE_FILEFORMAT ImageFileFormat;
+} D3DXIMAGE_INFO;
+
+/**********************************************
+ ****************** Functions *****************
+ **********************************************/
+/* Typedefs for callback functions */
+typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *out, CONST D3DXVECTOR2 *texcoord, CONST D3DXVECTOR2 *texelsize, LPVOID data);
+typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *out, CONST D3DXVECTOR3 *texcoord, CONST D3DXVECTOR3 *texelsize, LPVOID data);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Image Information */
+HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info);
+HRESULT WINAPI D3DXGetImageInfoFromFileW(LPCWSTR file, D3DXIMAGE_INFO *info);
+#define        D3DXGetImageInfoFromFile WINELIB_NAME_AW(D3DXGetImageInfoFromFile)
+
+HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, LPCSTR resource, D3DXIMAGE_INFO *info);
+HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, LPCWSTR resource, D3DXIMAGE_INFO *info);
+#define        D3DXGetImageInfoFromResource WINELIB_NAME_AW(D3DXGetImageInfoFromResource)
+
+HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3DXIMAGE_INFO *info);
+
+
+/* Surface Loading/Saving */
+HRESULT WINAPI D3DXLoadSurfaceFromFileA(       LPDIRECT3DSURFACE9 destsurface,
+                                               CONST PALETTEENTRY *destpalette,
+                                               CONST RECT *destrect,
+                                               LPCSTR srcfile,
+                                               CONST RECT *srcrect,
+                                               DWORD filter,
+                                               D3DCOLOR colorkey,
+                                               D3DXIMAGE_INFO *srcinfo);
+
+HRESULT WINAPI D3DXLoadSurfaceFromFileW(       LPDIRECT3DSURFACE9 destsurface,
+                                               CONST PALETTEENTRY *destpalette,
+                                               CONST RECT *destrect,
+                                               LPCWSTR srcfile,
+                                               CONST RECT *srcrect,
+                                               DWORD filter,
+                                               D3DCOLOR colorkey,
+                                               D3DXIMAGE_INFO *srcinfo);
+#define        D3DXLoadSurfaceFromFile WINELIB_NAME_AW(D3DXLoadSurfaceFromFile)
+
+HRESULT WINAPI D3DXLoadSurfaceFromResourceA(   LPDIRECT3DSURFACE9 destsurface,
+                                               CONST PALETTEENTRY *destpalette,
+                                               CONST RECT *destrect,
+                                               HMODULE srcmodule,
+                                               LPCSTR resource,
+                                               CONST RECT *srcrect,
+                                               DWORD filter,
+                                               D3DCOLOR colorkey,
+                                               D3DXIMAGE_INFO *srcinfo);
+
+HRESULT WINAPI D3DXLoadSurfaceFromResourceW(   LPDIRECT3DSURFACE9 destsurface,
+                                               CONST PALETTEENTRY *destpalette,
+                                               CONST RECT *destrect,
+                                               HMODULE srcmodule,
+                                               LPCWSTR resource,
+                                               CONST RECT *srcrect,
+                                               DWORD filter,
+                                               D3DCOLOR colorkey,
+                                               D3DXIMAGE_INFO *srcinfo);
+#define        D3DXLoadSurfaceFromResource WINELIB_NAME_AW(D3DXLoadSurfaceFromResource)
+
+HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 destsurface,
+                                               CONST PALETTEENTRY *destpalette,
+                                               CONST RECT*destrect,
+                                               LPCVOID srcdata,
+                                               UINT srcdatasize,
+                                               CONST RECT *srcrect,
+                                               DWORD filter,
+                                               D3DCOLOR colorkey,
+                                               D3DXIMAGE_INFO *srcinfo);
+
+HRESULT WINAPI D3DXLoadSurfaceFromSurface(     LPDIRECT3DSURFACE9 destsurface,
+                                               CONST PALETTEENTRY *destpalette,
+                                               CONST RECT *destrect,
+                                               LPDIRECT3DSURFACE9 srcsurface,
+                                               CONST PALETTEENTRY *srcpalette,
+                                               CONST RECT *srcrect,
+                                               DWORD filter,
+                                               D3DCOLOR colorkey);
+
+HRESULT WINAPI D3DXLoadSurfaceFromMemory(      LPDIRECT3DSURFACE9 destsurface,
+                                               CONST PALETTEENTRY *destpalette,
+                                               CONST RECT *destrect,
+                                               LPCVOID srcmemory,
+                                               D3DFORMAT srcformat,
+                                               UINT srcpitch,
+                                               CONST PALETTEENTRY *srcpalette,
+                                               CONST RECT *srcrect,
+                                               DWORD filter,
+                                               D3DCOLOR colorkey);
+
+HRESULT WINAPI D3DXSaveSurfaceToFileA(         LPCSTR destfile,
+                                               D3DXIMAGE_FILEFORMAT destformat,
+                                               LPDIRECT3DSURFACE9 srcsurface,
+                                               CONST PALETTEENTRY *srcpalette,
+                                               CONST RECT *srcrect);
+
+HRESULT WINAPI D3DXSaveSurfaceToFileW(         LPCWSTR destfile,
+                                               D3DXIMAGE_FILEFORMAT destformat,
+                                               LPDIRECT3DSURFACE9 srcsurface,
+                                               CONST PALETTEENTRY *srcpalette,
+                                               CONST RECT *srcrect);
+#define        D3DXSaveSurfaceToFile WINELIB_NAME_AW(D3DXSaveSurfaceToFile)
+
+
+/* Volume Loading/Saving */
+HRESULT WINAPI D3DXLoadVolumeFromFileA(       LPDIRECT3DVOLUME9 destvolume,
+                                              CONST PALETTEENTRY *destpalette,
+                                              CONST D3DBOX *destbox,
+                                              LPCSTR srcfile,
+                                              CONST D3DBOX *srcbox,
+                                              DWORD filter,
+                                              D3DCOLOR colorkey,
+                                              D3DXIMAGE_INFO *srcinfo);
+
+HRESULT WINAPI D3DXLoadVolumeFromFileW(       LPDIRECT3DVOLUME9 destVolume,
+                                              CONST PALETTEENTRY *destpalette,
+                                              CONST D3DBOX *destbox,
+                                              LPCWSTR srcfile,
+                                              CONST D3DBOX *srcbox,
+                                              DWORD filter,
+                                              D3DCOLOR colorkey,
+                                              D3DXIMAGE_INFO *srcinfo);
+#define        D3DXLoadVolumeFromFile WINELIB_NAME_AW(D3DXLoadVolumeFromFile)
+
+HRESULT WINAPI D3DXLoadVolumeFromResourceA(   LPDIRECT3DVOLUME9 destVolume,
+                                              CONST PALETTEENTRY *destpalette,
+                                              CONST D3DBOX *destbox,
+                                              HMODULE srcmodule,
+                                              LPCSTR resource,
+                                              CONST D3DBOX *srcbox,
+                                              DWORD filter,
+                                              D3DCOLOR colorkey,
+                                              D3DXIMAGE_INFO *srcinfo);
+
+HRESULT WINAPI D3DXLoadVolumeFromResourceW(   LPDIRECT3DVOLUME9 destVolume,
+                                              CONST PALETTEENTRY *destpalette,
+                                              CONST D3DBOX *destbox,
+                                              HMODULE srcmodule,
+                                              LPCWSTR resource,
+                                              CONST D3DBOX *srcbox,
+                                              DWORD filter,
+                                              D3DCOLOR colorkey,
+                                              D3DXIMAGE_INFO *srcinfo);
+#define        D3DXLoadVolumeFromResource WINELIB_NAME_AW(D3DXLoadVolumeFromResource)
+
+HRESULT WINAPI D3DXLoadVolumeFromFileInMemory(LPDIRECT3DVOLUME9 destvolume,
+                                              CONST PALETTEENTRY *destpalette,
+                                              CONST D3DBOX *destbox,
+                                              LPCVOID srcdata,
+                                              UINT srcdatasize,
+                                              CONST D3DBOX *srcbox,
+                                              DWORD filter,
+                                              D3DCOLOR colorkey,
+                                              D3DXIMAGE_INFO *srcinfo);
+
+HRESULT WINAPI D3DXLoadVolumeFromVolume(      LPDIRECT3DVOLUME9 destvolume,
+                                              CONST PALETTEENTRY *destpalette,
+                                              CONST D3DBOX *destbox,
+                                              LPDIRECT3DVOLUME9 srcvolume,
+                                              CONST PALETTEENTRY *srcpalette,
+                                              CONST D3DBOX *srcbox,
+                                              DWORD filter,
+                                              D3DCOLOR colorkey);
+
+HRESULT WINAPI D3DXLoadVolumeFromMemory(      LPDIRECT3DVOLUME9 destvolume,
+                                              CONST PALETTEENTRY *destpalette,
+                                              CONST D3DBOX *destbox,
+                                              LPCVOID srcmemory,
+                                              D3DFORMAT srcformat,
+                                              UINT srcrowpitch,
+                                              UINT srcslicepitch,
+                                              CONST PALETTEENTRY *srcpalette,
+                                              CONST D3DBOX *srcbox,
+                                              DWORD filter,
+                                              D3DCOLOR colorkey);
+
+HRESULT WINAPI D3DXSaveVolumeToFileA(         LPCSTR destfile,
+                                              D3DXIMAGE_FILEFORMAT destformat,
+                                              LPDIRECT3DVOLUME9 srcvolume,
+                                              CONST PALETTEENTRY *srcpalette,
+                                              CONST D3DBOX *srcbox);
+
+HRESULT WINAPI D3DXSaveVolumeToFileW(         LPCWSTR destfile,
+                                              D3DXIMAGE_FILEFORMAT destformat,
+                                              LPDIRECT3DVOLUME9 srcvolume,
+                                              CONST PALETTEENTRY *srcpalette,
+                                              CONST D3DBOX *srcbox);
+#define        D3DXSaveVolumeToFile WINELIB_NAME_AW(D3DXSaveVolumeToFile)
+
+
+/* Texture, cube texture and volume texture creation */
+HRESULT WINAPI D3DXCheckTextureRequirements(      LPDIRECT3DDEVICE9 device,
+                                                  UINT *width,
+                                                  UINT *height,
+                                                  UINT *miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT *format,
+                                                  D3DPOOL pool);
+HRESULT WINAPI D3DXCheckCubeTextureRequirements(  LPDIRECT3DDEVICE9 device,
+                                                  UINT *size,
+                                                  UINT *miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT *format,
+                                                  D3DPOOL pool);
+
+HRESULT WINAPI D3DXCheckVolumeTextureRequirements(LPDIRECT3DDEVICE9 device,
+                                                  UINT *width,
+                                                  UINT *height,
+                                                  UINT *depth,
+                                                  UINT *miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT *format,
+                                                  D3DPOOL pool);
+
+HRESULT WINAPI D3DXCreateTexture(      LPDIRECT3DDEVICE9 device,
+                                       UINT width,
+                                       UINT height,
+                                       UINT miplevels,
+                                       DWORD usage,
+                                       D3DFORMAT format,
+                                       D3DPOOL pool,
+                                       LPDIRECT3DTEXTURE9 *texture);
+
+HRESULT WINAPI D3DXCreateCubeTexture(  LPDIRECT3DDEVICE9 device,
+                                       UINT size,
+                                       UINT miplevels,
+                                       DWORD usage,
+                                       D3DFORMAT format,
+                                       D3DPOOL pool,
+                                       LPDIRECT3DCUBETEXTURE9 *cube);
+
+HRESULT WINAPI D3DXCreateVolumeTexture(LPDIRECT3DDEVICE9 device,
+                                       UINT width,
+                                       UINT height,
+                                       UINT depth,
+                                       UINT miplevels,
+                                       DWORD usage,
+                                       D3DFORMAT format,
+                                       D3DPOOL pool,
+                                       LPDIRECT3DVOLUMETEXTURE9 *volume);
+
+HRESULT WINAPI D3DXCreateTextureFromFileA(      LPDIRECT3DDEVICE9 device,
+                                                LPCSTR srcfile,
+                                                LPDIRECT3DTEXTURE9 *texture);
+
+HRESULT WINAPI D3DXCreateTextureFromFileW(      LPDIRECT3DDEVICE9 device,
+                                                LPCWSTR srcfile,
+                                                LPDIRECT3DTEXTURE9 *texture);
+#define        D3DXCreateTextureFromFile WINELIB_NAME_AW(D3DXCreateTextureFromFile)
+
+HRESULT WINAPI D3DXCreateCubeTextureFromFileA(  LPDIRECT3DDEVICE9 device,
+                                                LPCSTR srcfile,
+                                                LPDIRECT3DCUBETEXTURE9 *cube);
+
+HRESULT WINAPI D3DXCreateCubeTextureFromFileW(  LPDIRECT3DDEVICE9 device,
+                                                LPCWSTR srcfile,
+                                                LPDIRECT3DCUBETEXTURE9 *cube);
+#define        D3DXCreateCubeTextureFromFile WINELIB_NAME_AW(D3DXCreateCubeTextureFromFile)
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromFileA(LPDIRECT3DDEVICE9 device,
+                                                LPCSTR srcfile,
+                                                LPDIRECT3DVOLUMETEXTURE9 *volume);
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromFileW(LPDIRECT3DDEVICE9 device,
+                                                LPCWSTR srcfile,
+                                                LPDIRECT3DVOLUMETEXTURE9 *volume);
+#define        D3DXCreateVolumeTextureFromFile WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFile)
+
+HRESULT WINAPI D3DXCreateTextureFromResourceA(      LPDIRECT3DDEVICE9 device,
+                                                    HMODULE srcmodule,
+                                                    LPCSTR resource,
+                                                    LPDIRECT3DTEXTURE9 *texture);
+
+HRESULT WINAPI D3DXCreateTextureFromResourceW(      LPDIRECT3DDEVICE9 device,
+                                                    HMODULE srcmodule,
+                                                    LPCWSTR resource,
+                                                    LPDIRECT3DTEXTURE9 *texture);
+#define        D3DXCreateTextureFromResource WINELIB_NAME_AW(D3DXCreateTextureFromResource)
+
+HRESULT WINAPI D3DXCreateCubeTextureFromResourceA(  LPDIRECT3DDEVICE9 device,
+                                                    HMODULE srcmodule,
+                                                    LPCSTR resource,
+                                                    LPDIRECT3DCUBETEXTURE9 *cube);
+HRESULT WINAPI D3DXCreateCubeTextureFromResourceW(  LPDIRECT3DDEVICE9 device,
+                                                    HMODULE srcmodule,
+                                                    LPCWSTR resource,
+                                                    LPDIRECT3DCUBETEXTURE9 *cube);
+#define        D3DXCreateCubeTextureFromResource WINELIB_NAME_AW(D3DXCreateCubeTextureFromResource)
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromResourceA(LPDIRECT3DDEVICE9 device,
+                                                    HMODULE srcmodule,
+                                                    LPCSTR resource,
+                                                    LPDIRECT3DVOLUMETEXTURE9 *volume);
+HRESULT WINAPI D3DXCreateVolumeTextureFromResourceW(LPDIRECT3DDEVICE9 device,
+                                                    HMODULE srcmodule,
+                                                    LPCWSTR resource,
+                                                    LPDIRECT3DVOLUMETEXTURE9 *volume);
+#define        D3DXCreateVolumeTextureFromResource WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResource)
+
+HRESULT WINAPI D3DXCreateTextureFromFileExA(      LPDIRECT3DDEVICE9 device,
+                                                  LPCSTR srcfile,
+                                                  UINT width,
+                                                  UINT height,
+                                                  UINT miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT format,
+                                                  D3DPOOL pool,
+                                                  DWORD filter,
+                                                  DWORD mipfilter,
+                                                  D3DCOLOR colorkey,
+                                                  D3DXIMAGE_INFO *srcinfo,
+                                                  PALETTEENTRY *palette,
+                                                  LPDIRECT3DTEXTURE9 *texture);
+
+HRESULT WINAPI D3DXCreateTextureFromFileExW(      LPDIRECT3DDEVICE9 device,
+                                                  LPCWSTR srcfile,
+                                                  UINT width,
+                                                  UINT height,
+                                                  UINT miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT format,
+                                                  D3DPOOL pool,
+                                                  DWORD filter,
+                                                  DWORD mipfilter,
+                                                  D3DCOLOR colorkey,
+                                                  D3DXIMAGE_INFO *srcinfo,
+                                                  PALETTEENTRY *palette,
+                                                  LPDIRECT3DTEXTURE9 *texture);
+#define        D3DXCreateTextureFromFileEx WINELIB_NAME_AW(D3DXCreateTextureFromFileEx)
+
+HRESULT WINAPI D3DXCreateCubeTextureFromFileExA(  LPDIRECT3DDEVICE9 device,
+                                                  LPCSTR srcfile,
+                                                  UINT size,
+                                                  UINT miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT format,
+                                                  D3DPOOL pool,
+                                                  DWORD filter,
+                                                  DWORD mipfilter,
+                                                  D3DCOLOR colorkey,
+                                                  D3DXIMAGE_INFO *srcinfo,
+                                                  PALETTEENTRY *palette,
+                                                  LPDIRECT3DCUBETEXTURE9 *cube);
+
+HRESULT WINAPI D3DXCreateCubeTextureFromFileExW(  LPDIRECT3DDEVICE9 device,
+                                                  LPCWSTR srcfile,
+                                                  UINT size,
+                                                  UINT miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT format,
+                                                  D3DPOOL pool,
+                                                  DWORD filter,
+                                                  DWORD mipfilter,
+                                                  D3DCOLOR colorkey,
+                                                  D3DXIMAGE_INFO *srcinfo,
+                                                  PALETTEENTRY *palette,
+                                                  LPDIRECT3DCUBETEXTURE9 *cube);
+#define        D3DXCreateCubeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromFileEx)
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromFileExA(LPDIRECT3DDEVICE9 device,
+                                                  LPCSTR srcfile,
+                                                  UINT width,
+                                                  UINT height,
+                                                  UINT depth,
+                                                  UINT miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT format,
+                                                  D3DPOOL pool,
+                                                  DWORD filter,
+                                                  DWORD mipfilter,
+                                                  D3DCOLOR colorkey,
+                                                  D3DXIMAGE_INFO *srcinfo,
+                                                  PALETTEENTRY *palette,
+                                                  LPDIRECT3DVOLUMETEXTURE9 *volume);
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromFileExW(LPDIRECT3DDEVICE9 device,
+                                                  LPCWSTR srcfile,
+                                                  UINT width,
+                                                  UINT height,
+                                                  UINT depth,
+                                                  UINT miplevels,
+                                                  DWORD usage,
+                                                  D3DFORMAT format,
+                                                  D3DPOOL pool,
+                                                  DWORD filter,
+                                                  DWORD mipfilter,
+                                                  D3DCOLOR colorkey,
+                                                  D3DXIMAGE_INFO *srcinfo,
+                                                  PALETTEENTRY *palette,
+                                                  LPDIRECT3DVOLUMETEXTURE9 *volume);
+#define        D3DXCreateVolumeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFileEx)
+
+HRESULT WINAPI D3DXCreateTextureFromResourceExA(      LPDIRECT3DDEVICE9 device,
+                                                      HMODULE srcmodule,
+                                                      LPCSTR resource,
+                                                      UINT width,
+                                                      UINT height,
+                                                      UINT miplevels,
+                                                      DWORD usage,
+                                                      D3DFORMAT format,
+                                                      D3DPOOL pool,
+                                                      DWORD filter,
+                                                      DWORD mipfilter,
+                                                      D3DCOLOR colorkey,
+                                                      D3DXIMAGE_INFO *srcinfo,
+                                                      PALETTEENTRY *palette,
+                                                      LPDIRECT3DTEXTURE9 *texture);
+
+HRESULT WINAPI D3DXCreateTextureFromResourceExW(      LPDIRECT3DDEVICE9 device,
+                                                      HMODULE srcmodule,
+                                                      LPCWSTR resource,
+                                                      UINT width,
+                                                      UINT height,
+                                                      UINT miplevels,
+                                                      DWORD usage,
+                                                      D3DFORMAT format,
+                                                      D3DPOOL pool,
+                                                      DWORD filter,
+                                                      DWORD mipfilter,
+                                                      D3DCOLOR colorkey,
+                                                      D3DXIMAGE_INFO *srcinfo,
+                                                      PALETTEENTRY *palette,
+                                                      LPDIRECT3DTEXTURE9 *texture);
+#define        D3DXCreateTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateTextureFromResourceEx)
+
+HRESULT WINAPI D3DXCreateCubeTextureFromResourceExA(  LPDIRECT3DDEVICE9 device,
+                                                      HMODULE srcmodule,
+                                                      LPCSTR resource,
+                                                      UINT size,
+                                                      UINT miplevels,
+                                                      DWORD usage,
+                                                      D3DFORMAT format,
+                                                      D3DPOOL pool,
+                                                      DWORD filter,
+                                                      DWORD mipfilter,
+                                                      D3DCOLOR colorkey,
+                                                      D3DXIMAGE_INFO *srcinfo,
+                                                      PALETTEENTRY *palette,
+                                                      LPDIRECT3DCUBETEXTURE9 *cube);
+
+HRESULT WINAPI D3DXCreateCubeTextureFromResourceExW(  LPDIRECT3DDEVICE9 device,
+                                                      HMODULE srcmodule,
+                                                      LPCWSTR resource,
+                                                      UINT size,
+                                                      UINT miplevels,
+                                                      DWORD usage,
+                                                      D3DFORMAT format,
+                                                      D3DPOOL pool,
+                                                      DWORD filter,
+                                                      DWORD mipfilter,
+                                                      D3DCOLOR colorkey,
+                                                      D3DXIMAGE_INFO *srcinfo,
+                                                      PALETTEENTRY *palette,
+                                                      LPDIRECT3DCUBETEXTURE9 *cube);
+#define        D3DXCreateCubeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromResourceEx)
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromResourceExA(LPDIRECT3DDEVICE9 device,
+                                                      HMODULE srcmodule,
+                                                      LPCSTR resource,
+                                                      UINT width,
+                                                      UINT height,
+                                                      UINT depth,
+                                                      UINT miplevels,
+                                                      DWORD usage,
+                                                      D3DFORMAT format,
+                                                      D3DPOOL pool,
+                                                      DWORD filter,
+                                                      DWORD mipfilter,
+                                                      D3DCOLOR colorkey,
+                                                      D3DXIMAGE_INFO *srcinfo,
+                                                      PALETTEENTRY *palette,
+                                                      LPDIRECT3DVOLUMETEXTURE9 *volume);
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromResourceExW(LPDIRECT3DDEVICE9 device,
+                                                      HMODULE srcmodule,
+                                                      LPCWSTR resource,
+                                                      UINT width,
+                                                      UINT height,
+                                                      UINT depth,
+                                                      UINT miplevels,
+                                                      DWORD usage,
+                                                      D3DFORMAT format,
+                                                      D3DPOOL pool,
+                                                      DWORD filter,
+                                                      DWORD mipfilter,
+                                                      D3DCOLOR colorkey,
+                                                      D3DXIMAGE_INFO *srcinfo,
+                                                      PALETTEENTRY *palette,
+                                                      LPDIRECT3DVOLUMETEXTURE9 *volume);
+#define        D3DXCreateVolumeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResourceEx)
+
+HRESULT WINAPI D3DXCreateTextureFromFileInMemory(      LPDIRECT3DDEVICE9 device,
+                                                       LPCVOID srcdata,
+                                                       UINT srcdatasize,
+                                                       LPDIRECT3DTEXTURE9* texture);
+
+HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemory(  LPDIRECT3DDEVICE9 device,
+                                                       LPCVOID srcdata,
+                                                       UINT srcdatasize,
+                                                       LPDIRECT3DCUBETEXTURE9* cube);
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemory(LPDIRECT3DDEVICE9 device,
+                                                       LPCVOID srcdata,
+                                                       UINT srcdatasize,
+                                                       LPDIRECT3DVOLUMETEXTURE9 *volume);
+
+HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(      LPDIRECT3DDEVICE9 device,
+                                                         LPCVOID srcdata,
+                                                         UINT srcdatasize,
+                                                         UINT width,
+                                                         UINT height,
+                                                         UINT miplevels,
+                                                         DWORD usage,
+                                                         D3DFORMAT format,
+                                                         D3DPOOL pool,
+                                                         DWORD filter,
+                                                         DWORD mipfilter,
+                                                         D3DCOLOR colorkey,
+                                                         D3DXIMAGE_INFO *srcinfo,
+                                                         PALETTEENTRY *palette,
+                                                         LPDIRECT3DTEXTURE9 *texture);
+
+HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemoryEx(  LPDIRECT3DDEVICE9 device,
+                                                         LPCVOID srcdata,
+                                                         UINT srcdatasize,
+                                                         UINT size,
+                                                         UINT miplevels,
+                                                         DWORD usage,
+                                                         D3DFORMAT format,
+                                                         D3DPOOL pool,
+                                                         DWORD filter,
+                                                         DWORD mipfilter,
+                                                         D3DCOLOR colorkey,
+                                                         D3DXIMAGE_INFO *srcinfo,
+                                                         PALETTEENTRY *palette,
+                                                         LPDIRECT3DCUBETEXTURE9 *cube);
+
+HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device,
+                                                         LPCVOID srcdata,
+                                                         UINT srcdatasize,
+                                                         UINT width,
+                                                         UINT height,
+                                                         UINT depth,
+                                                         UINT miplevels,
+                                                         DWORD usage,
+                                                         D3DFORMAT format,
+                                                         D3DPOOL pool,
+                                                         DWORD filter,
+                                                         DWORD mipfilter,
+                                                         D3DCOLOR colorkey,
+                                                         D3DXIMAGE_INFO *srcinfo,
+                                                         PALETTEENTRY *palette,
+                                                         LPDIRECT3DVOLUMETEXTURE9 *volume);
+
+HRESULT WINAPI D3DXSaveTextureToFileA(LPCSTR destfile,
+                                      D3DXIMAGE_FILEFORMAT destformat,
+                                      LPDIRECT3DBASETEXTURE9 srctexture,
+                                      CONST PALETTEENTRY *srcpalette);
+HRESULT WINAPI D3DXSaveTextureToFileW(LPCWSTR destfile,
+                                      D3DXIMAGE_FILEFORMAT destformat,
+                                      LPDIRECT3DBASETEXTURE9 srctexture,
+                                      CONST PALETTEENTRY *srcpalette);
+#define        D3DXSaveTextureToFile WINELIB_NAME_AW(D3DXSaveTextureToFile)
+
+
+/* Other functions */
+HRESULT WINAPI D3DXFilterTexture(      LPDIRECT3DBASETEXTURE9 texture,
+                                       CONST PALETTEENTRY *palette,
+                                       UINT srclevel,
+                                       DWORD filter);
+#define D3DXFilterCubeTexture D3DXFilterTexture
+#define D3DXFilterVolumeTexture D3DXFilterTexture
+
+HRESULT WINAPI D3DXFillTexture(        LPDIRECT3DTEXTURE9 texture,
+                                       LPD3DXFILL2D function,
+                                       LPVOID data);
+
+HRESULT WINAPI D3DXFillCubeTexture(    LPDIRECT3DCUBETEXTURE9 cube,
+                                       LPD3DXFILL3D function,
+                                       LPVOID data);
+
+HRESULT WINAPI D3DXFillVolumeTexture(  LPDIRECT3DVOLUMETEXTURE9 volume,
+                                       LPD3DXFILL3D function,
+                                       LPVOID data);
+
+HRESULT WINAPI D3DXFillTextureTX(      LPDIRECT3DTEXTURE9 texture,
+                                       CONST DWORD *function,
+                                       CONST D3DXVECTOR4 *constants,
+                                       UINT numconstants);
+
+HRESULT WINAPI D3DXFillCubeTextureTX(  LPDIRECT3DCUBETEXTURE9 cube,
+                                       CONST DWORD *function,
+                                       CONST D3DXVECTOR4 *constants,
+                                       UINT numconstants);
+
+HRESULT WINAPI D3DXFillVolumeTextureTX(LPDIRECT3DVOLUMETEXTURE9 volume,
+                                       CONST DWORD *function,
+                                       CONST D3DXVECTOR4 *constants,
+                                       UINT numconstants);
+
+HRESULT WINAPI D3DXComputeNormalMap(   LPDIRECT3DTEXTURE9 texture,
+                                       LPDIRECT3DTEXTURE9 srctexture,
+                                       CONST PALETTEENTRY *srcpalette,
+                                       DWORD flags,
+                                       DWORD channel,
+                                       FLOAT amplitude);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_D3DX9TEX_H */
index 9f3d66f7224c5058cbcc6e616c7fc4022137f6db..599b80a261c957f5af402a12476908c17e825aee 100644 (file)
-/*==========================================================================;
+/*
+ * Copyright (C) the Wine project
  *
- *  Copyright (C) 1995,1996 Microsoft Corporation.  All Rights Reserved.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- *  File:       dsound.h
- *  Content:    DirectSound include file
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- **************************************************************************/
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
 
-#ifndef __DSOUND_INCLUDED__
+#ifndef __WINE_DSOUND_H
+#define __WINE_DSOUND_H
 #define __DSOUND_INCLUDED__
 
-#include <d3dtypes.h>
+#include <_mingw_dxhelper.h>
+#ifndef DIRECTSOUND_VERSION
+#define DIRECTSOUND_VERSION 0x0900
+#endif
 
 #define COM_NO_WINDOWS_H
 #include <objbase.h>
-
-#define _FACDS  0x878
-#define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
+#include <float.h>
 
 #ifdef __cplusplus
 extern "C" {
-#endif // __cplusplus
-
-// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
-DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
-
-// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
-DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+#endif /* defined(__cplusplus) */
+
+#ifndef DX_SHARED_DEFINES
+
+typedef float D3DVALUE, *LPD3DVALUE;
+
+#ifndef D3DCOLOR_DEFINED
+typedef DWORD D3DCOLOR, *LPD3DCOLOR;
+#define D3DCOLOR_DEFINED
+#endif
+
+#ifndef D3DVECTOR_DEFINED
+typedef struct _D3DVECTOR {
+    float x;
+    float y;
+    float z;
+} D3DVECTOR;
+#define D3DVECTOR_DEFINED
+#endif
+
+#ifndef LPD3DVECTOR_DEFINED
+typedef D3DVECTOR *LPD3DVECTOR;
+#define LPD3DVECTOR_DEFINED
+#endif
+
+#define DX_SHARED_DEFINES
+#endif /* DX_SHARED_DEFINES */
+
+/*****************************************************************************
+ * Predeclare the interfaces
+ */
+DEFINE_GUID(CLSID_DirectSound,         0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
+DEFINE_GUID(CLSID_DirectSound8,                0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
+DEFINE_GUID(CLSID_DirectSoundCapture,  0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
+DEFINE_GUID(CLSID_DirectSoundFullDuplex,0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
+
+DEFINE_GUID(IID_IDirectSound,          0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSound *LPDIRECTSOUND,**LPLPDIRECTSOUND;
+
+DEFINE_GUID(IID_IDirectSound8,         0xC50A7E93,0xF395,0x4834,0x9E,0xF6,0x7F,0xA9,0x9D,0xE5,0x09,0x66);
+typedef struct IDirectSound8 *LPDIRECTSOUND8,**LPLPDIRECTSOUND8;
+
+DEFINE_GUID(IID_IDirectSoundBuffer,    0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
+
+DEFINE_GUID(IID_IDirectSoundBuffer8,   0x6825A449,0x7524,0x4D82,0x92,0x0F,0x50,0xE3,0x6A,0xB3,0xAB,0x1E);
+typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8,**LPLPDIRECTSOUNDBUFFER8;
+
+DEFINE_GUID(IID_IDirectSoundNotify,    0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
+typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY,**LPLPDIRECTSOUNDNOTIFY;
+#define        IID_IDirectSoundNotify8         IID_IDirectSoundNotify
+
+DEFINE_GUID(IID_IDirectSound3DListener,        0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER,**LPLPDIRECTSOUND3DLISTENER;
+
+DEFINE_GUID(IID_IDirectSound3DBuffer,  0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
+typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER,**LPLPDIRECTSOUND3DBUFFER;
+
+DEFINE_GUID(IID_IDirectSoundCapture,   0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
+typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE,**LPLPDIRECTSOUNDCAPTURE;
+#define        IID_IDirectSoundCapture8        IID_IDirectSoundCapture
+typedef struct IDirectSoundCapture IDirectSoundCapture8,*LPDIRECTSOUNDCAPTURE8,**LPLPDIRECTSOUNDCAPTURE8;
+
+DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
+typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER,**LPLPDIRECTSOUNDCAPTUREBUFFER;
+
+DEFINE_GUID(IID_IDirectSoundCaptureBuffer8,0x00990DF4,0x0DBB,0x4872,0x83,0x3E,0x6D,0x30,0x3E,0x80,0xAE,0xB6);
+typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8,**LPLPDIRECTSOUNDCAPTUREBUFFER8;
+
+DEFINE_GUID(IID_IDirectSoundFullDuplex,        0xEDCB4C7A,0xDAAB,0x4216,0xA4,0x2E,0x6C,0x50,0x59,0x6D,0xDC,0x1D);
+typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX,**LPLPDIRECTSOUNDFULLDUPLEX;
+#define        IID_IDirectSoundFullDuplex8     IID_IDirectSoundFullDuplex
+
+DEFINE_GUID(DSDEVID_DefaultPlayback,     0xDEF00000,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+DEFINE_GUID(DSDEVID_DefaultCapture,      0xDEF00001,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+DEFINE_GUID(DSDEVID_DefaultVoicePlayback,0xDEF00002,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xDEF00003,0x9C6D,0x47ED,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
+
+DEFINE_GUID(DSDEVID_WinePlayback,        0x40316A1D,0x605B,0xD611,0x87,0xC6,0x00,0x80,0xAD,0x00,0x02,0xFE);
+
+#define        _FACDS          0x878
+#define        MAKE_DSHRESULT(code)            MAKE_HRESULT(1,_FACDS,code)
+
+#define DS_OK                          0
+#define DS_NO_VIRTUALIZATION            MAKE_HRESULT(0, _FACDS, 10)
+#define DS_INCOMPLETE                   MAKE_HRESULT(0, _FACDS, 20)
+#define DSERR_ALLOCATED                        MAKE_DSHRESULT(10)
+#define DSERR_CONTROLUNAVAIL           MAKE_DSHRESULT(30)
+#define DSERR_INVALIDPARAM             E_INVALIDARG
+#define DSERR_INVALIDCALL              MAKE_DSHRESULT(50)
+#define DSERR_GENERIC                  E_FAIL
+#define DSERR_PRIOLEVELNEEDED          MAKE_DSHRESULT(70)
+#define DSERR_OUTOFMEMORY              E_OUTOFMEMORY
+#define DSERR_BADFORMAT                        MAKE_DSHRESULT(100)
+#define DSERR_UNSUPPORTED              E_NOTIMPL
+#define DSERR_NODRIVER                 MAKE_DSHRESULT(120)
+#define DSERR_ALREADYINITIALIZED       MAKE_DSHRESULT(130)
+#define DSERR_NOAGGREGATION            CLASS_E_NOAGGREGATION
+#define DSERR_BUFFERLOST               MAKE_DSHRESULT(150)
+#define DSERR_OTHERAPPHASPRIO          MAKE_DSHRESULT(160)
+#define DSERR_UNINITIALIZED            MAKE_DSHRESULT(170)
+#define DSERR_NOINTERFACE               E_NOINTERFACE
+#define DSERR_ACCESSDENIED              E_ACCESSDENIED
+#define DSERR_BUFFERTOOSMALL            MAKE_DSHRESULT(180)
+#define DSERR_DS8_REQUIRED              MAKE_DSHRESULT(190)
+#define DSERR_SENDLOOP                  MAKE_DSHRESULT(200)
+#define DSERR_BADSENDBUFFERGUID         MAKE_DSHRESULT(210)
+#define DSERR_FXUNAVAILABLE             MAKE_DSHRESULT(220)
+#define DSERR_OBJECTNOTFOUND            MAKE_DSHRESULT(4449)
 
-//
-// Structures
-// 
+#define DSCAPS_PRIMARYMONO          0x00000001
+#define DSCAPS_PRIMARYSTEREO        0x00000002
+#define DSCAPS_PRIMARY8BIT          0x00000004
+#define DSCAPS_PRIMARY16BIT         0x00000008
+#define DSCAPS_CONTINUOUSRATE       0x00000010
+#define DSCAPS_EMULDRIVER           0x00000020
+#define DSCAPS_CERTIFIED            0x00000040
+#define DSCAPS_SECONDARYMONO        0x00000100
+#define DSCAPS_SECONDARYSTEREO      0x00000200
+#define DSCAPS_SECONDARY8BIT        0x00000400
+#define DSCAPS_SECONDARY16BIT       0x00000800
 
-#ifdef __cplusplus
-// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
-struct IDirectSound;
-struct IDirectSoundBuffer;
-struct IDirectSound3DListener;
-struct IDirectSound3DBuffer;
-struct IDirectSoundCapture;
-struct IDirectSoundCaptureBuffer;
-struct IDirectSoundNotify;
-#endif // __cplusplus
-
-typedef struct IDirectSound *LPDIRECTSOUND;
-typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
-typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
-typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
-typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
-typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
-typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
+#define        DSSCL_NORMAL            1
+#define        DSSCL_PRIORITY          2
+#define        DSSCL_EXCLUSIVE         3
+#define        DSSCL_WRITEPRIMARY      4
 
 typedef struct _DSCAPS
 {
-    DWORD           dwSize;
-    DWORD           dwFlags;
-    DWORD           dwMinSecondarySampleRate;
-    DWORD           dwMaxSecondarySampleRate;
-    DWORD           dwPrimaryBuffers;
-    DWORD           dwMaxHwMixingAllBuffers;
-    DWORD           dwMaxHwMixingStaticBuffers;
-    DWORD           dwMaxHwMixingStreamingBuffers;
-    DWORD           dwFreeHwMixingAllBuffers;
-    DWORD           dwFreeHwMixingStaticBuffers;
-    DWORD           dwFreeHwMixingStreamingBuffers;
-    DWORD           dwMaxHw3DAllBuffers;
-    DWORD           dwMaxHw3DStaticBuffers;
-    DWORD           dwMaxHw3DStreamingBuffers;
-    DWORD           dwFreeHw3DAllBuffers;
-    DWORD           dwFreeHw3DStaticBuffers;
-    DWORD           dwFreeHw3DStreamingBuffers;
-    DWORD           dwTotalHwMemBytes;
-    DWORD           dwFreeHwMemBytes;
-    DWORD           dwMaxContigFreeHwMemBytes;
-    DWORD           dwUnlockTransferRateHwBuffers;
-    DWORD           dwPlayCpuOverheadSwBuffers;
-    DWORD           dwReserved1;
-    DWORD           dwReserved2;
-} DSCAPS, *LPDSCAPS;
-
+    DWORD      dwSize;
+    DWORD      dwFlags;
+    DWORD      dwMinSecondarySampleRate;
+    DWORD      dwMaxSecondarySampleRate;
+    DWORD      dwPrimaryBuffers;
+    DWORD      dwMaxHwMixingAllBuffers;
+    DWORD      dwMaxHwMixingStaticBuffers;
+    DWORD      dwMaxHwMixingStreamingBuffers;
+    DWORD      dwFreeHwMixingAllBuffers;
+    DWORD      dwFreeHwMixingStaticBuffers;
+    DWORD      dwFreeHwMixingStreamingBuffers;
+    DWORD      dwMaxHw3DAllBuffers;
+    DWORD      dwMaxHw3DStaticBuffers;
+    DWORD      dwMaxHw3DStreamingBuffers;
+    DWORD      dwFreeHw3DAllBuffers;
+    DWORD      dwFreeHw3DStaticBuffers;
+    DWORD      dwFreeHw3DStreamingBuffers;
+    DWORD      dwTotalHwMemBytes;
+    DWORD      dwFreeHwMemBytes;
+    DWORD      dwMaxContigFreeHwMemBytes;
+    DWORD      dwUnlockTransferRateHwBuffers;
+    DWORD      dwPlayCpuOverheadSwBuffers;
+    DWORD      dwReserved1;
+    DWORD      dwReserved2;
+} DSCAPS,*LPDSCAPS;
 typedef const DSCAPS *LPCDSCAPS;
 
+#define DSBPLAY_LOOPING             0x00000001
+#define DSBPLAY_LOCHARDWARE         0x00000002
+#define DSBPLAY_LOCSOFTWARE         0x00000004
+#define DSBPLAY_TERMINATEBY_TIME    0x00000008
+#define DSBPLAY_TERMINATEBY_DISTANCE    0x000000010
+#define DSBPLAY_TERMINATEBY_PRIORITY    0x000000020
+
+#define DSBSTATUS_PLAYING           0x00000001
+#define DSBSTATUS_BUFFERLOST        0x00000002
+#define DSBSTATUS_LOOPING           0x00000004
+#define DSBSTATUS_LOCHARDWARE       0x00000008
+#define DSBSTATUS_LOCSOFTWARE       0x00000010
+#define DSBSTATUS_TERMINATED        0x00000020
+
+#define DSBLOCK_FROMWRITECURSOR     0x00000001
+#define DSBLOCK_ENTIREBUFFER        0x00000002
+
+#define DSBCAPS_PRIMARYBUFFER       0x00000001
+#define DSBCAPS_STATIC              0x00000002
+#define DSBCAPS_LOCHARDWARE         0x00000004
+#define DSBCAPS_LOCSOFTWARE         0x00000008
+#define DSBCAPS_CTRL3D              0x00000010
+#define DSBCAPS_CTRLFREQUENCY       0x00000020
+#define DSBCAPS_CTRLPAN             0x00000040
+#define DSBCAPS_CTRLVOLUME          0x00000080
+#define DSBCAPS_CTRLDEFAULT         0x000000E0  /* Pan + volume + frequency. */
+#define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
+#define DSBCAPS_CTRLFX              0x00000200
+#define DSBCAPS_CTRLALL             0x000001F0  /* All control capabilities */
+#define DSBCAPS_STICKYFOCUS         0x00004000
+#define DSBCAPS_GLOBALFOCUS         0x00008000
+#define DSBCAPS_GETCURRENTPOSITION2 0x00010000  /* More accurate play cursor under emulation*/
+#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
+#define DSBCAPS_LOCDEFER            0x00040000
+
+#define DSBSIZE_MIN                 4
+#define DSBSIZE_MAX                 0xFFFFFFF
+#define DSBPAN_LEFT                 -10000
+#define DSBPAN_CENTER               0
+#define DSBPAN_RIGHT                 10000
+#define DSBVOLUME_MAX                    0
+#define DSBVOLUME_MIN               -10000
+#define DSBFREQUENCY_MIN            100
+#define DSBFREQUENCY_MAX            200000
+#define DSBFREQUENCY_ORIGINAL       0
+
 typedef struct _DSBCAPS
 {
-    DWORD           dwSize;
-    DWORD           dwFlags;
-    DWORD           dwBufferBytes;
-    DWORD           dwUnlockTransferRate;
-    DWORD           dwPlayCpuOverhead;
-} DSBCAPS, *LPDSBCAPS;
-
+    DWORD      dwSize;
+    DWORD      dwFlags;
+    DWORD      dwBufferBytes;
+    DWORD      dwUnlockTransferRate;
+    DWORD      dwPlayCpuOverhead;
+} DSBCAPS,*LPDSBCAPS;
 typedef const DSBCAPS *LPCDSBCAPS;
 
-typedef struct _DSBUFFERDESC
+#define DSSCL_NORMAL                1
+#define DSSCL_PRIORITY              2
+#define DSSCL_EXCLUSIVE             3
+#define DSSCL_WRITEPRIMARY          4
+
+typedef struct _DSEFFECTDESC
+{
+    DWORD      dwSize;
+    DWORD      dwFlags;
+    GUID       guidDSFXClass;
+    DWORD_PTR  dwReserved1;
+    DWORD_PTR  dwReserved2;
+} DSEFFECTDESC,*LPDSEFFECTDESC;
+typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
+
+#define DSFX_LOCHARDWARE    0x00000001
+#define DSFX_LOCSOFTWARE    0x00000002
+
+enum
 {
-    DWORD           dwSize;
-    DWORD           dwFlags;
-    DWORD           dwBufferBytes;
-    DWORD           dwReserved;
-    LPWAVEFORMATEX  lpwfxFormat;
-} DSBUFFERDESC, *LPDSBUFFERDESC;
+    DSFXR_PRESENT,
+    DSFXR_LOCHARDWARE,
+    DSFXR_LOCSOFTWARE,
+    DSFXR_UNALLOCATED,
+    DSFXR_FAILED,
+    DSFXR_UNKNOWN,
+    DSFXR_SENDLOOP
+};
+
+typedef struct _DSBUFFERDESC1
+{
+    DWORD              dwSize;
+    DWORD              dwFlags;
+    DWORD              dwBufferBytes;
+    DWORD              dwReserved;
+    LPWAVEFORMATEX     lpwfxFormat;
+} DSBUFFERDESC1,*LPDSBUFFERDESC1;
+typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
 
+typedef struct _DSBUFFERDESC
+{
+    DWORD              dwSize;
+    DWORD              dwFlags;
+    DWORD              dwBufferBytes;
+    DWORD              dwReserved;
+    LPWAVEFORMATEX     lpwfxFormat;
+    GUID               guid3DAlgorithm;
+} DSBUFFERDESC,*LPDSBUFFERDESC;
 typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
 
-typedef struct _DS3DBUFFER
+typedef struct _DSBPOSITIONNOTIFY
 {
-    DWORD           dwSize;
-    D3DVECTOR       vPosition;
-    D3DVECTOR       vVelocity;
-    DWORD           dwInsideConeAngle;
-    DWORD           dwOutsideConeAngle;
-    D3DVECTOR       vConeOrientation;
-    LONG            lConeOutsideVolume;
-    D3DVALUE        flMinDistance;
-    D3DVALUE        flMaxDistance;
-    DWORD           dwMode;
-} DS3DBUFFER, *LPDS3DBUFFER;
+    DWORD      dwOffset;
+    HANDLE     hEventNotify;
+} DSBPOSITIONNOTIFY,*LPDSBPOSITIONNOTIFY;
+typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
 
-typedef const DS3DBUFFER *LPCDS3DBUFFER;
+#define DSSPEAKER_HEADPHONE     1
+#define DSSPEAKER_MONO          2
+#define DSSPEAKER_QUAD          3
+#define DSSPEAKER_STEREO        4
+#define DSSPEAKER_SURROUND      5
+#define DSSPEAKER_5POINT1       6
+#define DSSPEAKER_7POINT1       7
 
-typedef struct _DS3DLISTENER
-{
-    DWORD           dwSize;
-    D3DVECTOR       vPosition;
-    D3DVECTOR       vVelocity;
-    D3DVECTOR       vOrientFront;
-    D3DVECTOR       vOrientTop;
-    D3DVALUE        flDistanceFactor;
-    D3DVALUE        flRolloffFactor;
-    D3DVALUE        flDopplerFactor;
-} DS3DLISTENER, *LPDS3DLISTENER;
+#define DSSPEAKER_GEOMETRY_MIN      0x00000005  /* 5 degrees */
+#define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  /* 10 degrees */
+#define DSSPEAKER_GEOMETRY_WIDE     0x00000014  /* 20 degrees */
+#define DSSPEAKER_GEOMETRY_MAX      0x000000B4  /* 180 degrees */
 
-typedef const DS3DLISTENER *LPCDS3DLISTENER;
+#define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
+#define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
+#define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
 
-typedef struct _DSCCAPS
-{
-    DWORD           dwSize;
-    DWORD           dwFlags;
-    DWORD           dwFormats;
-    DWORD           dwChannels;
-} DSCCAPS, *LPDSCCAPS;
+#define DS_CERTIFIED                0x00000000
+#define DS_UNCERTIFIED              0x00000001
 
-typedef const DSCCAPS *LPCDSCCAPS;
+typedef struct _DSCEFFECTDESC
+{
+    DWORD       dwSize;
+    DWORD       dwFlags;
+    GUID        guidDSCFXClass;
+    GUID        guidDSCFXInstance;
+    DWORD       dwReserved1;
+    DWORD       dwReserved2;
+} DSCEFFECTDESC, *LPDSCEFFECTDESC;
+typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC;
+
+#define DSCFX_LOCHARDWARE   0x00000001
+#define DSCFX_LOCSOFTWARE   0x00000002
+
+#define DSCFXR_LOCHARDWARE  0x00000010
+#define DSCFXR_LOCSOFTWARE  0x00000020
+
+typedef struct _DSCBUFFERDESC1
+{
+  DWORD           dwSize;
+  DWORD           dwFlags;
+  DWORD           dwBufferBytes;
+  DWORD           dwReserved;
+  LPWAVEFORMATEX  lpwfxFormat;
+} DSCBUFFERDESC1, *LPDSCBUFFERDESC1;
 
 typedef struct _DSCBUFFERDESC
 {
-    DWORD           dwSize;
-    DWORD           dwFlags;
-    DWORD           dwBufferBytes;
-    DWORD           dwReserved;
-    LPWAVEFORMATEX  lpwfxFormat;
+  DWORD           dwSize;
+  DWORD           dwFlags;
+  DWORD           dwBufferBytes;
+  DWORD           dwReserved;
+  LPWAVEFORMATEX  lpwfxFormat;
+  DWORD           dwFXCount;
+  LPDSCEFFECTDESC lpDSCFXDesc;
 } DSCBUFFERDESC, *LPDSCBUFFERDESC;
-
 typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
 
-typedef struct _DSCBCAPS 
+typedef struct _DSCCAPS
 {
-    DWORD           dwSize;
-    DWORD           dwFlags;
-    DWORD           dwBufferBytes;
-    DWORD           dwReserved;
-} DSCBCAPS, *LPDSCBCAPS;
+  DWORD dwSize;
+  DWORD dwFlags;
+  DWORD dwFormats;
+  DWORD dwChannels;
+} DSCCAPS, *LPDSCCAPS;
+typedef const DSCCAPS *LPCDSCCAPS;
 
+typedef struct _DSCBCAPS
+{
+  DWORD dwSize;
+  DWORD dwFlags;
+  DWORD dwBufferBytes;
+  DWORD dwReserved;
+} DSCBCAPS, *LPDSCBCAPS;
 typedef const DSCBCAPS *LPCDSCBCAPS;
 
-typedef struct _DSBPOSITIONNOTIFY
-{
-    DWORD           dwOffset;
-    HANDLE          hEventNotify;
-} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
+#define DSCCAPS_EMULDRIVER          DSCAPS_EMULDRIVER
+#define DSCCAPS_CERTIFIED           DSCAPS_CERTIFIED
+#define DSCCAPS_MULTIPLECAPTURE     0x00000001
 
-typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
+#define DSCBCAPS_WAVEMAPPED         0x80000000
+#define DSCBCAPS_CTRLFX             0x00000200
 
-//
-// Compatibility typedefs
-//
+#define DSCBLOCK_ENTIREBUFFER       0x00000001
+#define DSCBSTART_LOOPING           0x00000001
+#define DSCBPN_OFFSET_STOP          0xffffffff
 
-typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
-typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
-typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
-typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
-typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
-typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
-typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
-typedef LPVOID *LPLPVOID;
-//typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
+#define DSCBSTATUS_CAPTURING        0x00000001
+#define DSCBSTATUS_LOOPING          0x00000002
 
-//
-// DirectSound API
-//
+#ifndef __LPCGUID_DEFINED__
+#define __LPCGUID_DEFINED__
+typedef const GUID *LPCGUID;
+#endif
 
-typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
-typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID,LPCWSTR,LPCWSTR,LPVOID);
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID,LPCSTR,LPCSTR,LPVOID);
+DECL_WINELIB_TYPE_AW(LPDSENUMCALLBACK)
 
-extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
-extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+extern HRESULT WINAPI DirectSoundCreate(LPCGUID lpGUID,LPDIRECTSOUND *ppDS,LPUNKNOWN pUnkOuter);
 extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
-
-extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
-extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+#define DirectSoundEnumerate WINELIB_NAME_AW(DirectSoundEnumerate)
+extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter);
 extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
+extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
+#define DirectSoundCaptureEnumerate WINELIB_NAME_AW(DirectSoundCaptureEnumerate)
 
-#ifdef UNICODE
-#define LPDSENUMCALLBACK            LPDSENUMCALLBACKW
-#define DirectSoundEnumerate        DirectSoundEnumerateW
-#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
-#else // UNICODE
-#define LPDSENUMCALLBACK            LPDSENUMCALLBACKA
-#define DirectSoundEnumerate        DirectSoundEnumerateA
-#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
-#endif // UNICODE
-
-//
-// IDirectSound
-//
+extern HRESULT WINAPI DirectSoundCreate8(LPCGUID lpGUID,LPDIRECTSOUND8 *ppDS8,LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE8 *ppDSC8, LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice,
+    LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd, DWORD dwLevel,
+    LPDIRECTSOUNDFULLDUPLEX *ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter);
+#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
+extern HRESULT WINAPI GetDeviceID(LPCGUID lpGuidSrc, LPGUID lpGuidDest);
 
-DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
 
+/*****************************************************************************
+ * IDirectSound interface
+ */
 #undef INTERFACE
 #define INTERFACE IDirectSound
-
-DECLARE_INTERFACE_(IDirectSound, IUnknown)
+DECLARE_INTERFACE_(IDirectSound,IUnknown)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
-    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
-    STDMETHOD_(ULONG,Release)       (THIS) PURE;
-    
-    // IDirectSound methods
-    STDMETHOD(CreateSoundBuffer)    (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
-    STDMETHOD(GetCaps)              (THIS_ LPDSCAPS) PURE;
-    STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
-    STDMETHOD(SetCooperativeLevel)  (THIS_ HWND, DWORD) PURE;
-    STDMETHOD(Compact)              (THIS) PURE;
-    STDMETHOD(GetSpeakerConfig)     (THIS_ LPDWORD) PURE;
-    STDMETHOD(SetSpeakerConfig)     (THIS_ DWORD) PURE;
-    STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSound methods ***/
+    STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
+    STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
+    STDMETHOD(Compact)(THIS) PURE;
+    STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
+    STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
+    STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
 };
+#undef INTERFACE
 
 #if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectSound_AddRef(p)                   (p)->lpVtbl->AddRef(p)
-#define IDirectSound_Release(p)                  (p)->lpVtbl->Release(p)
+/*** IUnknown methods ***/
+#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectSound_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectSound methods ***/
 #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
 #define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
 #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
 #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
 #define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
 #define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
-#define IDirectSound_SetSpeakerConfig(p,b)       (p)->lpVtbl->SetSpeakerConfig(p,b)
+#define IDirectSound_SetSpeakerConfig(p,a)       (p)->lpVtbl->SetSpeakerConfig(p,a)
 #define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound_QueryInterface(p,a,b)       (p)->QueryInterface(a,b)
-#define IDirectSound_AddRef(p)                   (p)->AddRef()
-#define IDirectSound_Release(p)                  (p)->Release()
+#else
+/*** IUnknown methods ***/
+#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSound_AddRef(p)             (p)->AddRef()
+#define IDirectSound_Release(p)            (p)->Release()
+/*** IDirectSound methods ***/
 #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
 #define IDirectSound_GetCaps(p,a)                (p)->GetCaps(a)
 #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
 #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
 #define IDirectSound_Compact(p)                  (p)->Compact()
 #define IDirectSound_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
-#define IDirectSound_SetSpeakerConfig(p,b)       (p)->SetSpeakerConfig(b)
+#define IDirectSound_SetSpeakerConfig(p,a)       (p)->SetSpeakerConfig(a)
 #define IDirectSound_Initialize(p,a)             (p)->Initialize(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundBuffer
-//
+#endif
 
-DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
 
-#undef INTERFACE
-#define INTERFACE IDirectSoundBuffer
-
-DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
+/*****************************************************************************
+ * IDirectSound8 interface
+ */
+#define INTERFACE IDirectSound8
+DECLARE_INTERFACE_(IDirectSound8,IUnknown)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
-    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
-    STDMETHOD_(ULONG,Release)       (THIS) PURE;
-    
-    // IDirectSoundBuffer methods
-    STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS) PURE;
-    STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD) PURE;
-    STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
-    STDMETHOD(GetVolume)            (THIS_ LPLONG) PURE;
-    STDMETHOD(GetPan)               (THIS_ LPLONG) PURE;
-    STDMETHOD(GetFrequency)         (THIS_ LPDWORD) PURE;
-    STDMETHOD(GetStatus)            (THIS_ LPDWORD) PURE;
-    STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
-    STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
-    STDMETHOD(Play)                 (THIS_ DWORD, DWORD, DWORD) PURE;
-    STDMETHOD(SetCurrentPosition)   (THIS_ DWORD) PURE;
-    STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX) PURE;
-    STDMETHOD(SetVolume)            (THIS_ LONG) PURE;
-    STDMETHOD(SetPan)               (THIS_ LONG) PURE;
-    STDMETHOD(SetFrequency)         (THIS_ DWORD) PURE;
-    STDMETHOD(Stop)                 (THIS) PURE;
-    STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
-    STDMETHOD(Restore)              (THIS) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSound8 methods ***/
+    STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
+    STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
+    STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
+    STDMETHOD(Compact)(THIS) PURE;
+    STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
+    STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
+    STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
+    STDMETHOD(VerifyCertification)(THIS_ LPDWORD pdwCertified) PURE;
 };
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectSoundBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
-#define IDirectSoundBuffer_Release(p)                   (p)->lpVtbl->Release(p)
-#define IDirectSoundBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
-#define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
-#define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
-#define IDirectSoundBuffer_GetVolume(p,a)               (p)->lpVtbl->GetVolume(p,a)
-#define IDirectSoundBuffer_GetPan(p,a)                  (p)->lpVtbl->GetPan(p,a)
-#define IDirectSoundBuffer_GetFrequency(p,a)            (p)->lpVtbl->GetFrequency(p,a)
-#define IDirectSoundBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
-#define IDirectSoundBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
-#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
-#define IDirectSoundBuffer_Play(p,a,b,c)                (p)->lpVtbl->Play(p,a,b,c)
-#define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->lpVtbl->SetCurrentPosition(p,a)
-#define IDirectSoundBuffer_SetFormat(p,a)               (p)->lpVtbl->SetFormat(p,a)
-#define IDirectSoundBuffer_SetVolume(p,a)               (p)->lpVtbl->SetVolume(p,a)
-#define IDirectSoundBuffer_SetPan(p,a)                  (p)->lpVtbl->SetPan(p,a)
-#define IDirectSoundBuffer_SetFrequency(p,a)            (p)->lpVtbl->SetFrequency(p,a)
-#define IDirectSoundBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
-#define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
-#define IDirectSoundBuffer_Restore(p)                   (p)->lpVtbl->Restore(p)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundBuffer_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
-#define IDirectSoundBuffer_AddRef(p)                    (p)->AddRef()
-#define IDirectSoundBuffer_Release(p)                   (p)->Release()
-#define IDirectSoundBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
-#define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
-#define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
-#define IDirectSoundBuffer_GetVolume(p,a)               (p)->GetVolume(a)
-#define IDirectSoundBuffer_GetPan(p,a)                  (p)->GetPan(a)
-#define IDirectSoundBuffer_GetFrequency(p,a)            (p)->GetFrequency(a)
-#define IDirectSoundBuffer_GetStatus(p,a)               (p)->GetStatus(a)
-#define IDirectSoundBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
-#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
-#define IDirectSoundBuffer_Play(p,a,b,c)                (p)->Play(a,b,c)
-#define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->SetCurrentPosition(a)
-#define IDirectSoundBuffer_SetFormat(p,a)               (p)->SetFormat(a)
-#define IDirectSoundBuffer_SetVolume(p,a)               (p)->SetVolume(a)
-#define IDirectSoundBuffer_SetPan(p,a)                  (p)->SetPan(a)
-#define IDirectSoundBuffer_SetFrequency(p,a)            (p)->SetFrequency(a)
-#define IDirectSoundBuffer_Stop(p)                      (p)->Stop()
-#define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
-#define IDirectSoundBuffer_Restore(p)                   (p)->Restore()
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSound3DListener
-//
-
-DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
-
 #undef INTERFACE
-#define INTERFACE IDirectSound3DListener
 
-DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSound8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound8_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectSound8_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectSound methods ***/
+#define IDirectSound8_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
+#define IDirectSound8_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
+#define IDirectSound8_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectSound8_Compact(p)                  (p)->lpVtbl->Compact(p)
+#define IDirectSound8_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
+#define IDirectSound8_SetSpeakerConfig(p,a)       (p)->lpVtbl->SetSpeakerConfig(p,a)
+#define IDirectSound8_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
+/*** IDirectSound8 methods ***/
+#define IDirectSound8_VerifyCertification(p,a)    (p)->lpVtbl->VerifyCertification(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirectSound8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSound8_AddRef(p)             (p)->AddRef()
+#define IDirectSound8_Release(p)            (p)->Release()
+/*** IDirectSound methods ***/
+#define IDirectSound8_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
+#define IDirectSound8_GetCaps(p,a)                (p)->GetCaps(a)
+#define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
+#define IDirectSound8_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
+#define IDirectSound8_Compact(p)                  (p)->Compact()
+#define IDirectSound8_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
+#define IDirectSound8_SetSpeakerConfig(p,a)       (p)->SetSpeakerConfig(a)
+#define IDirectSound8_Initialize(p,a)             (p)->Initialize(a)
+/*** IDirectSound8 methods ***/
+#define IDirectSound8_VerifyCertification(p,a)    (p)->VerifyCertification(a)
+#endif
+
+
+/*****************************************************************************
+ * IDirectSoundBuffer interface
+ */
+#define INTERFACE IDirectSoundBuffer
+DECLARE_INTERFACE_(IDirectSoundBuffer,IUnknown)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID FAR *) PURE;
-    STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
-    STDMETHOD_(ULONG,Release)           (THIS) PURE;
-
-    // IDirectSound3D methods
-    STDMETHOD(GetAllParameters)         (THIS_ LPDS3DLISTENER) PURE;
-    STDMETHOD(GetDistanceFactor)        (THIS_ LPD3DVALUE) PURE;
-    STDMETHOD(GetDopplerFactor)         (THIS_ LPD3DVALUE) PURE;
-    STDMETHOD(GetOrientation)           (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
-    STDMETHOD(GetPosition)              (THIS_ LPD3DVECTOR) PURE;
-    STDMETHOD(GetRolloffFactor)         (THIS_ LPD3DVALUE) PURE;
-    STDMETHOD(GetVelocity)              (THIS_ LPD3DVECTOR) PURE;
-    STDMETHOD(SetAllParameters)         (THIS_ LPCDS3DLISTENER, DWORD) PURE;
-    STDMETHOD(SetDistanceFactor)        (THIS_ D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetDopplerFactor)         (THIS_ D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetOrientation)           (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetPosition)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetRolloffFactor)         (THIS_ D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetVelocity)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
-    STDMETHOD(CommitDeferredSettings)   (THIS) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSoundBuffer methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
+    STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
+    STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+    STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
+    STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
+    STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
+    STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
+    STDMETHOD(Lock)(THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
+    STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
+    STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
+    STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
+    STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
+    STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
+    STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
+    STDMETHOD(Stop)(THIS) PURE;
+    STDMETHOD(Unlock)(THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioPtr2) PURE;
+    STDMETHOD(Restore)(THIS) PURE;
 };
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DListener_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectSound3DListener_AddRef(p)                        (p)->lpVtbl->AddRef(p)
-#define IDirectSound3DListener_Release(p)                       (p)->lpVtbl->Release(p)
-#define IDirectSound3DListener_GetAllParameters(p,a)            (p)->lpVtbl->GetAllParameters(p,a)
-#define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->lpVtbl->GetDistanceFactor(p,a)
-#define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->lpVtbl->GetDopplerFactor(p,a)
-#define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->lpVtbl->GetOrientation(p,a,b)
-#define IDirectSound3DListener_GetPosition(p,a)                 (p)->lpVtbl->GetPosition(p,a)
-#define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->lpVtbl->GetRolloffFactor(p,a)
-#define IDirectSound3DListener_GetVelocity(p,a)                 (p)->lpVtbl->GetVelocity(p,a)
-#define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->lpVtbl->SetAllParameters(p,a,b)
-#define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->lpVtbl->SetDistanceFactor(p,a,b)
-#define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->lpVtbl->SetDopplerFactor(p,a,b)
-#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
-#define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
-#define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->lpVtbl->SetRolloffFactor(p,a,b)
-#define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->lpVtbl->SetVelocity(p,a,b,c,d)
-#define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->lpVtbl->CommitDeferredSettings(p)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DListener_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
-#define IDirectSound3DListener_AddRef(p)                        (p)->AddRef()
-#define IDirectSound3DListener_Release(p)                       (p)->Release()
-#define IDirectSound3DListener_GetAllParameters(p,a)            (p)->GetAllParameters(a)
-#define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->GetDistanceFactor(a)
-#define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->GetDopplerFactor(a)
-#define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->GetOrientation(a,b)
-#define IDirectSound3DListener_GetPosition(p,a)                 (p)->GetPosition(a)
-#define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->GetRolloffFactor(a)
-#define IDirectSound3DListener_GetVelocity(p,a)                 (p)->GetVelocity(a)
-#define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->SetAllParameters(a,b)
-#define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->SetDistanceFactor(a,b)
-#define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->SetDopplerFactor(a,b)
-#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
-#define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
-#define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->SetRolloffFactor(a,b)
-#define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->SetVelocity(a,b,c,d)
-#define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->CommitDeferredSettings()
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSound3DBuffer
-//
-
-DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
-
 #undef INTERFACE
-#define INTERFACE IDirectSound3DBuffer
 
-DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectSoundBuffer_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b)   (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c)          (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a)              (p)->lpVtbl->GetVolume(p,a)
+#define IDirectSoundBuffer_GetPan(p,a)                 (p)->lpVtbl->GetPan(p,a)
+#define IDirectSoundBuffer_GetFrequency(p,a)           (p)->lpVtbl->GetFrequency(p,a)
+#define IDirectSoundBuffer_GetStatus(p,a)              (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundBuffer_Initialize(p,a,b)           (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)       (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c)               (p)->lpVtbl->Play(p,a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a)     (p)->lpVtbl->SetCurrentPosition(p,a)
+#define IDirectSoundBuffer_SetFormat(p,a)              (p)->lpVtbl->SetFormat(p,a)
+#define IDirectSoundBuffer_SetVolume(p,a)              (p)->lpVtbl->SetVolume(p,a)
+#define IDirectSoundBuffer_SetPan(p,a)                 (p)->lpVtbl->SetPan(p,a)
+#define IDirectSoundBuffer_SetFrequency(p,a)           (p)->lpVtbl->SetFrequency(p,a)
+#define IDirectSoundBuffer_Stop(p)                     (p)->lpVtbl->Stop(p)
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d)           (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDirectSoundBuffer_Restore(p)                  (p)->lpVtbl->Restore(p)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundBuffer_AddRef(p)             (p)->AddRef()
+#define IDirectSoundBuffer_Release(p)            (p)->Release()
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer_GetCaps(p,a)                (p)->GetCaps(a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b)   (p)->GetCurrentPosition(a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c)          (p)->GetFormat(a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a)              (p)->GetVolume(a)
+#define IDirectSoundBuffer_GetPan(p,a)                 (p)->GetPan(a)
+#define IDirectSoundBuffer_GetFrequency(p,a)           (p)->GetFrequency(a)
+#define IDirectSoundBuffer_GetStatus(p,a)              (p)->GetStatus(a)
+#define IDirectSoundBuffer_Initialize(p,a,b)           (p)->Initialize(a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)       (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c)               (p)->Play(a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a)     (p)->SetCurrentPosition(a)
+#define IDirectSoundBuffer_SetFormat(p,a)              (p)->SetFormat(a)
+#define IDirectSoundBuffer_SetVolume(p,a)              (p)->SetVolume(a)
+#define IDirectSoundBuffer_SetPan(p,a)                 (p)->SetPan(a)
+#define IDirectSoundBuffer_SetFrequency(p,a)           (p)->SetFrequency(a)
+#define IDirectSoundBuffer_Stop(p)                     (p)->Stop()
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d)           (p)->Unlock(a,b,c,d)
+#define IDirectSoundBuffer_Restore(p)                  (p)->Restore()
+#endif
+
+
+/*****************************************************************************
+ * IDirectSoundBuffer8 interface
+ */
+#define INTERFACE IDirectSoundBuffer8
+DECLARE_INTERFACE_(IDirectSoundBuffer8,IUnknown)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
-    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
-    STDMETHOD_(ULONG,Release)       (THIS) PURE;
-
-    // IDirectSoundBuffer3D methods
-    STDMETHOD(GetAllParameters)     (THIS_ LPDS3DBUFFER) PURE;
-    STDMETHOD(GetConeAngles)        (THIS_ LPDWORD, LPDWORD) PURE;
-    STDMETHOD(GetConeOrientation)   (THIS_ LPD3DVECTOR) PURE;
-    STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
-    STDMETHOD(GetMaxDistance)       (THIS_ LPD3DVALUE) PURE;
-    STDMETHOD(GetMinDistance)       (THIS_ LPD3DVALUE) PURE;
-    STDMETHOD(GetMode)              (THIS_ LPDWORD) PURE;
-    STDMETHOD(GetPosition)          (THIS_ LPD3DVECTOR) PURE;
-    STDMETHOD(GetVelocity)          (THIS_ LPD3DVECTOR) PURE;
-    STDMETHOD(SetAllParameters)     (THIS_ LPCDS3DBUFFER, DWORD) PURE;
-    STDMETHOD(SetConeAngles)        (THIS_ DWORD, DWORD, DWORD) PURE;
-    STDMETHOD(SetConeOrientation)   (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
-    STDMETHOD(SetMaxDistance)       (THIS_ D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetMinDistance)       (THIS_ D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetMode)              (THIS_ DWORD, DWORD) PURE;
-    STDMETHOD(SetPosition)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
-    STDMETHOD(SetVelocity)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSoundBuffer8 methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
+    STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
+    STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+    STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
+    STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
+    STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
+    STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
+    STDMETHOD(Lock)(THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
+    STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
+    STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
+    STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
+    STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
+    STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
+    STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
+    STDMETHOD(Stop)(THIS) PURE;
+    STDMETHOD(Unlock)(THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioPtr2) PURE;
+    STDMETHOD(Restore)(THIS) PURE;
+    STDMETHOD(SetFX)(THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE;
+    STDMETHOD(AcquireResources)(THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE;
+    STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
 };
+#undef INTERFACE
 
 #if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DBuffer_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectSound3DBuffer_AddRef(p)                  (p)->lpVtbl->AddRef(p)
-#define IDirectSound3DBuffer_Release(p)                 (p)->lpVtbl->Release(p)
-#define IDirectSound3DBuffer_GetAllParameters(p,a)      (p)->lpVtbl->GetAllParameters(p,a)
-#define IDirectSound3DBuffer_GetConeAngles(p,a,b)       (p)->lpVtbl->GetConeAngles(p,a,b)
-#define IDirectSound3DBuffer_GetConeOrientation(p,a)    (p)->lpVtbl->GetConeOrientation(p,a)
-#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)  (p)->lpVtbl->GetConeOutsideVolume(p,a)
-#define IDirectSound3DBuffer_GetPosition(p,a)           (p)->lpVtbl->GetPosition(p,a)
-#define IDirectSound3DBuffer_GetMinDistance(p,a)        (p)->lpVtbl->GetMinDistance(p,a)
-#define IDirectSound3DBuffer_GetMaxDistance(p,a)        (p)->lpVtbl->GetMaxDistance(p,a)
-#define IDirectSound3DBuffer_GetMode(p,a)               (p)->lpVtbl->GetMode(p,a)
-#define IDirectSound3DBuffer_GetVelocity(p,a)           (p)->lpVtbl->GetVelocity(p,a)
-#define IDirectSound3DBuffer_SetAllParameters(p,a,b)    (p)->lpVtbl->SetAllParameters(p,a,b)
-#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)     (p)->lpVtbl->SetConeAngles(p,a,b,c)
-#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
-#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
-#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)     (p)->lpVtbl->SetPosition(p,a,b,c,d)
-#define IDirectSound3DBuffer_SetMinDistance(p,a,b)      (p)->lpVtbl->SetMinDistance(p,a,b)
-#define IDirectSound3DBuffer_SetMaxDistance(p,a,b)      (p)->lpVtbl->SetMaxDistance(p,a,b)
-#define IDirectSound3DBuffer_SetMode(p,a,b)             (p)->lpVtbl->SetMode(p,a,b)
-#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)     (p)->lpVtbl->SetVelocity(p,a,b,c,d)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSound3DBuffer_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
-#define IDirectSound3DBuffer_AddRef(p)                  (p)->AddRef()
-#define IDirectSound3DBuffer_Release(p)                 (p)->Release()
-#define IDirectSound3DBuffer_GetAllParameters(p,a)      (p)->GetAllParameters(a)
-#define IDirectSound3DBuffer_GetConeAngles(p,a,b)       (p)->GetConeAngles(a,b)
-#define IDirectSound3DBuffer_GetConeOrientation(p,a)    (p)->GetConeOrientation(a)
-#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)  (p)->GetConeOutsideVolume(a)
-#define IDirectSound3DBuffer_GetPosition(p,a)           (p)->GetPosition(a)
-#define IDirectSound3DBuffer_GetMinDistance(p,a)        (p)->GetMinDistance(a)
-#define IDirectSound3DBuffer_GetMaxDistance(p,a)        (p)->GetMaxDistance(a)
-#define IDirectSound3DBuffer_GetMode(p,a)               (p)->GetMode(a)
-#define IDirectSound3DBuffer_GetVelocity(p,a)           (p)->GetVelocity(a)
-#define IDirectSound3DBuffer_SetAllParameters(p,a,b)    (p)->SetAllParameters(a,b)
-#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)     (p)->SetConeAngles(a,b,c)
-#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
-#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
-#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)     (p)->SetPosition(a,b,c,d)
-#define IDirectSound3DBuffer_SetMinDistance(p,a,b)      (p)->SetMinDistance(a,b)
-#define IDirectSound3DBuffer_SetMaxDistance(p,a,b)      (p)->SetMaxDistance(a,b)
-#define IDirectSound3DBuffer_SetMode(p,a,b)             (p)->SetMode(a,b)
-#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)     (p)->SetVelocity(a,b,c,d)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundCapture
-//
-
-DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
-
-#undef INTERFACE
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundBuffer8_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectSoundBuffer8_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer8_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b)   (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundBuffer8_GetFormat(p,a,b,c)          (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundBuffer8_GetVolume(p,a)              (p)->lpVtbl->GetVolume(p,a)
+#define IDirectSoundBuffer8_GetPan(p,a)                 (p)->lpVtbl->GetPan(p,a)
+#define IDirectSoundBuffer8_GetFrequency(p,a)           (p)->lpVtbl->GetFrequency(p,a)
+#define IDirectSoundBuffer8_GetStatus(p,a)              (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundBuffer8_Initialize(p,a,b)           (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g)       (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundBuffer8_Play(p,a,b,c)               (p)->lpVtbl->Play(p,a,b,c)
+#define IDirectSoundBuffer8_SetCurrentPosition(p,a)     (p)->lpVtbl->SetCurrentPosition(p,a)
+#define IDirectSoundBuffer8_SetFormat(p,a)              (p)->lpVtbl->SetFormat(p,a)
+#define IDirectSoundBuffer8_SetVolume(p,a)              (p)->lpVtbl->SetVolume(p,a)
+#define IDirectSoundBuffer8_SetPan(p,a)                 (p)->lpVtbl->SetPan(p,a)
+#define IDirectSoundBuffer8_SetFrequency(p,a)           (p)->lpVtbl->SetFrequency(p,a)
+#define IDirectSoundBuffer8_Stop(p)                     (p)->lpVtbl->Stop(p)
+#define IDirectSoundBuffer8_Unlock(p,a,b,c,d)           (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDirectSoundBuffer8_Restore(p)                  (p)->lpVtbl->Restore(p)
+/*** IDirectSoundBuffer8 methods ***/
+#define IDirectSoundBuffer8_SetFX(p,a,b,c)              (p)->lpVtbl->SetFX(p,a,b,c)
+#define IDirectSoundBuffer8_AcquireResources(p,a,b,c)   (p)->lpVtbl->AcquireResources(p,a,b,c)
+#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d)  (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundBuffer8_AddRef(p)             (p)->AddRef()
+#define IDirectSoundBuffer8_Release(p)            (p)->Release()
+/*** IDirectSoundBuffer methods ***/
+#define IDirectSoundBuffer8_GetCaps(p,a)                (p)->GetCaps(a)
+#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b)   (p)->GetCurrentPosition(a,b)
+#define IDirectSoundBuffer8_GetFormat(p,a,b,c)          (p)->GetFormat(a,b,c)
+#define IDirectSoundBuffer8_GetVolume(p,a)              (p)->GetVolume(a)
+#define IDirectSoundBuffer8_GetPan(p,a)                 (p)->GetPan(a)
+#define IDirectSoundBuffer8_GetFrequency(p,a)           (p)->GetFrequency(a)
+#define IDirectSoundBuffer8_GetStatus(p,a)              (p)->GetStatus(a)
+#define IDirectSoundBuffer8_Initialize(p,a,b)           (p)->Initialize(a,b)
+#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g)       (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundBuffer8_Play(p,a,b,c)               (p)->Play(a,b,c)
+#define IDirectSoundBuffer8_SetCurrentPosition(p,a)     (p)->SetCurrentPosition(a)
+#define IDirectSoundBuffer8_SetFormat(p,a)              (p)->SetFormat(a)
+#define IDirectSoundBuffer8_SetVolume(p,a)              (p)->SetVolume(a)
+#define IDirectSoundBuffer8_SetPan(p,a)                 (p)->SetPan(a)
+#define IDirectSoundBuffer8_SetFrequency(p,a)           (p)->SetFrequency(a)
+#define IDirectSoundBuffer8_Stop(p)                     (p)->Stop()
+#define IDirectSoundBuffer8_Unlock(p,a,b,c,d)           (p)->Unlock(a,b,c,d)
+#define IDirectSoundBuffer8_Restore(p)                  (p)->Restore()
+/*** IDirectSoundBuffer8 methods ***/
+#define IDirectSoundBuffer8_SetFX(p,a,b,c)              (p)->SetFX(a,b,c)
+#define IDirectSoundBuffer8_AcquireResources(p,a,b,c)   (p)->AcquireResources(a,b,c)
+#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d)  (p)->GetObjectInPath(a,b,c,d)
+#endif
+
+
+/*****************************************************************************
+ * IDirectSoundCapture interface
+ */
 #define INTERFACE IDirectSoundCapture
-
-DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
+DECLARE_INTERFACE_(IDirectSoundCapture,IUnknown)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
-    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
-    STDMETHOD_(ULONG,Release)       (THIS) PURE;
-
-    // IDirectSoundCapture methods
-    STDMETHOD(CreateCaptureBuffer)  (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
-    STDMETHOD(GetCaps)              (THIS_ LPDSCCAPS ) PURE;
-    STDMETHOD(Initialize)           (THIS_ LPGUID) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSoundCapture methods ***/
+    STDMETHOD(CreateCaptureBuffer)(THIS_ LPCDSCBUFFERDESC lpcDSCBufferDesc,LPDIRECTSOUNDCAPTUREBUFFER *lplpDSCaptureBuffer, LPUNKNOWN pUnk) PURE;
+    STDMETHOD(GetCaps)(THIS_ LPDSCCAPS lpDSCCaps) PURE;
+    STDMETHOD(Initialize)(THIS_ LPCGUID lpcGUID) PURE;
 };
+#undef INTERFACE
 
 #if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCapture_QueryInterface(p,a,b)           (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectSoundCapture_AddRef(p)                       (p)->lpVtbl->AddRef(p)
-#define IDirectSoundCapture_Release(p)                      (p)->lpVtbl->Release(p)
-#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
-#define IDirectSoundCapture_GetCaps(p,a)                    (p)->lpVtbl->GetCaps(p,a)
-#define IDirectSoundCapture_Initialize(p,a)                 (p)->lpVtbl->Initialize(p,a)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCapture_QueryInterface(p,a,b)           (p)->QueryInterface(a,b)
-#define IDirectSoundCapture_AddRef(p)                       (p)->AddRef()
-#define IDirectSoundCapture_Release(p)                      (p)->Release()
-#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->CreateCaptureBuffer(a,b,c)
-#define IDirectSoundCapture_GetCaps(p,a)                    (p)->GetCaps(a)
-#define IDirectSoundCapture_Initialize(p,a)                 (p)->Initialize(a)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundCaptureBuffer
-//
-
-DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
-
-#undef INTERFACE
+/*** IUnknown methods ***/
+#define IDirectSoundCapture_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCapture_AddRef(p)                    (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCapture_Release(p)                   (p)->lpVtbl->Release(p)
+/*** IDirectSoundCapture methods ***/
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCapture_Initialize(p,a)              (p)->lpVtbl->Initialize(p,a)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundCapture_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
+#define IDirectSoundCapture_AddRef(p)                    (p)->AddRef()
+#define IDirectSoundCapture_Release(p)                   (p)->Release()
+/*** IDirectSoundCapture methods ***/
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a)                 (p)->GetCaps(a)
+#define IDirectSoundCapture_Initialize(p,a)              (p)->Initialize(a)
+#endif
+
+/*****************************************************************************
+ * IDirectSoundCaptureBuffer interface
+ */
 #define INTERFACE IDirectSoundCaptureBuffer
-
-DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
+DECLARE_INTERFACE_(IDirectSoundCaptureBuffer,IUnknown)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
-    STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
-    STDMETHOD_(ULONG,Release)       (THIS) PURE;
-
-    // IDirectSoundCaptureBuffer methods
-    STDMETHOD(GetCaps)              (THIS_ LPDSCBCAPS ) PURE;
-    STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD ) PURE;
-    STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
-    STDMETHOD(GetStatus)            (THIS_ LPDWORD ) PURE;
-    STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
-    STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
-    STDMETHOD(Start)                (THIS_ DWORD) PURE;
-    STDMETHOD(Stop)                 (THIS) PURE;
-    STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSoundCaptureBuffer methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
+    STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
+    STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+    STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
+    STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
+    STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
+    STDMETHOD(Stop)(THIS) PURE;
+    STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
 };
-
-#if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)        (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectSoundCaptureBuffer_AddRef(p)                    (p)->lpVtbl->AddRef(p)
-#define IDirectSoundCaptureBuffer_Release(p)                   (p)->lpVtbl->Release(p)
-#define IDirectSoundCaptureBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
-#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
-#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
-#define IDirectSoundCaptureBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
-#define IDirectSoundCaptureBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
-#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
-#define IDirectSoundCaptureBuffer_Start(p,a)                   (p)->lpVtbl->Start(p,a)
-#define IDirectSoundCaptureBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
-#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)        (p)->QueryInterface(a,b)
-#define IDirectSoundCaptureBuffer_AddRef(p)                    (p)->AddRef()
-#define IDirectSoundCaptureBuffer_Release(p)                   (p)->Release()
-#define IDirectSoundCaptureBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
-#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
-#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
-#define IDirectSoundCaptureBuffer_GetStatus(p,a)               (p)->GetStatus(a)
-#define IDirectSoundCaptureBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
-#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
-#define IDirectSoundCaptureBuffer_Start(p,a)                   (p)->Start(a)
-#define IDirectSoundCaptureBuffer_Stop(p)                      (p)->Stop()
-#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IDirectSoundNotify
-//
-
-DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
-
 #undef INTERFACE
-#define INTERFACE IDirectSoundNotify
 
-DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)     (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCaptureBuffer_AddRef(p)                 (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCaptureBuffer_Release(p)                (p)->lpVtbl->Release(p)
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer_GetCaps(p,a)              (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)        (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a)            (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b)         (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)     (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a)                (p)->lpVtbl->Start(p,a)
+#define IDirectSoundCaptureBuffer_Stop(p)                   (p)->lpVtbl->Stop(p)
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)         (p)->lpVtbl->Unlock(p,a,b,c,d)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)     (p)->QueryInterface(a,b)
+#define IDirectSoundCaptureBuffer_AddRef(p)                 (p)->AddRef()
+#define IDirectSoundCaptureBuffer_Release(p)                (p)->Release()
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer_GetCaps(p,a)              (p)->GetCaps(a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)        (p)->GetFormat(a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a)            (p)->GetStatus(a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b)         (p)->Initialize(a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)     (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a)                (p)->Start(a)
+#define IDirectSoundCaptureBuffer_Stop(p)                   (p)->Stop()
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)         (p)->Unlock(a,b,c,d)
+#endif
+
+/*****************************************************************************
+ * IDirectSoundCaptureBuffer8 interface
+ */
+#define INTERFACE IDirectSoundCaptureBuffer8
+DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8,IDirectSoundCaptureBuffer)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
-    STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
-    STDMETHOD_(ULONG,Release)           (THIS) PURE;
-
-    // IDirectSoundNotify methods
-    STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSoundCaptureBuffer methods ***/
+    STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
+    STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
+    STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
+    STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
+    STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
+    STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
+    STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
+    STDMETHOD(Stop)(THIS) PURE;
+    STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
+    /*** IDirectSoundCaptureBuffer8 methods ***/
+    STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
+    STDMETHOD(GetFXStatus)(THIS_ DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
 };
+#undef INTERFACE
 
 #if !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundNotify_QueryInterface(p,a,b)            (p)->lpVtbl->QueryInterface(p,a,b)
-#define IDirectSoundNotify_AddRef(p)                        (p)->lpVtbl->AddRef(p)
-#define IDirectSoundNotify_Release(p)                       (p)->lpVtbl->Release(p)
-#define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->lpVtbl->SetNotificationPositions(p,a,b)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IDirectSoundNotify_QueryInterface(p,a,b)            (p)->QueryInterface(a,b)
-#define IDirectSoundNotify_AddRef(p)                        (p)->AddRef()
-#define IDirectSoundNotify_Release(p)                       (p)->Release()
-#define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->SetNotificationPositions(a,b)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-//
-// IKsPropertySet
-//
-
-#ifndef _IKsPropertySet_
-#define _IKsPropertySet_
-
-#ifdef __cplusplus
-// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
-struct IKsPropertySet;
-#endif // __cplusplus
-
-typedef struct IKsPropertySet *LPKSPROPERTYSET;
-
-#define KSPROPERTY_SUPPORT_GET  0x00000001
-#define KSPROPERTY_SUPPORT_SET  0x00000002
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundCaptureBuffer8_AddRef(p)                  (p)->lpVtbl->AddRef(p)
+#define IDirectSoundCaptureBuffer8_Release(p)                 (p)->lpVtbl->Release(p)
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer8_GetCaps(p,a)               (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b)  (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c)         (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundCaptureBuffer8_GetStatus(p,a)             (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundCaptureBuffer8_Initialize(p,a,b)          (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g)      (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer8_Start(p,a)                 (p)->lpVtbl->Start(p,a)
+#define IDirectSoundCaptureBuffer8_Stop(p)                    (p)->lpVtbl->Stop(p)
+#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d)          (p)->lpVtbl->Unlock(p,a,b,c,d)
+/*** IDirectSoundCaptureBuffer8 methods ***/
+#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
+#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b)         (p)->lpVtbl->GetFXStatus(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
+#define IDirectSoundCaptureBuffer8_AddRef(p)                  (p)->AddRef()
+#define IDirectSoundCaptureBuffer8_Release(p)                 (p)->Release()
+/*** IDirectSoundCaptureBuffer methods ***/
+#define IDirectSoundCaptureBuffer8_GetCaps(p,a)               (p)->GetCaps(a)
+#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b)  (p)->GetCurrentPosition(a,b)
+#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c)         (p)->GetFormat(a,b,c)
+#define IDirectSoundCaptureBuffer8_GetStatus(p,a)             (p)->GetStatus(a)
+#define IDirectSoundCaptureBuffer8_Initialize(p,a,b)          (p)->Initialize(a,b)
+#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g)      (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer8_Start(p,a)                 (p)->Start(a)
+#define IDirectSoundCaptureBuffer8_Stop(p)                    (p)->Stop()
+#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d)          (p)->Unlock(a,b,c,d)
+/*** IDirectSoundCaptureBuffer8 methods ***/
+#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
+#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b)         (p)->GetFXStatus(a,b)
+#endif
+
+/*****************************************************************************
+ * IDirectSoundNotify interface
+ */
+#define WINE_NOBUFFER                   0x80000000
+
+#define DSBPN_OFFSETSTOP               -1
+
+#define DSBNOTIFICATIONS_MAX           100000UL
 
-DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
-
-#undef INTERFACE
-#define INTERFACE IKsPropertySet
-
-DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
+#define INTERFACE IDirectSoundNotify
+DECLARE_INTERFACE_(IDirectSoundNotify,IUnknown)
 {
-    // IUnknown methods
-    STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
-    STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
-    STDMETHOD_(ULONG,Release)   (THIS) PURE;
-
-    // IKsPropertySet methods
-    STDMETHOD(Get)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
-    STDMETHOD(Set)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
-    STDMETHOD(QuerySupport)     (THIS_ REFGUID, ULONG, PULONG) PURE;
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSoundNotify methods ***/
+    STDMETHOD(SetNotificationPositions)(THIS_ DWORD cPositionNotifies, LPCDSBPOSITIONNOTIFY lpcPositionNotifies) PURE;
 };
+#undef INTERFACE
 
 #if !defined(__cplusplus) || defined(CINTERFACE)
-#define IKsPropertySet_QueryInterface(p,a,b)       (p)->lpVtbl->QueryInterface(p,a,b)
-#define IKsPropertySet_AddRef(p)                   (p)->lpVtbl->AddRef(p)
-#define IKsPropertySet_Release(p)                  (p)->lpVtbl->Release(p)
-#define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
-#define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->lpVtbl->Set(p,a,b,c,d,e,f)
-#define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->lpVtbl->QuerySupport(p,a,b,c)
-#else // !defined(__cplusplus) || defined(CINTERFACE)
-#define IKsPropertySet_QueryInterface(p,a,b)       (p)->QueryInterface(a,b)
-#define IKsPropertySet_AddRef(p)                   (p)->AddRef()
-#define IKsPropertySet_Release(p)                  (p)->Release()
-#define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->Get(a,b,c,d,e,f,g)
-#define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->Set(a,b,c,d,e,f)
-#define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->QuerySupport(a,b,c)
-#endif // !defined(__cplusplus) || defined(CINTERFACE)
-
-#endif // _IKsPropertySet_
-
-//
-// Return Codes
-//
-
-#define DS_OK                           0
-
-// The call failed because resources (such as a priority level)
-// were already being used by another caller.
-#define DSERR_ALLOCATED                 MAKE_DSHRESULT(10)
-
-// The control (vol,pan,etc.) requested by the caller is not available.
-#define DSERR_CONTROLUNAVAIL            MAKE_DSHRESULT(30)
-
-// An invalid parameter was passed to the returning function
-#define DSERR_INVALIDPARAM              E_INVALIDARG
-
-// This call is not valid for the current state of this object
-#define DSERR_INVALIDCALL               MAKE_DSHRESULT(50)
-
-// An undetermined error occured inside the DirectSound subsystem
-#define DSERR_GENERIC                   E_FAIL
-
-// The caller does not have the priority level required for the function to
-// succeed.
-#define DSERR_PRIOLEVELNEEDED           MAKE_DSHRESULT(70)
-
-// Not enough free memory is available to complete the operation
-#define DSERR_OUTOFMEMORY               E_OUTOFMEMORY
-
-// The specified WAVE format is not supported
-#define DSERR_BADFORMAT                 MAKE_DSHRESULT(100)
-
-// The function called is not supported at this time
-#define DSERR_UNSUPPORTED               E_NOTIMPL
-
-// No sound driver is available for use
-#define DSERR_NODRIVER                  MAKE_DSHRESULT(120)
-
-// This object is already initialized
-#define DSERR_ALREADYINITIALIZED        MAKE_DSHRESULT(130)
-
-// This object does not support aggregation
-#define DSERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
-
-// The buffer memory has been lost, and must be restored.
-#define DSERR_BUFFERLOST                MAKE_DSHRESULT(150)
-
-// Another app has a higher priority level, preventing this call from
-// succeeding.
-#define DSERR_OTHERAPPHASPRIO           MAKE_DSHRESULT(160)
-
-// This object has not been initialized
-#define DSERR_UNINITIALIZED             MAKE_DSHRESULT(170)
-
-// The requested COM interface is not available
-#define DSERR_NOINTERFACE               E_NOINTERFACE
-
-//
-// Flags
-//
-
-#define DSCAPS_PRIMARYMONO          0x00000001
-#define DSCAPS_PRIMARYSTEREO        0x00000002
-#define DSCAPS_PRIMARY8BIT          0x00000004
-#define DSCAPS_PRIMARY16BIT         0x00000008
-#define DSCAPS_CONTINUOUSRATE       0x00000010
-#define DSCAPS_EMULDRIVER           0x00000020
-#define DSCAPS_CERTIFIED            0x00000040
-#define DSCAPS_SECONDARYMONO        0x00000100
-#define DSCAPS_SECONDARYSTEREO      0x00000200
-#define DSCAPS_SECONDARY8BIT        0x00000400
-#define DSCAPS_SECONDARY16BIT       0x00000800
-
-#define DSBPLAY_LOOPING             0x00000001
-      
-#define DSBSTATUS_PLAYING           0x00000001
-#define DSBSTATUS_BUFFERLOST        0x00000002
-#define DSBSTATUS_LOOPING           0x00000004
-
-#define DSBLOCK_FROMWRITECURSOR     0x00000001
-#define DSBLOCK_ENTIREBUFFER        0x00000002
-
-#define DSSCL_NORMAL                0x00000001
-#define DSSCL_PRIORITY              0x00000002
-#define DSSCL_EXCLUSIVE             0x00000003
-#define DSSCL_WRITEPRIMARY          0x00000004
-
+/*** IUnknown methods ***/
+#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundNotify_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectSoundNotify_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectSoundNotify methods ***/
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSoundNotify_AddRef(p)             (p)->AddRef()
+#define IDirectSoundNotify_Release(p)            (p)->Release()
+/*** IDirectSoundNotify methods ***/
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
+#endif
+
+
+/*****************************************************************************
+ * IDirectSound3DListener interface
+ */
 #define DS3DMODE_NORMAL             0x00000000
 #define DS3DMODE_HEADRELATIVE       0x00000001
 #define DS3DMODE_DISABLE            0x00000002
@@ -777,8 +911,8 @@ DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
 #define DS3D_IMMEDIATE              0x00000000
 #define DS3D_DEFERRED               0x00000001
 
-#define DS3D_MINDISTANCEFACTOR      0.0f
-#define DS3D_MAXDISTANCEFACTOR      10.0f
+#define DS3D_MINDISTANCEFACTOR      FLT_MIN
+#define DS3D_MAXDISTANCEFACTOR      FLT_MAX
 #define DS3D_DEFAULTDISTANCEFACTOR  1.0f
 
 #define DS3D_MINROLLOFFFACTOR       0.0f
@@ -796,68 +930,271 @@ DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
 #define DS3D_MAXCONEANGLE           360
 #define DS3D_DEFAULTCONEANGLE       360
 
-#define DS3D_DEFAULTCONEOUTSIDEVOLUME   0
-
-#define DSBCAPS_PRIMARYBUFFER       0x00000001
-#define DSBCAPS_STATIC              0x00000002
-#define DSBCAPS_LOCHARDWARE         0x00000004
-#define DSBCAPS_LOCSOFTWARE         0x00000008
-#define DSBCAPS_CTRL3D              0x00000010
-#define DSBCAPS_CTRLFREQUENCY       0x00000020
-#define DSBCAPS_CTRLPAN             0x00000040
-#define DSBCAPS_CTRLVOLUME          0x00000080
-#define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
-#define DSBCAPS_CTRLDEFAULT         0x000000E0
-#define DSBCAPS_CTRLALL             0x000001F0
-#define DSBCAPS_STICKYFOCUS         0x00004000
-#define DSBCAPS_GLOBALFOCUS         0x00008000 
-#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
-#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
-
-#define DSCBCAPS_WAVEMAPPED         0x80000000
+#define DS3D_DEFAULTCONEOUTSIDEVOLUME   DSBVOLUME_MAX
+
+typedef struct _DS3DLISTENER {
+       DWORD                           dwSize;
+       D3DVECTOR                       vPosition;
+       D3DVECTOR                       vVelocity;
+       D3DVECTOR                       vOrientFront;
+       D3DVECTOR                       vOrientTop;
+       D3DVALUE                        flDistanceFactor;
+       D3DVALUE                        flRolloffFactor;
+       D3DVALUE                        flDopplerFactor;
+} DS3DLISTENER, *LPDS3DLISTENER;
 
-#define DSSPEAKER_HEADPHONE         0x00000001
-#define DSSPEAKER_MONO              0x00000002
-#define DSSPEAKER_QUAD              0x00000003
-#define DSSPEAKER_STEREO            0x00000004
-#define DSSPEAKER_SURROUND          0x00000005
+typedef const DS3DLISTENER *LPCDS3DLISTENER;
 
-#define DSSPEAKER_GEOMETRY_MIN      0x00000005  //   5 degrees
-#define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  //  10 degrees
-#define DSSPEAKER_GEOMETRY_WIDE     0x00000014  //  20 degrees
-#define DSSPEAKER_GEOMETRY_MAX      0x000000B4  // 180 degrees
+#define INTERFACE IDirectSound3DListener
+DECLARE_INTERFACE_(IDirectSound3DListener,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSound3DListener methods ***/
+    STDMETHOD(GetAllParameters)(THIS_ LPDS3DLISTENER lpListener) PURE;
+    STDMETHOD(GetDistanceFactor)(THIS_ LPD3DVALUE lpflDistanceFactor) PURE;
+    STDMETHOD(GetDopplerFactor)(THIS_ LPD3DVALUE lpflDopplerFactor) PURE;
+    STDMETHOD(GetOrientation)(THIS_ LPD3DVECTOR lpvOrientFront, LPD3DVECTOR lpvOrientTop) PURE;
+    STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE;
+    STDMETHOD(GetRolloffFactor)(THIS_ LPD3DVALUE lpflRolloffFactor) PURE;
+    STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE;
+    STDMETHOD(SetAllParameters)(THIS_ LPCDS3DLISTENER lpcListener, DWORD dwApply) PURE;
+    STDMETHOD(SetDistanceFactor)(THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
+    STDMETHOD(SetDopplerFactor)(THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
+    STDMETHOD(SetOrientation)(THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
+    STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+    STDMETHOD(SetRolloffFactor)(THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
+    STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+    STDMETHOD(CommitDeferredSettings)(THIS) PURE;
+};
+#undef INTERFACE
 
-#define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
-#define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
-#define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound3DListener_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectSound3DListener_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectSound3DListener methods ***/
+#define IDirectSound3DListener_GetAllParameters(p,a)           (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a)          (p)->lpVtbl->GetDistanceFactor(p,a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a)           (p)->lpVtbl->GetDopplerFactor(p,a)
+#define IDirectSound3DListener_GetOrientation(p,a,b)           (p)->lpVtbl->GetOrientation(p,a,b)
+#define IDirectSound3DListener_GetPosition(p,a)                (p)->lpVtbl->GetPosition(p,a)
+#define IDirectSound3DListener_GetRolloffFactor(p,a)           (p)->lpVtbl->GetRolloffFactor(p,a)
+#define IDirectSound3DListener_GetVelocity(p,a)                (p)->lpVtbl->GetVelocity(p,a)
+#define IDirectSound3DListener_SetAllParameters(p,a,b)         (p)->lpVtbl->SetAllParameters(p,a,b)
+#define IDirectSound3DListener_SetDistanceFactor(p,a,b)        (p)->lpVtbl->SetDistanceFactor(p,a,b)
+#define IDirectSound3DListener_SetDopplerFactor(p,a,b)         (p)->lpVtbl->SetDopplerFactor(p,a,b)
+#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
+#define IDirectSound3DListener_SetPosition(p,a,b,c,d)          (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirectSound3DListener_SetRolloffFactor(p,a,b)         (p)->lpVtbl->SetRolloffFactor(p,a,b)
+#define IDirectSound3DListener_SetVelocity(p,a,b,c,d)          (p)->lpVtbl->SetVelocity(p,a,b,c,d)
+#define IDirectSound3DListener_CommitDeferredSettings(p)       (p)->lpVtbl->CommitDeferredSettings(p)
+#else
+/*** IUnknown methods ***/
+#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSound3DListener_AddRef(p)             (p)->AddRef()
+#define IDirectSound3DListener_Release(p)            (p)->Release()
+/*** IDirectSound3DListener methods ***/
+#define IDirectSound3DListener_GetAllParameters(p,a)           (p)->GetAllParameters(a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a)          (p)->GetDistanceFactor(a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a)           (p)->GetDopplerFactor(a)
+#define IDirectSound3DListener_GetOrientation(p,a,b)           (p)->GetOrientation(a,b)
+#define IDirectSound3DListener_GetPosition(p,a)                (p)->GetPosition(a)
+#define IDirectSound3DListener_GetRolloffFactor(p,a)           (p)->GetRolloffFactor(a)
+#define IDirectSound3DListener_GetVelocity(p,a)                (p)->GetVelocity(a)
+#define IDirectSound3DListener_SetAllParameters(p,a,b)         (p)->SetAllParameters(a,b)
+#define IDirectSound3DListener_SetDistanceFactor(p,a,b)        (p)->SetDistanceFactor(a,b)
+#define IDirectSound3DListener_SetDopplerFactor(p,a,b)         (p)->SetDopplerFactor(a,b)
+#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
+#define IDirectSound3DListener_SetPosition(p,a,b,c,d)          (p)->SetPosition(a,b,c,d)
+#define IDirectSound3DListener_SetRolloffFactor(p,a,b)         (p)->SetRolloffFactor(a,b)
+#define IDirectSound3DListener_SetVelocity(p,a,b,c,d)          (p)->SetVelocity(a,b,c,d)
+#define IDirectSound3DListener_CommitDeferredSettings(p)       (p)->CommitDeferredSettings()
+#endif
+
+
+/*****************************************************************************
+ * IDirectSound3DBuffer interface
+ */
+typedef struct  _DS3DBUFFER {
+       DWORD                           dwSize;
+       D3DVECTOR                       vPosition;
+       D3DVECTOR                       vVelocity;
+       DWORD                           dwInsideConeAngle;
+       DWORD                           dwOutsideConeAngle;
+       D3DVECTOR                       vConeOrientation;
+       LONG                            lConeOutsideVolume;
+       D3DVALUE                        flMinDistance;
+       D3DVALUE                        flMaxDistance;
+       DWORD                           dwMode;
+} DS3DBUFFER, *LPDS3DBUFFER;
 
-#define DSCCAPS_EMULDRIVER          0x00000020
+typedef const DS3DBUFFER *LPCDS3DBUFFER;
 
-#define DSCBLOCK_ENTIREBUFFER       0x00000001
+#define INTERFACE IDirectSound3DBuffer
+DECLARE_INTERFACE_(IDirectSound3DBuffer,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSound3DBuffer methods ***/
+    STDMETHOD(GetAllParameters)(THIS_ LPDS3DBUFFER lpDs3dBuffer) PURE;
+    STDMETHOD(GetConeAngles)(THIS_ LPDWORD lpdwInsideConeAngle, LPDWORD lpdwOutsideConeAngle) PURE;
+    STDMETHOD(GetConeOrientation)(THIS_ LPD3DVECTOR lpvOrientation) PURE;
+    STDMETHOD(GetConeOutsideVolume)(THIS_ LPLONG lplConeOutsideVolume) PURE;
+    STDMETHOD(GetMaxDistance)(THIS_ LPD3DVALUE lpflMaxDistance) PURE;
+    STDMETHOD(GetMinDistance)(THIS_ LPD3DVALUE lpflMinDistance) PURE;
+    STDMETHOD(GetMode)(THIS_ LPDWORD lpwdMode) PURE;
+    STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE;
+    STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE;
+    STDMETHOD(SetAllParameters)(THIS_ LPCDS3DBUFFER lpcDs3dBuffer, DWORD dwApply) PURE;
+    STDMETHOD(SetConeAngles)(THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE;
+    STDMETHOD(SetConeOrientation)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+    STDMETHOD(SetConeOutsideVolume)(THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE;
+    STDMETHOD(SetMaxDistance)(THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE;
+    STDMETHOD(SetMinDistance)(THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE;
+    STDMETHOD(SetMode)(THIS_ DWORD dwMode, DWORD dwApply) PURE;
+    STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+    STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+};
+#undef INTERFACE
 
-#define DSCBSTATUS_CAPTURING        0x00000001
-#define DSCBSTATUS_LOOPING          0x00000002
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSound3DBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectSound3DBuffer_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectSound3DBuffer methods ***/
+#define IDirectSound3DBuffer_GetAllParameters(p,a)         (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSound3DBuffer_GetConeAngles(p,a,b)          (p)->lpVtbl->GetConeAngles(p,a,b)
+#define IDirectSound3DBuffer_GetConeOrientation(p,a)       (p)->lpVtbl->GetConeOrientation(p,a)
+#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)     (p)->lpVtbl->GetConeOutsideVolume(p,a)
+#define IDirectSound3DBuffer_GetMaxDistance(p,a)           (p)->lpVtbl->GetMaxDistance(p,a)
+#define IDirectSound3DBuffer_GetMinDistance(p,a)           (p)->lpVtbl->GetMinDistance(p,a)
+#define IDirectSound3DBuffer_GetMode(p,a)                  (p)->lpVtbl->GetMode(p,a)
+#define IDirectSound3DBuffer_GetPosition(p,a)              (p)->lpVtbl->GetPosition(p,a)
+#define IDirectSound3DBuffer_GetVelocity(p,a)              (p)->lpVtbl->GetVelocity(p,a)
+#define IDirectSound3DBuffer_SetAllParameters(p,a,b)       (p)->lpVtbl->SetAllParameters(p,a,b)
+#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)        (p)->lpVtbl->SetConeAngles(p,a,b,c)
+#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
+#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)   (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
+#define IDirectSound3DBuffer_SetMaxDistance(p,a,b)         (p)->lpVtbl->SetMaxDistance(p,a,b)
+#define IDirectSound3DBuffer_SetMinDistance(p,a,b)         (p)->lpVtbl->SetMinDistance(p,a,b)
+#define IDirectSound3DBuffer_SetMode(p,a,b)                (p)->lpVtbl->SetMode(p,a,b)
+#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)        (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)        (p)->lpVtbl->SetVelocity(p,a,b,c,d)
+#else
+/*** IUnknown methods ***/
+#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#define IDirectSound3DBuffer_AddRef(p)             (p)->AddRef()
+#define IDirectSound3DBuffer_Release(p)            (p)->Release()
+/*** IDirectSound3DBuffer methods ***/
+#define IDirectSound3DBuffer_GetAllParameters(p,a)         (p)->GetAllParameters(a)
+#define IDirectSound3DBuffer_GetConeAngles(p,a,b)          (p)->GetConeAngles(a,b)
+#define IDirectSound3DBuffer_GetConeOrientation(p,a)       (p)->GetConeOrientation(a)
+#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)     (p)->GetConeOutsideVolume(a)
+#define IDirectSound3DBuffer_GetMaxDistance(p,a)           (p)->GetMaxDistance(a)
+#define IDirectSound3DBuffer_GetMinDistance(p,a)           (p)->GetMinDistance(a)
+#define IDirectSound3DBuffer_GetMode(p,a)                  (p)->GetMode(a)
+#define IDirectSound3DBuffer_GetPosition(p,a)              (p)->GetPosition(a)
+#define IDirectSound3DBuffer_GetVelocity(p,a)              (p)->GetVelocity(a)
+#define IDirectSound3DBuffer_SetAllParameters(p,a,b)       (p)->SetAllParameters(a,b)
+#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)        (p)->SetConeAngles(a,b,c)
+#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
+#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)   (p)->SetConeOutsideVolume(a,b)
+#define IDirectSound3DBuffer_SetMaxDistance(p,a,b)         (p)->SetMaxDistance(a,b)
+#define IDirectSound3DBuffer_SetMinDistance(p,a,b)         (p)->SetMinDistance(a,b)
+#define IDirectSound3DBuffer_SetMode(p,a,b)                (p)->SetMode(a,b)
+#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)        (p)->SetPosition(a,b,c,d)
+#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)        (p)->SetVelocity(a,b,c,d)
+#endif
+
+/*****************************************************************************
+ * IKsPropertySet interface
+ */
+#ifndef _IKsPropertySet_
+#define _IKsPropertySet_
 
-#define DSCBSTART_LOOPING           0x00000001
+typedef struct IKsPropertySet *LPKSPROPERTYSET;
 
-#define DSBFREQUENCY_MIN            100
-#define DSBFREQUENCY_MAX            100000
-#define DSBFREQUENCY_ORIGINAL       0
+DEFINE_GUID(IID_IKsPropertySet,0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93);
 
-#define DSBPAN_LEFT                 -10000
-#define DSBPAN_CENTER               0
-#define DSBPAN_RIGHT                10000
+#define KSPROPERTY_SUPPORT_GET 1
+#define KSPROPERTY_SUPPORT_SET 2
 
-#define DSBVOLUME_MIN               -10000
-#define DSBVOLUME_MAX               0
+#define INTERFACE IKsPropertySet
+DECLARE_INTERFACE_(IKsPropertySet,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IKsPropertySet methods ***/
+    STDMETHOD(Get)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3,ULONG *px4) PURE;
+    STDMETHOD(Set)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3) PURE;
+    STDMETHOD(QuerySupport)(THIS_ REFGUID rgid,ULONG x1,ULONG *px2) PURE;
+};
+#undef INTERFACE
 
-#define DSBSIZE_MIN                 4
-#define DSBSIZE_MAX                 0x0FFFFFFF
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IKsPropertySet_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
+#define IKsPropertySet_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define IKsPropertySet_Release(p)               (p)->lpVtbl->Release(p)
+/*** IKsPropertySet methods ***/
+#define IKsPropertySet_Get(p,a,b,c,d,e,f,g)     (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
+#define IKsPropertySet_Set(p,a,b,c,d,e,f)       (p)->lpVtbl->Set(p,a,b,c,d,e,f)
+#define IKsPropertySet_QuerySupport(p,a,b,c)    (p)->lpVtbl->QuerySupport(p,a,b,c)
+#else
+/*** IUnknown methods ***/
+#define IKsPropertySet_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
+#define IKsPropertySet_AddRef(p)                (p)->AddRef()
+#define IKsPropertySet_Release(p)               (p)->Release()
+/*** IKsPropertySet methods ***/
+#define IKsPropertySet_Get(p,a,b,c,d,e,f,g)     (p)->Get(a,b,c,d,e,f,g)
+#define IKsPropertySet_Set(p,a,b,c,d,e,f)       (p)->Set(a,b,c,d,e,f)
+#define IKsPropertySet_QuerySupport(p,a,b,c)    (p)->QuerySupport(a,b,c)
+#endif
+
+#endif /* _IKsPropertySet_ */
+
+/*****************************************************************************
+ * IDirectSoundFullDuplex interface
+ */
+#define INTERFACE IDirectSoundFullDuplex
+DECLARE_INTERFACE_(IDirectSoundFullDuplex,IUnknown)
+{
+    /*** IUnknown methods ***/
+    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
+    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+    STDMETHOD_(ULONG,Release)(THIS) PURE;
+    /*** IDirectSoundFullDuplex methods ***/
+    STDMETHOD(Initialize)(THIS_ LPCGUID pCaptureGuid,LPCGUID pRendererGuid,LPCDSCBUFFERDESC lpDscBufferDesc,LPCDSBUFFERDESC lpDsBufferDesc,HWND hWnd,DWORD dwLevel,LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8,LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE;
+};
+#undef INTERFACE
 
-#define DSBPN_OFFSETSTOP            0xFFFFFFFF
+#if !defined(__cplusplus) || defined(CINTERFACE)
+/*** IUnknown methods ***/
+#define IDirectSoundFullDuplex_QueryInterface(p,a,b)    (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectSoundFullDuplex_AddRef(p)                (p)->lpVtbl->AddRef(p)
+#define IDirectSoundFullDuplex_Release(p)               (p)->lpVtbl->Release(p)
+/*** IDirectSoundFullDuplex methods ***/
+#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h)    (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h)
+#else
+/*** IUnknown methods ***/
+#define IDirectSoundFullDuplex_QueryInterface(p,a,b)    (p)->QueryInterface(a,b)
+#define IDirectSoundFullDuplex_AddRef(p)                (p)->AddRef()
+#define IDirectSoundFullDuplex_Release(p)               (p)->Release()
+/*** IDirectSoundFullDuplex methods ***/
+#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h)    (p)->Initialize(a,b,c,d,e,f,g,h)
+#endif
 
 #ifdef __cplusplus
-};
-#endif // __cplusplus
+} /* extern "C" */
+#endif /* defined(__cplusplus) */
 
-#endif  // __DSOUND_INCLUDED__ 
+#endif /* __WINE_DSOUND_H */