]> git.notmuchmail.org Git - apitrace/commitdiff
Auto-generate d3d9.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 8 Jul 2008 17:17:51 +0000 (02:17 +0900)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 8 Jul 2008 17:17:51 +0000 (02:17 +0900)
18 files changed:
.gitignore
SConstruct
d3d9.def [new file with mode: 0644]
d3d9.py [new file with mode: 0644]
d3d9/SConscript [deleted file]
d3d9/d3d9.def [deleted file]
d3d9/dllmain.cpp [deleted file]
d3d9/dllmain.hpp [deleted file]
d3d9/idirect3d9.cpp [deleted file]
d3d9/idirect3d9.hpp [deleted file]
d3d9/idirect3d_device9.cpp [deleted file]
d3d9/idirect3d_device9.hpp [deleted file]
d3d9/idirect3d_swapchain9.cpp [deleted file]
d3d9/idirect3d_swapchain9.hpp [deleted file]
d3d9/stdafx.h [deleted file]
d3d9caps.py [new file with mode: 0644]
d3d9types.py [new file with mode: 0644]
windows.py

index 9ee4cdb1b878dfc799856b3d1a9493d9d7c9b792..387186373d25d646f60825938a08c79c44626410 100644 (file)
@@ -11,3 +11,4 @@
 *.xml
 *.zip
 d3d8.cpp
