]> git.cworth.org Git - apitrace/commitdiff
Eliminate dependency on D3DX10/D3DX11.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 30 Apr 2012 15:51:08 +0000 (16:51 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Mon, 30 Apr 2012 15:51:08 +0000 (16:51 +0100)
Given that it's being deprecated.

dispatch/d3d10_1imports.hpp [new file with mode: 0644]
dispatch/d3d10imports.hpp [new file with mode: 0644]
dispatch/d3d11imports.hpp [new file with mode: 0644]
dispatch/d3derr.hpp [new file with mode: 0644]
wrappers/CMakeLists.txt
wrappers/d3d10_1trace.py
wrappers/d3d10trace.py
wrappers/d3d11trace.py

diff --git a/dispatch/d3d10_1imports.hpp b/dispatch/d3d10_1imports.hpp
new file mode 100644 (file)
index 0000000..254323e
--- /dev/null
@@ -0,0 +1,43 @@
+/**************************************************************************
+ *
+ * Copyright 2012 VMware, Inc.
+ * 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.
+ *
+ **************************************************************************/
+
+/*
+ * Central place for all D3D10 includes, and respective OS dependent headers.
+ */
+
+#ifndef _D3D10_1IMPORTS_HPP_
+#define _D3D10_1IMPORTS_HPP_
+
+
+#include <windows.h>
+
+#include "compat.h"
+
+#include <d3d10_1.h>
+
+#include "d3derr.hpp"
+
+
+#endif /* _D3D10_1IMPORTS_HPP_ */
diff --git a/dispatch/d3d10imports.hpp b/dispatch/d3d10imports.hpp
new file mode 100644 (file)
index 0000000..d21aec8
--- /dev/null
@@ -0,0 +1,43 @@
+/**************************************************************************
+ *
+ * Copyright 2012 VMware, Inc.
+ * 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.
+ *
+ **************************************************************************/
+
+/*
+ * Central place for all D3D10 includes, and respective OS dependent headers.
+ */
+
+#ifndef _D3D10IMPORTS_HPP_
+#define _D3D10IMPORTS_HPP_
+
+
+#include <windows.h>
+
+#include "compat.h"
+
+#include <d3d10.h>
+
+#include "d3derr.hpp"
+
+
+#endif /* _D3D10IMPORTS_HPP_ */
diff --git a/dispatch/d3d11imports.hpp b/dispatch/d3d11imports.hpp
new file mode 100644 (file)
index 0000000..eabcaf1
--- /dev/null
@@ -0,0 +1,43 @@
+/**************************************************************************
+ *
+ * Copyright 2012 VMware, Inc.
+ * 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.
+ *
+ **************************************************************************/
+
+/*
+ * Central place for all D3D11 includes, and respective OS dependent headers.
+ */
+
+#ifndef _D3D11IMPORTS_HPP_
+#define _D3D11IMPORTS_HPP_
+
+
+#include <windows.h>
+
+#include "compat.h"
+
+#include <d3d11.h>
+
+#include "d3derr.hpp"
+
+
+#endif /* _D3D11IMPORTS_HPP_ */
diff --git a/dispatch/d3derr.hpp b/dispatch/d3derr.hpp
new file mode 100644 (file)
index 0000000..39a3e9c
--- /dev/null
@@ -0,0 +1,63 @@
+/**************************************************************************
+ *
+ * Copyright 2012 VMware, Inc.
+ * 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.
+ *
+ **************************************************************************/
+
+/*
+ * D3DERR return codes.
+ *
+ * These were defined in d3dx10.h/d3dx11.h on DirectX SDK, and moved to
+ * winerror.h on Windows 8 SDK.
+ *
+ * See also:
+ * - http://msdn.microsoft.com/en-us/library/windows/desktop/ff476174.aspx
+ * - http://msdn.microsoft.com/en-us/library/windows/desktop/bb205278.aspx
+ * - http://msdn.microsoft.com/en-us/library/windows/desktop/bb172554.aspx
+ */
+
+#ifndef _D3DERR_HPP_
+#define _D3DERR_HPP_
+
+
+#ifndef _FACD3D
+#define _FACD3D  0x876
+#endif
+
+#ifndef MAKE_D3DHRESULT
+#define MAKE_D3DHRESULT(code) MAKE_HRESULT(1, _FACD3D, code)
+#endif
+
+#ifndef MAKE_D3DSTATUS
+#define MAKE_D3DSTATUS(code) MAKE_HRESULT(0, _FACD3D, code)
+#endif
+
+#ifndef D3DERR_INVALIDCALL
+#define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
+#endif
+
+#ifndef D3DERR_WASSTILLDRAWING
+#define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
+#endif
+
+
+#endif /* _D3DERR_HPP_ */
index 59bc2dc6241d38edb3411ce6857105d18f9b4732..602932bf724585447529beae5d72a43c1c8849fe 100644 (file)
@@ -108,8 +108,8 @@ if (WIN32)
     endif ()
 
     # d3d10.dll
-    if (DirectX_D3DX10_INCLUDE_DIR)
-        include_directories (SYSTEM ${DirectX_D3DX10_INCLUDE_DIR})
+    if (DirectX_D3D10_INCLUDE_DIR)
+        include_directories (SYSTEM ${DirectX_D3D10_INCLUDE_DIR})
         add_custom_command (
             OUTPUT d3d10trace.cpp
             COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d10trace.py > ${CMAKE_CURRENT_BINARY_DIR}/d3d10trace.cpp
@@ -142,7 +142,7 @@ if (WIN32)
     endif ()
 
     # d3d10_1.dll
-    if (DirectX_D3DX10_INCLUDE_DIR AND DirectX_D3D10_1_INCLUDE_DIR)
+    if (DirectX_D3D10_1_INCLUDE_DIR)
         include_directories (SYSTEM ${DirectX_D3D10_1_INCLUDE_DIR})
         add_custom_command (
             OUTPUT d3d10_1trace.cpp
@@ -176,14 +176,14 @@ if (WIN32)
     endif ()
 
     # d3d11.dll
-    if (DirectX_D3DX11_INCLUDE_DIR)
+    if (DirectX_D3D11_INCLUDE_DIR)
         if (DirectX_D3D11_1_INCLUDE_DIR)
             set (HAVE_D3D11_1 1)
         else ()
             set (HAVE_D3D11_1 0)
         endif ()
 
-        include_directories (SYSTEM ${DirectX_D3DX11_INCLUDE_DIR})
+        include_directories (SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
         add_custom_command (
             OUTPUT d3d11trace.cpp
             COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/d3d11trace.py ${HAVE_D3D11_1} > ${CMAKE_CURRENT_BINARY_DIR}/d3d11trace.cpp
index fb84835f3f8bc7f136829a37fee6a21e58dbf41d..485ec32b672d536b94253313ff5f74c24d73f3c0 100644 (file)
@@ -34,12 +34,7 @@ if __name__ == '__main__':
     print '#include "trace_writer_local.hpp"'
     print '#include "os.hpp"'
     print
-    print '#include <windows.h>'
-    print
-    print '#include "compat.h"'
-    print
-    print '#include <d3d10_1.h>'
-    print '#include <d3dx10.h>'
+    print '#include "d3d10_1imports.hpp"'
     print
     tracer = DllTracer('d3d10_1.dll')
     tracer.traceApi(d3d10_1)
index d13f65d3bc139b632642ac1d031fc5a436adb9e5..3529d582039f95db441796ad21b9ef54d08c5c8e 100644 (file)
@@ -34,12 +34,7 @@ if __name__ == '__main__':
     print '#include "trace_writer_local.hpp"'
     print '#include "os.hpp"'
     print
-    print '#include <windows.h>'
-    print
-    print '#include "compat.h"'
-    print
-    print '#include <d3d10.h>'
-    print '#include <d3dx10.h>'
+    print '#include "d3d10imports.hpp"'
     print
     tracer = DllTracer('d3d10.dll')
     tracer.traceApi(d3d10)
index ceafdcc10580683679c009d8fe7a84741049292d..80e855fe18bbff13579bdc433b3533513e4d283d 100644 (file)
@@ -36,17 +36,13 @@ if __name__ == '__main__':
     print '#include "trace_writer_local.hpp"'
     print '#include "os.hpp"'
     print
-    print '#include <windows.h>'
+    print '#include "d3d11imports.hpp"'
     print
-    print '#include "compat.h"'
-    print
-    print '#include <d3d11.h>'
 
     if int(sys.argv[1]):
         import specs.d3d11_1
         print '#include <d3d11_1.h>'
+        print
 
-    print '#include <d3dx11.h>'
-    print
     tracer = DllTracer('d3d11.dll')
     tracer.traceApi(d3d11)