Now resizes with hwnd
but controls are dead asgassdsad
This commit is contained in:
17
main.cpp
17
main.cpp
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user