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