@@ -3812,26 +3812,29 @@ def draw_overlay(self):
3812
3812
draw_over = draw_overlay
3813
3813
3814
3814
def _setup (self ):
3815
- # Set the window color, this will be transparent in saved images.
3816
- glClearColor (VERY_LIGHT_GREY , VERY_LIGHT_GREY , VERY_LIGHT_GREY , 0 )
3817
- # Reset the transformation state.
3818
- # Most of this is already taken care of in Pyglet.
3819
- #glMatrixMode(GL_PROJECTION)
3820
- #glLoadIdentity()
3821
- #glOrtho(0, self.width, 0, self.height, -1, 1)
3822
- #glMatrixMode(GL_MODELVIEW)
3823
- glLoadIdentity ()
3824
- # Enable line anti-aliasing.
3825
- glEnable (GL_LINE_SMOOTH )
3826
- # Enable alpha transparency.
3827
- glEnable (GL_BLEND )
3828
- glBlendFuncSeparate (GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA , GL_ONE , GL_ONE_MINUS_SRC_ALPHA )
3829
- #glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
3815
+ """ Initializes the application window and resets the state.
3816
+ Clears the canvas and calls Canvas.setup().
3817
+ """
3830
3818
# Start the application (if not already running).
3831
3819
if not self ._active :
3832
3820
self ._window .switch_to ()
3821
+ # Set the window color, this will be transparent in saved images.
3822
+ glClearColor (VERY_LIGHT_GREY , VERY_LIGHT_GREY , VERY_LIGHT_GREY , 0 )
3823
+ # Reset the transformation state.
3824
+ # Most of this is already taken care of in Pyglet.
3825
+ #glMatrixMode(GL_PROJECTION)
3826
+ #glLoadIdentity()
3827
+ #glOrtho(0, self.width, 0, self.height, -1, 1)
3828
+ #glMatrixMode(GL_MODELVIEW)
3829
+ glLoadIdentity ()
3830
+ # Enable line anti-aliasing.
3831
+ glEnable (GL_LINE_SMOOTH )
3832
+ # Enable alpha transparency.
3833
+ glEnable (GL_BLEND )
3834
+ glBlendFuncSeparate (GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA , GL_ONE , GL_ONE_MINUS_SRC_ALPHA )
3835
+ #glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
3833
3836
self ._window .dispatch_events ()
3834
- self ._window .set_visible ()
3837
+ self ._window .set_visible (True )
3835
3838
self ._active = True
3836
3839
self .clear ()
3837
3840
self .setup ()
0 commit comments