Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
NY00123
EDuke32-CSRefactor
Commits
bb8db7d4
Commit
bb8db7d4
authored
May 23, 2020
by
Richard Gobeille
Browse files
engine: better handle the GL driver enforcing a particular SwapInterval
parent
31bd7eb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/build/src/sdlayer.cpp
View file @
bb8db7d4
...
...
@@ -95,6 +95,7 @@ static uint16_t sysgamma[3][256];
char
nogl
=
0
;
#endif
static
int32_t
vsync_renderlayer
;
static
int
vsync_unsupported
;
int32_t
maxrefreshfreq
=
0
;
// last gamma, contrast, brightness
static
float
lastvidgcb
[
3
];
...
...
@@ -559,14 +560,21 @@ static int sdlayer_checkvsync(int checkSync)
int
const
actualSync
=
SDL_GL_GetSwapInterval
();
if
(
actualSync
!=
sdlayer_getswapinterval
(
checkSync
))
{
OSD_Printf
(
"
debug:
GL driver forcing SwapInterval %d!
\n
"
,
actualSync
);
OSD_Printf
(
"GL
:
driver
en
forcing SwapInterval %d
, unable to configure VSync
!
\n
"
,
actualSync
);
checkSync
=
actualSync
;
vsync_unsupported
=
true
;
}
return
checkSync
;
}
int32_t
videoSetVsync
(
int32_t
newSync
)
{
if
(
vsync_unsupported
)
{
OSD_Printf
(
"GL: VSync configuration locked by driver.
\n
"
);
return
vsync_renderlayer
;
}
if
(
vsync_renderlayer
==
newSync
)
return
newSync
;
...
...
@@ -579,7 +587,7 @@ int32_t videoSetVsync(int32_t newSync)
{
if
(
newSync
==
-
1
)
{
OSD_Printf
(
"
debug:
GL driver rejected SwapInterval %d!
\n
"
,
sdlayer_getswapinterval
(
newSync
));
OSD_Printf
(
"GL
:
driver rejected SwapInterval %d
, unable to configure adaptive VSync
!
\n
"
,
sdlayer_getswapinterval
(
newSync
));
newSync
=
1
;
result
=
SDL_GL_SetSwapInterval
(
sdlayer_getswapinterval
(
newSync
));
...
...
@@ -587,7 +595,7 @@ int32_t videoSetVsync(int32_t newSync)
if
(
result
==
-
1
)
{
OSD_Printf
(
"
debug:
GL driver rejected SwapInterval %d!
\n
"
,
sdlayer_getswapinterval
(
newSync
));
OSD_Printf
(
"GL
:
driver rejected SwapInterval %d
, unable to configure VSync
!
\n
"
,
sdlayer_getswapinterval
(
newSync
));
newSync
=
0
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment