MCPcopy Create free account
hub / github.com/Apress/Ray-Tracing-Gems-II / wWinMain

Function wWinMain

Chapter_14/src/main.cpp:218–260  ·  view source on GitHub ↗

* Program entry point. */

Source from the content-addressed store, hash-verified

216 * Program entry point.
217 */
218int 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}

Callers

nothing calls this directly

Calls 5

ParseCommandLineFunction · 0.85
InitMethod · 0.45
UpdateMethod · 0.45
RenderMethod · 0.45
CleanupMethod · 0.45

Tested by

no test coverage detected