mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 02:30:46 +00:00
git-svn-id: https://svn.eduke32.com/eduke32@890 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d8ae04d773
commit
8838d469c1
4 changed files with 19 additions and 3 deletions
|
@ -5977,7 +5977,8 @@ static int osdcmd_polymostvars(const osdfuncparm_t *parm)
|
|||
else if (!Bstrcasecmp(parm->name, "r_swapinterval"))
|
||||
{
|
||||
if (showval) { OSD_Printf("r_swapinterval is %d\n", vsync); }
|
||||
else vsync = (val != 0);
|
||||
// else vsync = (val != 0);
|
||||
else setvsync(val != 0);
|
||||
return OSDCMD_OK;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -897,6 +897,7 @@ int setvideomode(int x, int y, int c, int fs)
|
|||
{
|
||||
int regrab = 0;
|
||||
static int warnonce = 0;
|
||||
static int ovsync = 1;
|
||||
|
||||
if ((fs == fullscreen) && (x == xres) && (y == yres) && (c == bpp) &&
|
||||
!videomodereset)
|
||||
|
@ -956,6 +957,7 @@ int setvideomode(int x, int y, int c, int fs)
|
|||
{ SDL_GL_MULTISAMPLEBUFFERS, glmultisample > 0 },
|
||||
{ SDL_GL_MULTISAMPLESAMPLES, glmultisample },
|
||||
{ SDL_GL_STENCIL_SIZE, 1 },
|
||||
{ SDL_GL_SWAP_CONTROL, vsync },
|
||||
};
|
||||
|
||||
if (nogl) return -1;
|
||||
|
@ -977,8 +979,20 @@ int setvideomode(int x, int y, int c, int fs)
|
|||
SDL_GL_SetAttribute(attributes[i].attr, j);
|
||||
}
|
||||
|
||||
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, vsync);
|
||||
/* HACK: changing SDL GL attribs only works before surface creation,
|
||||
so we have to create a new surface in a different format first
|
||||
to force the surface we WANT to be recreated instead of reused. */
|
||||
|
||||
if (vsync != ovsync)
|
||||
{
|
||||
if (sdl_surface)
|
||||
{
|
||||
SDL_FreeSurface(sdl_surface);
|
||||
sdl_surface = SDL_SetVideoMode(x, y, 8, SURFACE_FLAGS | ((fs&1)?SDL_FULLSCREEN:0));
|
||||
SDL_FreeSurface(sdl_surface);
|
||||
}
|
||||
ovsync = vsync;
|
||||
}
|
||||
sdl_surface = SDL_SetVideoMode(x, y, c, SDL_OPENGL | ((fs&1)?SDL_FULLSCREEN:0));
|
||||
if (!sdl_surface)
|
||||
{
|
||||
|
|
|
@ -2120,6 +2120,7 @@ int setvideomode(int x, int y, int c, int fs)
|
|||
for (i=0;i<NUM_INPUTS;i++) if (inp[i]) AcquireInputDevices(1,i);
|
||||
modechange=1;
|
||||
videomodereset = 0;
|
||||
OSD_ResizeDisplay(xres,yres);
|
||||
//baselayer_onvideomodechange(c>8);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -2441,7 +2441,7 @@ cheat_for_port_credits:
|
|||
"Use models",
|
||||
"Blend model animations",
|
||||
"-",
|
||||
"Enable VSync",
|
||||
"Use VSync",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue