]> git.notmuchmail.org Git - apitrace/commitdiff
Stub d3d state dumping.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 8 May 2012 22:41:35 +0000 (23:41 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 8 May 2012 22:41:35 +0000 (23:41 +0100)
retrace/CMakeLists.txt
retrace/d3dretrace_main.cpp
retrace/d3dstate.cpp [new file with mode: 0644]
retrace/d3dstate.hpp

index dcf9da4423de374189a330eb09d159d7fcb12a53..8d638d017b677cec50df93927bf2d68e1bc7f643 100644 (file)
@@ -149,6 +149,7 @@ if (WIN32 AND DirectX_D3DX9_INCLUDE_DIR)
         retrace_stdc.cpp
         d3dretrace_main.cpp
         d3dretrace_d3d9.cpp
+        d3dstate.cpp
         d3dstate_images.cpp
     )
     target_link_libraries (d3dretrace
index 4dba29942f9fb5916ac81a13f9dbb9fe77c64ae0..40d53eafb1b946201a076cb996b8dddb5d12202e 100644 (file)
@@ -71,7 +71,13 @@ retrace::getSnapshot(void) {
 bool
 retrace::dumpState(std::ostream &os)
 {
-    return false;
+    if (!d3dretrace::pLastDirect3DDevice9) {
+        return false;
+    }
+
+    d3dstate::dumpDevice(os, d3dretrace::pLastDirect3DDevice9);
+
+    return true;
 }
 
 
diff --git a/retrace/d3dstate.cpp b/retrace/d3dstate.cpp
new file mode 100644 (file)
index 0000000..4fa89c2
--- /dev/null
@@ -0,0 +1,45 @@
+/**************************************************************************
+ *
+ * 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.
+ *
+ **************************************************************************/
+
+
+#include <iostream>
+
+#include "d3d9imports.hpp"
+#include "json.hpp"
+
+
+namespace d3dstate {
+
+
+void
+dumpDevice(std::ostream &os, IDirect3DDevice9 *pDevice)
+{
+    JSONWriter json(os);
+
+    /* TODO */
+}
+
+
+} /* namespace d3dstate */
index c607ed2ee1f18121481600e1f62c94e458da59e7..33322a10a22b37438a4ec086f495d3edaecee30d 100644 (file)
@@ -27,6 +27,9 @@
 #define _D3DSTATE_HPP_
 
 
+#include <iostream>
+
+
 struct IDirect3DDevice9;
 
 
@@ -42,6 +45,10 @@ image::Image *
 getRenderTargetImage(IDirect3DDevice9 *pDevice);
 
 
+void
+dumpDevice(std::ostream &os, IDirect3DDevice9 *pDevice);
+
+
 } /* namespace d3dstate */