def __init__(self):
        """
        Opens a window using pyglet, registers input callbacks
        and creates a moderngl context.
        """
        super().__init__()
        # Disable all error checking
        pyglet.options['debug_gl'] = False

        # Set context parameters
        config = pyglet.gl.Config()
        config.double_buffer = True
        config.major_version = self.gl_version.major
        config.minor_version = self.gl_version.minor
        config.forward_compatible = True
        config.sample_buffers = 1 if self.samples > 1 else 0
        config.samples = self.samples
        # Find monitor

        # Open window
        self.window = PygletWrapper(
            width=self.width, height=self.height,
            caption=self.title,
            resizable=self.resizable,
            vsync=self.vsync,
            fullscreen=self.fullscreen,
        )
        self.window.set_mouse_visible(self.cursor)

        self.window.event(self.on_key_press)
        self.window.event(self.on_key_release)
        self.window.event(self.on_mouse_motion)
        self.window.event(self.on_resize)

        self.ctx = moderngl.create_context(require=self.gl_version.code)
        context.WINDOW = self
        self.fbo = self.ctx.screen
        self.set_default_viewport()
def __init__ ( self ) : super ( ) . __init__ ( ) pyglet . options [ 'debug_gl' ] = False config = pyglet . gl . Config ( ) config . double_buffer = True config . major_version = self . gl_version . major config . minor_version = self . gl_version . minor config . forward_compatible = True config . sample_buffers = 1 if self . samples > 1 else 0 config . samples = self . samples self . window = PygletWrapper ( width = self . width , height = self . height , caption = self . title , resizable = self . resizable , vsync = self . vsync , fullscreen = self . fullscreen , ) self . window . set_mouse_visible ( self . cursor ) self . window . event ( self . on_key_press ) self . window . event ( self . on_key_release ) self . window . event ( self . on_mouse_motion ) self . window . event ( self . on_resize ) self . ctx = moderngl . create_context ( require = self . gl_version . code ) context . WINDOW = self self . fbo = self . ctx . screen self . set_default_viewport ( )
Opens a window using pyglet, registers input callbacks
        and creates a moderngl context.