From 753c11cc7c9e6b88c833bd0211def839170d2f80 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Tue, 23 May 2023 21:04:32 +0800 Subject: [PATCH] sync pyglet update --- libs/pyglet/sprite.py | 3 ++- libs/pyglet/window/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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