summaryrefslogtreecommitdiff
path: root/Editor/EditorMain.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-11-13 22:07:18 +0800
committerchai <chaifix@163.com>2020-11-13 22:07:18 +0800
commit0edde8a08c6a9a55135dadcff6cd21988d523041 (patch)
tree696f72ba8e82e7aaa8b41bb277557eb34e4ebaaf /Editor/EditorMain.cpp
parent2fae5dab12e9b7e3d70e21707c8b358834808451 (diff)
parent6f326b50d86fab5955a37fe317f14888662b055a (diff)
Merge branch 'master' of warmcat.org:/home/git-repo/GameLab
# Conflicts: # Projects/VisualStudio/Editor/Editor.vcxproj # Projects/VisualStudio/Editor/Editor.vcxproj.filters
Diffstat (limited to 'Editor/EditorMain.cpp')
-rw-r--r--Editor/EditorMain.cpp45
1 files changed, 45 insertions, 0 deletions
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 <windows.h>
+#include <vector>
+#include "GUI/EditorWindows.h"
+
+static int MainMessageLoop()
+{
+ BOOL returnValue;
+ MSG msg, lastMsg;
+ msg.message = WM_NULL;
+ std::vector<MSG> 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;
+}