mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
sdl2: add -borderless option for windowed
This commit is contained in:
parent
8d2b813554
commit
7e650d30f6
1 changed files with 12 additions and 5 deletions
|
@ -133,6 +133,7 @@ static SDL_bool mousegrabok = SDL_TRUE;
|
||||||
static SDL_bool videoblitok = SDL_FALSE;
|
static SDL_bool videoblitok = SDL_FALSE;
|
||||||
static SDL_bool exposevideo = SDL_FALSE;
|
static SDL_bool exposevideo = SDL_FALSE;
|
||||||
static SDL_bool usesdl2soft = SDL_FALSE;
|
static SDL_bool usesdl2soft = SDL_FALSE;
|
||||||
|
static SDL_bool borderlesswindow = SDL_FALSE;
|
||||||
|
|
||||||
// SDL2 vars
|
// SDL2 vars
|
||||||
SDL_Window *window;
|
SDL_Window *window;
|
||||||
|
@ -1387,6 +1388,7 @@ void I_FinishUpdate(void)
|
||||||
SDL_UpdateTexture(texture, &rect, vidSurface->pixels, vidSurface->pitch);
|
SDL_UpdateTexture(texture, &rect, vidSurface->pixels, vidSurface->pitch);
|
||||||
SDL_UnlockSurface(vidSurface);
|
SDL_UnlockSurface(vidSurface);
|
||||||
}
|
}
|
||||||
|
SDL_RenderClear(renderer);
|
||||||
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
}
|
}
|
||||||
|
@ -1660,7 +1662,12 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
||||||
|
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
{
|
{
|
||||||
flags = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (borderlesswindow)
|
||||||
|
{
|
||||||
|
flags |= SDL_WINDOW_BORDERLESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
|
@ -1819,10 +1826,10 @@ void I_StartupGraphics(void)
|
||||||
{
|
{
|
||||||
rendermode = render_soft;
|
rendermode = render_soft;
|
||||||
}
|
}
|
||||||
if (M_CheckParm("-softblit"))
|
|
||||||
{
|
usesdl2soft = M_CheckParm("-softblit");
|
||||||
usesdl2soft = SDL_TRUE;
|
borderlesswindow = M_CheckParm("-borderless");
|
||||||
}
|
|
||||||
//SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2);
|
//SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2);
|
||||||
SDLESSet();
|
SDLESSet();
|
||||||
VID_Command_ModeList_f();
|
VID_Command_ModeList_f();
|
||||||
|
|
Loading…
Reference in a new issue