From: Steinar H. Gunderson Date: Mon, 5 Oct 2015 23:24:26 +0000 (+0200) Subject: Make get_current_context_identifier() understand EGL. X-Git-Tag: 1.3.0~31 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=67a7863f5f060d4396b27a39ea8b495498197e45;ds=sidebyside Make get_current_context_identifier() understand EGL. If we're using EGL and not GLX (typically because we're using GLES, but also increasingly with desktop GL), we'd always return NULL. This could FBOs to be confused between contexts. --- diff --git a/util.cpp b/util.cpp index c2ac593..3f59edf 100644 --- a/util.cpp +++ b/util.cpp @@ -19,6 +19,7 @@ #include #else #include +#include #endif using namespace std; @@ -331,7 +332,11 @@ void *get_gl_context_identifier() #elif defined(WIN32) return (void *)wglGetCurrentContext(); #else - return (void *)glXGetCurrentContext(); + void *ret = (void *)glXGetCurrentContext(); + if (ret != NULL) { + return ret; + } + return (void *)eglGetCurrentContext(); #endif }