diff --git a/libs/pyglet/sprite.py b/libs/pyglet/sprite.py index 300a8bd..76fce76 100644 --- a/libs/pyglet/sprite.py +++ b/libs/pyglet/sprite.py @@ -400,7 +400,8 @@ class Sprite(event.EventDispatcher): self._group.blend_dest, self._group.program, group) - self._batch.migrate(self._vertex_list, GL_TRIANGLES, self._group, self._batch) + if self._batch is not None: + self._batch.migrate(self._vertex_list, GL_TRIANGLES, self._group, self._batch) @property def image(self): diff --git a/libs/pyglet/window/__init__.py b/libs/pyglet/window/__init__.py index 215b5fb..b10b4a0 100644 --- a/libs/pyglet/window/__init__.py +++ b/libs/pyglet/window/__init__.py @@ -1799,7 +1799,9 @@ class FPSDisplay: usage is to create an `FPSDisplay` for each window, and draw the display at the end of the windows' :py:meth:`~pyglet.window.Window.on_draw` event handler:: - window = pyglet.window.Window() + from pyglet.window import Window, FPSDisplay + + window = Window() fps_display = FPSDisplay(window) @window.event