1919 pyglet .options .backend = "webgl"
2020
2121import pyglet .window .mouse
22+ import pyglet .config
2223from pyglet .display .base import Screen , ScreenMode
2324from pyglet .event import EVENT_HANDLE_STATE , EVENT_UNHANDLED
2425from pyglet .window import MouseCursor
@@ -194,11 +195,9 @@ def __init__(
194195 config = None
195196 # Attempt to make window with antialiasing
196197 if gl_api == "opengl" or gl_api == "opengles" :
197- import pyglet .graphics .api .gl as gl
198-
199198 if antialiasing :
200199 try :
201- config = gl . base .OpenGLConfig (
200+ config = pyglet . config .OpenGLConfig (
202201 major_version = gl_version [0 ],
203202 minor_version = gl_version [1 ],
204203 opengl_api = gl_api .replace ("open" , "" ), # type: ignore # pending: upstream fix
@@ -218,7 +217,7 @@ def __init__(
218217 antialiasing = False
219218 # If we still don't have a config
220219 if not config :
221- config = gl . base .OpenGLConfig (
220+ config = pyglet . config .OpenGLConfig (
222221 major_version = gl_version [0 ],
223222 minor_version = gl_version [1 ],
224223 opengl_api = gl_api .replace ("open" , "" ), # type: ignore # pending: upstream fix
@@ -230,14 +229,13 @@ def __init__(
230229 blue_size = 8 ,
231230 alpha_size = 8 ,
232231 )
233- config = config .match (self )
234232 try :
235233 super ().__init__ (
236234 width = width ,
237235 height = height ,
238236 caption = title ,
239237 resizable = resizable ,
240- config = config ,
238+ config = config , # type: ignore Pylance seems to think this is an EmscriptenWindow at this point?
241239 vsync = vsync ,
242240 visible = visible ,
243241 style = style ,
0 commit comments