print '// Swizzling mapping for lock addresses'
print 'static std::map<void *, void *> _maps;'
print
+ print r'''
+static void
+createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
+ if (pSwapChainDesc->Windowed) {
+ UINT Width = pSwapChainDesc->BufferDesc.Width;
+ UINT Height = pSwapChainDesc->BufferDesc.Height;
+ if (!Width) Width = 1024;
+ if (!Height) Height = 768;
+ pSwapChainDesc->OutputWindow = d3dretrace::createWindow(Width, Height);
+ }
+}
+'''
self.table_name = 'd3dretrace::d3d10_callbacks'
if function.name in self.createDeviceFunctionNames:
# create windows as neccessary
if 'pSwapChainDesc' in function.argNames():
- print r' pSwapChainDesc->OutputWindow = d3dretrace::createWindow(512, 512);'
+ print r' createWindow(pSwapChainDesc);'
# Compensate for the fact we don't trace the software renderer
# module LoadLibrary call
def invokeInterfaceMethod(self, interface, method):
# keep track of the last used device for state dumping
+ if interface.name in ('ID3D10Device', 'ID3D10Device1'):
+ if method.name == 'Release':
+ print r' d3d10Dumper.unbindDevice(_this);'
+ else:
+ print r' d3d10Dumper.bindDevice(_this);'
if interface.name in ('ID3D11DeviceContext',):
if method.name == 'Release':
print r' d3d11Dumper.unbindDevice(_this);'
# create windows as neccessary
if method.name == 'CreateSwapChain':
- print r' pDesc->OutputWindow = d3dretrace::createWindow(512, 512);'
+ print r' createWindow(pDesc);'
# notify frame has been completed
if method.name == 'Present':
moduleNames = sys.argv[1:]
api = API()
+
if moduleNames:
api.addModule(dxgi)
+
if 'd3d10' in moduleNames:
if 'd3d10_1' in moduleNames:
print r'#include "d3d10_1imports.hpp"'
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
api.addModule(d3d10)
+ print
+ print '''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;'''
+ print
+
if 'd3d11' in moduleNames:
print r'#include "d3d11imports.hpp"'
if 'd3d11_1' in moduleNames: