*.pyo
*.xml
*.zip
+MD5SUM
config.log
ddraw.cpp
d3d8.cpp
d3d9.cpp
+d3d10.cpp
+d3d10_1.cpp
+dxsdk
opengl32.cpp
env.Tool('dxsdk', toolpath = ['scons'])
conf = Configure(env)
-has_d3d9 = conf.CheckCHeader('d3d9.h')
-has_d3d8 = conf.CheckCHeader('d3d8.h')
-has_d3d7 = conf.CheckCHeader('ddraw.h')
+has_d3d7 = conf.CheckCXXHeader('ddraw.h')
+has_d3d8 = conf.CheckCXXHeader('d3d8.h')
+has_d3d9 = conf.CheckCXXHeader('d3d9.h')
+if env['toolchain'] != 'crossmingw':
+ has_d3d10 = conf.CheckCXXHeader('d3d10.h')
+ has_d3d10_1 = conf.CheckCXXHeader('d3d10_1.h')
+else:
+ # The above checks do not give reliable results for MinGW
+ has_d3d10 = True
+ has_d3d10_1 = True
env = conf.Finish()
-if has_d3d7:
+if has_d3d7 and False:
env.Command(
target = 'ddraw.cpp',
source = ['ddraw.py', 'd3d.py', 'd3dtypes.py', 'd3dcaps.py', 'windows.py', 'base.py'],
env.Default(d3d9)
+if has_d3d10:
+ env.Command(
+ target = 'd3d10.cpp',
+ source = ['d3d10misc.py', 'windows.py', 'base.py'],
+ action = 'python $SOURCE > $TARGET',
+ )
+
+ d3d10 = env.SharedLibrary(
+ target = 'd3d10',
+ source = [
+ 'd3d10.def',
+ 'd3d10.cpp',
+ 'log.cpp',
+ ]
+ )
+
+ env.Default(d3d10)
+
+if has_d3d10_1:
+ env.Command(
+ target = 'd3d10_1.cpp',
+ source = ['d3d10_1.py', 'windows.py', 'base.py'],
+ action = 'python $SOURCE > $TARGET',
+ )
+
+ d3d10_1 = env.SharedLibrary(
+ target = 'd3d10_1',
+ source = [
+ 'd3d10_1.def',
+ 'd3d10_1.cpp',
+ 'log.cpp',
+ ]
+ )
+
+ env.Default(d3d10_1)
+
env.Command(
target = 'opengl32.cpp',
source = ['opengl32.py', 'gl.py', 'windows.py', 'base.py'],
ULong = Intrinsic("unsigned long", "%lu")
Float = Intrinsic("float", "%f")
Double = Intrinsic("double", "%f")
+SizeT = Intrinsic("size_t", "%lu")
def wrap():
--- /dev/null
+#ifdef __MINGW32__
+#define __in /**/
+#define __out /**/
+#define __inout /**/
+#define __inout_opt /**/
+#define __in_opt /**/
+#define __out_opt /**/
+#define __in_bcount(x) /**/
+#define __out_bcount(x) /**/
+#define __in_bcount_opt(x) /**/
+#define __out_bcount_opt(x) /**/
+#define __in_range(x,y) /**/
+#define __in_ecount(x) /**/
+#define __out_ecount(x) /**/
+#define __in_ecount_opt(x) /**/
+#define __out_ecount_opt(x) /**/
+#define __field_bcount(x) /**/
+#define __field_ecount(x) /**/
+#define __field_ecount_full(x) /**/
+#define __inline static __inline__
+
+#define DECLSPEC_DEPRECATED /**/
+
+#define UINT8 uint8_t
+
+#endif
+
--- /dev/null
+LIBRARY "d3d10"
+
+EXPORTS
+ D3D10CreateDevice
+ D3D10CreateDeviceAndSwapChain
+ D3D10CreateBlob
--- /dev/null
+LIBRARY "d3d10_1"
+
+EXPORTS
+ D3D10CreateDevice1
+ D3D10CreateDeviceAndSwapChain1
+ D3D10CreateBlob
--- /dev/null
+#############################################################################
+#
+# Copyright 2009 VMware, Inc.
+#
+# 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/>.
+#
+#############################################################################
+
+"""d3d10_1.h"""
+
+from windows import *
+
+ID3D10Blob = Interface("ID3D10Blob", IUnknown)
+LPD3D10BLOB = Pointer(ID3D10Blob)
+
+ID3D10Blob.methods += [
+ Method(LPVOID, "GetBufferPointer", []),
+ Method(SIZE_T, "GetBufferSize", []),
+]
+
+D3D10_DRIVER_TYPE = Enum("D3D10_DRIVER_TYPE", [
+ "D3D10_DRIVER_TYPE_HARDWARE",
+ "D3D10_DRIVER_TYPE_REFERENCE",
+ "D3D10_DRIVER_TYPE_NULL",
+ "D3D10_DRIVER_TYPE_SOFTWARE",
+ "D3D10_DRIVER_TYPE_WARP",
+])
+
+D3D10_FEATURE_LEVEL1 = Enum("D3D10_FEATURE_LEVEL1", [
+ "D3D10_FEATURE_LEVEL_10_0",
+ "D3D10_FEATURE_LEVEL_10_1",
+ "D3D10_FEATURE_LEVEL_9_1",
+ "D3D10_FEATURE_LEVEL_9_2",
+ "D3D10_FEATURE_LEVEL_9_3",
+])
+
+# TODO
+IDXGIAdapter = Alias("IDXGIAdapter", Void)
+ID3D10Device1 = Alias("ID3D10Device1", Void)
+IDXGISwapChain = Alias("IDXGISwapChain", Void)
+DXGI_SWAP_CHAIN_DESC = Alias("DXGI_SWAP_CHAIN_DESC", Void)
+
+d3d10_1 = Dll("d3d10")
+d3d10_1.functions += [
+ DllFunction(HRESULT, "D3D10CreateDevice1", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (UINT, "Flags"), (D3D10_FEATURE_LEVEL1, "HardwareLevel"), (UINT, "SDKVersion"), (OutPointer(Pointer(ID3D10Device1)), "ppDevice")]),
+ 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")]),
+ DllFunction(HRESULT, "D3D10CreateBlob", [(SIZE_T, "NumBytes"), (OutPointer(LPD3D10BLOB), "ppBuffer")]),
+]
+
+if __name__ == '__main__':
+ print '#include <windows.h>'
+ print '#include <tchar.h>'
+ print
+ print '#include "compat.h"'
+ print
+ print '#include <d3d10_1.h>'
+ print
+ print '#include "log.hpp"'
+ print
+ wrap()
--- /dev/null
+#############################################################################
+#
+# Copyright 2009 VMware, Inc.
+#
+# 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/>.
+#
+#############################################################################
+
+"""d3d10misc.h"""
+
+from windows import *
+
+ID3D10Blob = Interface("ID3D10Blob", IUnknown)
+LPD3D10BLOB = Pointer(ID3D10Blob)
+
+ID3D10Blob.methods += [
+ Method(LPVOID, "GetBufferPointer", []),
+ Method(SIZE_T, "GetBufferSize", []),
+]
+
+D3D10_DRIVER_TYPE = Enum("D3D10_DRIVER_TYPE", [
+ "D3D10_DRIVER_TYPE_HARDWARE",
+ "D3D10_DRIVER_TYPE_REFERENCE",
+ "D3D10_DRIVER_TYPE_NULL",
+ "D3D10_DRIVER_TYPE_SOFTWARE",
+ "D3D10_DRIVER_TYPE_WARP",
+])
+
+# TODO
+IDXGIAdapter = Alias("IDXGIAdapter", Void)
+ID3D10Device = Alias("ID3D10Device", Void)
+IDXGISwapChain = Alias("IDXGISwapChain", Void)
+DXGI_SWAP_CHAIN_DESC = Alias("DXGI_SWAP_CHAIN_DESC", Void)
+
+d3d10 = Dll("d3d10")
+d3d10.functions += [
+ DllFunction(HRESULT, "D3D10CreateDevice", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (UINT, "Flags"), (UINT, "SDKVersion"), (OutPointer(Pointer(ID3D10Device)), "ppDevice")]),
+ DllFunction(HRESULT, "D3D10CreateDeviceAndSwapChain", [(Pointer(IDXGIAdapter), "pAdapter"), (D3D10_DRIVER_TYPE, "DriverType"), (HMODULE, "Software"), (UINT, "Flags"), (UINT, "SDKVersion"), (Pointer(DXGI_SWAP_CHAIN_DESC), "pSwapChainDesc"), (OutPointer(Pointer(IDXGISwapChain)), "ppSwapChain"), (OutPointer(Pointer(ID3D10Device)), "ppDevice")]),
+ DllFunction(HRESULT, "D3D10CreateBlob", [(SIZE_T, "NumBytes"), (OutPointer(LPD3D10BLOB), "ppBuffer")]),
+]
+
+if __name__ == '__main__':
+ print '#include <windows.h>'
+ print '#include <tchar.h>'
+ print
+ print '#include "compat.h"'
+ print
+ print '#include <d3d10.h>'
+ print
+ print '#include "log.hpp"'
+ print
+ wrap()
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"'
LPCWSTR = Const(WString)
LARGE_INTEGER = Intrinsic("LARGE_INTEGER", "0x%llx")
+SIZE_T = Alias("SIZE_T", SizeT)
HRESULT = Alias("HRESULT", Int)
])
LPRGNDATA = Pointer(RGNDATA)
+HMODULE = Alias("HMODULE", LPVOID)
IUnknown = Interface("IUnknown")