Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the renderer #256

Merged
merged 2 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)| |
11 changes: 2 additions & 9 deletions ppb/systems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down