d3d10: Add a debug function for D3D10_DRIVER_TYPE.

Henri Verbeet hverbeet at codeweavers.com
Mon Oct 20 08:28:08 CDT 2008


---
 dlls/d3d10/Makefile.in     |    3 ++-
 dlls/d3d10/d3d10_main.c    |    7 ++-----
 dlls/d3d10/d3d10_private.h |   33 +++++++++++++++++++++++++++++++++
 dlls/d3d10/utils.c         |   43 +++++++++++++++++++++++++++++++++++++++++++
 include/d3d10.idl          |    2 +-
 include/d3d10misc.h        |   39 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 120 insertions(+), 7 deletions(-)
 create mode 100644 dlls/d3d10/d3d10_private.h
 create mode 100644 dlls/d3d10/utils.c
 create mode 100644 include/d3d10misc.h

diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in
index d9bb511..0acf4c0 100644
--- a/dlls/d3d10/Makefile.in
+++ b/dlls/d3d10/Makefile.in
@@ -7,7 +7,8 @@ IMPORTLIB = d3d10
 IMPORTS   = dxguid uuid wined3d kernel32
 
 C_SRCS = \
-	d3d10_main.c
+	d3d10_main.c \
+	utils.c
 
 RC_SRCS = version.rc
 
diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c
index 8d80c41..c0a65f4 100644
--- a/dlls/d3d10/d3d10_main.c
+++ b/dlls/d3d10/d3d10_main.c
@@ -20,12 +20,9 @@
  */
 
 #include "config.h"
-#include <stdarg.h>
+#include "wine/port.h"
 
-#include "windef.h"
-#include "winbase.h"
-#include "winuser.h"
-#include "wine/debug.h"
+#include "d3d10_private.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
 
diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h
new file mode 100644
index 0000000..6c6bf12
--- /dev/null
+++ b/dlls/d3d10/d3d10_private.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Henri Verbeet for CodeWeavers
+ *
+ * This library 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 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __WINE_D3D10_PRIVATE_H
+#define __WINE_D3D10_PRIVATE_H
+
+#include "wine/debug.h"
+
+#include "winbase.h"
+#include "winuser.h"
+#include "objbase.h"
+
+#include "d3d10.h"
+
+/* TRACE helper functions */
+const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type);
+
+#endif /* __WINE_D3D10_PRIVATE_H */
diff --git a/dlls/d3d10/utils.c b/dlls/d3d10/utils.c
new file mode 100644
index 0000000..461056b
--- /dev/null
+++ b/dlls/d3d10/utils.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2008 Henri Verbeet for CodeWeavers
+ *
+ * This library 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 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include "config.h"
+#include "wine/port.h"
+
+#include "d3d10_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3d10);
+
+#define WINE_D3D10_TO_STR(x) case x: return #x
+
+const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type)
+{
+    switch(driver_type)
+    {
+        WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_HARDWARE);
+        WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_REFERENCE);
+        WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_NULL);
+        WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_SOFTWARE);
+        default:
+            FIXME("Unrecognized D3D10_DRIVER_TYPE %#x\n", driver_type);
+            return "unrecognized";
+    }
+}
+
+#undef WINE_D3D10_TO_STR
diff --git a/include/d3d10.idl b/include/d3d10.idl
index 032063f..ad90ede 100644
--- a/include/d3d10.idl
+++ b/include/d3d10.idl
@@ -1533,7 +1533,7 @@ interface ID3D10Multithread : IUnknown
         BOOL GetMultithreadProtected();
 }
 
-/* TODO: Include "d310misc.h" as soon as it exists */
+cpp_quote("#include <d3d10misc.h>")
 /* TODO: Include "d310effect.h" as soon as it exists */
 /* TODO: Include "d310shader.h" as soon as it exists */
 /* TODO: Include "d310sdklayers.h" as soon as it exists */
diff --git a/include/d3d10misc.h b/include/d3d10misc.h
new file mode 100644
index 0000000..69b8069
--- /dev/null
+++ b/include/d3d10misc.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2008 Henri Verbeet for CodeWeavers
+ *
+ * This library 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 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef __D3D10MISC_H__
+#define __D3D10MISC_H__
+
+#include "d3d10.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum D3D10_DRIVER_TYPE {
+    D3D10_DRIVER_TYPE_HARDWARE  = 0,
+    D3D10_DRIVER_TYPE_REFERENCE = 1,
+    D3D10_DRIVER_TYPE_NULL      = 2,
+    D3D10_DRIVER_TYPE_SOFTWARE  = 3,
+} D3D10_DRIVER_TYPE;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __D3D10MISC_H__ */
-- 
1.5.6.4



--------------060300080605000701000202--



More information about the wine-patches mailing list