+d3d9.cpp
index cdfd6204245d1fe33da0807acc6b42d7f9912682..9f7b0973c9550240530347b29375b3f88f97e6aa 100644 (file)
@@ -55,16 +55,18 @@ cflags = [
 if env['debug']:
     cflags += [
       '/Od', # disable optimizations
-      '/Oi', # enable intrinsic functions
       '/Oy-', # disable frame pointer omission
     ]
 else:
     cflags += [
       '/Ox', # maximum optimizations
-      '/Oi', # enable intrinsic functions
       '/Os', # favor code space
     ]
-cflags += ['/MT']
+cflags += [
+    '/Oi', # enable intrinsic functions
+    '/GF', # enable read-only string pooling
+    '/MT',
+]
 env.Append(CFLAGS = cflags)
 env.Append(CXXFLAGS = cflags)
 
@@ -81,16 +83,12 @@ env.Append(CPPPATH = [
     os.path.join(env['dxsdk'], 'Include'),
 ])
 
-Export('env')
-
-
 env.Command(
     target = 'd3d8.cpp', 
     source = ['d3d8.py', 'd3d8types.py', 'd3d8caps.py', 'windows.py', 'base.py'],
     action = 'python $SOURCE > $TARGET',
 )
     
-
 d3d8 = env.SharedLibrary(
     target = 'd3d8',
     source = [
@@ -99,12 +97,23 @@ d3d8 = env.SharedLibrary(
     ]
 )
 
-SConscript([
-    'd3d9/SConscript',
-])
+env.Default(d3d8)
 
+env.Command(
+    target = 'd3d9.cpp', 
+    source = ['d3d9.py', 'd3d9types.py', 'd3d9caps.py', 'windows.py', 'base.py'],
+    action = 'python $SOURCE > $TARGET',
+)
+    
+d3d9 = env.SharedLibrary(
+    target = 'd3d9',
+    source = [
+        'd3d9.def',
+        'd3d9.cpp',
+    ]
+)
 
-env.Default(d3d8)
+env.Default(d3d9)
 
 env.Tool('packaging')
 
diff --git a/d3d9.def b/d3d9.def
new file mode 100644 (file)
index 0000000..7ddfe20
--- /dev/null
+++ b/d3d9.def
@@ -0,0 +1,5 @@
+LIBRARY        "d3d9"
+
+EXPORTS
+        Direct3DCreate9 @1
+        Direct3DCreate9Ex @2
diff --git a/d3d9.py b/d3d9.py
new file mode 100644 (file)
index 0000000..7489c18
--- /dev/null
+++ b/d3d9.py
@@ -0,0 +1,365 @@
+#############################################################################
+#
+# Copyright 2008 Jose Fonseca
+#
+# This program 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program.  If not, see <http://www.gnu.org/licenses/>.
+#
+#############################################################################
+
+"""d3d9.h"""
+
+from windows import *
+from d3d9types import *
+from d3d9caps import *
+
+IDirect3D9 = Interface("IDirect3D9", IUnknown)
+IDirect3DDevice9 = Interface("IDirect3DDevice9", IUnknown)
+IDirect3DStateBlock9 = Interface("IDirect3DStateBlock9", IUnknown)
+IDirect3DSwapChain9 = Interface("IDirect3DSwapChain9", IUnknown)
+IDirect3DResource9 = Interface("IDirect3DResource9", IUnknown)
+IDirect3DVertexDeclaration9 = Interface("IDirect3DVertexDeclaration9", IUnknown)
+IDirect3DVertexShader9 = Interface("IDirect3DVertexShader9", IUnknown)
+IDirect3DPixelShader9 = Interface("IDirect3DPixelShader9", IUnknown)
+IDirect3DBaseTexture9 = Interface("IDirect3DBaseTexture9", IDirect3DResource9)
+IDirect3DTexture9 = Interface("IDirect3DTexture9", IDirect3DBaseTexture9)
+IDirect3DVolumeTexture9 = Interface("IDirect3DVolumeTexture9", IDirect3DBaseTexture9)
+IDirect3DCubeTexture9 = Interface("IDirect3DCubeTexture9", IDirect3DBaseTexture9)
+IDirect3DVertexBuffer9 = Interface("IDirect3DVertexBuffer9", IDirect3DResource9)
+IDirect3DIndexBuffer9 = Interface("IDirect3DIndexBuffer9", IDirect3DResource9)
+IDirect3DSurface9 = Interface("IDirect3DSurface9", IDirect3DResource9)
+IDirect3DVolume9 = Interface("IDirect3DVolume9", IUnknown)
+IDirect3DQuery9 = Interface("IDirect3DQuery9", IUnknown)
+IDirect3D9Ex = Interface("IDirect3D9Ex", IDirect3D9)
+IDirect3DDevice9Ex = Interface("IDirect3DDevice9Ex", IDirect3DDevice9)
+IDirect3DSwapChain9Ex = Interface("IDirect3DSwapChain9Ex", IDirect3DSwapChain9)
+
+PDIRECT3D9 = WrapPointer(IDirect3D9)
+PDIRECT3DDEVICE9 = WrapPointer(IDirect3DDevice9)
+PDIRECT3DSTATEBLOCK9 = WrapPointer(IDirect3DStateBlock9)
+PDIRECT3DSWAPCHAIN9 = WrapPointer(IDirect3DSwapChain9)
+PDIRECT3DRESOURCE9 = WrapPointer(IDirect3DResource9)
+PDIRECT3DVERTEXDECLARATION9 = WrapPointer(IDirect3DVertexDeclaration9)
+PDIRECT3DVERTEXSHADER9 = WrapPointer(IDirect3DVertexShader9)
+PDIRECT3DPIXELSHADER9 = WrapPointer(IDirect3DPixelShader9)
+PDIRECT3DBASETEXTURE9 = WrapPointer(IDirect3DBaseTexture9)
+PDIRECT3DTEXTURE9 = WrapPointer(IDirect3DTexture9)
+PDIRECT3DVOLUMETEXTURE9 = WrapPointer(IDirect3DVolumeTexture9)
+PDIRECT3DCUBETEXTURE9 = WrapPointer(IDirect3DCubeTexture9)
+PDIRECT3DVERTEXBUFFER9 = WrapPointer(IDirect3DVertexBuffer9)
+PDIRECT3DINDEXBUFFER9 = WrapPointer(IDirect3DIndexBuffer9)
+PDIRECT3DSURFACE9 = WrapPointer(IDirect3DSurface9)
+PDIRECT3DVOLUME9 = WrapPointer(IDirect3DVolume9)
+PDIRECT3DQUERY9 = WrapPointer(IDirect3DQuery9)
+PDIRECT3D9EX = WrapPointer(IDirect3D9Ex)
+PDIRECT3DDEVICE9EX = WrapPointer(IDirect3DDevice9Ex)
+PDIRECT3DSWAPCHAIN9EX = WrapPointer(IDirect3DSwapChain9Ex)
+
+IDirect3D9.methods += [
+    Method(HRESULT, "RegisterSoftwareDevice", [(Pointer(Void), "pInitializeFunction")]),
+    Method(UINT, "GetAdapterCount", []),
+    Method(HRESULT, "GetAdapterIdentifier", [(UINT, "Adapter"), (DWORD, "Flags"), (Pointer(D3DADAPTER_IDENTIFIER9), "pIdentifier")]),
+    Method(UINT, "GetAdapterModeCount", [(UINT, "Adapter"), (D3DFORMAT, "Format")]),
+    Method(HRESULT, "EnumAdapterModes", [(UINT, "Adapter"), (D3DFORMAT, "Format"), (UINT, "Mode"), (Pointer(D3DDISPLAYMODE), "pMode")]),
+    Method(HRESULT, "GetAdapterDisplayMode", [(UINT, "Adapter"), (Pointer(D3DDISPLAYMODE), "pMode")]),
+    Method(HRESULT, "CheckDeviceType", [(UINT, "Adapter"), (D3DDEVTYPE, "DevType"), (D3DFORMAT, "AdapterFormat"), (D3DFORMAT, "BackBufferFormat"), (BOOL, "bWindowed")]),
+    Method(HRESULT, "CheckDeviceFormat", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "AdapterFormat"), (DWORD, "Usage"), (D3DRESOURCETYPE, "RType"), (D3DFORMAT, "CheckFormat")]),
+    Method(HRESULT, "CheckDeviceMultiSampleType", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "SurfaceFormat"), (BOOL, "Windowed"), (D3DMULTISAMPLE_TYPE, "MultiSampleType"), (Pointer(DWORD), "pQualityLevels")]),
+    Method(HRESULT, "CheckDepthStencilMatch", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "AdapterFormat"), (D3DFORMAT, "RenderTargetFormat"), (D3DFORMAT, "DepthStencilFormat")]),
+    Method(HRESULT, "CheckDeviceFormatConversion", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "SourceFormat"), (D3DFORMAT, "TargetFormat")]),
+    Method(HRESULT, "GetDeviceCaps", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (Pointer(D3DCAPS9), "pCaps")]),
+    Method(HMONITOR, "GetAdapterMonitor", [(UINT, "Adapter")]),
+    Method(HRESULT, "CreateDevice", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (DWORD, "BehaviorFlags"), (Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), (Pointer(Pointer(IDirect3DDevice9)), "ppReturnedDeviceInterface")]),
+]
+
+IDirect3DDevice9.methods += [
+    Method(HRESULT, "TestCooperativeLevel", []),
+    Method(UINT, "GetAvailableTextureMem", []),
+    Method(HRESULT, "EvictManagedResources", []),
+    Method(HRESULT, "GetDirect3D", [(Pointer(Pointer(IDirect3D9)), "ppD3D9")]),
+    Method(HRESULT, "GetDeviceCaps", [(Pointer(D3DCAPS9), "pCaps")]),
+    Method(HRESULT, "GetDisplayMode", [(UINT, "iSwapChain"), (Pointer(D3DDISPLAYMODE), "pMode")]),
+    Method(HRESULT, "GetCreationParameters", [(Pointer(D3DDEVICE_CREATION_PARAMETERS), "pParameters")]),
+    Method(HRESULT, "SetCursorProperties", [(UINT, "XHotSpot"), (UINT, "YHotSpot"), (Pointer(IDirect3DSurface9), "pCursorBitmap")]),
+    Method(Void, "SetCursorPosition", [(Int, "X"), (Int, "Y"), (DWORD, "Flags")]),
+    Method(BOOL, "ShowCursor", [(BOOL, "bShow")]),
+    Method(HRESULT, "CreateAdditionalSwapChain", [(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), (Pointer(Pointer(IDirect3DSwapChain9)), "pSwapChain")]),
+    Method(HRESULT, "GetSwapChain", [(UINT, "iSwapChain"), (Pointer(Pointer(IDirect3DSwapChain9)), "pSwapChain")]),
+    Method(UINT, "GetNumberOfSwapChains", []),
+    Method(HRESULT, "Reset", [(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters")]),
+    Method(HRESULT, "Present", [(Pointer(Const(RECT)), "pSourceRect"), (Pointer(Const(RECT)), "pDestRect"), (HWND, "hDestWindowOverride"), (Pointer(Const(RGNDATA)), "pDirtyRegion")]),
+    Method(HRESULT, "GetBackBuffer", [(UINT, "iSwapChain"), (UINT, "iBackBuffer"), (D3DBACKBUFFER_TYPE, "Type"), (Pointer(Pointer(IDirect3DSurface9)), "ppBackBuffer")]),
+    Method(HRESULT, "GetRasterStatus", [(UINT, "iSwapChain"), (Pointer(D3DRASTER_STATUS), "pRasterStatus")]),
+    Method(HRESULT, "SetDialogBoxMode", [(BOOL, "bEnableDialogs")]),
+    Method(Void, "SetGammaRamp", [(UINT, "iSwapChain"), (DWORD, "Flags"), (Pointer(Const(D3DGAMMARAMP)), "pRamp")]),
+    Method(Void, "GetGammaRamp", [(UINT, "iSwapChain"), (Pointer(D3DGAMMARAMP), "pRamp")]),
+    Method(HRESULT, "CreateTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (Pointer(Pointer(IDirect3DTexture9)), "ppTexture"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "CreateVolumeTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Depth"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (Pointer(Pointer(IDirect3DVolumeTexture9)), "ppVolumeTexture"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "CreateCubeTexture", [(UINT, "EdgeLength"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (Pointer(Pointer(IDirect3DCubeTexture9)), "ppCubeTexture"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "CreateVertexBuffer", [(UINT, "Length"), (DWORD, "Usage"), (DWORD, "FVF"), (D3DPOOL, "Pool"), (Pointer(Pointer(IDirect3DVertexBuffer9)), "ppVertexBuffer"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "CreateIndexBuffer", [(UINT, "Length"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (Pointer(Pointer(IDirect3DIndexBuffer9)), "ppIndexBuffer"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "CreateRenderTarget", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Lockable"), (Pointer(Pointer(IDirect3DSurface9)), "ppSurface"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "CreateDepthStencilSurface", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Discard"), (Pointer(Pointer(IDirect3DSurface9)), "ppSurface"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "UpdateSurface", [(Pointer(IDirect3DSurface9), "pSourceSurface"), (Pointer(Const(RECT)), "pSourceRect"), (Pointer(IDirect3DSurface9), "pDestinationSurface"), (Pointer(Const(POINT)), "pDestPoint")]),
+    Method(HRESULT, "UpdateTexture", [(Pointer(IDirect3DBaseTexture9), "pSourceTexture"), (Pointer(IDirect3DBaseTexture9), "pDestinationTexture")]),
+    Method(HRESULT, "GetRenderTargetData", [(Pointer(IDirect3DSurface9), "pRenderTarget"), (Pointer(IDirect3DSurface9), "pDestSurface")]),
+    Method(HRESULT, "GetFrontBufferData", [(UINT, "iSwapChain"), (Pointer(IDirect3DSurface9), "pDestSurface")]),
+    Method(HRESULT, "StretchRect", [(Pointer(IDirect3DSurface9), "pSourceSurface"), (Pointer(Const(RECT)), "pSourceRect"), (Pointer(IDirect3DSurface9), "pDestSurface"), (Pointer(Const(RECT)), "pDestRect"), (D3DTEXTUREFILTERTYPE, "Filter")]),
+    Method(HRESULT, "ColorFill", [(Pointer(IDirect3DSurface9), "pSurface"), (Pointer(Const(RECT)), "pRect"), (D3DCOLOR, "color")]),
+    Method(HRESULT, "CreateOffscreenPlainSurface", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (Pointer(Pointer(IDirect3DSurface9)), "ppSurface"), (Pointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "SetRenderTarget", [(DWORD, "RenderTargetIndex"), (Pointer(IDirect3DSurface9), "pRenderTarget")]),
+    Method(HRESULT, "GetRenderTarget", [(DWORD, "RenderTargetIndex"), (Pointer(Pointer(IDirect3DSurface9)), "ppRenderTarget")]),
+    Method(HRESULT, "SetDepthStencilSurface", [(Pointer(IDirect3DSurface9), "pNewZStencil")]),
+    Method(HRESULT, "GetDepthStencilSurface", [(Pointer(Pointer(IDirect3DSurface9)), "ppZStencilSurface")]),
+    Method(HRESULT, "BeginScene", []),
+    Method(HRESULT, "EndScene", []),
+    Method(HRESULT, "Clear", [(DWORD, "Count"), (Pointer(Const(D3DRECT)), "pRects"), (DWORD, "Flags"), (D3DCOLOR, "Color"), (Float, "Z"), (DWORD, "Stencil")]),
+    Method(HRESULT, "SetTransform", [(D3DTRANSFORMSTATETYPE, "State"), (Pointer(Const(D3DMATRIX)), "pMatrix")]),
+    Method(HRESULT, "GetTransform", [(D3DTRANSFORMSTATETYPE, "State"), (Pointer(D3DMATRIX), "pMatrix")]),
+    Method(HRESULT, "MultiplyTransform", [(D3DTRANSFORMSTATETYPE, "State"), (Pointer(Const(D3DMATRIX)), "pMatrix")]),
+    Method(HRESULT, "SetViewport", [(Pointer(Const(D3DVIEWPORT9)), "pViewport")]),
+    Method(HRESULT, "GetViewport", [(Pointer(D3DVIEWPORT9), "pViewport")]),
+    Method(HRESULT, "SetMaterial", [(Pointer(Const(D3DMATERIAL9)), "pMaterial")]),
+    Method(HRESULT, "GetMaterial", [(Pointer(D3DMATERIAL9), "pMaterial")]),
+    Method(HRESULT, "SetLight", [(DWORD, "Index"), (Pointer(Const(D3DLIGHT9)), "pLight")]),
+    Method(HRESULT, "GetLight", [(DWORD, "Index"), (Pointer(D3DLIGHT9), "pLight")]),
+    Method(HRESULT, "LightEnable", [(DWORD, "Index"), (BOOL, "Enable")]),
+    Method(HRESULT, "GetLightEnable", [(DWORD, "Index"), (Pointer(BOOL), "pEnable")]),
+    Method(HRESULT, "SetClipPlane", [(DWORD, "Index"), (Pointer(Const(Float)), "pPlane")]),
+    Method(HRESULT, "GetClipPlane", [(DWORD, "Index"), (Pointer(Float), "pPlane")]),
+    Method(HRESULT, "SetRenderState", [(D3DRENDERSTATETYPE, "State"), (DWORD, "Value")]),
+    Method(HRESULT, "GetRenderState", [(D3DRENDERSTATETYPE, "State"), (Pointer(DWORD), "pValue")]),
+    Method(HRESULT, "CreateStateBlock", [(D3DSTATEBLOCKTYPE, "Type"), (Pointer(Pointer(IDirect3DStateBlock9)), "ppSB")]),
+    Method(HRESULT, "BeginStateBlock", []),
+    Method(HRESULT, "EndStateBlock", [(Pointer(Pointer(IDirect3DStateBlock9)), "ppSB")]),
+    Method(HRESULT, "SetClipStatus", [(Pointer(Const(D3DCLIPSTATUS9)), "pClipStatus")]),
+    Method(HRESULT, "GetClipStatus", [(Pointer(D3DCLIPSTATUS9), "pClipStatus")]),
+    Method(HRESULT, "GetTexture", [(DWORD, "Stage"), (Pointer(Pointer(IDirect3DBaseTexture9)), "ppTexture")]),
+    Method(HRESULT, "SetTexture", [(DWORD, "Stage"), (Pointer(IDirect3DBaseTexture9), "pTexture")]),
+    Method(HRESULT, "GetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), (Pointer(DWORD), "pValue")]),
+    Method(HRESULT, "SetTextureStageState", [(DWORD, "Stage"), (D3DTEXTURESTAGESTATETYPE, "Type"), (DWORD, "Value")]),
+    Method(HRESULT, "GetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), (Pointer(DWORD), "pValue")]),
+    Method(HRESULT, "SetSamplerState", [(DWORD, "Sampler"), (D3DSAMPLERSTATETYPE, "Type"), (DWORD, "Value")]),
+    Method(HRESULT, "ValidateDevice", [(Pointer(DWORD), "pNumPasses")]),
+    Method(HRESULT, "SetPaletteEntries", [(UINT, "PaletteNumber"), (Pointer(Const(PALETTEENTRY)), "pEntries")]),
+    Method(HRESULT, "GetPaletteEntries", [(UINT, "PaletteNumber"), (Pointer(PALETTEENTRY), "pEntries")]),
+    Method(HRESULT, "SetCurrentTexturePalette", [(UINT, "PaletteNumber")]),
+    Method(HRESULT, "GetCurrentTexturePalette", [(Pointer(UINT), "PaletteNumber")]),
+    Method(HRESULT, "SetScissorRect", [(Pointer(Const(RECT)), "pRect")]),
+    Method(HRESULT, "GetScissorRect", [(Pointer(RECT), "pRect")]),
+    Method(HRESULT, "SetSoftwareVertexProcessing", [(BOOL, "bSoftware")]),
+    Method(BOOL, "GetSoftwareVertexProcessing", []),
+    Method(HRESULT, "SetNPatchMode", [(Float, "nSegments")]),
+    Method(Float, "GetNPatchMode", []),
+    Method(HRESULT, "DrawPrimitive", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "StartVertex"), (UINT, "PrimitiveCount")]),
+    Method(HRESULT, "DrawIndexedPrimitive", [(D3DPRIMITIVETYPE, "PrimitiveType"), (INT, "BaseVertexIndex"), (UINT, "MinVertexIndex"), (UINT, "NumVertices"), (UINT, "startIndex"), (UINT, "primCount")]),
+    Method(HRESULT, "DrawPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "PrimitiveCount"), (Pointer(Const(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]),
+    Method(HRESULT, "DrawIndexedPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "MinVertexIndex"), (UINT, "NumVertices"), (UINT, "PrimitiveCount"), (Pointer(Const(Void)), "pIndexData"), (D3DFORMAT, "IndexDataFormat"), (Pointer(Const(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]),
+    Method(HRESULT, "ProcessVertices", [(UINT, "SrcStartIndex"), (UINT, "DestIndex"), (UINT, "VertexCount"), (Pointer(IDirect3DVertexBuffer9), "pDestBuffer"), (Pointer(IDirect3DVertexDeclaration9), "pVertexDecl"), (DWORD, "Flags")]),
+    Method(HRESULT, "CreateVertexDeclaration", [(Pointer(Const(D3DVERTEXELEMENT9)), "pVertexElements"), (Pointer(Pointer(IDirect3DVertexDeclaration9)), "ppDecl")]),
+    Method(HRESULT, "SetVertexDeclaration", [(Pointer(IDirect3DVertexDeclaration9), "pDecl")]),
+    Method(HRESULT, "GetVertexDeclaration", [(Pointer(Pointer(IDirect3DVertexDeclaration9)), "ppDecl")]),
+    Method(HRESULT, "SetFVF", [(DWORD, "FVF")]),
+    Method(HRESULT, "GetFVF", [(Pointer(DWORD), "pFVF")]),
+    Method(HRESULT, "CreateVertexShader", [(Pointer(Const(DWORD)), "pFunction"), (Pointer(Pointer(IDirect3DVertexShader9)), "ppShader")]),
+    Method(HRESULT, "SetVertexShader", [(Pointer(IDirect3DVertexShader9), "pShader")]),
+    Method(HRESULT, "GetVertexShader", [(Pointer(Pointer(IDirect3DVertexShader9)), "ppShader")]),
+    Method(HRESULT, "SetVertexShaderConstantF", [(UINT, "StartRegister"), (Pointer(Const(Float)), "pConstantData"), (UINT, "Vector4fCount")]),
+    Method(HRESULT, "GetVertexShaderConstantF", [(UINT, "StartRegister"), (Pointer(Float), "pConstantData"), (UINT, "Vector4fCount")]),
+    Method(HRESULT, "SetVertexShaderConstantI", [(UINT, "StartRegister"), (Pointer(Const(Int)), "pConstantData"), (UINT, "Vector4iCount")]),
+    Method(HRESULT, "GetVertexShaderConstantI", [(UINT, "StartRegister"), (Pointer(Int), "pConstantData"), (UINT, "Vector4iCount")]),
+    Method(HRESULT, "SetVertexShaderConstantB", [(UINT, "StartRegister"), (Pointer(Const(BOOL)), "pConstantData"), (UINT, "BoolCount")]),
+    Method(HRESULT, "GetVertexShaderConstantB", [(UINT, "StartRegister"), (Pointer(BOOL), "pConstantData"), (UINT, "BoolCount")]),
+    Method(HRESULT, "SetStreamSource", [(UINT, "StreamNumber"), (Pointer(IDirect3DVertexBuffer9), "pStreamData"), (UINT, "OffsetInBytes"), (UINT, "Stride")]),
+    Method(HRESULT, "GetStreamSource", [(UINT, "StreamNumber"), (Pointer(Pointer(IDirect3DVertexBuffer9)), "ppStreamData"), (Pointer(UINT), "pOffsetInBytes"), (Pointer(UINT), "pStride")]),
+    Method(HRESULT, "SetStreamSourceFreq", [(UINT, "StreamNumber"), (UINT, "Setting")]),
+    Method(HRESULT, "GetStreamSourceFreq", [(UINT, "StreamNumber"), (Pointer(UINT), "pSetting")]),
+    Method(HRESULT, "SetIndices", [(Pointer(IDirect3DIndexBuffer9), "pIndexData")]),
+    Method(HRESULT, "GetIndices", [(Pointer(Pointer(IDirect3DIndexBuffer9)), "ppIndexData")]),
+    Method(HRESULT, "CreatePixelShader", [(Pointer(Const(DWORD)), "pFunction"), (Pointer(Pointer(IDirect3DPixelShader9)), "ppShader")]),
+    Method(HRESULT, "SetPixelShader", [(Pointer(IDirect3DPixelShader9), "pShader")]),
+    Method(HRESULT, "GetPixelShader", [(Pointer(Pointer(IDirect3DPixelShader9)), "ppShader")]),
+    Method(HRESULT, "SetPixelShaderConstantF", [(UINT, "StartRegister"), (Pointer(Const(Float)), "pConstantData"), (UINT, "Vector4fCount")]),
+    Method(HRESULT, "GetPixelShaderConstantF", [(UINT, "StartRegister"), (Pointer(Float), "pConstantData"), (UINT, "Vector4fCount")]),
+    Method(HRESULT, "SetPixelShaderConstantI", [(UINT, "StartRegister"), (Pointer(Const(Int)), "pConstantData"), (UINT, "Vector4iCount")]),
+    Method(HRESULT, "GetPixelShaderConstantI", [(UINT, "StartRegister"), (Pointer(Int), "pConstantData"), (UINT, "Vector4iCount")]),
+    Method(HRESULT, "SetPixelShaderConstantB", [(UINT, "StartRegister"), (Pointer(Const(BOOL)), "pConstantData"), (UINT, "BoolCount")]),
+    Method(HRESULT, "GetPixelShaderConstantB", [(UINT, "StartRegister"), (Pointer(BOOL), "pConstantData"), (UINT, "BoolCount")]),
+    Method(HRESULT, "DrawRectPatch", [(UINT, "Handle"), (Pointer(Const(Float)), "pNumSegs"), (Pointer(Const(D3DRECTPATCH_INFO)), "pRectPatchInfo")]),
+    Method(HRESULT, "DrawTriPatch", [(UINT, "Handle"), (Pointer(Const(Float)), "pNumSegs"), (Pointer(Const(D3DTRIPATCH_INFO)), "pTriPatchInfo")]),
+    Method(HRESULT, "DeletePatch", [(UINT, "Handle")]),
+    Method(HRESULT, "CreateQuery", [(D3DQUERYTYPE, "Type"), (Pointer(Pointer(IDirect3DQuery9)), "ppQuery")]),
+]
+
+IDirect3DStateBlock9.methods += [
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(HRESULT, "Capture", []),
+    Method(HRESULT, "Apply", []),
+]
+
+IDirect3DSwapChain9.methods += [
+    Method(HRESULT, "Present", [(Pointer(Const(RECT)), "pSourceRect"), (Pointer(Const(RECT)), "pDestRect"), (HWND, "hDestWindowOverride"), (Pointer(Const(RGNDATA)), "pDirtyRegion"), (DWORD, "dwFlags")]),
+    Method(HRESULT, "GetFrontBufferData", [(Pointer(IDirect3DSurface9), "pDestSurface")]),
+    Method(HRESULT, "GetBackBuffer", [(UINT, "iBackBuffer"), (D3DBACKBUFFER_TYPE, "Type"), (Pointer(Pointer(IDirect3DSurface9)), "ppBackBuffer")]),
+    Method(HRESULT, "GetRasterStatus", [(Pointer(D3DRASTER_STATUS), "pRasterStatus")]),
+    Method(HRESULT, "GetDisplayMode", [(Pointer(D3DDISPLAYMODE), "pMode")]),
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(HRESULT, "GetPresentParameters", [(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters")]),
+]
+
+IDirect3DResource9.methods += [
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (Pointer(Const(Void)), "pData"), (DWORD, "SizeOfData"), (DWORD, "Flags")]),
+    Method(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
+    Method(HRESULT, "FreePrivateData", [(REFGUID, "refguid")]),
+    Method(DWORD, "SetPriority", [(DWORD, "PriorityNew")]),
+    Method(DWORD, "GetPriority", []),
+    Method(Void, "PreLoad", []),
+    Method(D3DRESOURCETYPE, "GetType", []),
+]
+
+IDirect3DVertexDeclaration9.methods += [
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(HRESULT, "GetDeclaration", [(Pointer(D3DVERTEXELEMENT9), "pElement"), (Pointer(UINT), "pNumElements")]),
+]
+
+IDirect3DVertexShader9.methods += [
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(HRESULT, "GetFunction", [(Pointer(Void), "pData"), (Pointer(UINT), "pSizeOfData")]),
+]
+
+IDirect3DPixelShader9.methods += [
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(HRESULT, "GetFunction", [(Pointer(Void), "pData"), (Pointer(UINT), "pSizeOfData")]),
+]
+
+IDirect3DBaseTexture9.methods += [
+    Method(DWORD, "SetLOD", [(DWORD, "LODNew")]),
+    Method(DWORD, "GetLOD", []),
+    Method(DWORD, "GetLevelCount", []),
+    Method(HRESULT, "SetAutoGenFilterType", [(D3DTEXTUREFILTERTYPE, "FilterType")]),
+    Method(D3DTEXTUREFILTERTYPE, "GetAutoGenFilterType", []),
+    Method(Void, "GenerateMipSubLevels", []),
+]
+
+IDirect3DTexture9.methods += [
+    Method(HRESULT, "GetLevelDesc", [(UINT, "Level"), (Pointer(D3DSURFACE_DESC), "pDesc")]),
+    Method(HRESULT, "GetSurfaceLevel", [(UINT, "Level"), (Pointer(Pointer(IDirect3DSurface9)), "ppSurfaceLevel")]),
+    Method(HRESULT, "LockRect", [(UINT, "Level"), (Pointer(D3DLOCKED_RECT), "pLockedRect"), (Pointer(Const(RECT)), "pRect"), (DWORD, "Flags")]),
+    Method(HRESULT, "UnlockRect", [(UINT, "Level")]),
+    Method(HRESULT, "AddDirtyRect", [(Pointer(Const(RECT)), "pDirtyRect")]),
+]
+
+IDirect3DVolumeTexture9.methods += [
+    Method(HRESULT, "GetLevelDesc", [(UINT, "Level"), (Pointer(D3DVOLUME_DESC), "pDesc")]),
+    Method(HRESULT, "GetVolumeLevel", [(UINT, "Level"), (Pointer(Pointer(IDirect3DVolume9)), "ppVolumeLevel")]),
+    Method(HRESULT, "LockBox", [(UINT, "Level"), (Pointer(D3DLOCKED_BOX), "pLockedVolume"), (Pointer(Const(D3DBOX)), "pBox"), (DWORD, "Flags")]),
+    Method(HRESULT, "UnlockBox", [(UINT, "Level")]),
+    Method(HRESULT, "AddDirtyBox", [(Pointer(Const(D3DBOX)), "pDirtyBox")]),
+]
+
+IDirect3DCubeTexture9.methods += [
+    Method(HRESULT, "GetLevelDesc", [(UINT, "Level"), (Pointer(D3DSURFACE_DESC), "pDesc")]),
+    Method(HRESULT, "GetCubeMapSurface", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level"), (Pointer(Pointer(IDirect3DSurface9)), "ppCubeMapSurface")]),
+    Method(HRESULT, "LockRect", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level"), (Pointer(D3DLOCKED_RECT), "pLockedRect"), (Pointer(Const(RECT)), "pRect"), (DWORD, "Flags")]),
+    Method(HRESULT, "UnlockRect", [(D3DCUBEMAP_FACES, "FaceType"), (UINT, "Level")]),
+    Method(HRESULT, "AddDirtyRect", [(D3DCUBEMAP_FACES, "FaceType"), (Pointer(Const(RECT)), "pDirtyRect")]),
+]
+
+IDirect3DVertexBuffer9.methods += [
+    Method(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), (Pointer(Pointer(Void)), "ppbData"), (DWORD, "Flags")]),
+    Method(HRESULT, "Unlock", []),
+    Method(HRESULT, "GetDesc", [(Pointer(D3DVERTEXBUFFER_DESC), "pDesc")]),
+]
+
+IDirect3DIndexBuffer9.methods += [
+    Method(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), (Pointer(Pointer(Void)), "ppbData"), (DWORD, "Flags")]),
+    Method(HRESULT, "Unlock", []),
+    Method(HRESULT, "GetDesc", [(Pointer(D3DINDEXBUFFER_DESC), "pDesc")]),
+]
+
+IDirect3DSurface9.methods += [
+    Method(HRESULT, "GetContainer", [(REFIID, "riid"), (Pointer(Pointer(Void)), "ppContainer")]),
+    Method(HRESULT, "GetDesc", [(Pointer(D3DSURFACE_DESC), "pDesc")]),
+    Method(HRESULT, "LockRect", [(Pointer(D3DLOCKED_RECT), "pLockedRect"), (Pointer(Const(RECT)), "pRect"), (DWORD, "Flags")]),
+    Method(HRESULT, "UnlockRect", []),
+    Method(HRESULT, "GetDC", [(Pointer(HDC), "phdc")]),
+    Method(HRESULT, "ReleaseDC", [(HDC, "hdc")]),
+]
+
+IDirect3DVolume9.methods += [
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (Pointer(Const(Void)), "pData"), (DWORD, "SizeOfData"), (DWORD, "Flags")]),
+    Method(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), (Pointer(Void), "pData"), (Pointer(DWORD), "pSizeOfData")]),
+    Method(HRESULT, "FreePrivateData", [(REFGUID, "refguid")]),
+    Method(HRESULT, "GetContainer", [(REFIID, "riid"), (Pointer(Pointer(Void)), "ppContainer")]),
+    Method(HRESULT, "GetDesc", [(Pointer(D3DVOLUME_DESC), "pDesc")]),
+    Method(HRESULT, "LockBox", [(Pointer(D3DLOCKED_BOX), "pLockedVolume"), (Pointer(Const(D3DBOX)), "pBox"), (DWORD, "Flags")]),
+    Method(HRESULT, "UnlockBox", []),
+]
+
+IDirect3DQuery9.methods += [
+    Method(HRESULT, "GetDevice", [(Pointer(Pointer(IDirect3DDevice9)), "ppDevice")]),
+    Method(D3DQUERYTYPE, "GetType", []),
+    Method(DWORD, "GetDataSize", []),
+    Method(HRESULT, "Issue", [(DWORD, "dwIssueFlags")]),
+    Method(HRESULT, "GetData", [(Pointer(Void), "pData"), (DWORD, "dwSize"), (DWORD, "dwGetDataFlags")]),
+]
+
+IDirect3D9Ex.methods += [
+    Method(UINT, "GetAdapterModeCountEx", [(UINT, "Adapter"), (Pointer(Const(D3DDISPLAYMODEFILTER)), "pFilter") ]),
+    Method(HRESULT, "EnumAdapterModesEx", [(UINT, "Adapter"), (Pointer(Const(D3DDISPLAYMODEFILTER)), "pFilter"), (UINT, "Mode"), (Pointer(D3DDISPLAYMODEEX), "pMode")]),
+    Method(HRESULT, "GetAdapterDisplayModeEx", [(UINT, "Adapter"), (Pointer(D3DDISPLAYMODEEX), "pMode"), (Pointer(D3DDISPLAYROTATION), "pRotation")]),
+    Method(HRESULT, "CreateDeviceEx", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (DWORD, "BehaviorFlags"), (Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), (Pointer(D3DDISPLAYMODEEX), "pFullscreenDisplayMode"), (Pointer(Pointer(IDirect3DDevice9Ex)), "ppReturnedDeviceInterface")]),
+    Method(HRESULT, "GetAdapterLUID", [(UINT, "Adapter"), (Pointer(LUID), "pLUID")]),
+]
+
+IDirect3DDevice9Ex.methods += [
+    Method(HRESULT, "SetConvolutionMonoKernel", [(UINT, "width"), (UINT, "height"), (Pointer(Float), "rows"), (Pointer(Float), "columns")]),
+    Method(HRESULT, "ComposeRects", [(Pointer(IDirect3DSurface9), "pSrc"), (Pointer(IDirect3DSurface9), "pDst"), (Pointer(IDirect3DVertexBuffer9), "pSrcRectDescs"), (UINT, "NumRects"), (Pointer(IDirect3DVertexBuffer9), "pDstRectDescs"), (D3DCOMPOSERECTSOP, "Operation"), (Int, "Xoffset"), (Int, "Yoffset")]),
+    Method(HRESULT, "PresentEx", [(Pointer(Const(RECT)), "pSourceRect"), (Pointer(Const(RECT)), "pDestRect"), (HWND, "hDestWindowOverride"), (Pointer(Const(RGNDATA)), "pDirtyRegion"), (DWORD, "dwFlags")]),
+    Method(HRESULT, "GetGPUThreadPriority", [(Pointer(INT), "pPriority")]),
+    Method(HRESULT, "SetGPUThreadPriority", [(INT, "Priority")]),
+    Method(HRESULT, "WaitForVBlank", [(UINT, "iSwapChain")]),
+    Method(HRESULT, "CheckResourceResidency", [(Pointer(Pointer(IDirect3DResource9)), "pResourceArray"), (UINT32, "NumResources")]),
+    Method(HRESULT, "SetMaximumFrameLatency", [(UINT, "MaxLatency")]),
+    Method(HRESULT, "GetMaximumFrameLatency", [(Pointer(UINT), "pMaxLatency")]),
+    Method(HRESULT, "CheckDeviceState", [(HWND, "hDestinationWindow")]),
+    Method(HRESULT, "CreateRenderTargetEx", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Lockable"), (Pointer(Pointer(IDirect3DSurface9)), "ppSurface"), (Pointer(HANDLE), "pSharedHandle"), (DWORD, "Usage")]),
+    Method(HRESULT, "CreateOffscreenPlainSurfaceEx", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (Pointer(Pointer(IDirect3DSurface9)), "ppSurface"), (Pointer(HANDLE), "pSharedHandle"), (DWORD, "Usage")]),
+    Method(HRESULT, "CreateDepthStencilSurfaceEx", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Discard"), (Pointer(Pointer(IDirect3DSurface9)), "ppSurface"), (Pointer(HANDLE), "pSharedHandle"), (DWORD, "Usage")]),
+    Method(HRESULT, "ResetEx", [(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), (Pointer(D3DDISPLAYMODEEX), "pFullscreenDisplayMode")]),
+    Method(HRESULT, "GetDisplayModeEx", [(UINT, "iSwapChain"), (Pointer(D3DDISPLAYMODEEX), "pMode"), (Pointer(D3DDISPLAYROTATION), "pRotation")]),
+]
+
+IDirect3DSwapChain9Ex.methods += [
+    Method(HRESULT, "GetLastPresentCount", [(Pointer(UINT), "pLastPresentCount")]),
+    Method(HRESULT, "GetPresentStats", [(Pointer(D3DPRESENTSTATS), "pPresentationStatistics")]),
+    Method(HRESULT, "GetDisplayModeEx", [(Pointer(D3DDISPLAYMODEEX), "pMode"), (Pointer(D3DDISPLAYROTATION), "pRotation")]),
+]
+
+d3d9 = Dll("d3d9")
+d3d9.functions += [
+    Function(PDIRECT3D9, "Direct3DCreate9", [(UINT, "SDKVersion")]),
+    Function(HRESULT, "Direct3DCreate9Ex", [(UINT, "SDKVersion"), (Pointer(Pointer(IDirect3D9Ex)), "ppD3D")]),
+]
+
+if __name__ == '__main__':
+    print '#include <windows.h>'
+    print '#include <tchar.h>'
+    print '#include <d3d9.h>'
+    print
+    print '#include "log.hpp"'
+    print
+    wrap()
+
diff --git a/d3d9/SConscript b/d3d9/SConscript
deleted file mode 100644 (file)
index 6c5af22..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Import('env')
-
-env.SharedLibrary(
-    target = 'd3d9.dll',
-    source = [
-        'd3d9.def',
-        'dllmain.cpp',
-        'idirect3d9.cpp',
-        'idirect3d_device9.cpp',
-        'idirect3d_swapchain9.cpp',
-    ]
-)
diff --git a/d3d9/d3d9.def b/d3d9/d3d9.def
deleted file mode 100644 (file)
index d74db14..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-LIBRARY        "d3d9"
-
-EXPORTS
-        Direct3DCreate9 @1
diff --git a/d3d9/dllmain.cpp b/d3d9/dllmain.cpp
deleted file mode 100644 (file)
index 9a8878b..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-// proxydll.cpp
-#include "stdafx.h"
-#include "dllmain.hpp"
-
-// global variables
-#pragma data_seg (".d3d9_shared")
-TraceDirect3DSwapChain9* gl_pmyIDirect3DSwapChain9;
-TraceDirect3DDevice9* gl_pmyIDirect3DDevice9;
-TraceDirect3D9* gl_pmyIDirect3D9;
-HINSTANCE gl_hOriginalDll;
-HINSTANCE gl_hThisInstance;
-#pragma data_seg ()
-
-BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
-{
-    // to avoid compiler lvl4 warnings 
-    LPVOID lpDummy = lpReserved;
-    lpDummy = NULL;
-
-    switch (ul_reason_for_call)
-    {
-        case DLL_PROCESS_ATTACH: InitInstance(hModule); break;
-        case DLL_PROCESS_DETACH: ExitInstance(); break;
-
-        case DLL_THREAD_ATTACH: break;
-        case DLL_THREAD_DETACH: break;
-    }
-    return TRUE;
-}
-
-// Exported function (faking d3d9.dll's one-and-only export)
-IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion)
-{
-    if (!gl_hOriginalDll) LoadOriginalDll(); // looking for the "right d3d9.dll"
-
-    // Hooking IDirect3D Object from Original Library
-    typedef IDirect3D9 *(WINAPI* D3D9_Type)(UINT SDKVersion);
-    D3D9_Type D3DCreate9_fn = (D3D9_Type) GetProcAddress( gl_hOriginalDll, "Direct3DCreate9");
-
-    // Debug
-    if (!D3DCreate9_fn)
-    {
-        OutputDebugString(_T("PROXYDLL: Pointer to original D3DCreate9 function not received ERROR ****\r\n"));
-        ::ExitProcess(0); // exit the hard way
-    }
-
-    // Request pointer from Original Dll. 
-    IDirect3D9 *pIDirect3D9_orig = D3DCreate9_fn(SDKVersion);
-
-    // Create my IDirect3D8 object and store pointer to original object there.
-    // note: the object will delete itself once Ref count is zero (similar to COM objects)
-    gl_pmyIDirect3D9 = new TraceDirect3D9(pIDirect3D9_orig);
-
-    // Return pointer to hooking Object instead of "real one"
-    return (gl_pmyIDirect3D9);
-}
-
-void InitInstance(HANDLE hModule) {
-    OutputDebugString(_T("PROXYDLL: InitInstance called.\r\n"));
-
-    // Initialisation
-    gl_hOriginalDll = NULL;
-    gl_hThisInstance = NULL;
-    gl_pmyIDirect3D9 = NULL;
-    gl_pmyIDirect3DDevice9 = NULL;
-    gl_pmyIDirect3DSwapChain9 = NULL;
-
-    // Storing Instance handle into global var
-    gl_hThisInstance = (HINSTANCE) hModule;
-}
-
-void LoadOriginalDll(void) {
-    TCHAR buffer[MAX_PATH];
-
-    // Getting path to system dir and to d3d8.dll
-    ::GetSystemDirectory(buffer, MAX_PATH);
-
-    // Append dll name
-    _tcscat(buffer, _T("\\d3d9.dll"));
-
-    // try to load the system's d3d9.dll, if pointer empty
-    if (!gl_hOriginalDll)
-        gl_hOriginalDll = ::LoadLibrary(buffer);
-
-    // Debug
-    if (!gl_hOriginalDll) {
-        OutputDebugString(_T("PROXYDLL: Original d3d9.dll not loaded ERROR ****\r\n"));
-        ::ExitProcess(0); // exit the hard way
-    }
-}
-
-void ExitInstance() {
-    OutputDebugString(_T("PROXYDLL: ExitInstance called.\r\n"));
-
-    // Release the system's d3d9.dll
-    if (gl_hOriginalDll) {
-        ::FreeLibrary(gl_hOriginalDll);
-        gl_hOriginalDll = NULL;
-    }
-}
-
diff --git a/d3d9/dllmain.hpp b/d3d9/dllmain.hpp
deleted file mode 100644 (file)
index 5a4528b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// proxydll.h
-#pragma once
-
-// Exported function
-IDirect3D9* WINAPI Direct3DCreate9 (UINT SDKVersion);
-
-// regular functions
-void InitInstance(HANDLE hModule);
-void ExitInstance(void);
-void LoadOriginalDll(void);
\ No newline at end of file
diff --git a/d3d9/idirect3d9.cpp b/d3d9/idirect3d9.cpp
deleted file mode 100644 (file)
index c8d4596..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#include "StdAfx.h"
-
-TraceDirect3D9::TraceDirect3D9(IDirect3D9 *pOriginal) {
-    m_pIDirect3D9 = pOriginal;
-}
-
-TraceDirect3D9::~TraceDirect3D9(void) {
-}
-
-HRESULT __stdcall TraceDirect3D9::QueryInterface(REFIID riid, void** ppvObj) {
-    *ppvObj = NULL;
-
-    // call this to increase AddRef at original object
-    // and to check if such an interface is there
-
-    HRESULT hRes = m_pIDirect3D9->QueryInterface(riid, ppvObj);
-
-    if (hRes == NOERROR) // if OK, send our "fake" address
-    {
-        *ppvObj = this;
-    }
-
-    return hRes;
-}
-
-ULONG __stdcall TraceDirect3D9::AddRef(void) {
-    return (m_pIDirect3D9->AddRef());
-}
-
-ULONG __stdcall TraceDirect3D9::Release(void) {
-    extern TraceDirect3D9* gl_pmyIDirect3D9;
-
-    // call original routine
-    ULONG count = m_pIDirect3D9->Release();
-
-    // in case no further Ref is there, the Original Object has deleted itself
-    // so do we here
-    if (count == 0) {
-        gl_pmyIDirect3D9 = NULL;
-        delete (this);
-    }
-
-    return (count);
-}
-
-HRESULT __stdcall TraceDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction) {
-    return (m_pIDirect3D9->RegisterSoftwareDevice(pInitializeFunction));
-}
-
-UINT __stdcall TraceDirect3D9::GetAdapterCount(void) {
-    return (m_pIDirect3D9->GetAdapterCount());
-}
-
-HRESULT __stdcall TraceDirect3D9::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) {
-    return (m_pIDirect3D9->GetAdapterIdentifier(Adapter, Flags, pIdentifier));
-}
-
-UINT __stdcall TraceDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) {
-    return (m_pIDirect3D9->GetAdapterModeCount(Adapter, Format));
-}
-
-HRESULT __stdcall TraceDirect3D9::EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) {
-    return (m_pIDirect3D9->EnumAdapterModes(Adapter, Format, Mode, pMode));
-}
-
-HRESULT __stdcall TraceDirect3D9::GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode) {
-    return (m_pIDirect3D9->GetAdapterDisplayMode(Adapter, pMode));
-}
-
-HRESULT __stdcall TraceDirect3D9::CheckDeviceType(UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) {
-    return (m_pIDirect3D9->CheckDeviceType(iAdapter, DevType, DisplayFormat, BackBufferFormat, bWindowed));
-}
-
-HRESULT __stdcall TraceDirect3D9::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) {
-    return (m_pIDirect3D9->CheckDeviceFormat(Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat));
-}
-
-HRESULT __stdcall TraceDirect3D9::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
-    return (m_pIDirect3D9->CheckDeviceMultiSampleType(Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType, pQualityLevels));
-}
-
-HRESULT __stdcall TraceDirect3D9::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
-    return (m_pIDirect3D9->CheckDepthStencilMatch(Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat));
-}
-
-HRESULT __stdcall TraceDirect3D9::CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) {
-    return (m_pIDirect3D9->CheckDeviceFormatConversion(Adapter, DeviceType, SourceFormat, TargetFormat));
-}
-
-HRESULT __stdcall TraceDirect3D9::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
-    return (m_pIDirect3D9->GetDeviceCaps(Adapter, DeviceType, pCaps));
-}
-
-HMONITOR __stdcall TraceDirect3D9::GetAdapterMonitor(UINT Adapter) {
-    return (m_pIDirect3D9->GetAdapterMonitor(Adapter));
-}
-
-HRESULT __stdcall TraceDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface) {
-    // global var
-    extern TraceDirect3DDevice9* gl_pmyIDirect3DDevice9;
-
-    // we intercept this call and provide our own "fake" Device Object
-    HRESULT hres = m_pIDirect3D9->CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface);
-
-    // Create our own Device object and store it in global pointer
-    // note: the object will delete itself once Ref count is zero (similar to COM objects)
-    gl_pmyIDirect3DDevice9 = new TraceDirect3DDevice9(*ppReturnedDeviceInterface);
-
-    // store our pointer (the fake one) for returning it to the calling progam
-    *ppReturnedDeviceInterface = gl_pmyIDirect3DDevice9;
-
-    return (hres);
-}
-
diff --git a/d3d9/idirect3d9.hpp b/d3d9/idirect3d9.hpp
deleted file mode 100644 (file)
index af67442..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-class TraceDirect3D9 : public IDirect3D9
-{
-public:
-    TraceDirect3D9(IDirect3D9 *pOriginal);
-    virtual ~TraceDirect3D9(void);
-
-    // The original DX9 function definitions
-       HRESULT  __stdcall QueryInterface(REFIID riid, void** ppvObj);
-    ULONG    __stdcall AddRef(void);
-       ULONG    __stdcall Release(void);
-    HRESULT  __stdcall RegisterSoftwareDevice(void* pInitializeFunction);
-       UINT     __stdcall GetAdapterCount(void);
-       HRESULT  __stdcall GetAdapterIdentifier(UINT Adapter,DWORD Flags,D3DADAPTER_IDENTIFIER9* pIdentifier) ;
-    UINT     __stdcall GetAdapterModeCount(UINT Adapter, D3DFORMAT Format);
-    HRESULT  __stdcall EnumAdapterModes(UINT Adapter,D3DFORMAT Format,UINT Mode,D3DDISPLAYMODE* pMode) ;
-    HRESULT  __stdcall GetAdapterDisplayMode( UINT Adapter,D3DDISPLAYMODE* pMode) ;
-    HRESULT  __stdcall CheckDeviceType(UINT iAdapter,D3DDEVTYPE DevType,D3DFORMAT DisplayFormat,D3DFORMAT BackBufferFormat,BOOL bWindowed) ;
-    HRESULT  __stdcall CheckDeviceFormat(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,DWORD Usage,D3DRESOURCETYPE RType,D3DFORMAT CheckFormat) ;
-    HRESULT  __stdcall CheckDeviceMultiSampleType(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SurfaceFormat,BOOL Windowed,D3DMULTISAMPLE_TYPE MultiSampleType,DWORD* pQualityLevels) ;
-    HRESULT  __stdcall CheckDepthStencilMatch(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT AdapterFormat,D3DFORMAT RenderTargetFormat,D3DFORMAT DepthStencilFormat) ;
-    HRESULT  __stdcall CheckDeviceFormatConversion(UINT Adapter,D3DDEVTYPE DeviceType,D3DFORMAT SourceFormat,D3DFORMAT TargetFormat);
-    HRESULT  __stdcall GetDeviceCaps(UINT Adapter,D3DDEVTYPE DeviceType,D3DCAPS9* pCaps) ;
-       HMONITOR __stdcall GetAdapterMonitor(UINT Adapter) ;
-       HRESULT  __stdcall CreateDevice(UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface) ;
-    // The original DX9 function definitions
-
-private:
-    IDirect3D9 *m_pIDirect3D9;
-};
diff --git a/d3d9/idirect3d_device9.cpp b/d3d9/idirect3d_device9.cpp
deleted file mode 100644 (file)
index bf209e0..0000000
+++ /dev/null
@@ -1,572 +0,0 @@
-#include "StdAfx.h"
-
-TraceDirect3DDevice9::TraceDirect3DDevice9(IDirect3DDevice9* pOriginal) {
-    m_pIDirect3DDevice9 = pOriginal; // store the pointer to original object
-}
-
-TraceDirect3DDevice9::~TraceDirect3DDevice9(void) {
-}
-
-HRESULT TraceDirect3DDevice9::QueryInterface(REFIID riid, void** ppvObj) {
-    // check if original dll can provide interface. then send *our* address
-    *ppvObj = NULL;
-
-    HRESULT hRes = m_pIDirect3DDevice9->QueryInterface(riid, ppvObj);
-
-    if (hRes == NOERROR) {
-        *ppvObj = this;
-    }
-
-    return hRes;
-}
-
-ULONG TraceDirect3DDevice9::AddRef(void) {
-    return (m_pIDirect3DDevice9->AddRef());
-}
-
-ULONG TraceDirect3DDevice9::Release(void) {
-    // ATTENTION: This is a booby-trap ! Watch out !
-    // If we create our own sprites, surfaces, etc. (thus increasing the ref counter
-    // by external action), we need to delete that objects before calling the original
-    // Release function        
-
-    // global var
-    extern TraceDirect3DDevice9* gl_pmyIDirect3DDevice9;
-
-    // release/delete own objects
-    // .....
-
-    // Calling original function now
-    ULONG count = m_pIDirect3DDevice9->Release();
-
-    if (count == 0) {
-        // now, the Original Object has deleted itself, so do we here
-        gl_pmyIDirect3DDevice9 = NULL;
-        delete (this); // destructor will be called automatically
-    }
-
-    return (count);
-}
-
-HRESULT TraceDirect3DDevice9::TestCooperativeLevel(void) {
-    return (m_pIDirect3DDevice9->TestCooperativeLevel());
-}
-
-UINT TraceDirect3DDevice9::GetAvailableTextureMem(void) {
-    return (m_pIDirect3DDevice9->GetAvailableTextureMem());
-}
-
-HRESULT TraceDirect3DDevice9::EvictManagedResources(void) {
-    return (m_pIDirect3DDevice9->EvictManagedResources());
-}
-
-HRESULT TraceDirect3DDevice9::GetDirect3D(IDirect3D9** ppD3D9) {
-    return (m_pIDirect3DDevice9->GetDirect3D(ppD3D9));
-}
-
-HRESULT TraceDirect3DDevice9::GetDeviceCaps(D3DCAPS9* pCaps) {
-    return (m_pIDirect3DDevice9->GetDeviceCaps(pCaps));
-}
-
-HRESULT TraceDirect3DDevice9::GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode) {
-    return (m_pIDirect3DDevice9->GetDisplayMode(iSwapChain, pMode));
-}
-
-HRESULT TraceDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters) {
-    return (m_pIDirect3DDevice9->GetCreationParameters(pParameters));
-}
-
-HRESULT TraceDirect3DDevice9::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) {
-    return (m_pIDirect3DDevice9->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap));
-}
-
-void TraceDirect3DDevice9::SetCursorPosition(int X, int Y, DWORD Flags) {
-    return (m_pIDirect3DDevice9->SetCursorPosition(X, Y, Flags));
-}
-
-BOOL TraceDirect3DDevice9::ShowCursor(BOOL bShow) {
-    return (m_pIDirect3DDevice9->ShowCursor(bShow));
-}
-
-HRESULT TraceDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) {
-    return (m_pIDirect3DDevice9->CreateAdditionalSwapChain(pPresentationParameters, pSwapChain));
-}
-
-HRESULT TraceDirect3DDevice9::GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) {
-    // global var
-    extern TraceDirect3DSwapChain9* gl_pmyIDirect3DSwapChain9;
-
-    // We only cover swapchain 0
-    if (iSwapChain != 0)
-        return (m_pIDirect3DDevice9->GetSwapChain(iSwapChain, pSwapChain));
-
-    if (gl_pmyIDirect3DSwapChain9) {
-        *pSwapChain = gl_pmyIDirect3DSwapChain9;
-        return (D3D_OK);
-    }
-
-    // we intercept this call and provide our own "fake" SwapChain Object
-    IDirect3DSwapChain9* pOriginal = NULL;
-    HRESULT hres = m_pIDirect3DDevice9->GetSwapChain(iSwapChain, &pOriginal);
-
-    // Create our own SwapChain object and store it in global pointer
-    // note: the object will delete itself once Ref count is zero (similar to COM objects)
-    gl_pmyIDirect3DSwapChain9
-            = new TraceDirect3DSwapChain9(pOriginal, m_pIDirect3DDevice9);
-
-    // store our pointer (the fake one) for returning it to the calling progam
-    *pSwapChain = gl_pmyIDirect3DSwapChain9;
-
-    return (hres);
-}
-
-UINT TraceDirect3DDevice9::GetNumberOfSwapChains(void) {
-    return (m_pIDirect3DDevice9->GetNumberOfSwapChains());
-}
-
-HRESULT TraceDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) {
-    return (m_pIDirect3DDevice9->Reset(pPresentationParameters));
-}
-
-HRESULT TraceDirect3DDevice9::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
-{
-    // we may want to draw own things here before flipping surfaces
-    // ... draw own stuff ...
-    this->ShowWeAreHere();
-
-    // call original routine
-    HRESULT hres = m_pIDirect3DDevice9->Present( pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
-
-    return (hres);
-}
-
-HRESULT TraceDirect3DDevice9::GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
-    return (m_pIDirect3DDevice9->GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer));
-}
-
-HRESULT TraceDirect3DDevice9::GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
-    return (m_pIDirect3DDevice9->GetRasterStatus(iSwapChain, pRasterStatus));
-}
-
-HRESULT TraceDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs) {
-    return (m_pIDirect3DDevice9->SetDialogBoxMode(bEnableDialogs));
-}
-
-void TraceDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp)
-{
-    return(m_pIDirect3DDevice9->SetGammaRamp(iSwapChain,Flags,pRamp));
-}
-
-void TraceDirect3DDevice9::GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp) {
-    return (m_pIDirect3DDevice9->GetGammaRamp(iSwapChain, pRamp));
-}
-
-HRESULT TraceDirect3DDevice9::CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateRenderTarget(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint)
-{
-    return(m_pIDirect3DDevice9->UpdateSurface(pSourceSurface,pSourceRect,pDestinationSurface,pDestPoint));
-}
-
-HRESULT TraceDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) {
-    return (m_pIDirect3DDevice9->UpdateTexture(pSourceTexture, pDestinationTexture));
-}
-
-HRESULT TraceDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) {
-    return (m_pIDirect3DDevice9->GetRenderTargetData(pRenderTarget, pDestSurface));
-}
-
-HRESULT TraceDirect3DDevice9::GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface) {
-    return (m_pIDirect3DDevice9->GetFrontBufferData(iSwapChain, pDestSurface));
-}
-
-HRESULT TraceDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter)
-{
-    return(m_pIDirect3DDevice9->StretchRect(pSourceSurface,pSourceRect,pDestSurface,pDestRect,Filter));
-}
-
-HRESULT TraceDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color)
-{
-    return(m_pIDirect3DDevice9->ColorFill(pSurface,pRect,color));
-}
-
-HRESULT TraceDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
-    return (m_pIDirect3DDevice9->CreateOffscreenPlainSurface(Width, Height, Format, Pool, ppSurface, pSharedHandle));
-}
-
-HRESULT TraceDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) {
-    return (m_pIDirect3DDevice9->SetRenderTarget(RenderTargetIndex, pRenderTarget));
-}
-
-HRESULT TraceDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) {
-    return (m_pIDirect3DDevice9->GetRenderTarget(RenderTargetIndex, ppRenderTarget));
-}
-
-HRESULT TraceDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) {
-    return (m_pIDirect3DDevice9->SetDepthStencilSurface(pNewZStencil));
-}
-
-HRESULT TraceDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) {
-    return (m_pIDirect3DDevice9->GetDepthStencilSurface(ppZStencilSurface));
-}
-
-HRESULT TraceDirect3DDevice9::BeginScene(void) {
-    return (m_pIDirect3DDevice9->BeginScene());
-}
-
-HRESULT TraceDirect3DDevice9::EndScene(void) {
-    return (m_pIDirect3DDevice9->EndScene());
-}
-
-HRESULT TraceDirect3DDevice9::Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil)
-{
-    return(m_pIDirect3DDevice9->Clear(Count,pRects,Flags,Color,Z,Stencil));
-}
-
-HRESULT TraceDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix)
-{
-    return(m_pIDirect3DDevice9->SetTransform(State,pMatrix));
-}
-
-HRESULT TraceDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) {
-    return (m_pIDirect3DDevice9->GetTransform(State, pMatrix));
-}
-
-HRESULT TraceDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix)
-{
-    return(m_pIDirect3DDevice9->MultiplyTransform(State,pMatrix));
-}
-
-HRESULT TraceDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport)
-{
-    return(m_pIDirect3DDevice9->SetViewport(pViewport));
-}
-
-HRESULT TraceDirect3DDevice9::GetViewport(D3DVIEWPORT9* pViewport) {
-    return (m_pIDirect3DDevice9->GetViewport(pViewport));
-}
-
-HRESULT TraceDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial)
-{
-    return(m_pIDirect3DDevice9->SetMaterial(pMaterial));
-}
-
-HRESULT TraceDirect3DDevice9::GetMaterial(D3DMATERIAL9* pMaterial) {
-    return (m_pIDirect3DDevice9->GetMaterial(pMaterial));
-}
-
-HRESULT TraceDirect3DDevice9::SetLight(DWORD Index,CONST D3DLIGHT9* pLight)
-{
-    return(m_pIDirect3DDevice9->SetLight(Index,pLight));
-}
-
-HRESULT TraceDirect3DDevice9::GetLight(DWORD Index, D3DLIGHT9* pLight) {
-    return (m_pIDirect3DDevice9->GetLight(Index, pLight));
-}
-
-HRESULT TraceDirect3DDevice9::LightEnable(DWORD Index, BOOL Enable) {
-    return (m_pIDirect3DDevice9->LightEnable(Index, Enable));
-}
-
-HRESULT TraceDirect3DDevice9::GetLightEnable(DWORD Index, BOOL* pEnable) {
-    return (m_pIDirect3DDevice9->GetLightEnable(Index, pEnable));
-}
-
-HRESULT TraceDirect3DDevice9::SetClipPlane(DWORD Index, CONST float* pPlane) {
-    return (m_pIDirect3DDevice9->SetClipPlane(Index, pPlane));
-}
-
-HRESULT TraceDirect3DDevice9::GetClipPlane(DWORD Index, float* pPlane) {
-    return (m_pIDirect3DDevice9->GetClipPlane(Index, pPlane));
-}
-
-HRESULT TraceDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value) {
-    return (m_pIDirect3DDevice9->SetRenderState(State, Value));
-}
-
-HRESULT TraceDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue) {
-    return (m_pIDirect3DDevice9->GetRenderState(State, pValue));
-}
-
-HRESULT TraceDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) {
-    return (m_pIDirect3DDevice9->CreateStateBlock(Type, ppSB));
-}
-
-HRESULT TraceDirect3DDevice9::BeginStateBlock(void) {
-    return (m_pIDirect3DDevice9->BeginStateBlock());
-}
-
-HRESULT TraceDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB) {
-    return (m_pIDirect3DDevice9->EndStateBlock(ppSB));
-}
-
-HRESULT TraceDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus)
-{
-    return(m_pIDirect3DDevice9->SetClipStatus(pClipStatus));
-}
-
-HRESULT TraceDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9* pClipStatus) {
-    return (m_pIDirect3DDevice9->GetClipStatus(pClipStatus));
-}
-
-HRESULT TraceDirect3DDevice9::GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture) {
-    return (m_pIDirect3DDevice9->GetTexture(Stage, ppTexture));
-}
-
-HRESULT TraceDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture) {
-    return (m_pIDirect3DDevice9->SetTexture(Stage, pTexture));
-}
-
-HRESULT TraceDirect3DDevice9::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
-    return (m_pIDirect3DDevice9->GetTextureStageState(Stage, Type, pValue));
-}
-
-HRESULT TraceDirect3DDevice9::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) {
-    return (m_pIDirect3DDevice9->SetTextureStageState(Stage, Type, Value));
-}
-
-HRESULT TraceDirect3DDevice9::GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) {
-    return (m_pIDirect3DDevice9->GetSamplerState(Sampler, Type, pValue));
-}
-
-HRESULT TraceDirect3DDevice9::SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) {
-    return (m_pIDirect3DDevice9->SetSamplerState(Sampler, Type, Value));
-}
-
-HRESULT TraceDirect3DDevice9::ValidateDevice(DWORD* pNumPasses) {
-    return (m_pIDirect3DDevice9->ValidateDevice(pNumPasses));
-}
-
-HRESULT TraceDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries)
-{
-    return(m_pIDirect3DDevice9->SetPaletteEntries(PaletteNumber, pEntries));
-}
-
-HRESULT TraceDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries) {
-    return (m_pIDirect3DDevice9->GetPaletteEntries(PaletteNumber, pEntries));
-}
-
-HRESULT TraceDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber) {
-    return (m_pIDirect3DDevice9->SetCurrentTexturePalette(PaletteNumber));
-}
-
-HRESULT TraceDirect3DDevice9::GetCurrentTexturePalette(UINT *PaletteNumber) {
-    return (m_pIDirect3DDevice9->GetCurrentTexturePalette(PaletteNumber));
-}
-
-HRESULT TraceDirect3DDevice9::SetScissorRect(CONST RECT* pRect)
-{
-    return(m_pIDirect3DDevice9->SetScissorRect( pRect));
-}
-
-HRESULT TraceDirect3DDevice9::GetScissorRect(RECT* pRect) {
-    return (m_pIDirect3DDevice9->GetScissorRect(pRect));
-}
-
-HRESULT TraceDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware) {
-    return (m_pIDirect3DDevice9->SetSoftwareVertexProcessing(bSoftware));
-}
-
-BOOL TraceDirect3DDevice9::GetSoftwareVertexProcessing(void) {
-    return (m_pIDirect3DDevice9->GetSoftwareVertexProcessing());
-}
-
-HRESULT TraceDirect3DDevice9::SetNPatchMode(float nSegments) {
-    return (m_pIDirect3DDevice9->SetNPatchMode(nSegments));
-}
-
-float TraceDirect3DDevice9::GetNPatchMode(void) {
-    return (m_pIDirect3DDevice9->GetNPatchMode());
-}
-
-HRESULT TraceDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) {
-    return (m_pIDirect3DDevice9->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount));
-}
-
-HRESULT TraceDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) {
-    return (m_pIDirect3DDevice9->DrawIndexedPrimitive(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount));
-}
-
-HRESULT TraceDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
-    return (m_pIDirect3DDevice9->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride));
-}
-
-HRESULT TraceDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
-    return (m_pIDirect3DDevice9->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride));
-}
-
-HRESULT TraceDirect3DDevice9::ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) {
-    return (m_pIDirect3DDevice9->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags));
-}
-
-HRESULT TraceDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl)
-{
-    return(m_pIDirect3DDevice9->CreateVertexDeclaration( pVertexElements,ppDecl));
-}
-
-HRESULT TraceDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) {
-    return (m_pIDirect3DDevice9->SetVertexDeclaration(pDecl));
-}
-
-HRESULT TraceDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) {
-    return (m_pIDirect3DDevice9->GetVertexDeclaration(ppDecl));
-}
-
-HRESULT TraceDirect3DDevice9::SetFVF(DWORD FVF) {
-    return (m_pIDirect3DDevice9->SetFVF(FVF));
-}
-
-HRESULT TraceDirect3DDevice9::GetFVF(DWORD* pFVF) {
-    return (m_pIDirect3DDevice9->GetFVF(pFVF));
-}
-
-HRESULT TraceDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader)
-{
-    return(m_pIDirect3DDevice9->CreateVertexShader(pFunction,ppShader));
-}
-
-HRESULT TraceDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) {
-    return (m_pIDirect3DDevice9->SetVertexShader(pShader));
-}
-
-HRESULT TraceDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader) {
-    return (m_pIDirect3DDevice9->GetVertexShader(ppShader));
-}
-
-HRESULT TraceDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
-    return (m_pIDirect3DDevice9->SetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount));
-}
-
-HRESULT TraceDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
-    return (m_pIDirect3DDevice9->GetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount));
-}
-
-HRESULT TraceDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
-    return (m_pIDirect3DDevice9->SetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount));
-}
-
-HRESULT TraceDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
-    return (m_pIDirect3DDevice9->GetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount));
-}
-
-HRESULT TraceDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount)
-{
-    return(m_pIDirect3DDevice9->SetVertexShaderConstantB(StartRegister,pConstantData,BoolCount));
-}
-
-HRESULT TraceDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
-    return (m_pIDirect3DDevice9->GetVertexShaderConstantB(StartRegister, pConstantData, BoolCount));
-}
-
-HRESULT TraceDirect3DDevice9::SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) {
-    return (m_pIDirect3DDevice9->SetStreamSource(StreamNumber, pStreamData, OffsetInBytes, Stride));
-}
-
-HRESULT TraceDirect3DDevice9::GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride) {
-    return (m_pIDirect3DDevice9->GetStreamSource(StreamNumber, ppStreamData, OffsetInBytes, pStride));
-}
-
-HRESULT TraceDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber, UINT Divider) {
-    return (m_pIDirect3DDevice9->SetStreamSourceFreq(StreamNumber, Divider));
-}
-
-HRESULT TraceDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber, UINT* Divider) {
-    return (m_pIDirect3DDevice9->GetStreamSourceFreq(StreamNumber, Divider));
-}
-
-HRESULT TraceDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) {
-    return (m_pIDirect3DDevice9->SetIndices(pIndexData));
-}
-
-HRESULT TraceDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData) {
-    return (m_pIDirect3DDevice9->GetIndices(ppIndexData));
-}
-
-HRESULT TraceDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader)
-{
-    return(m_pIDirect3DDevice9->CreatePixelShader(pFunction,ppShader));
-}
-
-HRESULT TraceDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) {
-    return (m_pIDirect3DDevice9->SetPixelShader(pShader));
-}
-
-HRESULT TraceDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader) {
-    return (m_pIDirect3DDevice9->GetPixelShader(ppShader));
-}
-
-HRESULT TraceDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
-    return (m_pIDirect3DDevice9->SetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount));
-}
-
-HRESULT TraceDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
-    return (m_pIDirect3DDevice9->GetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount));
-}
-
-HRESULT TraceDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
-    return (m_pIDirect3DDevice9->SetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount));
-}
-
-HRESULT TraceDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
-    return (m_pIDirect3DDevice9->GetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount));
-}
-
-HRESULT TraceDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount)
-{
-    return(m_pIDirect3DDevice9->SetPixelShaderConstantB(StartRegister,pConstantData,BoolCount));
-}
-
-HRESULT TraceDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
-    return (m_pIDirect3DDevice9->GetPixelShaderConstantB(StartRegister, pConstantData, BoolCount));
-}
-
-HRESULT TraceDirect3DDevice9::DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo)
-{
-    return(m_pIDirect3DDevice9->DrawRectPatch(Handle,pNumSegs, pRectPatchInfo));
-}
-
-HRESULT TraceDirect3DDevice9::DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo)
-{
-    return(m_pIDirect3DDevice9->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo));
-}
-
-HRESULT TraceDirect3DDevice9::DeletePatch(UINT Handle) {
-    return (m_pIDirect3DDevice9->DeletePatch(Handle));
-}
-
-HRESULT TraceDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) {
-    return (m_pIDirect3DDevice9->CreateQuery(Type, ppQuery));
-}
-
-// This is our test function
-void TraceDirect3DDevice9::ShowWeAreHere(void) {
-    D3DRECT rec = { 1, 1, 50, 50 };
-    m_pIDirect3DDevice9->Clear(1, &rec, D3DCLEAR_TARGET, D3DCOLOR_ARGB(255, 255, 255, 0), 0, 0);
-}
-
diff --git a/d3d9/idirect3d_device9.hpp b/d3d9/idirect3d_device9.hpp
deleted file mode 100644 (file)
index f17f0e3..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#pragma once
-
-class TraceDirect3DDevice9: public IDirect3DDevice9 {
-public:
-    TraceDirect3DDevice9(IDirect3DDevice9* pOriginal);
-    virtual ~TraceDirect3DDevice9(void);
-
-    // START: The original DX9 function definitions
-    HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
-    ULONG __stdcall AddRef(void);
-    ULONG __stdcall Release(void);
-    HRESULT __stdcall TestCooperativeLevel(void);
-    UINT __stdcall GetAvailableTextureMem(void);
-    HRESULT __stdcall EvictManagedResources(void);
-    HRESULT __stdcall GetDirect3D(IDirect3D9** ppD3D9);
-    HRESULT __stdcall GetDeviceCaps(D3DCAPS9* pCaps);
-    HRESULT __stdcall GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode);
-    HRESULT __stdcall GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters);
-    HRESULT __stdcall SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap);
-    void __stdcall SetCursorPosition(int X, int Y, DWORD Flags);
-    BOOL __stdcall ShowCursor(BOOL bShow);
-    HRESULT __stdcall CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain);
-    HRESULT __stdcall GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain);
-    UINT __stdcall GetNumberOfSwapChains(void);
-    HRESULT __stdcall Reset(D3DPRESENT_PARAMETERS* pPresentationParameters);
-    HRESULT __stdcall Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
-    HRESULT __stdcall GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer);
-    HRESULT __stdcall GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus);
-    HRESULT __stdcall SetDialogBoxMode(BOOL bEnableDialogs);
-    void __stdcall SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp);
-    void __stdcall GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp);
-    HRESULT __stdcall CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle);
-    HRESULT __stdcall CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle);
-    HRESULT __stdcall CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle);
-    HRESULT __stdcall CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle);
-    HRESULT __stdcall CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle);
-    HRESULT __stdcall CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
-    HRESULT __stdcall CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
-    HRESULT __stdcall UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint);
-    HRESULT __stdcall UpdateTexture(IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture);
-    HRESULT __stdcall GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface);
-    HRESULT __stdcall GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface);
-    HRESULT __stdcall StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter);
-    HRESULT __stdcall ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color);
-    HRESULT __stdcall CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle);
-    HRESULT __stdcall SetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget);
-    HRESULT __stdcall GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget);
-    HRESULT __stdcall SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil);
-    HRESULT __stdcall GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface);
-    HRESULT __stdcall BeginScene(void);
-    HRESULT __stdcall EndScene(void);
-    HRESULT __stdcall Clear(DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil);
-    HRESULT __stdcall SetTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix);
-    HRESULT __stdcall GetTransform(D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix);
-    HRESULT __stdcall MultiplyTransform(D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix);
-    HRESULT __stdcall SetViewport(CONST D3DVIEWPORT9* pViewport);
-    HRESULT __stdcall GetViewport(D3DVIEWPORT9* pViewport);
-    HRESULT __stdcall SetMaterial(CONST D3DMATERIAL9* pMaterial);
-    HRESULT __stdcall GetMaterial(D3DMATERIAL9* pMaterial);
-    HRESULT __stdcall SetLight(DWORD Index,CONST D3DLIGHT9* pLight);
-    HRESULT __stdcall GetLight(DWORD Index,D3DLIGHT9* pLight);
-    HRESULT __stdcall LightEnable(DWORD Index,BOOL Enable);
-    HRESULT __stdcall GetLightEnable(DWORD Index,BOOL* pEnable);
-    HRESULT __stdcall SetClipPlane(DWORD Index,CONST float* pPlane);
-    HRESULT __stdcall GetClipPlane(DWORD Index,float* pPlane);
-    HRESULT __stdcall SetRenderState(D3DRENDERSTATETYPE State,DWORD Value);
-    HRESULT __stdcall GetRenderState(D3DRENDERSTATETYPE State,DWORD* pValue);
-    HRESULT __stdcall CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB);
-    HRESULT __stdcall BeginStateBlock(void);
-    HRESULT __stdcall EndStateBlock(IDirect3DStateBlock9** ppSB);
-    HRESULT __stdcall SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus);
-    HRESULT __stdcall GetClipStatus(D3DCLIPSTATUS9* pClipStatus);
-    HRESULT __stdcall GetTexture(DWORD Stage,IDirect3DBaseTexture9** ppTexture);
-    HRESULT __stdcall SetTexture(DWORD Stage,IDirect3DBaseTexture9* pTexture);
-    HRESULT __stdcall GetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue);
-    HRESULT __stdcall SetTextureStageState(DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value);
-    HRESULT __stdcall GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue);
-    HRESULT __stdcall SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value);
-    HRESULT __stdcall ValidateDevice(DWORD* pNumPasses);
-    HRESULT __stdcall SetPaletteEntries(UINT PaletteNumber,CONST PALETTEENTRY* pEntries);
-    HRESULT __stdcall GetPaletteEntries(UINT PaletteNumber,PALETTEENTRY* pEntries);
-    HRESULT __stdcall SetCurrentTexturePalette(UINT PaletteNumber);
-    HRESULT __stdcall GetCurrentTexturePalette(UINT *PaletteNumber);
-    HRESULT __stdcall SetScissorRect(CONST RECT* pRect);
-    HRESULT __stdcall GetScissorRect( RECT* pRect);
-    HRESULT __stdcall SetSoftwareVertexProcessing(BOOL bSoftware);
-    BOOL __stdcall GetSoftwareVertexProcessing(void);
-    HRESULT __stdcall SetNPatchMode(float nSegments);
-    float __stdcall GetNPatchMode(void);
-    HRESULT __stdcall DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount);
-    HRESULT __stdcall DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
-    HRESULT __stdcall DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
-    HRESULT __stdcall DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
-    HRESULT __stdcall ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags);
-    HRESULT __stdcall CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl);
-    HRESULT __stdcall SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl);
-    HRESULT __stdcall GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl);
-    HRESULT __stdcall SetFVF(DWORD FVF);
-    HRESULT __stdcall GetFVF(DWORD* pFVF);
-    HRESULT __stdcall CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader);
-    HRESULT __stdcall SetVertexShader(IDirect3DVertexShader9* pShader);
-    HRESULT __stdcall GetVertexShader(IDirect3DVertexShader9** ppShader);
-    HRESULT __stdcall SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount);
-    HRESULT __stdcall GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount);
-    HRESULT __stdcall SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount);
-    HRESULT __stdcall GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount);
-    HRESULT __stdcall SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount);
-    HRESULT __stdcall GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
-    HRESULT __stdcall SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
-    HRESULT __stdcall GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride);
-    HRESULT __stdcall SetStreamSourceFreq(UINT StreamNumber,UINT Divider);
-    HRESULT __stdcall GetStreamSourceFreq(UINT StreamNumber,UINT* Divider);
-    HRESULT __stdcall SetIndices(IDirect3DIndexBuffer9* pIndexData);
-    HRESULT __stdcall GetIndices(IDirect3DIndexBuffer9** ppIndexData);
-    HRESULT __stdcall CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader);
-    HRESULT __stdcall SetPixelShader(IDirect3DPixelShader9* pShader);
-    HRESULT __stdcall GetPixelShader(IDirect3DPixelShader9** ppShader);
-    HRESULT __stdcall SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount);
-    HRESULT __stdcall GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount);
-    HRESULT __stdcall SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount);
-    HRESULT __stdcall GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount);
-    HRESULT __stdcall SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount);
-    HRESULT __stdcall GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount);
-    HRESULT __stdcall DrawRectPatch(UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
-    HRESULT __stdcall DrawTriPatch(UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
-    HRESULT __stdcall DeletePatch(UINT Handle);
-    HRESULT __stdcall CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery);
-    // END: The original DX9 function definitions
-
-private:
-    IDirect3DDevice9 *m_pIDirect3DDevice9;
-
-    // This is our test function
-    void ShowWeAreHere(void);
-};
diff --git a/d3d9/idirect3d_swapchain9.cpp b/d3d9/idirect3d_swapchain9.cpp
deleted file mode 100644 (file)
index 8e814c9..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#include "StdAfx.h"
-
-TraceDirect3DSwapChain9::TraceDirect3DSwapChain9(IDirect3DSwapChain9* pOriginal, IDirect3DDevice9* pDevice) {
-    m_pIDirect3DSwapChain9 = pOriginal; // store the pointer to original object
-    m_pIDirect3DDevice9 = pDevice;
-}
-
-TraceDirect3DSwapChain9::~TraceDirect3DSwapChain9(void) {
-    m_pIDirect3DSwapChain9 = NULL;
-}
-
-HRESULT TraceDirect3DSwapChain9::QueryInterface(REFIID riid, void** ppvObj) {
-    // check if original dll can provide interface. then send *our* address
-    *ppvObj = NULL;
-
-    HRESULT hRes = m_pIDirect3DSwapChain9->QueryInterface(riid, ppvObj);
-
-    if (hRes == NOERROR) {
-        *ppvObj = this;
-    }
-
-    return hRes;
-}
-
-ULONG TraceDirect3DSwapChain9::AddRef(void) {
-    return (m_pIDirect3DSwapChain9->AddRef());
-}
-
-ULONG TraceDirect3DSwapChain9::Release(void) {
-    // ATTENTION: This is a booby-trap ! Watch out !
-    // If we create our own sprites, surfaces, etc. (thus increasing the ref counter
-    // by external action), we need to delete that objects before calling the original
-    // Release function        
-
-    // global var
-    extern TraceDirect3DSwapChain9* gl_pmyIDirect3DSwapChain9;
-
-    // release/delete own objects
-    // .....
-
-    // Calling original function now
-    ULONG count = m_pIDirect3DSwapChain9->Release();
-
-    if (count == 0) {
-        // now, the Original Object has deleted itself, so do we here
-        gl_pmyIDirect3DSwapChain9 = NULL;
-        delete (this); // destructor will be called automatically
-    }
-
-    return (count);
-}
-
-HRESULT TraceDirect3DSwapChain9::Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags)
-{
-    // Some games use this one for presenting. They ignore the Device's present routine
-
-    // we may want to draw own things here before flipping surfaces
-    // ... draw own stuff ...
-    this->ShowWeAreHere();
-
-    // call original routine
-    HRESULT hres = m_pIDirect3DSwapChain9->Present(pSourceRect,pDestRect,hDestWindowOverride,pDirtyRegion,dwFlags);
-
-    return (hres);
-}
-
-HRESULT TraceDirect3DSwapChain9::GetFrontBufferData(IDirect3DSurface9* pDestSurface) {
-    return (m_pIDirect3DSwapChain9->GetFrontBufferData(pDestSurface));
-}
-
-HRESULT TraceDirect3DSwapChain9::GetBackBuffer(UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
-    return (m_pIDirect3DSwapChain9->GetBackBuffer(iBackBuffer, Type, ppBackBuffer));
-}
-
-HRESULT TraceDirect3DSwapChain9::GetRasterStatus(D3DRASTER_STATUS* pRasterStatus) {
-    return (m_pIDirect3DSwapChain9->GetRasterStatus(pRasterStatus));
-}
-
-HRESULT TraceDirect3DSwapChain9::GetDisplayMode(D3DDISPLAYMODE* pMode) {
-    return (m_pIDirect3DSwapChain9->GetDisplayMode(pMode));
-}
-
-HRESULT TraceDirect3DSwapChain9::GetDevice(IDirect3DDevice9** ppDevice) {
-    return (m_pIDirect3DSwapChain9->GetDevice(ppDevice));
-}
-
-HRESULT TraceDirect3DSwapChain9::GetPresentParameters(D3DPRESENT_PARAMETERS* pPresentationParameters) {
-    return (m_pIDirect3DSwapChain9->GetPresentParameters(pPresentationParameters));
-}
-
-// This is our test function
-void TraceDirect3DSwapChain9::ShowWeAreHere(void) {
-    D3DRECT rec = { 100, 1, 150, 50 };
-    m_pIDirect3DDevice9->Clear(1, &rec, D3DCLEAR_TARGET, D3DCOLOR_ARGB(255, 255, 255, 0), 0, 0);
-}
-
diff --git a/d3d9/idirect3d_swapchain9.hpp b/d3d9/idirect3d_swapchain9.hpp
deleted file mode 100644 (file)
index 36d08b2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma once
-
-class TraceDirect3DSwapChain9: public IDirect3DSwapChain9 {
-public:
-            TraceDirect3DSwapChain9(IDirect3DSwapChain9* pOriginal, IDirect3DDevice9* pDevice);
-    virtual ~TraceDirect3DSwapChain9(void);
-
-    // START: The original DX9 function definitions
-    HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObj);
-    ULONG __stdcall AddRef(void);
-    ULONG __stdcall Release(void);
-    HRESULT __stdcall Present(CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion,DWORD dwFlags);
-    HRESULT __stdcall GetFrontBufferData(IDirect3DSurface9* pDestSurface);
-    HRESULT __stdcall GetBackBuffer(UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer);
-    HRESULT __stdcall GetRasterStatus(D3DRASTER_STATUS* pRasterStatus);
-    HRESULT __stdcall GetDisplayMode(D3DDISPLAYMODE* pMode);
-    HRESULT __stdcall GetDevice(IDirect3DDevice9** ppDevice);
-    HRESULT __stdcall GetPresentParameters(D3DPRESENT_PARAMETERS* pPresentationParameters);
-    // END: The original DX9 function definitions
-
-private:
-    IDirect3DSwapChain9 *m_pIDirect3DSwapChain9;
-    IDirect3DDevice9 *m_pIDirect3DDevice9;
-
-    // This is our test function
-    void ShowWeAreHere(void);
-};
diff --git a/d3d9/stdafx.h b/d3d9/stdafx.h
deleted file mode 100644 (file)
index 610cc9d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// stdafx.h 
-#pragma once
-
-#include <windows.h>
-#include <tchar.h>
-
-#include <d3d9.h>
-
-#include "idirect3d9.hpp"
-#include "idirect3d_device9.hpp"
-#include "idirect3d_swapchain9.hpp"
diff --git a/d3d9caps.py b/d3d9caps.py
new file mode 100644 (file)
index 0000000..b43758b
--- /dev/null
@@ -0,0 +1,413 @@
+#############################################################################
+#
+# Copyright 2008 Jose Fonseca
+#
+# This program 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program.  If not, see <http://www.gnu.org/licenses/>.
+#
+#############################################################################
+
+"""d3d9caps.h"""
+
+from windows import *
+from d3d9types import *
+
+D3DVS20CAPS = Flags(DWORD, [
+    "D3DVS20CAPS_PREDICATION",
+])
+
+D3DVSHADERCAPS2_0 = Struct("D3DVSHADERCAPS2_0", [
+    (D3DVS20CAPS, "Caps"),
+    (INT, "DynamicFlowControlDepth"),
+    (INT, "NumTemps"),
+    (INT, "StaticFlowControlDepth"),
+])
+
+D3DPS20CAPS = Flags(DWORD, [
+    "D3DPS20CAPS_ARBITRARYSWIZZLE",
+    "D3DPS20CAPS_GRADIENTINSTRUCTIONS",
+    "D3DPS20CAPS_PREDICATION",
+    "D3DPS20CAPS_NODEPENDENTREADLIMIT",
+    "D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT",
+])
+
+D3DPSHADERCAPS2_0 = Struct("D3DPSHADERCAPS2_0", [
+    (D3DPS20CAPS, "Caps"),
+    (INT, "DynamicFlowControlDepth"),
+    (INT, "NumTemps"),
+    (INT, "StaticFlowControlDepth"),
+    (INT, "NumInstructionSlots"),
+])
+
+D3DCAPS = Flags(DWORD, [
+    "D3DCAPS_READ_SCANLINE",
+])
+
+D3DCAPS2 = Flags(DWORD, [
+    "D3DCAPS2_FULLSCREENGAMMA",
+    "D3DCAPS2_CANCALIBRATEGAMMA",
+    "D3DCAPS2_RESERVED",
+    "D3DCAPS2_CANMANAGERESOURCE",
+    "D3DCAPS2_DYNAMICTEXTURES",
+    "D3DCAPS2_CANAUTOGENMIPMAP",
+    "D3DCAPS2_CANSHARERESOURCE",
+])
+
+D3DCAPS3 = Flags(DWORD, [
+    "D3DCAPS3_RESERVED",
+    "D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD",
+    "D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION",
+    "D3DCAPS3_COPY_TO_VIDMEM",
+    "D3DCAPS3_COPY_TO_SYSTEMMEM",
+])
+
+
+D3DPRESENT_INTERVAL = Flags(DWORD, [
+    "D3DPRESENT_INTERVAL_DEFAULT",
+    "D3DPRESENT_INTERVAL_ONE",
+    "D3DPRESENT_INTERVAL_TWO",
+    "D3DPRESENT_INTERVAL_THREE",
+    "D3DPRESENT_INTERVAL_FOUR",
+    "D3DPRESENT_INTERVAL_IMMEDIATE",
+])
+
+D3DCURSORCAPS = Flags(DWORD, [
+    "D3DCURSORCAPS_COLOR",
+    "D3DCURSORCAPS_LOWRES",
+])
+
+D3DDEVCAPS = Flags(DWORD, [
+    "D3DDEVCAPS_EXECUTESYSTEMMEMORY",
+    "D3DDEVCAPS_EXECUTEVIDEOMEMORY",
+    "D3DDEVCAPS_TLVERTEXSYSTEMMEMORY",
+    "D3DDEVCAPS_TLVERTEXVIDEOMEMORY",
+    "D3DDEVCAPS_TEXTURESYSTEMMEMORY",
+    "D3DDEVCAPS_TEXTUREVIDEOMEMORY",
+    "D3DDEVCAPS_DRAWPRIMTLVERTEX",
+    "D3DDEVCAPS_CANRENDERAFTERFLIP",
+    "D3DDEVCAPS_TEXTURENONLOCALVIDMEM",
+    "D3DDEVCAPS_DRAWPRIMITIVES2",
+    "D3DDEVCAPS_SEPARATETEXTUREMEMORIES",
+    "D3DDEVCAPS_DRAWPRIMITIVES2EX",
+    "D3DDEVCAPS_HWTRANSFORMANDLIGHT",
+    "D3DDEVCAPS_CANBLTSYSTONONLOCAL",
+    "D3DDEVCAPS_HWRASTERIZATION",
+    "D3DDEVCAPS_PUREDEVICE",
+    "D3DDEVCAPS_QUINTICRTPATCHES",
+    "D3DDEVCAPS_RTPATCHES",
+    "D3DDEVCAPS_RTPATCHHANDLEZERO",
+    "D3DDEVCAPS_NPATCHES",
+])
+
+D3DPMISCCAPS = Flags(DWORD, [
+    "D3DPMISCCAPS_MASKZ",
+    "D3DPMISCCAPS_CULLNONE",
+    "D3DPMISCCAPS_CULLCW",
+    "D3DPMISCCAPS_CULLCCW",
+    "D3DPMISCCAPS_COLORWRITEENABLE",
+    "D3DPMISCCAPS_CLIPPLANESCALEDPOINTS",
+    "D3DPMISCCAPS_CLIPTLVERTS",
+    "D3DPMISCCAPS_TSSARGTEMP",
+    "D3DPMISCCAPS_BLENDOP",
+    "D3DPMISCCAPS_NULLREFERENCE",
+    "D3DPMISCCAPS_INDEPENDENTWRITEMASKS",
+    "D3DPMISCCAPS_PERSTAGECONSTANT",
+    "D3DPMISCCAPS_FOGANDSPECULARALPHA",
+    "D3DPMISCCAPS_SEPARATEALPHABLEND",
+    "D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS",
+    "D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING",
+    "D3DPMISCCAPS_FOGVERTEXCLAMPED",
+    "D3DPMISCCAPS_POSTBLENDSRGBCONVERT",
+])
+
+D3DLINECAPS = Flags(DWORD, [
+    "D3DLINECAPS_TEXTURE",
+    "D3DLINECAPS_ZTEST",
+    "D3DLINECAPS_BLEND",
+    "D3DLINECAPS_ALPHACMP",
+    "D3DLINECAPS_FOG",
+    "D3DLINECAPS_ANTIALIAS",
+])
+
+D3DPRASTERCAPS = Flags(DWORD, [
+    "D3DPRASTERCAPS_DITHER",
+    "D3DPRASTERCAPS_ZTEST",
+    "D3DPRASTERCAPS_FOGVERTEX",
+    "D3DPRASTERCAPS_FOGTABLE",
+    "D3DPRASTERCAPS_MIPMAPLODBIAS",
+    "D3DPRASTERCAPS_ZBUFFERLESSHSR",
+    "D3DPRASTERCAPS_FOGRANGE",
+    "D3DPRASTERCAPS_ANISOTROPY",
+    "D3DPRASTERCAPS_WBUFFER",
+    "D3DPRASTERCAPS_WFOG",
+    "D3DPRASTERCAPS_ZFOG",
+    "D3DPRASTERCAPS_COLORPERSPECTIVE",
+    "D3DPRASTERCAPS_SCISSORTEST",
+    "D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS",
+    "D3DPRASTERCAPS_DEPTHBIAS",
+    "D3DPRASTERCAPS_MULTISAMPLE_TOGGLE",
+])
+
+D3DPCMPCAPS = Flags(DWORD, [
+    "D3DPCMPCAPS_NEVER",
+    "D3DPCMPCAPS_LESS",
+    "D3DPCMPCAPS_EQUAL",
+    "D3DPCMPCAPS_LESSEQUAL",
+    "D3DPCMPCAPS_GREATER",
+    "D3DPCMPCAPS_NOTEQUAL",
+    "D3DPCMPCAPS_GREATEREQUAL",
+    "D3DPCMPCAPS_ALWAYS",
+])
+
+D3DPBLENDCAPS = Flags(DWORD, [
+    "D3DPBLENDCAPS_ZERO",
+    "D3DPBLENDCAPS_ONE",
+    "D3DPBLENDCAPS_SRCCOLOR",
+    "D3DPBLENDCAPS_INVSRCCOLOR",
+    "D3DPBLENDCAPS_SRCALPHA",
+    "D3DPBLENDCAPS_INVSRCALPHA",
+    "D3DPBLENDCAPS_DESTALPHA",
+    "D3DPBLENDCAPS_INVDESTALPHA",
+    "D3DPBLENDCAPS_DESTCOLOR",
+    "D3DPBLENDCAPS_INVDESTCOLOR",
+    "D3DPBLENDCAPS_SRCALPHASAT",
+    "D3DPBLENDCAPS_BOTHSRCALPHA",
+    "D3DPBLENDCAPS_BOTHINVSRCALPHA",
+    "D3DPBLENDCAPS_BLENDFACTOR",
+    "D3DPBLENDCAPS_SRCCOLOR2",
+    "D3DPBLENDCAPS_INVSRCCOLOR2",
+])
+
+D3DPSHADECAPS = Flags(DWORD, [
+    "D3DPSHADECAPS_COLORGOURAUDRGB",
+    "D3DPSHADECAPS_SPECULARGOURAUDRGB",
+    "D3DPSHADECAPS_ALPHAGOURAUDBLEND",
+    "D3DPSHADECAPS_FOGGOURAUD",
+])
+
+D3DPTEXTURECAPS = Flags(DWORD, [
+    "D3DPTEXTURECAPS_PERSPECTIVE",
+    "D3DPTEXTURECAPS_POW2",
+    "D3DPTEXTURECAPS_ALPHA",
+    "D3DPTEXTURECAPS_SQUAREONLY",
+    "D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE",
+    "D3DPTEXTURECAPS_ALPHAPALETTE",
+    "D3DPTEXTURECAPS_NONPOW2CONDITIONAL",
+    "D3DPTEXTURECAPS_PROJECTED",
+    "D3DPTEXTURECAPS_CUBEMAP",
+    "D3DPTEXTURECAPS_VOLUMEMAP",
+    "D3DPTEXTURECAPS_MIPMAP",
+    "D3DPTEXTURECAPS_MIPVOLUMEMAP",
+    "D3DPTEXTURECAPS_MIPCUBEMAP",
+    "D3DPTEXTURECAPS_CUBEMAP_POW2",
+    "D3DPTEXTURECAPS_VOLUMEMAP_POW2",
+    "D3DPTEXTURECAPS_NOPROJECTEDBUMPENV",
+])
+
+D3DPTFILTERCAPS = Flags(DWORD, [
+    "D3DPTFILTERCAPS_MINFPOINT",
+    "D3DPTFILTERCAPS_MINFLINEAR",
+    "D3DPTFILTERCAPS_MINFANISOTROPIC",
+    "D3DPTFILTERCAPS_MINFPYRAMIDALQUAD",
+    "D3DPTFILTERCAPS_MINFGAUSSIANQUAD",
+    "D3DPTFILTERCAPS_MIPFPOINT",
+    "D3DPTFILTERCAPS_MIPFLINEAR",
+    "D3DPTFILTERCAPS_CONVOLUTIONMONO",
+    "D3DPTFILTERCAPS_MAGFPOINT",
+    "D3DPTFILTERCAPS_MAGFLINEAR",
+    "D3DPTFILTERCAPS_MAGFANISOTROPIC",
+    "D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD",
+    "D3DPTFILTERCAPS_MAGFGAUSSIANQUAD",
+])
+
+D3DPTADDRESSCAPS = Flags(DWORD, [
+    "D3DPTADDRESSCAPS_WRAP",
+    "D3DPTADDRESSCAPS_MIRROR",
+    "D3DPTADDRESSCAPS_CLAMP",
+    "D3DPTADDRESSCAPS_BORDER",
+    "D3DPTADDRESSCAPS_INDEPENDENTUV",
+    "D3DPTADDRESSCAPS_MIRRORONCE",
+])
+
+D3DSTENCILCAPS = Flags(DWORD, [
+    "D3DSTENCILCAPS_KEEP",
+    "D3DSTENCILCAPS_ZERO",
+    "D3DSTENCILCAPS_REPLACE",
+    "D3DSTENCILCAPS_INCRSAT",
+    "D3DSTENCILCAPS_DECRSAT",
+    "D3DSTENCILCAPS_INVERT",
+    "D3DSTENCILCAPS_INCR",
+    "D3DSTENCILCAPS_DECR",
+    "D3DSTENCILCAPS_TWOSIDED",
+])
+
+D3DTEXOPCAPS = Flags(DWORD, [
+    "D3DTEXOPCAPS_DISABLE",
+    "D3DTEXOPCAPS_SELECTARG1",
+    "D3DTEXOPCAPS_SELECTARG2",
+    "D3DTEXOPCAPS_MODULATE",
+    "D3DTEXOPCAPS_MODULATE2X",
+    "D3DTEXOPCAPS_MODULATE4X",
+    "D3DTEXOPCAPS_ADD",
+    "D3DTEXOPCAPS_ADDSIGNED",
+    "D3DTEXOPCAPS_ADDSIGNED2X",
+    "D3DTEXOPCAPS_SUBTRACT",
+    "D3DTEXOPCAPS_ADDSMOOTH",
+    "D3DTEXOPCAPS_BLENDDIFFUSEALPHA",
+    "D3DTEXOPCAPS_BLENDTEXTUREALPHA",
+    "D3DTEXOPCAPS_BLENDFACTORALPHA",
+    "D3DTEXOPCAPS_BLENDTEXTUREALPHAPM",
+    "D3DTEXOPCAPS_BLENDCURRENTALPHA",
+    "D3DTEXOPCAPS_PREMODULATE",
+    "D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR",
+    "D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA",
+    "D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR",
+    "D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA",
+    "D3DTEXOPCAPS_BUMPENVMAP",
+    "D3DTEXOPCAPS_BUMPENVMAPLUMINANCE",
+    "D3DTEXOPCAPS_DOTPRODUCT3",
+    "D3DTEXOPCAPS_MULTIPLYADD",
+    "D3DTEXOPCAPS_LERP",
+])
+
+D3DFVFCAPS = Flags(DWORD, [
+    "D3DFVFCAPS_TEXCOORDCOUNTMASK",
+    "D3DFVFCAPS_DONOTSTRIPELEMENTS",
+    "D3DFVFCAPS_PSIZE",
+])
+
+D3DVTXPCAPS = Flags(DWORD, [
+    "D3DVTXPCAPS_TEXGEN",
+    "D3DVTXPCAPS_MATERIALSOURCE7",
+    "D3DVTXPCAPS_DIRECTIONALLIGHTS",
+    "D3DVTXPCAPS_POSITIONALLIGHTS",
+    "D3DVTXPCAPS_LOCALVIEWER",
+    "D3DVTXPCAPS_TWEENING",
+    "D3DVTXPCAPS_TEXGEN_SPHEREMAP",
+    "D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER",
+])
+
+D3DDEVCAPS2 = Flags(DWORD, [
+    "D3DDEVCAPS2_STREAMOFFSET",
+    "D3DDEVCAPS2_DMAPNPATCH",
+    "D3DDEVCAPS2_ADAPTIVETESSRTPATCH",
+    "D3DDEVCAPS2_ADAPTIVETESSNPATCH",
+    "D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES",
+    "D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH",
+    "D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET",
+])
+
+D3DDTCAPS = Flags(DWORD, [
+    "D3DDTCAPS_UBYTE4",
+    "D3DDTCAPS_UBYTE4N",
+    "D3DDTCAPS_SHORT2N",
+    "D3DDTCAPS_SHORT4N",
+    "D3DDTCAPS_USHORT2N",
+    "D3DDTCAPS_USHORT4N",
+    "D3DDTCAPS_UDEC3",
+    "D3DDTCAPS_DEC3N",
+    "D3DDTCAPS_FLOAT16_2",
+    "D3DDTCAPS_FLOAT16_4",
+])
+
+D3DPS_VERSION = Enum("DWORD", [
+    "D3DPS_VERSION(0,0)",
+    "D3DPS_VERSION(1,0)",
+    "D3DPS_VERSION(1,1)",
+    "D3DPS_VERSION(1,2)",
+    "D3DPS_VERSION(1,3)",
+    "D3DPS_VERSION(1,4)",
+    "D3DPS_VERSION(2,0)",
+    "D3DPS_VERSION(3,0)",
+])
+
+D3DVS_VERSION = Enum("DWORD", [
+    "D3DVS_VERSION(0,0)",
+    "D3DVS_VERSION(1,0)",
+    "D3DVS_VERSION(1,1)",
+    "D3DVS_VERSION(2,0)",
+    "D3DVS_VERSION(3,0)",
+])
+
+D3DCAPS9 = Struct("D3DCAPS9", [
+    (D3DDEVTYPE, "DeviceType"),
+    (UINT, "AdapterOrdinal"),
+    (D3DCAPS, "Caps"),
+    (D3DCAPS2, "Caps2"),
+    (D3DCAPS3, "Caps3"),
+    (D3DPRESENT_INTERVAL, "PresentationIntervals"),
+    (D3DCURSORCAPS, "CursorCaps"),
+    (D3DDEVCAPS, "DevCaps"),
+    (D3DPMISCCAPS, "PrimitiveMiscCaps"),
+    (D3DPRASTERCAPS, "RasterCaps"),
+    (D3DPCMPCAPS, "ZCmpCaps"),
+    (D3DPBLENDCAPS, "SrcBlendCaps"),
+    (D3DPBLENDCAPS, "DestBlendCaps"),
+    (D3DPCMPCAPS, "AlphaCmpCaps"),
+    (D3DPSHADECAPS, "ShadeCaps"),
+    (D3DPTEXTURECAPS, "TextureCaps"),
+    (D3DPTFILTERCAPS, "TextureFilterCaps"),
+    (D3DPTFILTERCAPS, "CubeTextureFilterCaps"),
+    (D3DPTFILTERCAPS, "VolumeTextureFilterCaps"),
+    (D3DPTADDRESSCAPS, "TextureAddressCaps"),
+    (D3DPTADDRESSCAPS, "VolumeTextureAddressCaps"),
+    (D3DLINECAPS, "LineCaps"),
+    (DWORD, "MaxTextureWidth"),
+    (DWORD, "MaxTextureHeight"),
+    (DWORD, "MaxVolumeExtent"),
+    (DWORD, "MaxTextureRepeat"),
+    (DWORD, "MaxTextureAspectRatio"),
+    (DWORD, "MaxAnisotropy"),
+    (Float, "MaxVertexW"),
+    (Float, "GuardBandLeft"),
+    (Float, "GuardBandTop"),
+    (Float, "GuardBandRight"),
+    (Float, "GuardBandBottom"),
+    (Float, "ExtentsAdjust"),
+    (D3DSTENCILCAPS, "StencilCaps"),
+    (D3DFVFCAPS, "FVFCaps"),
+    (D3DTEXOPCAPS, "TextureOpCaps"),
+    (DWORD, "MaxTextureBlendStages"),
+    (DWORD, "MaxSimultaneousTextures"),
+    (D3DVTXPCAPS, "VertexProcessingCaps"),
+    (DWORD, "MaxActiveLights"),
+    (DWORD, "MaxUserClipPlanes"),
+    (DWORD, "MaxVertexBlendMatrices"),
+    (DWORD, "MaxVertexBlendMatrixIndex"),
+    (Float, "MaxPointSize"),
+    (DWORD, "MaxPrimitiveCount"),
+    (DWORD, "MaxVertexIndex"),
+    (DWORD, "MaxStreams"),
+    (DWORD, "MaxStreamStride"),
+    (D3DVS_VERSION, "VertexShaderVersion"),
+    (DWORD, "MaxVertexShaderConst"),
+    (D3DPS_VERSION, "PixelShaderVersion"),
+    (Float, "PixelShader1xMaxValue"),
+    (D3DDEVCAPS2, "DevCaps2"),
+    (Float, "MaxNpatchTessellationLevel"),
+    (DWORD, "Reserved5"),
+    (UINT, "MasterAdapterOrdinal"),
+    (UINT, "AdapterOrdinalInGroup"),
+    (UINT, "NumberOfAdaptersInGroup"),
+    (D3DDTCAPS, "DeclTypes"),
+    (DWORD, "NumSimultaneousRTs"),
+    (D3DPTFILTERCAPS, "StretchRectFilterCaps"),
+    (D3DVSHADERCAPS2_0, "VS20Caps"),
+    (D3DPSHADERCAPS2_0, "PS20Caps"),
+    (D3DPTFILTERCAPS, "VertexTextureFilterCaps"),
+    (DWORD, "MaxVShaderInstructionsExecuted"),
+    (DWORD, "MaxPShaderInstructionsExecuted"),
+    (DWORD, "MaxVertexShader30InstructionSlots"),
+    (DWORD, "MaxPixelShader30InstructionSlots"),
+])
+
diff --git a/d3d9types.py b/d3d9types.py
new file mode 100644 (file)
index 0000000..a8ac525
--- /dev/null
@@ -0,0 +1,1349 @@
+#############################################################################
+#
+# Copyright 2008 Jose Fonseca
+#
+# This program 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 program.  If not, see <http://www.gnu.org/licenses/>.
+#
+#############################################################################
+
+"""d3d9types.h"""
+
+from windows import *
+
+D3DCOLOR = Alias("D3DCOLOR", DWORD)
+
+D3DVECTOR = Struct("D3DVECTOR", [
+    (Float, "x"),
+    (Float, "y"),
+    (Float, "z"),
+])
+
+D3DCOLORVALUE = Struct("D3DCOLORVALUE", [
+    (Float, "r"),
+    (Float, "g"),
+    (Float, "b"),
+    (Float, "a"),
+])
+
+D3DRECT = Struct("D3DRECT", [
+    (LONG, "x1"),
+    (LONG, "y1"),
+    (LONG, "x2"),
+    (LONG, "y2"),
+])
+
+D3DMATRIX = Struct("D3DMATRIX", [
+    (Float, "m[4][4]"),
+])
+
+D3DVIEWPORT9 = Struct("D3DVIEWPORT9", [
+    (DWORD, "X"),
+    (DWORD, "Y"),
+    (DWORD, "Width"),
+    (DWORD, "Height"),
+    (Float, "MinZ"),
+    (Float, "MaxZ"),
+])
+
+D3DCLIP = Flags(DWORD, [
+    "D3DCLIPPLANE0",
+    "D3DCLIPPLANE1",
+    "D3DCLIPPLANE2",
+    "D3DCLIPPLANE3",
+    "D3DCLIPPLANE4",
+    "D3DCLIPPLANE5",
+])
+
+D3DCS = Flags(DWORD, [
+    "D3DCS_ALL",
+    "D3DCS_LEFT",
+    "D3DCS_RIGHT",
+    "D3DCS_TOP",
+    "D3DCS_BOTTOM",
+    "D3DCS_FRONT",
+    "D3DCS_BACK",
+    "D3DCS_PLANE0",
+    "D3DCS_PLANE1",
+    "D3DCS_PLANE2",
+    "D3DCS_PLANE3",
+    "D3DCS_PLANE4",
+    "D3DCS_PLANE5",
+])
+
+D3DCLIPSTATUS9 = Struct("D3DCLIPSTATUS9", [
+    (DWORD, "ClipUnion"),
+    (DWORD, "ClipIntersection"),
+])
+
+D3DMATERIAL9 = Struct("D3DMATERIAL9", [
+    (D3DCOLORVALUE, "Diffuse"),
+    (D3DCOLORVALUE, "Ambient"),
+    (D3DCOLORVALUE, "Specular"),
+    (D3DCOLORVALUE, "Emissive"),
+    (Float, "Power"),
+])
+
+D3DLIGHTTYPE = Enum("D3DLIGHTTYPE", [
+    "D3DLIGHT_POINT",
+    "D3DLIGHT_SPOT",
+    "D3DLIGHT_DIRECTIONAL",
+    "D3DLIGHT_FORCE_DWORD",
+])
+
+D3DLIGHT9 = 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"),
+])
+
+D3DCS = Flags(DWORD, [
+    "D3DCLEAR_TARGET",
+    "D3DCLEAR_ZBUFFER",
+    "D3DCLEAR_STENCIL",
+])
+
+D3DSHADEMODE = Enum("D3DSHADEMODE", [
+    "D3DSHADE_FLAT",
+    "D3DSHADE_GOURAUD",
+    "D3DSHADE_PHONG",
+    "D3DSHADE_FORCE_DWORD",
+])
+
+D3DFILLMODE = Enum("D3DFILLMODE", [
+    "D3DFILL_POINT",
+    "D3DFILL_WIREFRAME",
+    "D3DFILL_SOLID",
+    "D3DFILL_FORCE_DWORD",
+])
+
+D3DBLEND = Enum("D3DBLEND", [
+    "D3DBLEND_ZERO",
+    "D3DBLEND_ONE",
+    "D3DBLEND_SRCCOLOR",
+    "D3DBLEND_INVSRCCOLOR",
+    "D3DBLEND_SRCALPHA",
+    "D3DBLEND_INVSRCALPHA",
+    "D3DBLEND_DESTALPHA",
+    "D3DBLEND_INVDESTALPHA",
+    "D3DBLEND_DESTCOLOR",
+    "D3DBLEND_INVDESTCOLOR",
+    "D3DBLEND_SRCALPHASAT",
+    "D3DBLEND_BOTHSRCALPHA",
+    "D3DBLEND_BOTHINVSRCALPHA",
+    "D3DBLEND_BLENDFACTOR",
+    "D3DBLEND_INVBLENDFACTOR",
+    "D3DBLEND_SRCCOLOR2",
+    "D3DBLEND_INVSRCCOLOR2",
+    "D3DBLEND_FORCE_DWORD",
+])
+
+D3DBLENDOP = Enum("D3DBLENDOP", [
+    "D3DBLENDOP_ADD",
+    "D3DBLENDOP_SUBTRACT",
+    "D3DBLENDOP_REVSUBTRACT",
+    "D3DBLENDOP_MIN",
+    "D3DBLENDOP_MAX",
+    "D3DBLENDOP_FORCE_DWORD",
+])
+
+D3DTEXTUREADDRESS = Enum("D3DTEXTUREADDRESS", [
+    "D3DTADDRESS_WRAP",
+    "D3DTADDRESS_MIRROR",
+    "D3DTADDRESS_CLAMP",
+    "D3DTADDRESS_BORDER",
+    "D3DTADDRESS_MIRRORONCE",
+    "D3DTADDRESS_FORCE_DWORD",
+])
+
+D3DCULL = Enum("D3DCULL", [
+    "D3DCULL_NONE",
+    "D3DCULL_CW",
+    "D3DCULL_CCW",
+    "D3DCULL_FORCE_DWORD",
+])
+
+D3DCMPFUNC = Enum("D3DCMPFUNC", [
+    "D3DCMP_NEVER",
+    "D3DCMP_LESS",
+    "D3DCMP_EQUAL",
+    "D3DCMP_LESSEQUAL",
+    "D3DCMP_GREATER",
+    "D3DCMP_NOTEQUAL",
+    "D3DCMP_GREATEREQUAL",
+    "D3DCMP_ALWAYS",
+    "D3DCMP_FORCE_DWORD",
+])
+
+D3DSTENCILOP = Enum("D3DSTENCILOP", [
+    "D3DSTENCILOP_KEEP",
+    "D3DSTENCILOP_ZERO",
+    "D3DSTENCILOP_REPLACE",
+    "D3DSTENCILOP_INCRSAT",
+    "D3DSTENCILOP_DECRSAT",
+    "D3DSTENCILOP_INVERT",
+    "D3DSTENCILOP_INCR",
+    "D3DSTENCILOP_DECR",
+    "D3DSTENCILOP_FORCE_DWORD",
+])
+
+D3DFOGMODE = Enum("D3DFOGMODE", [
+    "D3DFOG_NONE",
+    "D3DFOG_EXP",
+    "D3DFOG_EXP2",
+    "D3DFOG_LINEAR",
+    "D3DFOG_FORCE_DWORD",
+])
+
+D3DZBUFFERTYPE = Enum("D3DZBUFFERTYPE", [
+    "D3DZB_FALSE",
+    "D3DZB_TRUE",
+    "D3DZB_USEW",
+    "D3DZB_FORCE_DWORD",
+])
+
+D3DPRIMITIVETYPE = Enum("D3DPRIMITIVETYPE", [
+    "D3DPT_POINTLIST",
+    "D3DPT_LINELIST",
+    "D3DPT_LINESTRIP",
+    "D3DPT_TRIANGLELIST",
+    "D3DPT_TRIANGLESTRIP",
+    "D3DPT_TRIANGLEFAN",
+    "D3DPT_FORCE_DWORD",
+])
+
+D3DTRANSFORMSTATETYPE = Enum("D3DTRANSFORMSTATETYPE", [
+    "D3DTS_VIEW",
+    "D3DTS_PROJECTION",
+    "D3DTS_TEXTURE0",
+    "D3DTS_TEXTURE1",
+    "D3DTS_TEXTURE2",
+    "D3DTS_TEXTURE3",
+    "D3DTS_TEXTURE4",
+    "D3DTS_TEXTURE5",
+    "D3DTS_TEXTURE6",
+    "D3DTS_TEXTURE7",
+    "D3DTS_FORCE_DWORD",
+])
+
+D3DTS = Flags(DWORD, [
+    "D3DTS_WORLDMATRIX(index)",
+    "D3DTS_WORLD",
+    "D3DTS_WORLD1",
+    "D3DTS_WORLD2",
+    "D3DTS_WORLD3",
+])
+
+D3DRENDERSTATETYPE = Enum("D3DRENDERSTATETYPE", [
+    "D3DRS_ZENABLE",
+    "D3DRS_FILLMODE",
+    "D3DRS_SHADEMODE",
+    "D3DRS_ZWRITEENABLE",
+    "D3DRS_ALPHATESTENABLE",
+    "D3DRS_LASTPIXEL",
+    "D3DRS_SRCBLEND",
+    "D3DRS_DESTBLEND",
+    "D3DRS_CULLMODE",
+    "D3DRS_ZFUNC",
+    "D3DRS_ALPHAREF",
+    "D3DRS_ALPHAFUNC",
+    "D3DRS_DITHERENABLE",
+    "D3DRS_ALPHABLENDENABLE",
+    "D3DRS_FOGENABLE",
+    "D3DRS_SPECULARENABLE",
+    "D3DRS_FOGCOLOR",
+    "D3DRS_FOGTABLEMODE",
+    "D3DRS_FOGSTART",
+    "D3DRS_FOGEND",
+    "D3DRS_FOGDENSITY",
+    "D3DRS_RANGEFOGENABLE",
+    "D3DRS_STENCILENABLE",
+    "D3DRS_STENCILFAIL",
+    "D3DRS_STENCILZFAIL",
+    "D3DRS_STENCILPASS",
+    "D3DRS_STENCILFUNC",
+    "D3DRS_STENCILREF",
+    "D3DRS_STENCILMASK",
+    "D3DRS_STENCILWRITEMASK",
+    "D3DRS_TEXTUREFACTOR",
+    "D3DRS_WRAP0",
+    "D3DRS_WRAP1",
+    "D3DRS_WRAP2",
+    "D3DRS_WRAP3",
+    "D3DRS_WRAP4",
+    "D3DRS_WRAP5",
+    "D3DRS_WRAP6",
+    "D3DRS_WRAP7",
+    "D3DRS_CLIPPING",
+    "D3DRS_LIGHTING",
+    "D3DRS_AMBIENT",
+    "D3DRS_FOGVERTEXMODE",
+    "D3DRS_COLORVERTEX",
+    "D3DRS_LOCALVIEWER",
+    "D3DRS_NORMALIZENORMALS",
+    "D3DRS_DIFFUSEMATERIALSOURCE",
+    "D3DRS_SPECULARMATERIALSOURCE",
+    "D3DRS_AMBIENTMATERIALSOURCE",
+    "D3DRS_EMISSIVEMATERIALSOURCE",
+    "D3DRS_VERTEXBLEND",
+    "D3DRS_CLIPPLANEENABLE",
+    "D3DRS_POINTSIZE",
+    "D3DRS_POINTSIZE_MIN",
+    "D3DRS_POINTSPRITEENABLE",
+    "D3DRS_POINTSCALEENABLE",
+    "D3DRS_POINTSCALE_A",
+    "D3DRS_POINTSCALE_B",
+    "D3DRS_POINTSCALE_C",
+    "D3DRS_MULTISAMPLEANTIALIAS",
+    "D3DRS_MULTISAMPLEMASK",
+    "D3DRS_PATCHEDGESTYLE",
+    "D3DRS_DEBUGMONITORTOKEN",
+    "D3DRS_POINTSIZE_MAX",
+    "D3DRS_INDEXEDVERTEXBLENDENABLE",
+    "D3DRS_COLORWRITEENABLE",
+    "D3DRS_TWEENFACTOR",
+    "D3DRS_BLENDOP",
+    "D3DRS_POSITIONDEGREE",
+    "D3DRS_NORMALDEGREE",
+    "D3DRS_SCISSORTESTENABLE",
+    "D3DRS_SLOPESCALEDEPTHBIAS",
+    "D3DRS_ANTIALIASEDLINEENABLE",
+    "D3DRS_MINTESSELLATIONLEVEL",
+    "D3DRS_MAXTESSELLATIONLEVEL",
+    "D3DRS_ADAPTIVETESS_X",
+    "D3DRS_ADAPTIVETESS_Y",
+    "D3DRS_ADAPTIVETESS_Z",
+    "D3DRS_ADAPTIVETESS_W",
+    "D3DRS_ENABLEADAPTIVETESSELLATION",
+    "D3DRS_TWOSIDEDSTENCILMODE",
+    "D3DRS_CCW_STENCILFAIL",
+    "D3DRS_CCW_STENCILZFAIL",
+    "D3DRS_CCW_STENCILPASS",
+    "D3DRS_CCW_STENCILFUNC",
+    "D3DRS_COLORWRITEENABLE1",
+    "D3DRS_COLORWRITEENABLE2",
+    "D3DRS_COLORWRITEENABLE3",
+    "D3DRS_BLENDFACTOR",
+    "D3DRS_SRGBWRITEENABLE",
+    "D3DRS_DEPTHBIAS",
+    "D3DRS_WRAP8",
+    "D3DRS_WRAP9",
+    "D3DRS_WRAP10",
+    "D3DRS_WRAP11",
+    "D3DRS_WRAP12",
+    "D3DRS_WRAP13",
+    "D3DRS_WRAP14",
+    "D3DRS_WRAP15",
+    "D3DRS_SEPARATEALPHABLENDENABLE",
+    "D3DRS_SRCBLENDALPHA",
+    "D3DRS_DESTBLENDALPHA",
+    "D3DRS_BLENDOPALPHA",
+    "D3DRS_FORCE_DWORD",
+])
+
+D3DMATERIALCOLORSOURCE = Enum("D3DMATERIALCOLORSOURCE", [
+    "D3DMCS_MATERIAL",
+    "D3DMCS_COLOR1",
+    "D3DMCS_COLOR2",
+    "D3DMCS_FORCE_DWORD",
+])
+
+D3DWRAP = Flags(DWORD, [
+    "D3DWRAP_U",
+    "D3DWRAP_V",
+    "D3DWRAP_W",
+])
+
+D3DWRAPCOORD = Flags(DWORD, [
+    "D3DWRAPCOORD_0",
+    "D3DWRAPCOORD_1",
+    "D3DWRAPCOORD_2",
+    "D3DWRAPCOORD_3",
+])
+
+D3DCOLORWRITEENABLE = Flags(DWORD, [
+    "D3DCOLORWRITEENABLE_RED",
+    "D3DCOLORWRITEENABLE_GREEN",
+    "D3DCOLORWRITEENABLE_BLUE",
+    "D3DCOLORWRITEENABLE_ALPHA",
+])
+
+D3DTEXTURESTAGESTATETYPE = Enum("D3DTEXTURESTAGESTATETYPE", [
+    "D3DTSS_COLOROP",
+    "D3DTSS_COLORARG1",
+    "D3DTSS_COLORARG2",
+    "D3DTSS_ALPHAOP",
+    "D3DTSS_ALPHAARG1",
+    "D3DTSS_ALPHAARG2",
+    "D3DTSS_BUMPENVMAT00",
+    "D3DTSS_BUMPENVMAT01",
+    "D3DTSS_BUMPENVMAT10",
+    "D3DTSS_BUMPENVMAT11",
+    "D3DTSS_TEXCOORDINDEX",
+    "D3DTSS_BUMPENVLSCALE",
+    "D3DTSS_BUMPENVLOFFSET",
+    "D3DTSS_TEXTURETRANSFORMFLAGS",
+    "D3DTSS_COLORARG0",
+    "D3DTSS_ALPHAARG0",
+    "D3DTSS_RESULTARG",
+    "D3DTSS_CONSTANT",
+    "D3DTSS_FORCE_DWORD",
+])
+
+D3DSAMPLERSTATETYPE = Enum("D3DSAMPLERSTATETYPE", [
+
+    "D3DSAMP_ADDRESSU",
+    "D3DSAMP_ADDRESSV",
+    "D3DSAMP_ADDRESSW",
+    "D3DSAMP_BORDERCOLOR",
+    "D3DSAMP_MAGFILTER",
+    "D3DSAMP_MINFILTER",
+    "D3DSAMP_MIPFILTER",
+    "D3DSAMP_MIPMAPLODBIAS",
+    "D3DSAMP_MAXMIPLEVEL",
+    "D3DSAMP_MAXANISOTROPY",
+    "D3DSAMP_SRGBTEXTURE",
+    "D3DSAMP_ELEMENTINDEX",
+    "D3DSAMP_DMAPOFFSET",
+    "D3DSAMP_FORCE_DWORD",
+])
+
+D3DTSS = Flags(DWORD, [
+    "D3DTSS_TCI_PASSTHRU",
+    "D3DTSS_TCI_CAMERASPACENORMAL",
+    "D3DTSS_TCI_CAMERASPACEPOSITION",
+    "D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR",
+    "D3DTSS_TCI_SPHEREMAP",
+])
+
+D3DTEXTUREOP = Enum("D3DTEXTUREOP", [
+    "D3DTOP_DISABLE",
+    "D3DTOP_SELECTARG1",
+    "D3DTOP_SELECTARG2",
+    "D3DTOP_MODULATE",
+    "D3DTOP_MODULATE2X",
+    "D3DTOP_MODULATE4X",
+    "D3DTOP_ADD",
+    "D3DTOP_ADDSIGNED",
+    "D3DTOP_ADDSIGNED2X",
+    "D3DTOP_SUBTRACT",
+    "D3DTOP_ADDSMOOTH",
+    "D3DTOP_BLENDDIFFUSEALPHA",
+    "D3DTOP_BLENDTEXTUREALPHA",
+    "D3DTOP_BLENDFACTORALPHA",
+    "D3DTOP_BLENDTEXTUREALPHAPM",
+    "D3DTOP_BLENDCURRENTALPHA",
+    "D3DTOP_PREMODULATE",
+    "D3DTOP_MODULATEALPHA_ADDCOLOR",
+    "D3DTOP_MODULATECOLOR_ADDALPHA",
+    "D3DTOP_MODULATEINVALPHA_ADDCOLOR",
+    "D3DTOP_MODULATEINVCOLOR_ADDALPHA",
+    "D3DTOP_BUMPENVMAP",
+    "D3DTOP_BUMPENVMAPLUMINANCE",
+    "D3DTOP_DOTPRODUCT3",
+    "D3DTOP_MULTIPLYADD",
+    "D3DTOP_LERP",
+    "D3DTOP_FORCE_DWORD",
+])
+
+D3DTA = Flags(DWORD, [
+    "D3DTA_SELECTMASK",
+    "D3DTA_DIFFUSE",
+    "D3DTA_CURRENT",
+    "D3DTA_TEXTURE",
+    "D3DTA_TFACTOR",
+    "D3DTA_SPECULAR",
+    "D3DTA_TEMP",
+    "D3DTA_CONSTANT",
+    "D3DTA_COMPLEMENT",
+    "D3DTA_ALPHAREPLICATE",
+])
+
+D3DTEXTUREFILTERTYPE = Enum("D3DTEXTUREFILTERTYPE", [
+    "D3DTEXF_NONE",
+    "D3DTEXF_POINT",
+    "D3DTEXF_LINEAR",
+    "D3DTEXF_ANISOTROPIC",
+    "D3DTEXF_PYRAMIDALQUAD",
+    "D3DTEXF_GAUSSIANQUAD",
+    "D3DTEXF_CONVOLUTIONMONO",
+    "D3DTEXF_FORCE_DWORD",
+])
+
+D3DPV = Flags(DWORD, [
+    "D3DPV_DONOTCOPYDATA",
+])
+
+D3DFVF = Flags(DWORD, [
+    "D3DFVF_RESERVED0",
+    "D3DFVF_POSITION_MASK",
+    "D3DFVF_XYZ",
+    "D3DFVF_XYZRHW",
+    "D3DFVF_XYZB1",
+    "D3DFVF_XYZB2",
+    "D3DFVF_XYZB3",
+    "D3DFVF_XYZB4",
+    "D3DFVF_XYZB5",
+    "D3DFVF_XYZW",
+    "D3DFVF_NORMAL",
+    "D3DFVF_PSIZE",
+    "D3DFVF_DIFFUSE",
+    "D3DFVF_SPECULAR",
+    "D3DFVF_TEXCOUNT_MASK",
+    "D3DFVF_TEXCOUNT_SHIFT",
+    "D3DFVF_TEX0",
+    "D3DFVF_TEX1",
+    "D3DFVF_TEX2",
+    "D3DFVF_TEX3",
+    "D3DFVF_TEX4",
+    "D3DFVF_TEX5",
+    "D3DFVF_TEX6",
+    "D3DFVF_TEX7",
+    "D3DFVF_TEX8",
+    "D3DFVF_LASTBETA_UBYTE4",
+    "D3DFVF_LASTBETA_D3DCOLOR",
+    "D3DFVF_RESERVED2",
+    "D3DFVF_TEXCOORDSIZE3(0)",
+    "D3DFVF_TEXCOORDSIZE2(0)",
+    "D3DFVF_TEXCOORDSIZE4(0)",
+    "D3DFVF_TEXCOORDSIZE1(0)",
+    "D3DFVF_TEXCOORDSIZE3(1)",
+    "D3DFVF_TEXCOORDSIZE2(1)",
+    "D3DFVF_TEXCOORDSIZE4(1)",
+    "D3DFVF_TEXCOORDSIZE1(1)",
+    "D3DFVF_TEXCOORDSIZE3(2)",
+    "D3DFVF_TEXCOORDSIZE2(2)",
+    "D3DFVF_TEXCOORDSIZE4(2)",
+    "D3DFVF_TEXCOORDSIZE1(2)",
+    "D3DFVF_TEXCOORDSIZE3(3)",
+    "D3DFVF_TEXCOORDSIZE2(3)",
+    "D3DFVF_TEXCOORDSIZE4(3)",
+    "D3DFVF_TEXCOORDSIZE1(3)",
+])
+
+D3DDECLUSAGE = Enum("D3DDECLUSAGE", [
+    "D3DDECLUSAGE_POSITION",
+    "D3DDECLUSAGE_BLENDWEIGHT",
+    "D3DDECLUSAGE_BLENDINDICES",
+    "D3DDECLUSAGE_NORMAL",
+    "D3DDECLUSAGE_PSIZE",
+    "D3DDECLUSAGE_TEXCOORD",
+    "D3DDECLUSAGE_TANGENT",
+    "D3DDECLUSAGE_BINORMAL",
+    "D3DDECLUSAGE_TESSFACTOR",
+    "D3DDECLUSAGE_POSITIONT",
+    "D3DDECLUSAGE_COLOR",
+    "D3DDECLUSAGE_FOG",
+    "D3DDECLUSAGE_DEPTH",
+    "D3DDECLUSAGE_SAMPLE",
+])
+
+D3DDECLMETHOD = Enum("D3DDECLMETHOD", [
+    "D3DDECLMETHOD_DEFAULT",
+    "D3DDECLMETHOD_PARTIALU",
+    "D3DDECLMETHOD_PARTIALV",
+    "D3DDECLMETHOD_CROSSUV",
+    "D3DDECLMETHOD_UV",
+    "D3DDECLMETHOD_LOOKUP",
+    "D3DDECLMETHOD_LOOKUPPRESAMPLED",
+])
+
+D3DDECLTYPE = Enum("D3DDECLTYPE", [
+    "D3DDECLTYPE_FLOAT1",
+    "D3DDECLTYPE_FLOAT2",
+    "D3DDECLTYPE_FLOAT3",
+    "D3DDECLTYPE_FLOAT4",
+    "D3DDECLTYPE_D3DCOLOR",
+    "D3DDECLTYPE_UBYTE4",
+    "D3DDECLTYPE_SHORT2",
+    "D3DDECLTYPE_SHORT4",
+    "D3DDECLTYPE_UBYTE4N",
+    "D3DDECLTYPE_SHORT2N",
+    "D3DDECLTYPE_SHORT4N",
+    "D3DDECLTYPE_USHORT2N",
+    "D3DDECLTYPE_USHORT4N",
+    "D3DDECLTYPE_UDEC3",
+    "D3DDECLTYPE_DEC3N",
+    "D3DDECLTYPE_FLOAT16_2",
+    "D3DDECLTYPE_FLOAT16_4",
+    "D3DDECLTYPE_UNUSED",
+])
+
+D3DVERTEXELEMENT9 = Struct("D3DVERTEXELEMENT9", [
+    (WORD, "Stream"),
+    (WORD, "Offset"),
+    (BYTE, "Type"),
+    (BYTE, "Method"),
+    (BYTE, "Usage"),
+    (BYTE, "UsageIndex"),
+])
+
+D3DSHADER_INSTRUCTION_OPCODE_TYPE = Enum("D3DSHADER_INSTRUCTION_OPCODE_TYPE", [
+    "D3DSIO_NOP",
+    "D3DSIO_MOV",
+    "D3DSIO_ADD",
+    "D3DSIO_SUB",
+    "D3DSIO_MAD",
+    "D3DSIO_MUL",
+    "D3DSIO_RCP",
+    "D3DSIO_RSQ",
+    "D3DSIO_DP3",
+    "D3DSIO_DP4",
+    "D3DSIO_MIN",
+    "D3DSIO_MAX",
+    "D3DSIO_SLT",
+    "D3DSIO_SGE",
+    "D3DSIO_EXP",
+    "D3DSIO_LOG",
+    "D3DSIO_LIT",
+    "D3DSIO_DST",
+    "D3DSIO_LRP",
+    "D3DSIO_FRC",
+    "D3DSIO_M4x4",
+    "D3DSIO_M4x3",
+    "D3DSIO_M3x4",
+    "D3DSIO_M3x3",
+    "D3DSIO_M3x2",
+    "D3DSIO_CALL",
+    "D3DSIO_CALLNZ",
+    "D3DSIO_LOOP",
+    "D3DSIO_RET",
+    "D3DSIO_ENDLOOP",
+    "D3DSIO_LABEL",
+    "D3DSIO_DCL",
+    "D3DSIO_POW",
+    "D3DSIO_CRS",
+    "D3DSIO_SGN",
+    "D3DSIO_ABS",
+    "D3DSIO_NRM",
+    "D3DSIO_SINCOS",
+    "D3DSIO_REP",
+    "D3DSIO_ENDREP",
+    "D3DSIO_IF",
+    "D3DSIO_IFC",
+    "D3DSIO_ELSE",
+    "D3DSIO_ENDIF",
+    "D3DSIO_BREAK",
+    "D3DSIO_BREAKC",
+    "D3DSIO_MOVA",
+    "D3DSIO_DEFB",
+    "D3DSIO_DEFI",
+    "D3DSIO_TEXCOORD",
+    "D3DSIO_TEXKILL",
+    "D3DSIO_TEX",
+    "D3DSIO_TEXBEM",
+    "D3DSIO_TEXBEML",
+    "D3DSIO_TEXREG2AR",
+    "D3DSIO_TEXREG2GB",
+    "D3DSIO_TEXM3x2PAD",
+    "D3DSIO_TEXM3x2TEX",
+    "D3DSIO_TEXM3x3PAD",
+    "D3DSIO_TEXM3x3TEX",
+    "D3DSIO_RESERVED0",
+    "D3DSIO_TEXM3x3SPEC",
+    "D3DSIO_TEXM3x3VSPEC",
+    "D3DSIO_EXPP",
+    "D3DSIO_LOGP",
+    "D3DSIO_CND",
+    "D3DSIO_DEF",
+    "D3DSIO_TEXREG2RGB",
+    "D3DSIO_TEXDP3TEX",
+    "D3DSIO_TEXM3x2DEPTH",
+    "D3DSIO_TEXDP3",
+    "D3DSIO_TEXM3x3",
+    "D3DSIO_TEXDEPTH",
+    "D3DSIO_CMP",
+    "D3DSIO_BEM",
+    "D3DSIO_DP2ADD",
+    "D3DSIO_DSX",
+    "D3DSIO_DSY",
+    "D3DSIO_TEXLDD",
+    "D3DSIO_SETP",
+    "D3DSIO_TEXLDL",
+    "D3DSIO_BREAKP",
+    "D3DSIO_PHASE",
+    "D3DSIO_COMMENT",
+    "D3DSIO_END",
+    "D3DSIO_FORCE_DWORD",
+])
+
+D3DSHADER_COMPARISON = Enum("D3DSHADER_COMPARISON", [
+    "D3DSPC_RESERVED0",
+    "D3DSPC_GT",
+    "D3DSPC_EQ",
+    "D3DSPC_GE",
+    "D3DSPC_LT",
+    "D3DSPC_NE",
+    "D3DSPC_LE",
+    "D3DSPC_RESERVED1",
+])
+
+D3DSAMPLER_TEXTURE_TYPE = Enum("D3DSAMPLER_TEXTURE_TYPE", [
+    "D3DSTT_UNKNOWN",
+    "D3DSTT_2D",
+    "D3DSTT_CUBE",
+    "D3DSTT_VOLUME",
+    "D3DSTT_FORCE_DWORD",
+])
+
+D3DSP = Flags(DWORD, [
+    "D3DSP_WRITEMASK_0",
+    "D3DSP_WRITEMASK_1",
+    "D3DSP_WRITEMASK_2",
+    "D3DSP_WRITEMASK_3",
+    "D3DSP_WRITEMASK_ALL",
+])
+
+D3DSHADER_PARAM_DSTMOD_TYPE = Flags(DWORD, [
+    "D3DSPDM_NONE",
+    "D3DSPDM_SATURATE",
+    "D3DSPDM_PARTIALPRECISION",
+    "D3DSPDM_MSAMPCENTROID",
+])
+
+D3DSHADER_PARAM_REGISTER_TYPE = Enum("D3DSHADER_PARAM_REGISTER_TYPE", [
+    "D3DSPR_TEMP",
+    "D3DSPR_INPUT",
+    "D3DSPR_CONST",
+    "D3DSPR_ADDR",
+    "D3DSPR_TEXTURE",
+    "D3DSPR_RASTOUT",
+    "D3DSPR_ATTROUT",
+    "D3DSPR_TEXCRDOUT",
+    "D3DSPR_OUTPUT",
+    "D3DSPR_CONSTINT",
+    "D3DSPR_COLOROUT",
+    "D3DSPR_DEPTHOUT",
+    "D3DSPR_SAMPLER",
+    "D3DSPR_CONST2",
+    "D3DSPR_CONST3",
+    "D3DSPR_CONST4",
+    "D3DSPR_CONSTBOOL",
+    "D3DSPR_LOOP",
+    "D3DSPR_TEMPFLOAT16",
+    "D3DSPR_MISCTYPE",
+    "D3DSPR_LABEL",
+    "D3DSPR_PREDICATE",
+    "D3DSPR_FORCE_DWORD",
+])
+
+D3DSHADER_MISCTYPE_OFFSETS = Enum("D3DSHADER_MISCTYPE_OFFSETS", [
+    "D3DSMO_POSITION",
+    "D3DSMO_FACE",
+])
+
+D3DVS_RASTOUT_OFFSETS = Enum("D3DVS_RASTOUT_OFFSETS", [
+    "D3DSRO_POSITION",
+    "D3DSRO_FOG",
+    "D3DSRO_POINT_SIZE",
+    "D3DSRO_FORCE_DWORD",
+])
+
+D3DVS_ADDRESSMODE_TYPE = Enum("D3DVS_ADDRESSMODE_TYPE", [
+    "D3DVS_ADDRMODE_ABSOLUTE",
+    "D3DVS_ADDRMODE_RELATIVE",
+    "D3DVS_ADDRMODE_FORCE_DWORD",
+])
+
+D3DSHADER_ADDRESSMODE_TYPE = Enum("D3DSHADER_ADDRESSMODE_TYPE", [
+    "D3DSHADER_ADDRMODE_ABSOLUTE",
+    "D3DSHADER_ADDRMODE_RELATIVE",
+    "D3DSHADER_ADDRMODE_FORCE_DWORD",
+])
+
+D3DVS = Flags(DWORD, [
+    "D3DVS_X_X",
+    "D3DVS_X_Y",
+    "D3DVS_X_Z",
+    "D3DVS_X_W",
+    "D3DVS_Y_X",
+    "D3DVS_Y_Y",
+    "D3DVS_Y_Z",
+    "D3DVS_Y_W",
+    "D3DVS_Z_X",
+    "D3DVS_Z_Y",
+    "D3DVS_Z_Z",
+    "D3DVS_Z_W",
+    "D3DVS_W_X",
+    "D3DVS_W_Y",
+    "D3DVS_W_Z",
+    "D3DVS_W_W",
+    "D3DVS_NOSWIZZLE",
+])
+
+D3DSP = Flags(DWORD, [
+    "D3DSP_NOSWIZZLE",
+    "D3DSP_REPLICATERED",
+    "D3DSP_REPLICATEGREEN",
+    "D3DSP_REPLICATEBLUE",
+    "D3DSP_REPLICATEALPHA",
+])
+
+D3DSHADER_PARAM_SRCMOD_TYPE = Enum("D3DSHADER_PARAM_SRCMOD_TYPE", [
+    "D3DSPSM_NONE",
+    "D3DSPSM_NEG",
+    "D3DSPSM_BIAS",
+    "D3DSPSM_BIASNEG",
+    "D3DSPSM_SIGN",
+    "D3DSPSM_SIGNNEG",
+    "D3DSPSM_COMP",
+    "D3DSPSM_X2",
+    "D3DSPSM_X2NEG",
+    "D3DSPSM_DZ",
+    "D3DSPSM_DW",
+    "D3DSPSM_ABS",
+    "D3DSPSM_ABSNEG",
+    "D3DSPSM_NOT",
+    "D3DSPSM_FORCE_DWORD",
+])
+
+D3DBASISTYPE = Enum("D3DBASISTYPE", [
+    "D3DBASIS_BEZIER",
+    "D3DBASIS_BSPLINE",
+    "D3DBASIS_CATMULL_ROM",
+    "D3DBASIS_FORCE_DWORD",
+])
+
+D3DDEGREETYPE = Enum("D3DDEGREETYPE", [
+    "D3DDEGREE_LINEAR",
+    "D3DDEGREE_QUADRATIC",
+    "D3DDEGREE_CUBIC",
+    "D3DDEGREE_QUINTIC",
+    "D3DDEGREE_FORCE_DWORD",
+])
+
+D3DPATCHEDGESTYLE = Enum("D3DPATCHEDGESTYLE", [
+    "D3DPATCHEDGE_DISCRETE",
+    "D3DPATCHEDGE_CONTINUOUS",
+    "D3DPATCHEDGE_FORCE_DWORD",
+])
+
+D3DSTATEBLOCKTYPE = Enum("D3DSTATEBLOCKTYPE", [
+    "D3DSBT_ALL",
+    "D3DSBT_PIXELSTATE",
+    "D3DSBT_VERTEXSTATE",
+    "D3DSBT_FORCE_DWORD",
+])
+
+D3DVERTEXBLENDFLAGS = Enum("D3DVERTEXBLENDFLAGS", [
+    "D3DVBF_DISABLE",
+    "D3DVBF_1WEIGHTS",
+    "D3DVBF_2WEIGHTS",
+    "D3DVBF_3WEIGHTS",
+    "D3DVBF_TWEENING",
+    "D3DVBF_0WEIGHTS",
+    "D3DVBF_FORCE_DWORD",
+])
+
+D3DTEXTURETRANSFORMFLAGS = Enum("D3DTEXTURETRANSFORMFLAGS", [
+    "D3DTTFF_DISABLE",
+    "D3DTTFF_COUNT1",
+    "D3DTTFF_COUNT2",
+    "D3DTTFF_COUNT3",
+    "D3DTTFF_COUNT4",
+    "D3DTTFF_PROJECTED",
+    "D3DTTFF_FORCE_DWORD",
+])
+
+D3DDEVTYPE = Enum("D3DDEVTYPE", [
+    "D3DDEVTYPE_HAL",
+    "D3DDEVTYPE_REF",
+    "D3DDEVTYPE_SW",
+    "D3DDEVTYPE_NULLREF",
+    "D3DDEVTYPE_FORCE_DWORD",
+])
+
+D3DMULTISAMPLE_TYPE = Enum("D3DMULTISAMPLE_TYPE", [
+    "D3DMULTISAMPLE_NONE",
+    "D3DMULTISAMPLE_NONMASKABLE",
+    "D3DMULTISAMPLE_2_SAMPLES",
+    "D3DMULTISAMPLE_3_SAMPLES",
+    "D3DMULTISAMPLE_4_SAMPLES",
+    "D3DMULTISAMPLE_5_SAMPLES",
+    "D3DMULTISAMPLE_6_SAMPLES",
+    "D3DMULTISAMPLE_7_SAMPLES",
+    "D3DMULTISAMPLE_8_SAMPLES",
+    "D3DMULTISAMPLE_9_SAMPLES",
+    "D3DMULTISAMPLE_10_SAMPLES",
+    "D3DMULTISAMPLE_11_SAMPLES",
+    "D3DMULTISAMPLE_12_SAMPLES",
+    "D3DMULTISAMPLE_13_SAMPLES",
+    "D3DMULTISAMPLE_14_SAMPLES",
+    "D3DMULTISAMPLE_15_SAMPLES",
+    "D3DMULTISAMPLE_16_SAMPLES",
+    "D3DMULTISAMPLE_FORCE_DWORD",
+])
+
+D3DFORMAT = Enum("D3DFORMAT", [
+    "D3DFMT_UNKNOWN",
+    "D3DFMT_R8G8B8",
+    "D3DFMT_A8R8G8B8",
+    "D3DFMT_X8R8G8B8",
+    "D3DFMT_R5G6B5",
+    "D3DFMT_X1R5G5B5",
+    "D3DFMT_A1R5G5B5",
+    "D3DFMT_A4R4G4B4",
+    "D3DFMT_R3G3B2",
+    "D3DFMT_A8",
+    "D3DFMT_A8R3G3B2",
+    "D3DFMT_X4R4G4B4",
+    "D3DFMT_A2B10G10R10",
+    "D3DFMT_A8B8G8R8",
+    "D3DFMT_X8B8G8R8",
+    "D3DFMT_G16R16",
+    "D3DFMT_A2R10G10B10",
+    "D3DFMT_A16B16G16R16",
+    "D3DFMT_A8P8",
+    "D3DFMT_P8",
+    "D3DFMT_L8",
+    "D3DFMT_A8L8",
+    "D3DFMT_A4L4",
+    "D3DFMT_V8U8",
+    "D3DFMT_L6V5U5",
+    "D3DFMT_X8L8V8U8",
+    "D3DFMT_Q8W8V8U8",
+    "D3DFMT_V16U16",
+    "D3DFMT_A2W10V10U10",
+    "D3DFMT_UYVY",
+    "D3DFMT_R8G8_B8G8",
+    "D3DFMT_YUY2",
+    "D3DFMT_G8R8_G8B8",
+    "D3DFMT_DXT1",
+    "D3DFMT_DXT2",
+    "D3DFMT_DXT3",
+    "D3DFMT_DXT4",
+    "D3DFMT_DXT5",
+    "D3DFMT_D16_LOCKABLE",
+    "D3DFMT_D32",
+    "D3DFMT_D15S1",
+    "D3DFMT_D24S8",
+    "D3DFMT_D24X8",
+    "D3DFMT_D24X4S4",
+    "D3DFMT_D16",
+    "D3DFMT_D32F_LOCKABLE",
+    "D3DFMT_D24FS8",
+    "D3DFMT_D32_LOCKABLE",
+    "D3DFMT_S8_LOCKABLE",
+    "D3DFMT_L16",
+    "D3DFMT_VERTEXDATA",
+    "D3DFMT_INDEX16",
+    "D3DFMT_INDEX32",
+    "D3DFMT_Q16W16V16U16",
+    "D3DFMT_MULTI2_ARGB8",
+    "D3DFMT_R16F",
+    "D3DFMT_G16R16F",
+    "D3DFMT_A16B16G16R16F",
+    "D3DFMT_R32F",
+    "D3DFMT_G32R32F",
+    "D3DFMT_A32B32G32R32F",
+    "D3DFMT_CxV8U8",
+    "D3DFMT_A1",
+    "D3DFMT_BINARYBUFFER",
+    "D3DFMT_FORCE_DWORD",
+])
+
+D3DDISPLAYMODE = Struct("D3DDISPLAYMODE", [
+    (UINT, "Width"),
+    (UINT, "Height"),
+    (UINT, "RefreshRate"),
+    (D3DFORMAT, "Format"),
+])
+
+D3DDEVICE_CREATION_PARAMETERS = Struct("D3DDEVICE_CREATION_PARAMETERS", [
+    (UINT, "AdapterOrdinal"),
+    (D3DDEVTYPE, "DeviceType"),
+    (HWND, "hFocusWindow"),
+    (DWORD, "BehaviorFlags"),
+])
+
+D3DSWAPEFFECT = Enum("D3DSWAPEFFECT", [
+    "D3DSWAPEFFECT_DISCARD",
+    "D3DSWAPEFFECT_FLIP",
+    "D3DSWAPEFFECT_COPY",
+    "D3DSWAPEFFECT_FORCE_DWORD",
+])
+
+D3DPOOL = Enum("D3DPOOL", [
+    "D3DPOOL_DEFAULT",
+    "D3DPOOL_MANAGED",
+    "D3DPOOL_SYSTEMMEM",
+    "D3DPOOL_SCRATCH",
+    "D3DPOOL_FORCE_DWORD",
+])
+
+D3DPRESENT = Flags(DWORD, [
+    "D3DPRESENT_RATE_DEFAULT",
+])
+
+D3DPRESENT_PARAMETERS = 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"),
+])
+
+D3DPRESENTFLAG = Flags(DWORD, [
+    "D3DPRESENTFLAG_LOCKABLE_BACKBUFFER",
+    "D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL",
+    "D3DPRESENTFLAG_DEVICECLIP",
+    "D3DPRESENTFLAG_VIDEO",
+    "D3DPRESENTFLAG_NOAUTOROTATE",
+    "D3DPRESENTFLAG_UNPRUNEDMODE",
+])
+
+D3DGAMMARAMP = Struct("D3DGAMMARAMP", [
+    (WORD, "red[256]"),
+    (WORD, "green[256]"),
+    (WORD, "blue[256]"),
+])
+
+D3DBACKBUFFER_TYPE = Enum("D3DBACKBUFFER_TYPE", [
+    "D3DBACKBUFFER_TYPE_MONO",
+    "D3DBACKBUFFER_TYPE_LEFT",
+    "D3DBACKBUFFER_TYPE_RIGHT",
+    "D3DBACKBUFFER_TYPE_FORCE_DWORD",
+])
+
+D3DRESOURCETYPE = Enum("D3DRESOURCETYPE", [
+    "D3DRTYPE_SURFACE",
+    "D3DRTYPE_VOLUME",
+    "D3DRTYPE_TEXTURE",
+    "D3DRTYPE_VOLUMETEXTURE",
+    "D3DRTYPE_CUBETEXTURE",
+    "D3DRTYPE_VERTEXBUFFER",
+    "D3DRTYPE_INDEXBUFFER",
+    "D3DRTYPE_FORCE_DWORD",
+])
+
+D3DUSAGE = Flags(DWORD, [
+    "D3DUSAGE_RENDERTARGET",
+    "D3DUSAGE_DEPTHSTENCIL",
+    "D3DUSAGE_DYNAMIC",
+    "D3DUSAGE_NONSECURE",
+    "D3DUSAGE_AUTOGENMIPMAP",
+    "D3DUSAGE_DMAP",
+    "D3DUSAGE_QUERY_LEGACYBUMPMAP",
+    "D3DUSAGE_QUERY_SRGBREAD",
+    "D3DUSAGE_QUERY_FILTER",
+    "D3DUSAGE_QUERY_SRGBWRITE",
+    "D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING",
+    "D3DUSAGE_QUERY_VERTEXTEXTURE",
+    "D3DUSAGE_QUERY_WRAPANDMIP",
+    "D3DUSAGE_WRITEONLY",
+    "D3DUSAGE_SOFTWAREPROCESSING",
+    "D3DUSAGE_DONOTCLIP",
+    "D3DUSAGE_POINTS",
+    "D3DUSAGE_RTPATCHES",
+    "D3DUSAGE_NPATCHES",
+    "D3DUSAGE_TEXTAPI",
+])
+
+D3DCUBEMAP_FACES = Enum("D3DCUBEMAP_FACES", [
+    "D3DCUBEMAP_FACE_POSITIVE_X",
+    "D3DCUBEMAP_FACE_NEGATIVE_X",
+    "D3DCUBEMAP_FACE_POSITIVE_Y",
+    "D3DCUBEMAP_FACE_NEGATIVE_Y",
+    "D3DCUBEMAP_FACE_POSITIVE_Z",
+    "D3DCUBEMAP_FACE_NEGATIVE_Z",
+    "D3DCUBEMAP_FACE_FORCE_DWORD",
+])
+
+D3DLOCK = Flags(DWORD, [
+    "D3DLOCK_READONLY",
+    "D3DLOCK_DISCARD",
+    "D3DLOCK_NOOVERWRITE",
+    "D3DLOCK_NOSYSLOCK",
+    "D3DLOCK_DONOTWAIT",
+    "D3DLOCK_NO_DIRTY_UPDATE",
+])
+
+D3DVERTEXBUFFER_DESC = Struct("D3DVERTEXBUFFER_DESC", [
+    (D3DFORMAT, "Format"),
+    (D3DRESOURCETYPE, "Type"),
+    (DWORD, "Usage"),
+    (D3DPOOL, "Pool"),
+    (UINT, "Size"),
+    (DWORD, "FVF"),
+])
+
+D3DINDEXBUFFER_DESC = Struct("D3DINDEXBUFFER_DESC", [
+    (D3DFORMAT, "Format"),
+    (D3DRESOURCETYPE, "Type"),
+    (DWORD, "Usage"),
+    (D3DPOOL, "Pool"),
+    (UINT, "Size"),
+])
+
+D3DSURFACE_DESC = Struct("D3DSURFACE_DESC", [
+    (D3DFORMAT, "Format"),
+    (D3DRESOURCETYPE, "Type"),
+    (DWORD, "Usage"),
+    (D3DPOOL, "Pool"),
+    (D3DMULTISAMPLE_TYPE, "MultiSampleType"),
+    (DWORD, "MultiSampleQuality"),
+    (UINT, "Width"),
+    (UINT, "Height"),
+])
+
+D3DVOLUME_DESC = Struct("D3DVOLUME_DESC", [
+    (D3DFORMAT, "Format"),
+    (D3DRESOURCETYPE, "Type"),
+    (DWORD, "Usage"),
+    (D3DPOOL, "Pool"),
+    (UINT, "Width"),
+    (UINT, "Height"),
+    (UINT, "Depth"),
+])
+
+D3DLOCKED_RECT = Struct("D3DLOCKED_RECT", [
+    (INT, "Pitch"),
+    (Pointer(Void), "pBits"),
+])
+
+D3DBOX = Struct("D3DBOX", [
+    (UINT, "Left"),
+    (UINT, "Top"),
+    (UINT, "Right"),
+    (UINT, "Bottom"),
+    (UINT, "Front"),
+    (UINT, "Back"),
+])
+
+D3DLOCKED_BOX = Struct("D3DLOCKED_BOX", [
+    (INT, "RowPitch"),
+    (INT, "SlicePitch"),
+    (Pointer(Void), "pBits"),
+])
+
+D3DRANGE = Struct("D3DRANGE", [
+    (UINT, "Offset"),
+    (UINT, "Size"),
+])
+
+D3DRECTPATCH_INFO = Struct("D3DRECTPATCH_INFO", [
+    (UINT, "StartVertexOffsetWidth"),
+    (UINT, "StartVertexOffsetHeight"),
+    (UINT, "Width"),
+    (UINT, "Height"),
+    (UINT, "Stride"),
+    (D3DBASISTYPE, "Basis"),
+    (D3DDEGREETYPE, "Degree"),
+])
+
+D3DTRIPATCH_INFO = Struct("D3DTRIPATCH_INFO", [
+    (UINT, "StartVertexOffset"),
+    (UINT, "NumVertices"),
+    (D3DBASISTYPE, "Basis"),
+    (D3DDEGREETYPE, "Degree"),
+])
+
+D3DADAPTER_IDENTIFIER9 = Struct("D3DADAPTER_IDENTIFIER9", [
+    (String, "Driver"),
+    (String, "Description"),
+    (String, "DeviceName"),
+    (LARGE_INTEGER, "DriverVersion"),
+    (DWORD, "VendorId"),
+    (DWORD, "DeviceId"),
+    (DWORD, "SubSysId"),
+    (DWORD, "Revision"),
+    (GUID, "DeviceIdentifier"),
+    (DWORD, "WHQLLevel"),
+])
+
+D3DRASTER_STATUS = Struct("D3DRASTER_STATUS", [
+    (BOOL, "InVBlank"),
+    (UINT, "ScanLine"),
+])
+
+D3DDEBUGMONITORTOKENS = Enum("D3DDEBUGMONITORTOKENS", [
+    "D3DDMT_ENABLE",
+    "D3DDMT_DISABLE",
+    "D3DDMT_FORCE_DWORD",
+])
+
+D3DQUERYTYPE = Enum("D3DQUERYTYPE", [
+    "D3DQUERYTYPE_VCACHE",
+    "D3DQUERYTYPE_RESOURCEMANAGER",
+    "D3DQUERYTYPE_VERTEXSTATS",
+    "D3DQUERYTYPE_EVENT",
+    "D3DQUERYTYPE_OCCLUSION",
+    "D3DQUERYTYPE_TIMESTAMP",
+    "D3DQUERYTYPE_TIMESTAMPDISJOINT",
+    "D3DQUERYTYPE_TIMESTAMPFREQ",
+    "D3DQUERYTYPE_PIPELINETIMINGS",
+    "D3DQUERYTYPE_INTERFACETIMINGS",
+    "D3DQUERYTYPE_VERTEXTIMINGS",
+    "D3DQUERYTYPE_PIXELTIMINGS",
+    "D3DQUERYTYPE_BANDWIDTHTIMINGS",
+    "D3DQUERYTYPE_CACHEUTILIZATION",
+])
+
+D3DISSUE = Flags(DWORD, [
+    "D3DISSUE_END",
+    "D3DISSUE_BEGIN",
+])
+
+D3DGETDATA = Flags(DWORD, [
+    "D3DGETDATA_FLUSH",
+])
+
+D3DRESOURCESTATS = Struct("D3DRESOURCESTATS", [
+    (BOOL, "bThrashing"),
+    (DWORD, "ApproxBytesDownloaded"),
+    (DWORD, "NumEvicts"),
+    (DWORD, "NumVidCreates"),
+    (DWORD, "LastPri"),
+    (DWORD, "NumUsed"),
+    (DWORD, "NumUsedInVidMem"),
+    (DWORD, "WorkingSet"),
+    (DWORD, "WorkingSetBytes"),
+    (DWORD, "TotalManaged"),
+    (DWORD, "TotalBytes"),
+])
+
+D3DDEVINFO_RESOURCEMANAGER = Struct("D3DDEVINFO_RESOURCEMANAGER", [
+    (D3DRESOURCESTATS, "stats[D3DRTYPECOUNT]"),
+    (D3DRESOURCESTATS, "stats[8]"),
+])
+
+D3DDEVINFO_D3DVERTEXSTATS = Struct("D3DDEVINFO_D3DVERTEXSTATS", [
+    (DWORD, "NumRenderedTriangles"),
+    (DWORD, "NumExtraClippingTriangles"),
+])
+
+D3DDEVINFO_VCACHE = Struct("D3DDEVINFO_VCACHE", [
+    (DWORD, "Pattern"),
+    (DWORD, "OptMethod"),
+    (DWORD, "CacheSize"),
+    (DWORD, "MagicNumber"),
+])
+
+D3DDEVINFO_D3D9PIPELINETIMINGS = Struct("D3DDEVINFO_D3D9PIPELINETIMINGS", [
+    (FLOAT, "VertexProcessingTimePercent"),
+    (FLOAT, "PixelProcessingTimePercent"),
+    (FLOAT, "OtherGPUProcessingTimePercent"),
+    (FLOAT, "GPUIdleTimePercent"),
+])
+
+D3DDEVINFO_D3D9INTERFACETIMINGS = Struct("D3DDEVINFO_D3D9INTERFACETIMINGS", [
+    (FLOAT, "WaitingForGPUToUseApplicationResourceTimePercent"),
+    (FLOAT, "WaitingForGPUToAcceptMoreCommandsTimePercent"),
+    (FLOAT, "WaitingForGPUToStayWithinLatencyTimePercent"),
+    (FLOAT, "WaitingForGPUExclusiveResourceTimePercent"),
+    (FLOAT, "WaitingForGPUOtherTimePercent"),
+])
+
+D3DDEVINFO_D3D9STAGETIMINGS = Struct("D3DDEVINFO_D3D9STAGETIMINGS", [
+    (FLOAT, "MemoryProcessingPercent"),
+    (FLOAT, "ComputationProcessingPercent"),
+])
+
+D3DDEVINFO_D3D9BANDWIDTHTIMINGS = Struct("D3DDEVINFO_D3D9BANDWIDTHTIMINGS", [
+    (FLOAT, "MaxBandwidthUtilized"),
+    (FLOAT, "FrontEndUploadMemoryUtilizedPercent"),
+    (FLOAT, "VertexRateUtilizedPercent"),
+    (FLOAT, "TriangleSetupRateUtilizedPercent"),
+    (FLOAT, "FillRateUtilizedPercent"),
+])
+
+D3DDEVINFO_D3D9CACHEUTILIZATION = Struct("D3DDEVINFO_D3D9CACHEUTILIZATION", [
+    (FLOAT, "TextureCacheHitRate"),
+    (FLOAT, "PostTransformVertexCacheHitRate"),
+])
+
+D3DCOMPOSERECTSOP = Enum("D3DCOMPOSERECTSOP", [
+    "D3DCOMPOSERECTS_COPY",
+    "D3DCOMPOSERECTS_OR",
+    "D3DCOMPOSERECTS_AND",
+    "D3DCOMPOSERECTS_NEG",
+    "D3DCOMPOSERECTS_FORCE_DWORD",
+])
+
+D3DCOMPOSERECTDESC = Struct("D3DCOMPOSERECTDESC", [
+    (USHORT, "X"),
+    (USHORT, "Y"),
+    (USHORT, "Width"),
+    (USHORT, "Height"),
+])
+
+D3DCOMPOSERECTDESTINATION = Struct("D3DCOMPOSERECTDESTINATION", [
+    (USHORT, "SrcRectIndex"),
+    (USHORT, "Reserved"),
+    (Short, "x"),
+    (Short, "y"),
+])
+
+D3DPRESENTSTATS = Struct("D3DPRESENTSTATS", [
+    (UINT, "PresentCount"),
+    (UINT, "PresentRefreshCount"),
+    (UINT, "SyncRefreshCount"),
+    (LARGE_INTEGER, "SyncQPCTime"),
+    (LARGE_INTEGER, "SyncGPUTime"),
+])
+
+D3DSCANLINEORDERING = Enum("D3DSCANLINEORDERING", [
+    "D3DSCANLINEORDERING_UNKNOWN",
+    "D3DSCANLINEORDERING_PROGRESSIVE",
+    "D3DSCANLINEORDERING_INTERLACED",
+])
+
+D3DDISPLAYMODEEX = Struct("D3DDISPLAYMODEEX", [
+    (UINT, "Size"),
+    (UINT, "Width"),
+    (UINT, "Height"),
+    (UINT, "RefreshRate"),
+    (D3DFORMAT, "Format"),
+    (D3DSCANLINEORDERING, "ScanLineOrdering"),
+])
+
+D3DDISPLAYMODEFILTER = Struct("D3DDISPLAYMODEFILTER", [
+    (UINT, "Size"),
+    (D3DFORMAT, "Format"),
+    (D3DSCANLINEORDERING, "ScanLineOrdering"),
+])
+
+D3DDISPLAYROTATION = Enum("D3DDISPLAYROTATION", [
+    "D3DDISPLAYROTATION_IDENTITY",
+    "D3DDISPLAYROTATION_90",
+    "D3DDISPLAYROTATION_180",
+    "D3DDISPLAYROTATION_270",
+])
+
+D3D9_RESOURCE_PRIORITY = Flags(DWORD, [
+    "D3D9_RESOURCE_PRIORITY_MINIMUM",
+    "D3D9_RESOURCE_PRIORITY_LOW",
+    "D3D9_RESOURCE_PRIORITY_NORMAL",
+    "D3D9_RESOURCE_PRIORITY_HIGH",
+    "D3D9_RESOURCE_PRIORITY_MAXIMUM",
+])
+
index 65517d74636434a954596898a68cfc032cb2fd6d..29e4e60a5c3e50d6f54636864029c5b5b5b5a682 100644 (file)
 
 from base import *
 
