-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Il 20/07/2010 05:17, Andreas Kloeckner ha scritto:

> 
> Mostly applied. Actually, I tried to piece together something
> platform-independent based on your and Paolo's comments--can you please
> test the version in git? I'm guessing I broke it, but I'd like to fix it
> back up as soon as possible.
> 
> Thanks for your contribution!
> Andreas
> 


With this patch the example is working at least on linux :)


iff --git a/examples/gl_interop_demo.py b/examples/gl_interop_demo.py
index 29ee8a1..468564c 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)



This evening I'll try this code on windows at home


- -- 
Paolo Simone Gasparello
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxFeh0ACgkQir9NfUtfsb+o+gCgjb8IHjrTNO6HlmYHcLBoAXYA
em4Anj7ySWB/O/CYwmzVNcC6y1eJluEE
=9mHA
-----END PGP SIGNATURE-----

_______________________________________________
PyOpenCL mailing list
PyOpenCL@tiker.net
http://lists.tiker.net/listinfo/pyopencl

Reply via email to