From 67a7863f5f060d4396b27a39ea8b495498197e45 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 6 Oct 2015 01:24:26 +0200 Subject: [PATCH] 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. --- util.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 } -- 2.39.2