-INT = Intrinsic("INT", "%u")
+SHORT = Intrinsic("SHORT", "%i")
+USHORT = Intrinsic("USHORT", "%u")
+INT = Intrinsic("INT", "%i")
 UINT = Intrinsic("UINT", "%u")
 LONG = Intrinsic("LONG", "%li")
 ULONG = Intrinsic("ULONG", "%lu")
+FLOAT = Intrinsic("FLOAT", "%f")
+
+INT32 = Intrinsic("INT32", "%i")
+UINT32 = Intrinsic("UINT32", "%i")
 
 BYTE = Intrinsic("BYTE", "0x%02lx")
 WORD = Intrinsic("WORD", "0x%04lx")
@@ -37,11 +43,14 @@ LARGE_INTEGER = Intrinsic("LARGE_INTEGER", "0x%llx")
 HRESULT = Alias("HRESULT", Int)
 
 PVOID = Intrinsic("PVOID", "%p")
+HANDLE = Intrinsic("HANDLE", "%p")
 HWND = Intrinsic("HWND", "%p")
+HDC = Intrinsic("HDC", "%p")
 HMONITOR = Intrinsic("HMONITOR", "%p")
 
 REFIID = Alias("REFIID", PVOID)
 GUID = Alias("GUID", PVOID)
+LUID = Alias("LUID", PVOID)
 
 POINT = Struct("POINT", (
   (LONG, "x"),