Now resizes with hwnd

but controls are dead asgassdsad
This commit is contained in:
andreja6
2018-04-24 18:23:07 -07:00
parent d0bba08f3a
commit 2b2672b9fd

View File

@@ -1174,6 +1174,21 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY: case WM_DESTROY:
PostQuitMessage(0); PostQuitMessage(0);
break; break;
case WM_SIZE:
if(app != 0)
{
HWND g3DWind = app->getHWND();
int width = 640;
int height = 480;
RECT rect;
if(GetClientRect(hwnd, &rect))
{
width = rect.right - rect.left;
height = rect.bottom - rect.top;
}
SetWindowPos(g3DWind, NULL, 0, 0, width, height, NULL);
}
break;
default: default:
return DefWindowProc(hwnd, msg, wParam, lParam); return DefWindowProc(hwnd, msg, wParam, lParam);
} }
@@ -1244,7 +1259,7 @@ int main(int argc, char** argv) {
RECT rect; RECT rect;
int width = 640; int width = 640;
int height = 480; int height = 480;
if(GetWindowRect(hwndMain, &rect)) if(GetClientRect(hwndMain, &rect))
{ {
width = rect.right - rect.left; width = rect.right - rect.left;
height = rect.bottom - rect.top; height = rect.bottom - rect.top;