From 3e16116fd369ad3cf3600b2c3015daa3cea80e63 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 25 Dec 2019 14:30:37 -0800 Subject: Native app: added gloden image processing --- NativeApp/src/Win32/WinMain.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'NativeApp/src/Win32/WinMain.cpp') diff --git a/NativeApp/src/Win32/WinMain.cpp b/NativeApp/src/Win32/WinMain.cpp index 63dd01c..3545c53 100644 --- a/NativeApp/src/Win32/WinMain.cpp +++ b/NativeApp/src/Win32/WinMain.cpp @@ -23,6 +23,8 @@ #include #include +#include + #include #include #include "NativeAppBase.h" @@ -72,13 +74,26 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow) rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, instance, NULL); if (!wnd) { - MessageBoxA(NULL, "Cannot create window", "Error", MB_OK | MB_ICONERROR); - return 0; + std::cerr << "Failed to create a window"; + return 1; + } + + g_pTheApp->OnWindowCreated(wnd, WindowWidth, WindowHeight); + + auto GoldenImgMode = g_pTheApp->GetGoldenImageMode(); + if (GoldenImgMode != NativeAppBase::GoldenImageMode::None) + { + g_pTheApp->Update(0, 0); + g_pTheApp->Render(); + g_pTheApp->Present(); + auto ExitCode = g_pTheApp->GetExitCode(); + g_pTheApp.reset(); + return ExitCode; } + ShowWindow(wnd, cmdShow); UpdateWindow(wnd); - g_pTheApp->OnWindowCreated(wnd, WindowWidth, WindowHeight); AppTitle = g_pTheApp->GetAppTitle(); Diligent::Timer Timer; -- cgit v1.2.3