summaryrefslogtreecommitdiff
path: root/Editor/EditorMain.cpp
blob: d45d08b2f88c652e218e32137217b16a918333e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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;
}