Skip to content
Snippets Groups Projects
Commit c46d4781 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Linux fixes to GL interop. (Paolo Simone Gasparello)

parent b49162f4
No related branches found
No related tags found
No related merge requests found
from OpenGL.GL import * from OpenGL.GL import *
from OpenGL.GLUT import * from OpenGL.GLUT import *
from OpenGL.raw.GL.VERSION.GL_1_5 import glBufferData as rawGlBufferData from OpenGL.raw.GL.VERSION.GL_1_5 import glBufferData as rawGlBufferData
from OpenGL import platform, GLX, WGL
from OpenGL import platform
try:
import OpenGL.WGL
except:
pass
try:
import OpenGL.GLX
except:
pass
import pyopencl as cl import pyopencl as cl
...@@ -42,11 +32,11 @@ def initialize(): ...@@ -42,11 +32,11 @@ def initialize():
if sys.platform == "linux2": if sys.platform == "linux2":
props.append( props.append(
(ctx_props.GLX_DISPLAY_KHR, (ctx_props.GLX_DISPLAY_KHR,
OpenGl.GLX.glXGetCurrentDisplay())) GLX.glXGetCurrentDisplay()))
elif sys.platform == "nt": elif sys.platform == "nt":
props.append( props.append(
(ctx_props.WGL_HDC_KHR, (ctx_props.WGL_HDC_KHR,
OpenGL.WGL.wglGetCurrentDC())) WGL.wglGetCurrentDC()))
ctx = cl.Context(properties=props) ctx = cl.Context(properties=props)
glClearColor(1, 1, 1, 1) glClearColor(1, 1, 1, 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment