MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / DoubleBufferedGlfwContext

Class DoubleBufferedGlfwContext

dm_control/viewer/gui/glfw_gui.py:40–57  ·  view source on GitHub ↗

Custom context manager for the GLFW based GUI.

Source from the content-addressed store, hash-verified

38
39
40class DoubleBufferedGlfwContext(glfw_renderer.GLFWContext):
41 """Custom context manager for the GLFW based GUI."""
42
43 def __init__(self, width, height, title):
44 self._title = title
45 super().__init__(max_width=width, max_height=height)
46
47 @_check_valid_backend
48 def _platform_init(self, width, height):
49 glfw.window_hint(glfw.SAMPLES, 4)
50 glfw.window_hint(glfw.VISIBLE, 1)
51 glfw.window_hint(glfw.DOUBLEBUFFER, 1)
52 self._context = glfw.create_window(width, height, self._title, None, None)
53 self._destroy_window = glfw.destroy_window
54
55 @property
56 def window(self):
57 return self._context
58
59
60class GlfwKeyboard(base.InputEventsProcessor):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…