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
e2fe8d97
Commit
e2fe8d97
authored
Jul 09, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move GL initialization check to OnInitGL
parent
87b57175
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
panel.py
printrun/gl/panel.py
+5
-7
stlview.py
printrun/stlview.py
+3
-0
No files found.
printrun/gl/panel.py
View file @
e2fe8d97
...
...
@@ -74,10 +74,7 @@ class wxGLPanel(wx.Panel):
'''Process the drawing event.'''
self
.
canvas
.
SetCurrent
(
self
.
context
)
if
not
self
.
GLinitialized
:
self
.
OnInitGL
()
self
.
GLinitialized
=
True
self
.
OnDraw
()
event
.
Skip
()
...
...
@@ -92,6 +89,9 @@ class wxGLPanel(wx.Panel):
#==========================================================================
def
OnInitGL
(
self
,
call_reshape
=
True
):
'''Initialize OpenGL for use in the window.'''
if
self
.
GLinitialized
:
return
self
.
GLinitialized
=
True
#create a pyglet context for this panel
self
.
pygletcontext
=
gl
.
Context
(
gl
.
current_context
)
self
.
pygletcontext
.
canvas
=
self
...
...
@@ -110,8 +110,6 @@ class wxGLPanel(wx.Panel):
def
OnReshape
(
self
,
width
,
height
):
'''Reshape the OpenGL viewport based on the dimensions of the window.'''
if
not
self
.
GLinitialized
:
self
.
GLinitialized
=
True
self
.
OnInitGL
(
call_reshape
=
False
)
glViewport
(
0
,
0
,
width
,
height
)
glMatrixMode
(
GL_PROJECTION
)
...
...
printrun/stlview.py
View file @
e2fe8d97
...
...
@@ -90,6 +90,9 @@ class StlViewPanel(wxGLPanel):
#==========================================================================
def
OnInitGL
(
self
):
'''Initialize OpenGL for use in the window.'''
if
self
.
GLinitialized
:
return
self
.
GLinitialized
=
True
#create a pyglet context for this panel
self
.
pygletcontext
=
Context
(
current_context
)
self
.
pygletcontext
.
canvas
=
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