summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2010-01-11 13:53:03 +0800
committerChia-I Wu <olvaffe@gmail.com>2010-01-12 11:25:09 +0800
commit43f67b61fd1020e7ec847c21e1dbae9544d463ec (patch)
tree8d13dce33d69e4e959383ab4b65c131e49ed4f24
parent99a37ed195801fd0a0b64a20f08c8d4f9d66137f (diff)
progs/es1: Bind texture image after rendering.
Unlike FBO, eglBindTexImage is supposed to be called after rendering. Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
-rw-r--r--progs/es1/xegl/render_tex.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/progs/es1/xegl/render_tex.c b/progs/es1/xegl/render_tex.c
index 0d1027b712..0200fa4cb0 100644
--- a/progs/es1/xegl/render_tex.c
+++ b/progs/es1/xegl/render_tex.c
@@ -229,17 +229,19 @@ draw(EGLDisplay egl_dpy, EGLSurface egl_surf, EGLSurface egl_pbuf,
printf("Error: eglMakeCurrent(pbuf) failed\n");
return;
}
- glBindTexture(GL_TEXTURE_2D, RenderTexture);
- eglBindTexImage(egl_dpy, egl_pbuf, EGL_BACK_BUFFER);
draw_torus_to_texture();
- eglReleaseTexImage(egl_dpy, egl_pbuf, EGL_BACK_BUFFER);
/* draw textured quad to window */
if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
printf("Error: eglMakeCurrent(pbuffer) failed\n");
return;
}
+
+ glBindTexture(GL_TEXTURE_2D, RenderTexture);
+ eglBindTexImage(egl_dpy, egl_pbuf, EGL_BACK_BUFFER);
draw_textured_quad();
+ eglReleaseTexImage(egl_dpy, egl_pbuf, EGL_BACK_BUFFER);
+
eglSwapBuffers(egl_dpy, egl_surf);
/*printf("End draw\n");*/