LONG width = mode->width; // vid_width
LONG height = mode->height; // vid_height
+ RECT workArea;
+ int workWidth, workHeight;
+ int titleBarPixels, screenHeight;
+
// adjust width and height for the space occupied by window decorators (title bar, borders)
rect->top = 0;
rect->left = 0;
rect->bottom = height;
AdjustWindowRectEx(rect, WS_CAPTION|WS_THICKFRAME, false, 0);
- RECT workArea;
SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0);
- int workWidth = workArea.right - workArea.left;
- int workHeight = workArea.bottom - workArea.top;
+ workWidth = workArea.right - workArea.left;
+ workHeight = workArea.bottom - workArea.top;
// SDL forces the window height to be <= screen height - 27px (on Win8.1 - probably intended for the title bar)
// If the task bar is docked to the the left screen border and we move the window to negative y,
// there would be some part of the regular desktop visible on the bottom of the screen.
- int titleBarPixels = 2;
- int screenHeight = GetSystemMetrics(SM_CYSCREEN);
+ titleBarPixels = 2;
+ screenHeight = GetSystemMetrics(SM_CYSCREEN);
if (screenHeight == workHeight)
titleBarPixels = -rect->top;
else
{
rect->left = workArea.left + max(0, (workWidth - width) / 2);
- rect->top = workArea.top + (0, (workHeight - height) / 2);
+ rect->top = workArea.top + max(0, (workHeight - height) / 2);
}
}
#endif
int i;
const char *drivername;
#endif
+ int xPos, yPos;
win_half_width = mode->width>>1;
win_half_height = mode->height>>1;
// Knghtbrd: should do platform-specific extension string function here
vid_isfullscreen = false;
- int xPos = SDL_WINDOWPOS_UNDEFINED;
- int yPos = SDL_WINDOWPOS_UNDEFINED;
+ xPos = SDL_WINDOWPOS_UNDEFINED;
+ yPos = SDL_WINDOWPOS_UNDEFINED;
#if SDL_MAJOR_VERSION == 1
{
const SDL_VideoInfo *vi = SDL_GetVideoInfo();
if (mode->fullscreen) {
if (vid_desktopfullscreen.integer)
{
- vid_mode_t *m = VID_GetDesktopMode();
+ vid_mode_t *m;
+ m = VID_GetDesktopMode();
mode->width = m->width;
mode->height = m->height;
windowflags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
}
else {
#ifdef WIN32
- DWORD windowStyle = 0;
RECT rect;
AdjustWindowBounds(mode, &rect);
xPos = rect.left;
else
{
RECT workArea;
- SystemParametersInfo(SPI_GETWORKAREA, NULL, &workArea, 0);
- int workWidth = workArea.right - workArea.left;
- int workHeight = workArea.bottom - workArea.top;
+ int workWidth, workHeight;
+ const int titleBarPixels = 2;
+
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0);
+ workWidth = workArea.right - workArea.left;
+ workHeight = workArea.bottom - workArea.top;
// if height/width matches physical screen height/width, adjust it to available desktop size
// and allow 2 pixels on top for the title bar so the window can be moved
- const int titleBarPixels = 2;
if (*width == GetSystemMetrics(SM_CXSCREEN) && (*height == GetSystemMetrics(SM_CYSCREEN) || *height == workHeight - titleBarPixels))
{
rect->right -= *width - workWidth;