make sure we ensure out gl context is current at each frame start

SVN revision: 55131
This commit is contained in:
Carsten Haitzler 2010-12-02 08:01:19 +00:00
parent b26182d35b
commit 4147f2f231
2 changed files with 31 additions and 27 deletions

View File

@ -535,9 +535,10 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
re = (Render_Engine *)data;
/* get the upate rect surface - return engine data as dummy */
if (!re->win->draw.redraw) return NULL;
eng_window_use(NULL);
eng_window_use(re->win);
if (!_re_wincheck(re)) return NULL;
evas_gl_common_context_flush(re->win->gl_context);
eng_window_use(re->win);
evas_gl_common_context_newframe(re->win->gl_context);
if (x) *x = re->win->draw.x1;
if (y) *y = re->win->draw.y1;

View File

@ -482,38 +482,41 @@ eng_window_use(Evas_GL_X11_Window *gw)
if (_evas_gl_x11_window)
evas_gl_common_context_flush(_evas_gl_x11_window->gl_context);
_evas_gl_x11_window = gw;
if (gw)
{
// EGL / GLES
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
if (gw->egl_surface[0] != EGL_NO_SURFACE)
{
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("eglMakeCurrent() failed!");
}
}
if (gw->egl_surface[0] != EGL_NO_SURFACE)
{
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
gw->egl_context[0]) == EGL_FALSE)
{
ERR("eglMakeCurrent() failed!");
}
}
// GLX
#else
if (gw->glxwin)
{
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->win, (void *)gw->win, (void *)gw->context);
}
}
else
{
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
{
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
}
}
if (gw->glxwin)
{
if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
gw->context))
{
ERR("glXMakeContextCurrent(%p, %p, %p, %p)", (void *)gw->disp, (void *)gw->win, (void *)gw->win, (void *)gw->context);
}
}
else
{
if (!glXMakeCurrent(gw->disp, gw->win, gw->context))
{
ERR("glXMakeCurrent(%p, 0x%x, %p) failed", gw->disp, (unsigned int)gw->win, (void *)gw->context);
}
}
#endif
}
}
evas_gl_common_context_use(gw->gl_context);
if (gw) evas_gl_common_context_use(gw->gl_context);
}
void