]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
Added darkplaces-osx-sdl launch script, this has been simplified since
[xonotic/darkplaces.git] / vid_sdl.c
index e3c934a7adac167d2e208bc99650f645e43f38d5..22fd13ebf975fa3a74145711e7b3a9095b415e41 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -87,7 +87,7 @@ static int video_bpp;
 static SDL_Surface *screen;
 static int video_flags;
 #else
-static SDL_GLContext *context;
+static SDL_GLContext context;
 static SDL_Window *window;
 static int window_flags;
 #endif
@@ -2453,7 +2453,7 @@ static void AdjustWindowBounds(viddef_mode_t *mode, RECT *rect)
        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
@@ -2465,6 +2465,8 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        int flags = SDL_OPENGL;
 #else
        int windowflags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL;
+       int xPos = SDL_WINDOWPOS_UNDEFINED;
+       int yPos = SDL_WINDOWPOS_UNDEFINED;
 #endif
 #ifndef USE_GLES2
        int i;
@@ -2527,8 +2529,6 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        // Knghtbrd: should do platform-specific extension string function here
 
        vid_isfullscreen = false;
-       int xPos = SDL_WINDOWPOS_UNDEFINED;
-       int yPos = SDL_WINDOWPOS_UNDEFINED;
 #if SDL_MAJOR_VERSION == 1
        {
                const SDL_VideoInfo *vi = SDL_GetVideoInfo();
@@ -2564,7 +2564,6 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
                }
                else {
 #ifdef WIN32
-                       DWORD windowStyle = 0;
                        RECT rect;
                        AdjustWindowBounds(mode, &rect);
                        xPos = rect.left;