From c46d4781053f075b33cc8ec9b89696d06b110d4c Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 20 Jul 2010 13:54:11 -0400
Subject: [PATCH] Linux fixes to GL interop. (Paolo Simone Gasparello)

---
 examples/gl_interop_demo.py | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/examples/gl_interop_demo.py b/examples/gl_interop_demo.py
index 29ee8a17..468564cd 100644
--- a/examples/gl_interop_demo.py
+++ b/examples/gl_interop_demo.py
@@ -1,17 +1,7 @@
 from OpenGL.GL import *
 from OpenGL.GLUT import *
 from OpenGL.raw.GL.VERSION.GL_1_5 import glBufferData as rawGlBufferData
-
-from OpenGL import platform
-
-try:
-    import OpenGL.WGL
-except:
-    pass
-try:
-    import OpenGL.GLX
-except:
-    pass
+from OpenGL import platform, GLX, WGL
 import pyopencl as cl
 
 
@@ -42,11 +32,11 @@ def initialize():
     if sys.platform == "linux2":
         props.append(
                 (ctx_props.GLX_DISPLAY_KHR, 
-                    OpenGl.GLX.glXGetCurrentDisplay()))
+                    GLX.glXGetCurrentDisplay()))
     elif sys.platform == "nt":
         props.append(
                 (ctx_props.WGL_HDC_KHR, 
-                    OpenGL.WGL.wglGetCurrentDC()))
+                    WGL.wglGetCurrentDC()))
     ctx = cl.Context(properties=props)
 
     glClearColor(1, 1, 1, 1)
-- 
GitLab