From 0ed754bf6007fd6e496d70b6fd545b0cf936c950 Mon Sep 17 00:00:00 2001 From: "Mike C. Fletcher" Date: Mon, 30 Dec 2019 10:29:12 -0500 Subject: [PATCH] FIX for #27 to work on machines where libOpenGL is not present Apparently the advice that we should use libOpenGL really isn't universally applicable. Ubuntu 18.04 *does* seem to have it, though that might be because of an installed package. Ubuntu 19.10 does *not* have libOpenGL by default. --- OpenGL/platform/egl.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/OpenGL/platform/egl.py b/OpenGL/platform/egl.py index 1e087eb0..ff9a68e0 100644 --- a/OpenGL/platform/egl.py +++ b/OpenGL/platform/egl.py @@ -31,11 +31,15 @@ def GLES3(self): @baseplatform.lazy_property def GL(self): try: - return ctypesloader.loadLibrary( - ctypes.cdll, - 'OpenGL', - mode=ctypes.RTLD_GLOBAL - ) + for name in ('OpenGL','GL'): + lib = ctypesloader.loadLibrary( + ctypes.cdll, + 'GL', + mode=ctypes.RTLD_GLOBAL + ) + if lib: + return lib + raise OSError("No GL/OpenGL library available") except OSError: return self.GLES2 or self.GLES1 @baseplatform.lazy_property