From b429cce3b66dc3556d97a1ae2c51c4a8b5005e42 Mon Sep 17 00:00:00 2001 From: Ronald Kinard Date: Thu, 24 Jul 2014 22:35:04 -0500 Subject: [PATCH] sdl2: add -borderless option for windowed --- src/sdl2/i_video.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/sdl2/i_video.c b/src/sdl2/i_video.c index 3718d3cef..12c36c7e2 100644 --- a/src/sdl2/i_video.c +++ b/src/sdl2/i_video.c @@ -133,6 +133,7 @@ static SDL_bool mousegrabok = SDL_TRUE; static SDL_bool videoblitok = SDL_FALSE; static SDL_bool exposevideo = SDL_FALSE; static SDL_bool usesdl2soft = SDL_FALSE; +static SDL_bool borderlesswindow = SDL_FALSE; // SDL2 vars SDL_Window *window; @@ -1387,6 +1388,7 @@ void I_FinishUpdate(void) SDL_UpdateTexture(texture, &rect, vidSurface->pixels, vidSurface->pitch); SDL_UnlockSurface(vidSurface); } + SDL_RenderClear(renderer); SDL_RenderCopy(renderer, texture, NULL, NULL); SDL_RenderPresent(renderer); } @@ -1660,7 +1662,12 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) if (fullscreen) { - flags = SDL_WINDOW_FULLSCREEN_DESKTOP; + flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; + } + + if (borderlesswindow) + { + flags |= SDL_WINDOW_BORDERLESS; } #ifdef HWRENDER @@ -1819,10 +1826,10 @@ void I_StartupGraphics(void) { rendermode = render_soft; } - if (M_CheckParm("-softblit")) - { - usesdl2soft = SDL_TRUE; - } + + usesdl2soft = M_CheckParm("-softblit"); + borderlesswindow = M_CheckParm("-borderless"); + //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); SDLESSet(); VID_Command_ModeList_f();