From 6f326b50d86fab5955a37fe317f14888662b055a Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 13 Nov 2020 19:18:49 +0800 Subject: +misc --- Editor/EditorMain.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Editor/EditorMain.cpp (limited to 'Editor/EditorMain.cpp') diff --git a/Editor/EditorMain.cpp b/Editor/EditorMain.cpp new file mode 100644 index 0000000..d45d08b --- /dev/null +++ b/Editor/EditorMain.cpp @@ -0,0 +1,45 @@ +#include +#include +#include "GUI/EditorWindows.h" + +static int MainMessageLoop() +{ + BOOL returnValue; + MSG msg, lastMsg; + msg.message = WM_NULL; + std::vector messages; + PeekMessage(&msg, NULL, 0U, 0U, PM_NOREMOVE); + bool isQuitSignaled = msg.message == WM_QUIT; + + while (!isQuitSignaled) + { + MSG msg; + while (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) != 0) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + + if (msg.message == WM_QUIT) + isQuitSignaled = true; + + } + + } + + return (INT)msg.wParam; +} + +int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) +{ + RegisterWindowClasses(); + + ContainnerWindow* wnd = new ContainnerWindow(); + + Vector2f min = Vector2f(100, 100); + Vector2f max = Vector2f(700, 700); + wnd->Init(Rectf(400, 400, 500, 500), ContainnerWindow::kShowMainWindow, min, max); + + MainMessageLoop(); + + return 0; +} -- cgit v1.1-26-g67d0