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
f2cab549
Commit
f2cab549
authored
May 29, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wx2.9 compatibility and cleanup
Tested on both wx2.9 and wx2.8, shouldn't bring any regression.
parent
1e2a09b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
18 deletions
+5
-18
gcview.py
printrun/gcview.py
+5
-18
No files found.
printrun/gcview.py
View file @
f2cab549
...
@@ -47,6 +47,7 @@ class wxGLPanel(wx.Panel):
...
@@ -47,6 +47,7 @@ class wxGLPanel(wx.Panel):
self
.
sizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
sizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
canvas
=
glcanvas
.
GLCanvas
(
self
,
attribList
=
attribList
)
self
.
canvas
=
glcanvas
.
GLCanvas
(
self
,
attribList
=
attribList
)
self
.
context
=
glcanvas
.
GLContext
(
self
.
canvas
)
self
.
sizer
.
Add
(
self
.
canvas
,
1
,
wx
.
EXPAND
)
self
.
sizer
.
Add
(
self
.
canvas
,
1
,
wx
.
EXPAND
)
self
.
SetSizer
(
self
.
sizer
)
self
.
SetSizer
(
self
.
sizer
)
self
.
sizer
.
Fit
(
self
)
self
.
sizer
.
Fit
(
self
)
...
@@ -56,20 +57,6 @@ class wxGLPanel(wx.Panel):
...
@@ -56,20 +57,6 @@ class wxGLPanel(wx.Panel):
self
.
canvas
.
Bind
(
wx
.
EVT_SIZE
,
self
.
processSizeEvent
)
self
.
canvas
.
Bind
(
wx
.
EVT_SIZE
,
self
.
processSizeEvent
)
self
.
canvas
.
Bind
(
wx
.
EVT_PAINT
,
self
.
processPaintEvent
)
self
.
canvas
.
Bind
(
wx
.
EVT_PAINT
,
self
.
processPaintEvent
)
#==========================================================================
# Canvas Proxy Methods
#==========================================================================
def
GetGLExtents
(
self
):
'''Get the extents of the OpenGL canvas.'''
return
self
.
canvas
.
GetClientSize
()
def
SwapBuffers
(
self
):
'''Swap the OpenGL buffers.'''
self
.
canvas
.
SwapBuffers
()
#==========================================================================
# wxPython Window Handlers
#==========================================================================
def
processEraseBackgroundEvent
(
self
,
event
):
def
processEraseBackgroundEvent
(
self
,
event
):
'''Process the erase background event.'''
'''Process the erase background event.'''
pass
# Do nothing, to avoid flashing on MSWin
pass
# Do nothing, to avoid flashing on MSWin
...
@@ -79,8 +66,8 @@ class wxGLPanel(wx.Panel):
...
@@ -79,8 +66,8 @@ class wxGLPanel(wx.Panel):
if
self
.
canvas
.
GetContext
():
if
self
.
canvas
.
GetContext
():
# Make sure the frame is shown before calling SetCurrent.
# Make sure the frame is shown before calling SetCurrent.
self
.
Show
()
self
.
Show
()
self
.
canvas
.
SetCurrent
()
self
.
canvas
.
SetCurrent
(
self
.
context
)
size
=
self
.
GetGLExtents
()
size
=
self
.
canvas
.
GetClientSize
()
self
.
winsize
=
(
size
.
width
,
size
.
height
)
self
.
winsize
=
(
size
.
width
,
size
.
height
)
self
.
width
,
self
.
height
=
size
.
width
,
size
.
height
self
.
width
,
self
.
height
=
size
.
width
,
size
.
height
self
.
OnReshape
(
size
.
width
,
size
.
height
)
self
.
OnReshape
(
size
.
width
,
size
.
height
)
...
@@ -90,7 +77,7 @@ class wxGLPanel(wx.Panel):
...
@@ -90,7 +77,7 @@ class wxGLPanel(wx.Panel):
def
processPaintEvent
(
self
,
event
):
def
processPaintEvent
(
self
,
event
):
'''Process the drawing event.'''
'''Process the drawing event.'''
self
.
canvas
.
SetCurrent
()
self
.
canvas
.
SetCurrent
(
self
.
context
)
if
not
self
.
GLinitialized
:
if
not
self
.
GLinitialized
:
self
.
OnInitGL
()
self
.
OnInitGL
()
...
@@ -154,7 +141,7 @@ class wxGLPanel(wx.Panel):
...
@@ -154,7 +141,7 @@ class wxGLPanel(wx.Panel):
self
.
pygletcontext
.
set_current
()
self
.
pygletcontext
.
set_current
()
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
)
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
)
self
.
draw_objects
()
self
.
draw_objects
()
self
.
SwapBuffers
()
self
.
canvas
.
SwapBuffers
()
#==========================================================================
#==========================================================================
# To be implemented by a sub class
# To be implemented by a sub class
...
...
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