Skip to content

Commit 7e75d63

Browse files
authored
Disallow max_fps=-1 (#99)
1 parent 2d97918 commit 7e75d63

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rendercanvas/_scheduler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ def set_update_mode(self, update_mode, *, min_fps=None, max_fps=None):
9494
self._min_fps = max(0.0, float(min_fps))
9595

9696
if max_fps is not None:
97+
# For users setting max_fps=-1 to try to disable the fps cap, as was the way to go in wgpu.gui
98+
if max_fps < 1:
99+
raise ValueError(
100+
"max_fps should be a >= 1. Use update_mode='fastest' to disable the fps cap. Also see ``vsync=False`` to unlock higher frame rates."
101+
)
97102
self._max_fps = max(1, float(max_fps))
98103

99104
def request_draw(self):

rendercanvas/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# This is the reference version number, to be bumped before each release.
1212
# The build system detects this definition when building a distribution.
13-
__version__ = "2.1.2"
13+
__version__ = "2.2.0"
1414

1515
# Allow using nearly the same code in different projects
1616
project_name = "rendercanvas"

0 commit comments

Comments
 (0)