* Program entry point. */
| 216 | * Program entry point. |
| 217 | */ |
| 218 | int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) |
| 219 | { |
| 220 | UNREFERENCED_PARAMETER(hInstance); |
| 221 | UNREFERENCED_PARAMETER(hPrevInstance); |
| 222 | |
| 223 | // Tell Windows that we're DPI aware (we handle scaling ourselves, e.g. the scaling of GUI) |
| 224 | SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); |
| 225 | |
| 226 | HRESULT hr = EXIT_SUCCESS; |
| 227 | { |
| 228 | MSG msg = { 0 }; |
| 229 | |
| 230 | // Get the application configuration |
| 231 | ConfigInfo config; |
| 232 | hr = Utils::ParseCommandLine(lpCmdLine, config); |
| 233 | if (hr != EXIT_SUCCESS) return hr; |
| 234 | |
| 235 | // Initialize |
| 236 | DXRApplication app; |
| 237 | app.Init(config); |
| 238 | |
| 239 | // Main loop |
| 240 | while (WM_QUIT != msg.message) |
| 241 | { |
| 242 | if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) |
| 243 | { |
| 244 | TranslateMessage(&msg); |
| 245 | DispatchMessage(&msg); |
| 246 | } |
| 247 | |
| 248 | app.Update(); |
| 249 | app.Render(); |
| 250 | } |
| 251 | |
| 252 | app.Cleanup(); |
| 253 | } |
| 254 | |
| 255 | #if defined _CRTDBG_MAP_ALLOC |
| 256 | _CrtDumpMemoryLeaks(); |
| 257 | #endif |
| 258 | |
| 259 | return hr; |
| 260 | } |
nothing calls this directly
no test coverage detected