Rendering Contexts

These are the top-level rendering contexts available in yt_idv.

yt_idv.rendering_contexts.render_context(engine='pyglet', **kwargs)[source]

Return the appropriate rendering context.

At present, this accepts either “pyglet” or “egl”

Parameters

engine (str, either "pyglet" or "egl") –

Returns

Return type

RenderingContext

class yt_idv.rendering_contexts.pyglet_context.PygletRenderingContext(*args: Any, **kwargs: Any)[source]

Bases: pyglet.window.Window, yt_idv.rendering_contexts.base_context.BaseContext

Basic rendering context for IDV using GLFW3, that handles the main window even loop

Parameters
  • width (int, optional) – The width of the Interactive Data Visualization window. For performance reasons it is recommended to use values that are natural powers of 2.

  • height (int, optional) – The height of the Interactive Data Visualization window. For performance reasons it is recommended to use values that are natural powers of 2.

  • title (str, optional) – The title of the Interactive Data Visualization window.

  • position (tuple of ints, optional) – What position should the window be moved to? (Upper left) If not specified, default to center.

center_window()[source]
on_draw()[source]
on_key_press(symbol, modifiers)[source]
on_mouse_drag(x, y, dx, dy, buttons, modifiers)[source]
on_mouse_press(x, y, button, modifiers)[source]
on_mouse_scroll(x, y, scroll_x, scroll_y)[source]
run()[source]
set_position(xpos, ypos)[source]
class yt_idv.rendering_contexts.egl_context.EGLRenderingContext(width=1024, height=1024, **kwargs)[source]

Bases: yt_idv.rendering_contexts.base_offscreen.OffscreenRenderingContext

Rendering context using EGL (experimental)

Parameters
  • width (int, optional) – The width of the off-screen buffer window. For performance reasons it is recommended to use values that are natural powers of 2.

  • height (int, optional) – The height of the off-screen buffer window. For performance reasons it it is recommended to use values that are natural powers of 2.