Type Definition gfx_gtk::GlRenderContext[][src]

type GlRenderContext<CF, DF> = RenderContext<GlDevice, GlFactory, CF, DF>;

render context, specialized for the gfx Gl backend

Methods

impl<CF, DF> GlRenderContext<CF, DF> where
    CF: Formatted<View = [f32; 4]>,
    CF::Channel: TextureChannel + RenderChannel,
    CF::Surface: RenderSurface + TextureSurface,
    DF: Formatted,
    DF::Channel: TextureChannel + RenderChannel,
    DF::Surface: DepthSurface + TextureSurface, 
[src]

Creates a new Gfx GlRender context including the Gl Device. The default epoxy Gl function pointer will be used to load the Gl binding.

  • aa antialiasing mode, currently supported Single and Multi(4)
  • widget_width width of the client area of the containing widget
  • widget_height height of the client area of the containing widget`
  • postprocess_shader optional buffer containing the source code of the postprocessing pixel shader. A simple default shader will be used if None

Creates a new Gfx GlRender context including the Gl Device.

  • aa antialiasing mode, currently supported Single and Multi(4)
  • widget_width width of the client area of the containing widget
  • widget_height height of the client area of the containing widget`
  • get_proc_addr the function used to look up the Gl API function pointers (usually epoxy::get_proc_addr)
  • postprocess_shader optional buffer containing the source code of the postprocessing pixel shader. A simple default shader will be used if None

Returns a reference to the current Gfx context

Returns a copy of the current viewport

Re-allocates render buffers and textures if the size has changed since last resize or creation of the context

  • widget_width width of the client area of the containing widget
  • widget_height height of the client area of the containing widget`
  • render_callback if Some(_), forwards the resize message to the given RenderCallbak for internal adjustment

Renders on the GlArea by invoking the render function to write onto the offline render target and blit the result onto the actual GlArea framebuffer, optionally applying an intermediate postprocess step (also customizable). Also transparently takes care of Gl context and state changes.

  • render_callback a reference of the render callback implementing the actual drawing