]> git.cworth.org Git - apitrace/blobdiff - d3d9.py
First stab at binary trace and retracing.
[apitrace] / d3d9.py
diff --git a/d3d9.py b/d3d9.py
index d398d58f4e9668b65a410e0aedc0fb0bf54bc58a..9aefe75fbce98e0282759fab1775cfc9785e763e 100644 (file)
--- a/d3d9.py
+++ b/d3d9.py
@@ -1,28 +1,37 @@
-#############################################################################
+##########################################################################
 #
-# Copyright 2008 Tungsten Graphics, Inc.
+# Copyright 2008-2009 VMware, Inc.
+# All Rights Reserved.
 #
-# 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.
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
 #
-# 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.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
 #
-# 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/>.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
 #
-#############################################################################
+##########################################################################/
 
 """d3d9.h"""
 
 from windows import *
+from d3dshader import *
 from d3d9types import *
 from d3d9caps import *
 
+D3DSHADER9 = D3DShader(9)
+
 HRESULT = Enum("HRESULT", [
     "D3D_OK",
     "D3DERR_WRONGTEXTUREFORMAT",
@@ -139,7 +148,7 @@ IDirect3DDevice9.methods += [
     Method(HRESULT, "CreateTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DTEXTURE9), "ppTexture"), (OutPointer(HANDLE), "pSharedHandle")]),
     Method(HRESULT, "CreateVolumeTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Depth"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DVOLUMETEXTURE9), "ppVolumeTexture"), (OutPointer(HANDLE), "pSharedHandle")]),
     Method(HRESULT, "CreateCubeTexture", [(UINT, "EdgeLength"), (UINT, "Levels"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DCUBETEXTURE9), "ppCubeTexture"), (OutPointer(HANDLE), "pSharedHandle")]),
-    Method(HRESULT, "CreateVertexBuffer", [(UINT, "Length"), (DWORD, "Usage"), (DWORD, "FVF"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DVERTEXBUFFER9), "ppVertexBuffer"), (OutPointer(HANDLE), "pSharedHandle")]),
+    Method(HRESULT, "CreateVertexBuffer", [(UINT, "Length"), (DWORD, "Usage"), (D3DFVF, "FVF"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DVERTEXBUFFER9), "ppVertexBuffer"), (OutPointer(HANDLE), "pSharedHandle")]),
     Method(HRESULT, "CreateIndexBuffer", [(UINT, "Length"), (DWORD, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), (OutPointer(PDIRECT3DINDEXBUFFER9), "ppIndexBuffer"), (OutPointer(HANDLE), "pSharedHandle")]),
     Method(HRESULT, "CreateRenderTarget", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Lockable"), (OutPointer(PDIRECT3DSURFACE9), "ppSurface"), (OutPointer(HANDLE), "pSharedHandle")]),
     Method(HRESULT, "CreateDepthStencilSurface", [(UINT, "Width"), (UINT, "Height"), (D3DFORMAT, "Format"), (D3DMULTISAMPLE_TYPE, "MultiSample"), (DWORD, "MultisampleQuality"), (BOOL, "Discard"), (OutPointer(PDIRECT3DSURFACE9), "ppSurface"), (OutPointer(HANDLE), "pSharedHandle")]),
@@ -202,9 +211,9 @@ IDirect3DDevice9.methods += [
     Method(HRESULT, "CreateVertexDeclaration", [(ConstPointer(D3DVERTEXELEMENT9), "pVertexElements"), (OutPointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]),
     Method(HRESULT, "SetVertexDeclaration", [(PDIRECT3DVERTEXDECLARATION9, "pDecl")]),
     Method(HRESULT, "GetVertexDeclaration", [(OutPointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]),
-    Method(HRESULT, "SetFVF", [(DWORD, "FVF")]),
-    Method(HRESULT, "GetFVF", [(OutPointer(DWORD), "pFVF")]),
-    Method(HRESULT, "CreateVertexShader", [(ConstPointer(DWORD), "pFunction"), (OutPointer(PDIRECT3DVERTEXSHADER9), "ppShader")]),
+    Method(HRESULT, "SetFVF", [(D3DFVF, "FVF")]),
+    Method(HRESULT, "GetFVF", [(OutPointer(D3DFVF), "pFVF")]),
+    Method(HRESULT, "CreateVertexShader", [(D3DSHADER9, "pFunction"), (OutPointer(PDIRECT3DVERTEXSHADER9), "ppShader")]),
     Method(HRESULT, "SetVertexShader", [(PDIRECT3DVERTEXSHADER9, "pShader")]),
     Method(HRESULT, "GetVertexShader", [(OutPointer(PDIRECT3DVERTEXSHADER9), "ppShader")]),
     Method(HRESULT, "SetVertexShaderConstantF", [(UINT, "StartRegister"), (ConstPointer(Float), "pConstantData"), (UINT, "Vector4fCount")]),
@@ -219,7 +228,7 @@ IDirect3DDevice9.methods += [
     Method(HRESULT, "GetStreamSourceFreq", [(UINT, "StreamNumber"), (OutPointer(UINT), "pSetting")]),
     Method(HRESULT, "SetIndices", [(PDIRECT3DINDEXBUFFER9, "pIndexData")]),
     Method(HRESULT, "GetIndices", [(OutPointer(PDIRECT3DINDEXBUFFER9), "ppIndexData")]),
-    Method(HRESULT, "CreatePixelShader", [(ConstPointer(DWORD), "pFunction"), (OutPointer(PDIRECT3DPIXELSHADER9), "ppShader")]),
+    Method(HRESULT, "CreatePixelShader", [(D3DSHADER9, "pFunction"), (OutPointer(PDIRECT3DPIXELSHADER9), "ppShader")]),
     Method(HRESULT, "SetPixelShader", [(PDIRECT3DPIXELSHADER9, "pShader")]),
     Method(HRESULT, "GetPixelShader", [(OutPointer(PDIRECT3DPIXELSHADER9), "ppShader")]),
     Method(HRESULT, "SetPixelShaderConstantF", [(UINT, "StartRegister"), (ConstPointer(Float), "pConstantData"), (UINT, "Vector4fCount")]),
@@ -397,6 +406,9 @@ d3d9.functions += [
 if __name__ == '__main__':
     print '#include <windows.h>'
     print '#include <tchar.h>'
+    print
+    print '#include "compat.h"'
+    print
     print '#include <d3d9.h>'
     print
     print '#include "log.hpp"'