From 4e2f68eb37cc1841a7dbeea6718365fe5cac5729 Mon Sep 17 00:00:00 2001
From: RD42 <42702181+dashr9230@users.noreply.github.com>
Date: Sat, 18 May 2024 22:34:13 +0800
Subject: [PATCH] [saco] Implement `DXUTD3DDeviceTypeToString(...)`
---
saco/d3d9/common/DXUTSettingsDlg.cpp | 29 ++++++++++++++++++++++++++++
saco/d3d9/common/DXUTSettingsDlg.h | 15 ++++++++++++++
saco/d3d9/common/dxstdafx.h | 11 +++++++++++
saco/saco.vcproj | 6 ++++++
4 files changed, 61 insertions(+)
create mode 100644 saco/d3d9/common/DXUTSettingsDlg.cpp
create mode 100644 saco/d3d9/common/DXUTSettingsDlg.h
diff --git a/saco/d3d9/common/DXUTSettingsDlg.cpp b/saco/d3d9/common/DXUTSettingsDlg.cpp
new file mode 100644
index 0000000..fb1ccf8
--- /dev/null
+++ b/saco/d3d9/common/DXUTSettingsDlg.cpp
@@ -0,0 +1,29 @@
+//--------------------------------------------------------------------------------------
+// File: DXUTSettingsDlg.cpp
+//
+// Dialog for selection of device settings
+//
+// Copyright (c) Microsoft Corporation. All rights reserved
+//--------------------------------------------------------------------------------------
+#include "dxstdafx.h"
+#include "DXUTgui.h"
+#include "DXUTsettingsDlg.h"
+#undef min // use __min instead
+#undef max // use __max instead
+
+
+//--------------------------------------------------------------------------------------
+// Returns the string for the given D3DDEVTYPE.
+//--------------------------------------------------------------------------------------
+TCHAR* DXUTD3DDeviceTypeToString(D3DDEVTYPE devType)
+{
+ switch (devType)
+ {
+ case D3DDEVTYPE_HAL: return "D3DDEVTYPE_HA";
+ case D3DDEVTYPE_SW: return "D3DDEVTYPE_SW";
+ case D3DDEVTYPE_REF: return "D3DDEVTYPE_REF";
+ default: return "Unknown devType";
+ }
+}
+
+
diff --git a/saco/d3d9/common/DXUTSettingsDlg.h b/saco/d3d9/common/DXUTSettingsDlg.h
new file mode 100644
index 0000000..f805333
--- /dev/null
+++ b/saco/d3d9/common/DXUTSettingsDlg.h
@@ -0,0 +1,15 @@
+//--------------------------------------------------------------------------------------
+// File: DXUTSettingsDlg.cpp
+//
+// Copyright (c) Microsoft Corporation. All rights reserved
+//--------------------------------------------------------------------------------------
+#pragma once
+#ifndef DXUT_SETTINGS_H
+#define DXUT_SETTINGS_H
+
+
+
+
+
+#endif
+
diff --git a/saco/d3d9/common/dxstdafx.h b/saco/d3d9/common/dxstdafx.h
index 37a7af4..71544d6 100644
--- a/saco/d3d9/common/dxstdafx.h
+++ b/saco/d3d9/common/dxstdafx.h
@@ -32,5 +32,16 @@
#include "DXUTmisc.h"
#include "DXUTgui.h"
+#include "DXUTsettingsDlg.h"
+
+#ifndef SAFE_DELETE
+#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
+#endif
+#ifndef SAFE_DELETE_ARRAY
+#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
+#endif
+#ifndef SAFE_RELEASE
+#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
+#endif
#endif // !defined(DXSDK_STDAFX_H)
diff --git a/saco/saco.vcproj b/saco/saco.vcproj
index 0b92829..c5546b5 100644
--- a/saco/saco.vcproj
+++ b/saco/saco.vcproj
@@ -592,6 +592,12 @@
+
+
+
+