Joachim Meyer 11 ani în urmă
părinte
comite
b0c08c7d8d

+ 1 - 0
Core/Contents/Include/PolyCore.h

@@ -57,6 +57,7 @@ namespace Polycode {
 		PolycodeViewBase() { windowData = NULL; }
 		virtual ~PolycodeViewBase(){}
 		void *windowData;
+		bool resizable;
 	};
 	
 	class _PolyExport TimeInfo {

+ 1 - 0
Core/Contents/Include/PolyWinCore.h

@@ -275,6 +275,7 @@ public:
 
 		bool isFullScreen;
 		bool retinaSupport;
+		bool resizable;
 
 		HDC hDC;
 		HGLRC hRC;

+ 2 - 0
Core/Contents/PolycodeView/MSVC/PolycodeView.cpp

@@ -184,6 +184,8 @@ PolycodeView::PolycodeView(HINSTANCE hInstance, int nCmdShow, LPCTSTR windowTitl
 
 	RegisterClassEx(&wcex);
 
+	this->resizable = resizable;
+
 	if(resizable) {
 		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_OVERLAPPEDWINDOW|WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
 	} else {

+ 8 - 2
Core/Contents/Source/PolyWinCore.cpp

@@ -113,6 +113,7 @@ Win32Core::Win32Core(PolycodeViewBase *view, int _xRes, int _yRes, bool fullScre
 	eventMutex = createMutex();
 
 	isFullScreen = fullScreen;
+	this->resizable = view->resizable;
 
 	renderer = new OpenGLRenderer();
 	services->setRenderer(renderer);
@@ -268,8 +269,13 @@ void Win32Core::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, in
 		rect.top = 0;
 		rect.right = xRes;
 		rect.bottom = yRes;
-		SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE);
-		AdjustWindowRect(&rect, WS_CAPTION | WS_POPUPWINDOW, FALSE);
+		if (resizable){
+			SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_VISIBLE);
+			AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW | WS_SYSMENU, FALSE);
+		} else {
+			SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPED | WS_SYSMENU | WS_VISIBLE);
+			AdjustWindowRect(&rect, WS_OVERLAPPED | WS_SYSMENU, FALSE);
+		}
 		MoveWindow(hWnd, 0, 0, rect.right-rect.left, rect.bottom-rect.top, TRUE);
 
 		ChangeDisplaySettings(0, 0);