Skip to content

Commit

Permalink
Dummy methods for vsync in windows with no support
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Sep 17, 2022
1 parent dd61366 commit 455813c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion moderngl_window/context/pyqt5/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, **kwargs):
gl.setProfile(QtOpenGL.QGLFormat.CoreProfile)
gl.setDepthBufferSize(24)
gl.setDoubleBuffer(True)
gl.setSwapInterval(1 if self.vsync else 0)
gl.setSwapInterval(1 if self._vsync else 0)

# Configure multisampling if needed
if self.samples > 1:
Expand Down Expand Up @@ -118,6 +118,10 @@ def _set_fullscreen(self, value: bool) -> None:
else:
self._widget.showNormal()

def _set_vsync(self, value: bool) -> None:
# TODO: Figure out how to toggle vsync
pass

@property
def size(self) -> Tuple[int, int]:
"""Tuple[int, int]: current window size.
Expand Down
4 changes: 4 additions & 0 deletions moderngl_window/context/pyside2/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def _set_fullscreen(self, value: bool) -> None:
else:
self._widget.showNormal()

def _set_vsync(self, value: bool) -> None:
# TODO: Figure out how to toggle vsync
pass

@property
def size(self) -> Tuple[int, int]:
"""Tuple[int, int]: current window size.
Expand Down
4 changes: 4 additions & 0 deletions moderngl_window/context/tk/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def __init__(self, **kwargs):
def _set_fullscreen(self, value: bool) -> None:
self._tk.attributes("-fullscreen", value)

def _set_vsync(self, value: bool) -> None:
# TODO: Figure out how to toggle vsync
pass

@property
def size(self) -> Tuple[int, int]:
"""Tuple[int, int]: current window size.
Expand Down

0 comments on commit 455813c

Please sign in to comment.