Browse Source

Add display/resizable to project setting to prevent windwo from resizing

marynate 11 years ago
parent
commit
f6e6093ab9
2 changed files with 7 additions and 0 deletions
  1. 3 0
      main/main.cpp
  2. 4 0
      platform/windows/os_windows.cpp

+ 3 - 0
main/main.cpp

@@ -577,12 +577,15 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas
 		video_mode.height=globals->get("display/height");
 		video_mode.height=globals->get("display/height");
 	if (use_custom_res && globals->has("display/fullscreen"))
 	if (use_custom_res && globals->has("display/fullscreen"))
 		video_mode.fullscreen=globals->get("display/fullscreen");
 		video_mode.fullscreen=globals->get("display/fullscreen");
+	if (use_custom_res && globals->has("display/resizable"))
+		video_mode.resizable=globals->get("display/resizable");
 
 
 
 
 
 
 	GLOBAL_DEF("display/width",video_mode.width);
 	GLOBAL_DEF("display/width",video_mode.width);
 	GLOBAL_DEF("display/height",video_mode.height);
 	GLOBAL_DEF("display/height",video_mode.height);
 	GLOBAL_DEF("display/fullscreen",video_mode.fullscreen);
 	GLOBAL_DEF("display/fullscreen",video_mode.fullscreen);
+	GLOBAL_DEF("display/resizable",video_mode.resizable);
 	if (rtm==-1) {
 	if (rtm==-1) {
 		rtm=GLOBAL_DEF("render/thread_model",OS::RENDER_THREAD_SAFE);
 		rtm=GLOBAL_DEF("render/thread_model",OS::RENDER_THREAD_SAFE);
 	}
 	}

+ 4 - 0
platform/windows/os_windows.cpp

@@ -888,6 +888,10 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
 	} else {
 	} else {
 		dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
 		dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
 		dwStyle=WS_OVERLAPPEDWINDOW;
 		dwStyle=WS_OVERLAPPEDWINDOW;
+		if (!video_mode.resizable) {
+			dwStyle &= ~WS_THICKFRAME;
+			dwStyle &= ~WS_MAXIMIZEBOX;
+		}
 	}
 	}
 
 
 	AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);
 	AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle);