Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
b23bbc5d
Commit
b23bbc5d
authored
Jun 02, 2011
by
Laurent Aimar
Browse files
Set swap interval to 1 in glx when possible.
It avoids tearing.
parent
fb044d45
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/video_output/xcb/glx.c
View file @
b23bbc5d
...
...
@@ -31,6 +31,7 @@
#include
<xcb/xcb.h>
#include
<X11/Xlib-xcb.h>
#include
<GL/glx.h>
#include
<GL/glxext.h>
#include
<vlc_common.h>
#include
<vlc_plugin.h>
...
...
@@ -359,6 +360,24 @@ static int Open (vlc_object_t *obj)
sys
->
glwin
=
sys
->
window
;
}
const
char
*
glx_extensions
=
glXQueryExtensionsString
(
dpy
,
snum
);
bool
is_swap_interval_set
=
false
;
#ifdef GLX_SGI_swap_control
if
(
strstr
(
glx_extensions
,
"GLX_SGI_swap_control"
))
{
PFNGLXSWAPINTERVALSGIPROC
SwapIntervalSGI
=
(
PFNGLXSWAPINTERVALSGIPROC
)
GetProcAddress
(
NULL
,
"glXSwapIntervalSGI"
);
if
(
!
is_swap_interval_set
&&
SwapIntervalSGI
)
is_swap_interval_set
=
!
SwapIntervalSGI
(
1
);
}
#endif
#ifdef GLX_EXT_swap_control
if
(
strstr
(
glx_extensions
,
"GLX_EXT_swap_control"
))
{
PFNGLXSWAPINTERVALEXTPROC
SwapIntervalEXT
=
(
PFNGLXSWAPINTERVALEXTPROC
)
GetProcAddress
(
NULL
,
"glXSwapIntervalEXT"
);
if
(
!
is_swap_interval_set
&&
SwapIntervalEXT
)
is_swap_interval_set
=
!
SwapIntervalEXT
(
dpy
,
sys
->
glwin
,
1
);
}
#endif
/* Initialize common OpenGL video display */
sys
->
gl
.
lock
=
NULL
;
sys
->
gl
.
unlock
=
NULL
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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