yt.visualization.volume_rendering.glfw_inputhook module

Enable pyglet to be used interactive by setting PyOS_InputHook.

Authors

  • Nicolas P. Rougier
  • Fernando Perez
class yt.visualization.volume_rendering.glfw_inputhook.GLFWInputHook(manager)[source]

Bases: IPython.lib.inputhook.InputHookBase

disable()
enable(app=None)[source]

Enable event loop integration with GLFW.

Parameters:app (ignored) – Ignored, it’s only a placeholder to keep the call signature of all gui activation methods consistent, which simplifies the logic of supporting magics.

Notes

This methods sets the PyOS_InputHook for GLFW, which allows GLFW to integrate with terminal based applications like IPython.

yt.visualization.volume_rendering.glfw_inputhook.create_inputhook_glfw(mgr, render_loop)[source]

Run the GLFW event loop by processing pending events only.

This keeps processing pending events until stdin is ready. After processing all pending events, a call to time.sleep is inserted. This is needed, otherwise, CPU usage is at 100%. This sleep time should be tuned though for best performance.

yt.visualization.volume_rendering.glfw_inputhook.stdin_ready()[source]