// forward-referenced functions
static void IN_StartupMouse (void);
-static void AdjustWindowBounds(int fullscreen, int *width, int *height, viddef_mode_t *mode, DWORD WindowStyle, RECT &rect);
+static void AdjustWindowBounds(int fullscreen, int *width, int *height, viddef_mode_t *mode, DWORD WindowStyle, RECT *rect);
//====================================
// without this help
Sleep(0);
- VID_UpdateGamma(false, 256);
+ VID_UpdateGamma();
}
//==========================================================================
*/
static void ClearAllStates (void)
{
- Key_ClearStates ();
+ Key_ReleaseAll();
if (vid_usingmouse)
mouse_oldbuttonstate = 0;
}
ChangeDisplaySettings (NULL, CDS_FULLSCREEN);
vid_wassuspended = true;
}
- VID_RestoreSystemGamma();
}
}
break;
case WM_MOVE:
- window_x = (int) LOWORD(lParam);
- window_y = (int) HIWORD(lParam);
+ window_x = (short) LOWORD(lParam);
+ window_y = (short) HIWORD(lParam);
VID_SetMouse(false, false, false);
break;
return lRet;
}
-int VID_SetGamma(unsigned short *ramps, int rampsize)
-{
- if (qwglMakeCurrent)
- {
- HDC hdc = GetDC (NULL);
- int i = SetDeviceGammaRamp(hdc, ramps);
- ReleaseDC (NULL, hdc);
- return i; // return success or failure
- }
- else
- return 0;
-}
-
-int VID_GetGamma(unsigned short *ramps, int rampsize)
-{
- if (qwglMakeCurrent)
- {
- HDC hdc = GetDC (NULL);
- int i = GetDeviceGammaRamp(hdc, ramps);
- ReleaseDC (NULL, hdc);
- return i; // return success or failure
- }
- else
- return 0;
-}
-
static void GL_CloseLibrary(void)
{
if (gldll)
ExWindowStyle = 0;
}
- AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, rect);
+ AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, &rect);
pixelformat = 0;
newpixelformat = 0;
return true;
}
-static void AdjustWindowBounds(int fullscreen, int *width, int *height, viddef_mode_t *mode, DWORD WindowStyle, RECT &rect)
+static void AdjustWindowBounds(int fullscreen, int *width, int *height, viddef_mode_t *mode, DWORD WindowStyle, RECT *rect)
{
int CenterX, CenterY;
- rect.top = 0;
- rect.left = 0;
- rect.right = width;
- rect.bottom = height;
- AdjustWindowRectEx(&rect, WindowStyle, false, 0);
+ rect->top = 0;
+ rect->left = 0;
+ rect->right = *width;
+ rect->bottom = *height;
+ AdjustWindowRectEx(rect, WindowStyle, false, 0);
if (fullscreen)
{
// 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))
+ if (*width == GetSystemMetrics(SM_CXSCREEN) && (*height == GetSystemMetrics(SM_CYSCREEN) || *height == workHeight - titleBarPixels))
{
- rect.right -= width - workWidth;
- width = mode->width = workWidth;
- rect.bottom -= height - (workHeight - titleBarPixels);
- height = mode->height = workHeight - titleBarPixels;
+ rect->right -= *width - workWidth;
+ *width = mode->width = workWidth;
+ rect->bottom -= *height - (workHeight - titleBarPixels);
+ *height = mode->height = workHeight - titleBarPixels;
CenterX = 0;
CenterY = titleBarPixels;
}
else
{
- CenterX = max(0, (workWidth - width) / 2);
- CenterY = max(0, (workHeight - height) / 2);
+ CenterX = max(0, (workWidth - *width) / 2);
+ CenterY = max(0, (workHeight - *height) / 2);
}
}
// x and y may be changed by WM_MOVE messages
window_x = CenterX;
window_y = CenterY;
- rect.left += CenterX;
- rect.right += CenterX;
- rect.top += CenterY;
- rect.bottom += CenterY;
+ rect->left += CenterX;
+ rect->right += CenterX;
+ rect->top += CenterY;
+ rect->bottom += CenterY;
}
#ifdef SUPPORTD3D
ExWindowStyle = 0;
}
- AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, rect);
+ AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, &rect);
gl_extensions = "";
gl_platformextensions = "";
ExWindowStyle = 0;
}
- AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, rect);
+ AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, &rect);
pixelformat = 0;
newpixelformat = 0;
VID_EnableJoystick(false);
VID_SetMouse(false, false, false);
- VID_RestoreSystemGamma();
vid_initialized = false;
isgl = gldll != NULL;