Rev 2 | Rev 11 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 3 | ||
---|---|---|---|
Line 206... | Line 206... | ||
206 | hMainWnd = CreateWindowEx (0, wc.lpszClassName, PROGRAM_NAME, WS_POPUPWINDOW, |
206 | hMainWnd = CreateWindowEx (0, wc.lpszClassName, PROGRAM_NAME, WS_POPUPWINDOW, |
207 | 0, 0, GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), |
207 | 0, 0, GetSystemMetrics (SM_CXSCREEN), GetSystemMetrics (SM_CYSCREEN), |
208 | NULL, hMenu, hAppInstance, NULL); |
208 | NULL, hMenu, hAppInstance, NULL); |
209 | else |
209 | else |
210 | { |
210 | { |
211 | // in windowed mode, ensure window width and height aren't greater than screen size |
211 | // in windowed mode, ensure window width and height aren't greater than screen size nor lower than a safe minimum |
212 | if (options.window_width > GetSystemMetrics (SM_CXMAXTRACK)) |
212 | if (options.window_width > GetSystemMetrics (SM_CXMAXTRACK)) |
213 | options.window_width = GetSystemMetrics (SM_CXMAXTRACK); |
213 | options.window_width = GetSystemMetrics (SM_CXMAXTRACK); // check this first in case screen size is reported incorrect |
214 | if (options.window_height > GetSystemMetrics (SM_CYMAXTRACK)) |
214 | if (options.window_height > GetSystemMetrics (SM_CYMAXTRACK)) |
215 | options.window_height = GetSystemMetrics (SM_CYMAXTRACK); |
215 | options.window_height = GetSystemMetrics (SM_CYMAXTRACK); |
- | 216 | if (options.window_width < 640) |
|
- | 217 | options.window_width = 640; // check this secondly in case screen size is reported incorrect |
|
- | 218 | if (options.window_height < 480) |
|
- | 219 | options.window_height = 480; |
|
216 | 220 | ||
217 | hMainWnd = CreateWindowEx (0, wc.lpszClassName, PROGRAM_NAME, WS_OVERLAPPEDWINDOW, |
221 | hMainWnd = CreateWindowEx (0, wc.lpszClassName, PROGRAM_NAME, WS_OVERLAPPEDWINDOW, |
218 | GetSystemMetrics (SM_CXSCREEN) / 2 - options.window_width / 2, |
222 | GetSystemMetrics (SM_CXSCREEN) / 2 - options.window_width / 2, |
219 | GetSystemMetrics (SM_CYSCREEN) / 2 - options.window_height / 2, |
223 | GetSystemMetrics (SM_CYSCREEN) / 2 - options.window_height / 2, |
220 | options.window_width, |
224 | options.window_width, |