diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-09-23 22:10:17 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-09-30 02:19:51 +0200 |
commit | a2be67cbfaf20303704ec549313778729190d89b (patch) | |
tree | 0771b7e42ea1437905297c12781962deff14347c /client/x11/red_window.cpp | |
parent | fe72894bb808969ef6c72a4852fa78477e2f77ef (diff) | |
download | spice-a2be67cbfaf20303704ec549313778729190d89b.tar.gz spice-a2be67cbfaf20303704ec549313778729190d89b.tar.xz spice-a2be67cbfaf20303704ec549313778729190d89b.zip |
spicec: use doublebuffer for opengl
This visually reduces glitches without noticeable speed difference.
It's also the traditionnal way of doing opengl.
Diffstat (limited to 'client/x11/red_window.cpp')
-rw-r--r-- | client/x11/red_window.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp index 83144a54..b6e11e14 100644 --- a/client/x11/red_window.cpp +++ b/client/x11/red_window.cpp @@ -2122,6 +2122,18 @@ void RedWindow::untouch_context() glXMakeCurrent(x_display, 0, 0); } +void RedWindow::swap_gl() +{ + PixelsSource_p *pix_source = (PixelsSource_p*)get_opaque(); + RedGlContext context = pix_source->x_drawable.context; + + if (!context) + return; + + glXMakeCurrent(x_display, get_window(), context); + glXSwapBuffers(x_display, get_window()); +} + void RedWindow::set_type_gl() { PixelsSource_p *pix_source = (PixelsSource_p*)get_opaque(); |