Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyopencl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pyopencl
Commits
c46d4781
Commit
c46d4781
authored
14 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Linux fixes to GL interop. (Paolo Simone Gasparello)
parent
b49162f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/gl_interop_demo.py
+3
-13
3 additions, 13 deletions
examples/gl_interop_demo.py
with
3 additions
and
13 deletions
examples/gl_interop_demo.py
+
3
−
13
View file @
c46d4781
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment