]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
forbid world writes after precache stage (without using sv.state, instead prog->allow...
[xonotic/darkplaces.git] / vid_sdl.c
index 42dbd46a83736164bb5aa0b805796b18ad8bc10f..0474a26c73f19976ab8e72a5c3cbea37a4eb9844 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -307,12 +307,6 @@ void VID_Init (void)
        if (SDL_Init(SDL_INIT_VIDEO) < 0)
                Sys_Error ("Failed to init video: %s\n", SDL_GetError());
        vid_isfullscreen = false;
-
-       SDL_SetEventFilter( (SDL_EventFilter) Sys_EventFilter );
-       // init keyboard
-       SDL_EnableUNICODE( SDL_ENABLE );
-       // enable key repeat since everyone expects it
-       SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 }
 
 // set the icon (we dont use SDL here since it would be too much a PITA)
@@ -424,7 +418,15 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp)
                VID_Shutdown();
                return false;
        }
+
+       // set window title
        VID_SetCaption();
+       // set up an event filter to ask confirmation on close button in WIN32
+       SDL_SetEventFilter( (SDL_EventFilter) Sys_EventFilter );
+       // init keyboard
+       SDL_EnableUNICODE( SDL_ENABLE );
+       // enable key repeat since everyone expects it
+       SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
 
        gl_renderer = qglGetString(GL_RENDERER);
        gl_vendor = qglGetString(GL_VENDOR);
@@ -460,13 +462,6 @@ int VID_GetGamma (unsigned short *ramps)
        return !SDL_GetGammaRamp( ramps, ramps + 256, ramps + 512);
 }
 
-void VID_GetWindowSize (int *x, int *y, int *width, int *height)
-{
-       *x = *y = 0;
-       *width = screen->w;
-       *height = screen->h;
-}
-
 void VID_Finish (void)
 {
        Uint8 appstate;