summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-23 22:47:06 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-30 02:19:51 +0200
commitfe72894bb808969ef6c72a4852fa78477e2f77ef (patch)
tree47066cd7967dcbc82a4fb5c6b4081fd136ffcf54 /client
parentc7d1024d9786b88665289182a5ed9e590b3a70c4 (diff)
downloadspice-fe72894bb808969ef6c72a4852fa78477e2f77ef.tar.gz
spice-fe72894bb808969ef6c72a4852fa78477e2f77ef.tar.xz
spice-fe72894bb808969ef6c72a4852fa78477e2f77ef.zip
spicec: fix non-doublebuffer drawing
First, context must set it, then Draw/ReadBuffer must be set to FRONT, and then explicit Flush is needed. This patch is mostly for future reference, it is mostly discarded in following patch using double-buffer.
Diffstat (limited to 'client')
-rw-r--r--client/x11/platform.cpp1
-rw-r--r--client/x11/red_drawable.cpp1
-rw-r--r--client/x11/red_pixmap_gl.cpp2
3 files changed, 4 insertions, 0 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 14c6e0cd..da6b6342 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -3224,6 +3224,7 @@ void Platform::init()
int num_configs;
int attrlist[] = {
GLX_RENDER_TYPE, GLX_RGBA_BIT,
+ GLX_DOUBLEBUFFER, False,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT | GLX_WINDOW_BIT,
GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
GLX_RED_SIZE, 8,
diff --git a/client/x11/red_drawable.cpp b/client/x11/red_drawable.cpp
index 54e53f8d..19532c74 100644
--- a/client/x11/red_drawable.cpp
+++ b/client/x11/red_drawable.cpp
@@ -85,6 +85,7 @@ static inline void copy_to_gldrawable_from_gltexture(const RedDrawable_p* dest,
if (rendertype == RENDER_TYPE_FBO) {
GLuint fbo;
+ glFlush();
fbo = source->gl.fbo;
glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo);
} else {
diff --git a/client/x11/red_pixmap_gl.cpp b/client/x11/red_pixmap_gl.cpp
index 1a586286..693b67d1 100644
--- a/client/x11/red_pixmap_gl.cpp
+++ b/client/x11/red_pixmap_gl.cpp
@@ -79,6 +79,8 @@ RedPixmapGL::RedPixmapGL(int width, int height, RedDrawable::Format format,
glXDestroyContext(XPlatform::get_display(), _glcont);
THROW("no GL_EXT_framebuffer_object extension");
}
+ glDrawBuffer(GL_FRONT);
+ glReadBuffer(GL_FRONT);
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);