Browse Source

no message

Hongtae Kim 8 years ago
parent
commit
38521138ac
1 changed files with 17 additions and 5 deletions
  1. 17
    5
      TestApp1/TestApp1.cpp

+ 17
- 5
TestApp1/TestApp1.cpp View File

@@ -11,11 +11,19 @@
11 11
 class TestApp1 : public DKApplication
12 12
 {
13 13
 	DKObject<DKWindow> window;
14
+	DKObject<DKScreen> screen;
14 15
 public:
15 16
 	void OnInitialize(void) override
16 17
 	{
17 18
 		DKLog("%s", DKGL_FUNCTION_NAME);
18
-		window = DKWindow::Create("DefaultWindow");
19
+		try {
20
+			window = DKWindow::Create("DefaultWindow");
21
+			screen = DKOBJECT_NEW DKScreen(window, NULL);
22
+		}
23
+		catch (DKError& e)
24
+		{
25
+			DKLog("error? :%ls", (const wchar_t*)e.Description());
26
+		}
19 27
 		window->Activate();
20 28
 
21 29
 		window->AddEventHandler(this,
@@ -28,6 +36,8 @@ public:
28 36
 		DKObject<DKGraphicsDevice> device = DKGraphicsDevice::SharedInstance();
29 37
 		DKObject<DKCommandQueue> queue = device->CreateCommandQueue();
30 38
 		DKObject<DKCommandBuffer> buffer = queue->CreateCommandBuffer();
39
+		DKObject<DKSwapChain> swapChain = queue->CreateSwapChain(window);
40
+
31 41
 	}
32 42
 	void OnTerminate(void) override
33 43
 	{
@@ -41,11 +51,13 @@ public:
41 51
 		{
42 52
 			if (buckets[i].totalChunks > 0)
43 53
 			{
44
-				DKLog("--> %lu: allocated:%lu, reserved:%.1fKB. (usage:%.1f%%)",
54
+				DKLog("--> %lu:  %lu/%lu (usage:%.1f%%, used:%.1KB, total%.1fKB)",
45 55
 					buckets[i].chunkSize,
46
-					buckets[i].chunkSize * buckets[i].usedChunks,
47
-					double(buckets[i].chunkSize * (buckets[i].totalChunks - buckets[i].usedChunks)) / 1024.0,
48
-					double(buckets[i].usedChunks) / double(buckets[i].totalChunks) * 100.0);
56
+					buckets[i].usedChunks, buckets[i].totalChunks,
57
+					double(buckets[i].usedChunks) / double(buckets[i].totalChunks) * 100.0,
58
+					double(buckets[i].chunkSize * buckets[i].usedChunks) / 1024.0,
59
+					double(buckets[i].chunkSize * buckets[i].totalChunks) / 1024.0
60
+				);
49 61
 				usedBytes += buckets[i].chunkSize * buckets[i].usedChunks;
50 62
 			}
51 63
 		}