Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Jakimow
EO Time Series Viewer
Commits
dfa2c8a5
Commit
dfa2c8a5
authored
Sep 05, 2013
by
Guillaume Poulin
Browse files
solve some issue with opengl and python3
parent
c02e6184
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyqtgraph/opengl/shaders.py
View file @
dfa2c8a5
import
OpenGL
try
:
from
OpenGL
import
NullFunctionError
except
ImportError
:
from
OpenGL.error
import
NullFunctionError
from
OpenGL.GL
import
*
from
OpenGL.GL
import
shaders
import
re
...
...
@@ -219,7 +222,7 @@ class Shader(object):
if
self
.
compiled
is
None
:
try
:
self
.
compiled
=
shaders
.
compileShader
(
self
.
code
,
self
.
shaderType
)
except
OpenGL
.
NullFunctionError
:
except
NullFunctionError
:
raise
Exception
(
"This OpenGL implementation does not support shader programs; many features on pyqtgraph will not work."
)
except
RuntimeError
as
exc
:
## Format compile errors a bit more nicely
...
...
@@ -227,9 +230,12 @@ class Shader(object):
err
,
code
,
typ
=
exc
.
args
if
not
err
.
startswith
(
'Shader compile failure'
):
raise
code
=
code
[
0
].
split
(
'
\n
'
)
code
=
code
[
0
].
decode
(
'utf_8'
).
split
(
'
\n
'
)
err
,
c
,
msgs
=
err
.
partition
(
':'
)
err
=
err
+
'
\n
'
msgs
=
re
.
sub
(
'b
\'
'
,
''
,
msgs
)
msgs
=
re
.
sub
(
'
\'
$'
,
''
,
msgs
)
msgs
=
re
.
sub
(
'
\\\\
n'
,
'
\n
'
,
msgs
)
msgs
=
msgs
.
split
(
'
\n
'
)
errNums
=
[()]
*
len
(
code
)
for
i
,
msg
in
enumerate
(
msgs
):
...
...
@@ -357,7 +363,7 @@ class ShaderProgram(object):
def
uniform
(
self
,
name
):
"""Return the location integer for a uniform variable in this program"""
return
glGetUniformLocation
(
self
.
program
(),
bytes
(
name
,
'utf_8'
))
return
glGetUniformLocation
(
self
.
program
(),
name
.
encode
(
'utf_8'
))
#def uniformBlockInfo(self, blockName):
#blockIndex = glGetUniformBlockIndex(self.program(), blockName)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment