]> git.cworth.org Git - apitrace/blob - d3d10_1.py
Rudimentary support for D3D10.
[apitrace] / d3d10_1.py
1 #############################################################################
2 #
3 # Copyright 2009 VMware, Inc.
4 #
5 # This program is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as published
7 # by the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 #
18 #############################################################################
19
20 """d3d10_1.h"""
21
22 from windows import *
23
24 ID3D10Blob = Interface("ID3D10Blob", IUnknown)
25 LPD3D10BLOB = Pointer(ID3D10Blob)
26
27 ID3D10Blob.methods += [
28     Method(LPVOID, "GetBufferPointer", []),
29     Method(SIZE_T, "GetBufferSize", []),
30 ]
31
32 D3D10_DRIVER_TYPE = Enum("D3D10_DRIVER_TYPE", [
33     "D3D10_DRIVER_TYPE_HARDWARE",
34     "D3D10_DRIVER_TYPE_REFERENCE",
35     "D3D10_DRIVER_TYPE_NULL",
36     "D3D10_DRIVER_TYPE_SOFTWARE",
37     "D3D10_DRIVER_TYPE_WARP",
38 ])
39
40 D3D10_FEATURE_LEVEL1 = Enum("D3D10_FEATURE_LEVEL1", [
41     "D3D10_FEATURE_LEVEL_10_0",
42     "D3D10_FEATURE_LEVEL_10_1",
43         "D3D10_FEATURE_LEVEL_9_1",
44         "D3D10_FEATURE_LEVEL_9_2",
45         "D3D10_FEATURE_LEVEL_9_3",
46 ])
47
48 # TODO
49 IDXGIAdapter = Alias("IDXGIAdapter", Void)
50 ID3D10Device1 = Alias("ID3D10Device1", Void)
51 IDXGISwapChain = Alias("IDXGISwapChain", Void)
52 DXGI_SWAP_CHAIN_DESC = Alias("DXGI_SWAP_CHAIN_DESC", Void)
53
54 d3d10_1 = Dll("d3d10")
55 d3d10_1.functions += [
56     DllFunction(HRESULT, "D3D10CreateDevice1", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (UINT, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), (OutPointer(Pointer(ID3D10Device1)), "ppDevice")]),
57     DllFunction(HRESULT, "D3D10CreateDeviceAndSwapChain1", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (UINT, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), (Pointer(DXGI_SWAP_CHAIN_DESC), "pSwapChainDesc"), (OutPointer(Pointer(IDXGISwapChain)), "ppSwapChain"), (OutPointer(Pointer(ID3D10Device1)), "ppDevice")]),
58     DllFunction(HRESULT, "D3D10CreateBlob", [(SIZE_T, "NumBytes"), (OutPointer(LPD3D10BLOB), "ppBuffer")]),
59 ]
60
61 if __name__ == '__main__':
62     print '#include <windows.h>'
63     print '#include <tchar.h>'
64     print
65     print '#include "compat.h"'
66     print
67     print '#include <d3d10_1.h>'
68     print
69     print '#include "log.hpp"'
70     print
71     wrap()