diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 88f06415..916388d4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -21,3 +21,4 @@ Name | Email | Twitter | [Andrew Schamp](https://github.com/schamp/) | | [schamp](https://twitter.com/schamp) [Dillon Omane](https://github.com/dillonko) | [Dillon_KO](dillonko84@gmail.com) [Nicolas Braud-Santoni](https://nicolas.braud-santoni.eu) | | | +[Zack OConnor](https://github.com/ZackOConnor)| (zackary.oconnor@gmail.com)| | \ No newline at end of file diff --git a/ppb/systems/__init__.py b/ppb/systems/__init__.py index 2cfc966e..e892e974 100644 --- a/ppb/systems/__init__.py +++ b/ppb/systems/__init__.py @@ -35,7 +35,6 @@ def __init__(self, resolution=default_resolution, window_title: str="PursuedPyBe self.resized_images = {} self.old_resized_images = {} self.render_clock = 0 - self.render_ready = False self.target_frame_rate = target_frame_rate self.target_count = 1 / self.target_frame_rate @@ -49,16 +48,10 @@ def __exit__(self, exc_type, exc_val, exc_tb): def on_idle(self, idle_event: events.Idle, signal): self.render_clock += idle_event.time_delta - if self.render_ready: - self.render_ready = False + if self.render_clock > self.target_count: + signal(events.PreRender()) signal(events.Render()) - elif self.render_clock >= self.target_count: self.render_clock = 0 - signal(events.PreRender()) - - def on_pre_render(self, pre_render_event, signal): - # Here to let the system flush responses to PreRender before rendering. - self.render_ready = True def on_render(self, render_event, signal): self.render_background(render_event.scene)