Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
60166d80
Commit
60166d80
authored
Apr 05, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch openGL failures and avoid flooding console to death
parent
3edac5ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
panel.py
printrun/gl/panel.py
+13
-2
No files found.
printrun/gl/panel.py
View file @
60166d80
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
from
threading
import
Lock
from
threading
import
Lock
import
logging
import
sys
import
traceback
import
wx
import
wx
from
wx
import
glcanvas
from
wx
import
glcanvas
...
@@ -77,6 +80,8 @@ class wxGLPanel(wx.Panel):
...
@@ -77,6 +80,8 @@ class wxGLPanel(wx.Panel):
self
.
basequat
=
[
0
,
0
,
0
,
1
]
self
.
basequat
=
[
0
,
0
,
0
,
1
]
self
.
zoom_factor
=
1.0
self
.
zoom_factor
=
1.0
self
.
gl_broken
=
False
# bind events
# bind events
self
.
canvas
.
Bind
(
wx
.
EVT_ERASE_BACKGROUND
,
self
.
processEraseBackgroundEvent
)
self
.
canvas
.
Bind
(
wx
.
EVT_ERASE_BACKGROUND
,
self
.
processEraseBackgroundEvent
)
self
.
canvas
.
Bind
(
wx
.
EVT_SIZE
,
self
.
processSizeEvent
)
self
.
canvas
.
Bind
(
wx
.
EVT_SIZE
,
self
.
processSizeEvent
)
...
@@ -104,8 +109,14 @@ class wxGLPanel(wx.Panel):
...
@@ -104,8 +109,14 @@ class wxGLPanel(wx.Panel):
'''Process the drawing event.'''
'''Process the drawing event.'''
self
.
canvas
.
SetCurrent
(
self
.
context
)
self
.
canvas
.
SetCurrent
(
self
.
context
)
self
.
OnInitGL
()
if
not
self
.
gl_broken
:
self
.
OnDraw
()
try
:
self
.
OnInitGL
()
self
.
OnDraw
()
except
pyglet
.
gl
.
lib
.
GLException
:
self
.
gl_broken
=
True
logging
.
error
(
_
(
"OpenGL failed, disabling it:"
))
traceback
.
print_exc
(
file
=
sys
.
stdout
)
event
.
Skip
()
event
.
Skip
()
def
Destroy
(
self
):
def
Destroy
(
self
):
...
...
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