diff options
Diffstat (limited to 'source/Asura.Editor/Main.cpp')
-rw-r--r-- | source/Asura.Editor/Main.cpp | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/source/Asura.Editor/Main.cpp b/source/Asura.Editor/Main.cpp index 207474b..87207f0 100644 --- a/source/Asura.Editor/Main.cpp +++ b/source/Asura.Editor/Main.cpp @@ -1,30 +1,33 @@ -/** - * Copyright (c) 2018-2019 AsuraEngine Team - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software m_ust not be m_isrepresented; you m_ust not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions m_ust be plainly m_arked as such, and m_ust not be - * m_isrepresented as being the original software. - * 3. This notice m_ay not be removed or altered from any source distribution. - **/ +#include <windows.h> -/// -/// ༭ĽͨdirectUIʵ֣Ⱦasura-libϣ¼Ӧͨwin32APIʵ֡ -/// -int main(int argn, char* args[]) -{ +int main(int argn, char* args[]) +{ + bool gotMsg; + MSG msg; + msg.message = WM_NULL; + PeekMessage(&msg, NULL, 0U, 0U, PM_NOREMOVE); + HANDLE hevent = (HANDLE)CreateEvent(NULL, FALSE, FALSE, NULL); + while (WM_QUIT != msg.message) + { + // Use PeekMessage() if the app is active, so we can use idle time to + // render the scene. Else, use GetMessage() to avoid eating CPU time. + //bool dontWaitForMessages = gAppActive || (!gAlreadyClosing && GetPlayerRunInBackground()) || (kPlayerPausing == GetPlayerPause()); + bool dontWaitForMessages = false; + if (dontWaitForMessages) + gotMsg = (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) != 0); + else + gotMsg = (GetMessage(&msg, NULL, 0U, 0U) != 0); + if (gotMsg) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + else { + // perform main loop + //PerformMainLoop(); + } + } }
\ No newline at end of file |