endif ()
if (WIN32 AND DirectX_D3D10_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
+ set (MODULES d3d10)
+
+ if (DirectX_D3D10_1_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
+ set (MODULES ${MODULES} d3d10_1)
+ endif ()
+
+ if (DirectX_D3D11_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
+ set (MODULES ${MODULES} d3d11)
+ endif ()
+
+ if (DirectX_D3D11_1_INCLUDE_DIR)
+ include_directories (SYSTEM ${DirectX_D3D11_1_INCLUDE_DIR})
+ set (MODULES ${MODULES} d3d11_1)
+ endif ()
+
add_custom_command (
OUTPUT d3dretrace_d3d10.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10retrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d10.cpp
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3dcommonretrace.py ${MODULES} > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d10.cpp
DEPENDS
- d3d10retrace.py
d3dcommonretrace.py
dllretrace.py
retrace.py
${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d11.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
+ ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
${CMAKE_SOURCE_DIR}/specs/d3d10.py
${CMAKE_SOURCE_DIR}/specs/d3d10misc.py
${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
${CMAKE_SOURCE_DIR}/specs/stdapi.py
)
- include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
add_executable (d3d10retrace
d3dretrace_main.cpp
d3dretrace_d3d10.cpp
install (TARGETS d3d10retrace RUNTIME DESTINATION bin)
endif ()
-
-if (WIN32 AND DirectX_D3D10_1_INCLUDE_DIR)
- add_custom_command (
- OUTPUT d3dretrace_d3d10_1.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10_1retrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d10_1.cpp
- DEPENDS
- d3d10retrace.py
- d3dcommonretrace.py
- dllretrace.py
- retrace.py
- ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
- ${CMAKE_SOURCE_DIR}/specs/d3d10_1.py
- ${CMAKE_SOURCE_DIR}/specs/d3d10.py
- ${CMAKE_SOURCE_DIR}/specs/d3d10sdklayers.py
- ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
- ${CMAKE_SOURCE_DIR}/specs/dxgi.py
- ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
- ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
- ${CMAKE_SOURCE_DIR}/specs/winapi.py
- ${CMAKE_SOURCE_DIR}/specs/stdapi.py
- )
-
- include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
- add_executable (d3d10_1retrace
- d3dretrace_main.cpp
- d3dretrace_d3d10_1.cpp
- d3dretrace_ws.cpp
- )
- target_link_libraries (d3d10_1retrace
- retrace_common
- )
-
- install (TARGETS d3d10_1retrace RUNTIME DESTINATION bin)
-endif ()
-
-if (WIN32 AND DirectX_D3D11_INCLUDE_DIR)
- add_custom_command (
- OUTPUT d3dretrace_d3d11.cpp
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11retrace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3dretrace_d3d11.cpp
- DEPENDS
- d3d11retrace.py
- d3dcommonretrace.py
- dllretrace.py
- retrace.py
- ${CMAKE_SOURCE_DIR}/dispatch/dispatch.py
- ${CMAKE_SOURCE_DIR}/specs/d3d11_1.py
- ${CMAKE_SOURCE_DIR}/specs/d3d11.py
- ${CMAKE_SOURCE_DIR}/specs/d3d11sdklayers.py
- ${CMAKE_SOURCE_DIR}/specs/d3dcommon.py
- ${CMAKE_SOURCE_DIR}/specs/dxgi.py
- ${CMAKE_SOURCE_DIR}/specs/dxgitype.py
- ${CMAKE_SOURCE_DIR}/specs/dxgiformat.py
- ${CMAKE_SOURCE_DIR}/specs/winapi.py
- ${CMAKE_SOURCE_DIR}/specs/stdapi.py
- )
-
- include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
- add_executable (d3d11retrace
- d3dretrace_main.cpp
- d3dretrace_d3d11.cpp
- d3dretrace_ws.cpp
- )
- target_link_libraries (d3d11retrace
- retrace_common
- )
-
- install (TARGETS d3d11retrace RUNTIME DESTINATION bin)
-endif ()
+++ /dev/null
-##########################################################################
-#
-# Copyright 2011 Jose Fonseca
-# All Rights Reserved.
-#
-# 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:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# 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.
-#
-##########################################################################/
-
-
-"""D3D10 retracer generator."""
-
-
-from d3dcommonretrace import D3DRetracer
-import specs.stdapi as stdapi
-from specs.d3d10_1 import d3d10_1
-
-
-if __name__ == '__main__':
- print r'''
-#include <string.h>
-
-#include <iostream>
-
-#include "d3d10_1imports.hpp"
-#include "d3d10size.hpp"
-#include "d3dretrace.hpp"
-
-'''
-
- retracer = D3DRetracer()
- retracer.retraceModule(d3d10_1)
+++ /dev/null
-##########################################################################
-#
-# Copyright 2011 Jose Fonseca
-# All Rights Reserved.
-#
-# 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:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# 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.
-#
-##########################################################################/
-
-
-"""D3D10 retracer generator."""
-
-
-from d3dcommonretrace import D3DRetracer
-import specs.stdapi as stdapi
-from specs.d3d10 import d3d10
-
-
-if __name__ == '__main__':
- print r'''
-#include <string.h>
-
-#include <iostream>
-
-#include "d3d10imports.hpp"
-#include "d3d10size.hpp"
-#include "d3dretrace.hpp"
-
-'''
-
- retracer = D3DRetracer()
- retracer.retraceModule(d3d10)
+++ /dev/null
-##########################################################################
-#
-# Copyright 2011 Jose Fonseca
-# All Rights Reserved.
-#
-# 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:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# 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.
-#
-##########################################################################/
-
-
-"""D3D10 retracer generator."""
-
-
-from d3dcommonretrace import D3DRetracer
-import specs.stdapi as stdapi
-from specs.d3d11 import d3d11
-
-
-if __name__ == '__main__':
- print r'''
-#include <string.h>
-
-#include <iostream>
-
-#include "d3d11imports.hpp"
-#include "d3d11size.hpp"
-#include "d3dretrace.hpp"
-
-'''
-
- retracer = D3DRetracer()
- retracer.retraceModule(d3d11)
"""D3D retracer generator."""
+import sys
from dllretrace import DllRetracer as Retracer
-import specs.stdapi as stdapi
+from specs.stdapi import API
+from specs.dxgi import dxgi
+from specs.d3d10 import d3d10
+from specs.d3d10_1 import d3d10_1
+from specs.d3d11 import d3d11
class D3DRetracer(Retracer):
print ' if (_pbData) {'
print ' retrace::delRegionByPointer(_pbData);'
print ' }'
+
+
+def main():
+ print r'''#include <string.h>'''
+ print
+ print r'#include <iostream>'
+ print
+ print r'#include "d3dretrace.hpp"'
+ print
+
+ 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"'
+ # D3D10CreateBlob is duplicated in d3d10 and d3d10_1
+ d3d10_1.functions = [function for function in d3d10_1.functions if function.name != 'D3D10CreateBlob']
+ api.addModule(d3d10_1)
+ else:
+ print r'#include "d3d10imports.hpp"'
+ print r'#include "d3d10size.hpp"'
+ api.addModule(d3d10)
+ if 'd3d11' in moduleNames:
+ print r'#include "d3d11imports.hpp"'
+ if 'd3d11_1' in moduleNames:
+ print '#include <d3d11_1.h>'
+ import specs.d3d11_1
+ print r'#include "d3d11size.hpp"'
+ api.addModule(d3d11)
+
+ retracer = D3DRetracer()
+ retracer.retraceApi(api)
+
+
+if __name__ == '__main__':
+ main()