fixed layout parser adding stack based recursion, code needs being cleaned up but layout works quite well now, added code draw while resizing

This commit is contained in:
2017-01-22 22:24:48 +00:00
parent 21622fd24c
commit e556cf4c61
7 changed files with 266 additions and 71 deletions

View File

@@ -211,7 +211,7 @@ int main()
PIXELFORMATDESCRIPTOR pfd;
App::I.create();
RECT clientRect = { 0, 0, App::I.width, App::I.height };
RECT clientRect = { 0, 0, (int)App::I.width, (int)App::I.height };
// Inizialize data structures to zero
memset(&wc, 0, sizeof(wc));
@@ -288,7 +288,7 @@ int main()
wglDeleteContext(hRC);
DestroyWindow(hWnd);
hWnd = CreateWindow(wc.lpszClassName, L"New Engine", WS_OVERLAPPEDWINDOW,
hWnd = CreateWindow(wc.lpszClassName, L"UI Layout Engine", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, clientRect.right - clientRect.left,
clientRect.bottom - clientRect.top, 0, 0, hInst, 0);
@@ -350,6 +350,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
case WM_CLOSE:
PostQuitMessage(0);
break;
case WM_SIZE:
App::I.resize((float)LOWORD(lp), (float)HIWORD(lp));
App::I.update(0.f);
SwapBuffers(hDC);
break;
case WM_KEYDOWN:
keys[wp] = true;
break;