Browse Source

User Config 를 파일에서 읽고 쓰도록 수정.

Hongtae Kim 5 years ago
parent
commit
15b3bd36f8
1 changed files with 9 additions and 6 deletions
  1. 9
    6
      TestApp1/TestApp1.cpp

+ 9
- 6
TestApp1/TestApp1.cpp View File

@@ -173,6 +173,8 @@ void PrintShaderResource(const DKShaderResource& res)
173 173
 class TestApp1 : public DKApplication
174 174
 {
175 175
 	DKResourcePool resourcePool;
176
+	DKString userConfigPath;
177
+
176 178
 public:
177 179
 	void OnInitialize(void) override
178 180
 	{
@@ -183,12 +185,10 @@ public:
183 185
 		DKLog("resPath: %ls", (const wchar_t*)resPath);
184 186
 		resourcePool.AddLocatorForPath(resPath);
185 187
 
186
-		DKVariant vulkanProps;
187
-		vulkanProps.NewValueAtKeyPath("pipelineCacheFilePath", 
188
-									  DefaultPath(SystemPath::AppExecutable).FilePathStringByAppendingPath("pipeline.cache"));
189
-
190
-		DKPropertySet::SystemConfig().SetValue("Vulkan", vulkanProps);
191
-
188
+		userConfigPath = DefaultPath(SystemPath::AppExecutable).FilePathStringByAppendingPath("app.config.xml");
189
+		int numItemsImported = DKPropertySet::DefaultSet().Import(userConfigPath, true);
190
+		if (numItemsImported >= 0)
191
+			DKLogI("UserSettings: %ls (%d items imported)", (const wchar_t*)userConfigPath, numItemsImported);
192 192
 
193 193
 		DKObject<DKData> vertData = resourcePool.LoadResourceData("shaders/texture/texture.vert.spv");
194 194
 		DKObject<DKData> fragData = resourcePool.LoadResourceData("shaders/texture/texture.frag.spv");
@@ -260,6 +260,9 @@ public:
260 260
 	{
261 261
 		DKLogD("%s", DKGL_FUNCTION_NAME);
262 262
 
263
+		int numItemsExported = DKPropertySet::DefaultSet().Export(userConfigPath, true);
264
+		DKLogI("Setting saved: %ls (%d items exported)", (const wchar_t*)userConfigPath, numItemsExported);
265
+
263 266
 		DKLogI("Memory Pool Statistics");
264 267
 		size_t numBuckets = DKMemoryPoolNumberOfBuckets();
265 268
 		DKMemoryPoolBucketStatus* buckets = new DKMemoryPoolBucketStatus[numBuckets];