[][src]Trait gfx_gtk::GlRenderCallback

pub trait GlRenderCallback<CF, DF> where
    CF: Formatted<View = GtkTargetColorView>,
    CF::Channel: TextureChannel + RenderChannel,
    CF::Surface: RenderSurface + TextureSurface,
    DF: Formatted,
    DF::Channel: TextureChannel + RenderChannel,
    DF::Surface: DepthSurface + TextureSurface, 
{ fn render(
        &mut self,
        gfx_context: &mut GlGfxContext,
        viewport: &Viewport,
        render_target: &GlFrameBuffer<CF>,
        depth_buffer: &GlDepthBuffer<DF>
    ) -> Result<GlRenderCallbackStatus>; fn resize(
        &mut self,
        _gfx_context: &mut GlGfxContext,
        _viewport: Viewport
    ) -> Result<GlRenderCallbackStatus> { ... } }

Implement custom render behaviour for the GlArea

  • CF color format of the offline target
  • DF depth format of the offline target

Required methods

fn render(
    &mut self,
    gfx_context: &mut GlGfxContext,
    viewport: &Viewport,
    render_target: &GlFrameBuffer<CF>,
    depth_buffer: &GlDepthBuffer<DF>
) -> Result<GlRenderCallbackStatus>

Invoked when the GlArea needs rendering (after an expose or queue_draw event)

  • gfx_context Gfx device, factory, encoder attached to the current Gl context
  • viewport size of the GlArea
  • render_target the offscreen target to render to
  • depth_buffer the offscreen depth buffer associated to the render_target

After rendering, the result should contain either: *Ok(Continue) to proceed with the postprocessing step *Ok(Skip) to blit directly to the GlArea buffer *Err(_) will stop the rendering of the requested frame Gtk may or may not retain the previous state of the frame

Loading content...

Provided methods

fn resize(
    &mut self,
    _gfx_context: &mut GlGfxContext,
    _viewport: Viewport
) -> Result<GlRenderCallbackStatus>

Invoked when the GlArea has been resized

  • gfx_context Gfx device, factory, encoder attached to the current Gl context
  • viewport size of the GlArea after resizing Should return Continue
Loading content...

Implementors

Loading content...