MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / test_all

Method test_all

tests/cgpu/SwapChainCreation/SwapChainCreation.cpp:92–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91template <ECGPUBackend backend>
92void SwapChainCreation<backend>::test_all()
93{
94#if defined(_WIN32) || defined(_WIN64)
95SUBCASE("CreateFromHWND")
96{
97 auto surface = cgpu_surface_from_hwnd(device, hwnd);
98
99 EXPECT_NE(surface, CGPU_NULLPTR);
100 EXPECT_NE(surface, nullptr);
101
102 auto swapchain = CreateSwapChainWithSurface(surface);
103
104 EXPECT_NE(swapchain, CGPU_NULLPTR);
105 EXPECT_NE(swapchain, nullptr);
106
107 cgpu_free_swapchain(swapchain);
108 cgpu_free_surface(device, surface);
109}
110#elif defined(__APPLE__)
111 #define BACK_BUFFER_WIDTH 1280
112 #define BACK_BUFFER_HEIGHT 720
113
114SUBCASE("CreateFromNSView")
115{
116 auto ns_view = (struct NSView*)nswindow_get_content_view(nswin);
117 auto surface = cgpu_surface_from_ns_view(device, (CGPUNSView*)ns_view);
118
119 EXPECT_NE(surface, CGPU_NULLPTR);
120 EXPECT_NE(surface, nullptr);
121
122 auto swapchain = CreateSwapChainWithSurface(surface);
123
124 EXPECT_NE(swapchain, CGPU_NULLPTR);
125 EXPECT_NE(swapchain, nullptr);
126
127 cgpu_free_swapchain(swapchain);
128 cgpu_free_surface(device, surface);
129}
130#endif
131}
132
133#if defined(_WIN32) || defined(_WIN64)
134LRESULT CALLBACK WindowProcedure(HWND window, UINT msg, WPARAM wp, LPARAM lp)

Callers

nothing calls this directly

Calls 4

cgpu_surface_from_hwndFunction · 0.85
cgpu_free_swapchainFunction · 0.85
cgpu_free_surfaceFunction · 0.85

Tested by

no test coverage detected