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

Method update

dm_control/viewer/gui/glfw_gui.py:288–300  ·  view source on GitHub ↗

Updates the window and renders a new image. Args: render_func: A callable returning a 3D numpy array of bytes (np.uint8), with dimensions (width, height, 3).

(self, render_func)

Source from the content-addressed store, hash-verified

286 self.update(tick_func)
287
288 def update(self, render_func):
289 """Updates the window and renders a new image.
290
291 Args:
292 render_func: A callable returning a 3D numpy array of bytes (np.uint8),
293 with dimensions (width, height, 3).
294 """
295 pixels = render_func()
296 with self._context.make_current() as ctx:
297 ctx.call(
298 self._update_gui_on_render_thread, self._context.window, pixels)
299 self._mouse.process_events()
300 self._keyboard.process_events()
301
302 def _update_gui_on_render_thread(self, window, pixels):
303 self._fullscreen_quad.render(pixels, self.shape)

Callers 2

event_loopMethod · 0.95
__iadd__Method · 0.45

Calls 3

make_currentMethod · 0.80
process_eventsMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected