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
 class TestApp1 : public DKApplication
11
 class TestApp1 : public DKApplication
12
 {
12
 {
13
 	DKObject<DKWindow> window;
13
 	DKObject<DKWindow> window;
14
+	DKObject<DKScreen> screen;
14
 public:
15
 public:
15
 	void OnInitialize(void) override
16
 	void OnInitialize(void) override
16
 	{
17
 	{
17
 		DKLog("%s", DKGL_FUNCTION_NAME);
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
 		window->Activate();
27
 		window->Activate();
20
 
28
 
21
 		window->AddEventHandler(this,
29
 		window->AddEventHandler(this,
28
 		DKObject<DKGraphicsDevice> device = DKGraphicsDevice::SharedInstance();
36
 		DKObject<DKGraphicsDevice> device = DKGraphicsDevice::SharedInstance();
29
 		DKObject<DKCommandQueue> queue = device->CreateCommandQueue();
37
 		DKObject<DKCommandQueue> queue = device->CreateCommandQueue();
30
 		DKObject<DKCommandBuffer> buffer = queue->CreateCommandBuffer();
38
 		DKObject<DKCommandBuffer> buffer = queue->CreateCommandBuffer();
39
+		DKObject<DKSwapChain> swapChain = queue->CreateSwapChain(window);
40
+
31
 	}
41
 	}
32
 	void OnTerminate(void) override
42
 	void OnTerminate(void) override
33
 	{
43
 	{
41
 		{
51
 		{
42
 			if (buckets[i].totalChunks > 0)
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
 					buckets[i].chunkSize,
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
 				usedBytes += buckets[i].chunkSize * buckets[i].usedChunks;
61
 				usedBytes += buckets[i].chunkSize * buckets[i].usedChunks;
50
 			}
62
 			}
51
 		}
63
 		}