From 1a3598a88a30608f5f918397ae6ac37ef8c7ad2a Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 8 Feb 2018 22:08:14 -0800 Subject: Reworked UWP app implementation --- Common/NativeApp/src/Win32/WinMain.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Common/NativeApp/src/Win32/WinMain.cpp') diff --git a/Common/NativeApp/src/Win32/WinMain.cpp b/Common/NativeApp/src/Win32/WinMain.cpp index 2d77f9f..878f1ec 100644 --- a/Common/NativeApp/src/Win32/WinMain.cpp +++ b/Common/NativeApp/src/Win32/WinMain.cpp @@ -51,10 +51,9 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow) RegisterClassEx(&wcex); // Create a window - NativeAppAttributes AppAttribs; - AppAttribs.WindowWidth = 1280; - AppAttribs.WindowHeight = 1024; - RECT rc = { 0, 0, AppAttribs.WindowWidth, AppAttribs.WindowHeight }; + LONG WindowWidth = 1280; + LONG WindowHeight = 1024; + RECT rc = { 0, 0, WindowWidth, WindowHeight }; AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE); HWND wnd = CreateWindow(L"SampleApp", Title.c_str(), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, @@ -67,8 +66,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow) ShowWindow(wnd, cmdShow); UpdateWindow(wnd); - AppAttribs.NativeWindowHandle = wnd; - g_pTheApp->Initialize(AppAttribs); + g_pTheApp->OnWindowCreated(wnd, WindowWidth, WindowHeight); Diligent::Timer Timer; auto PrevTime = Timer.GetElapsedTime(); @@ -92,6 +90,8 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE, LPSTR, int cmdShow) g_pTheApp->Render(); + g_pTheApp->Present(); + double filterScale = 0.2; filteredFrameTime = filteredFrameTime * (1.0 - filterScale) + filterScale * ElapsedTime; std::wstringstream fpsCounterSS; -- cgit v1.2.3