]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_wgl.c
r_coronas_occlusionquery: don't try using a GL20-requiring feature in the GL11/GL13...
[xonotic/darkplaces.git] / vid_wgl.c
index 7989055390be5cb11f175519dbf85ed800e30487..24bcdabc943ffabf7bf63e877ae3e96108f716b4 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -216,7 +216,7 @@ static HINSTANCE hInstDI;
 
 // 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);
 
 //====================================
 
@@ -1166,7 +1166,7 @@ qboolean VID_InitModeGL(viddef_mode_t *mode)
                ExWindowStyle = 0;
        }
 
-       AdjustWindowBounds(fullscreen, width, height, mode, WindowStyle, rect);
+       AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, &rect);
 
        pixelformat = 0;
        newpixelformat = 0;
@@ -1324,15 +1324,15 @@ qboolean VID_InitModeGL(viddef_mode_t *mode)
        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)
        {
@@ -1349,29 +1349,29 @@ static void AdjustWindowBounds(int fullscreen, int &width, int &height, viddef_m
                // 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
@@ -1413,7 +1413,7 @@ qboolean VID_InitModeDX(viddef_mode_t *mode, int version)
                ExWindowStyle = 0;
        }
 
-       AdjustWindowBounds(fullscreen, width, height, mode, WindowStyle, rect);
+       AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, &rect);
 
        gl_extensions = "";
        gl_platformextensions = "";
@@ -1748,7 +1748,7 @@ qboolean VID_InitModeSOFT(viddef_mode_t *mode)
                ExWindowStyle = 0;
        }
 
-       AdjustWindowBounds(fullscreen, width, height, mode, WindowStyle, rect);
+       AdjustWindowBounds(fullscreen, &width, &height, mode, WindowStyle, &rect);
 
        pixelformat = 0;
        newpixelformat = 0;