Struct conrod::backend::piston::gfx::GfxContext
[−]
[src]
pub struct GfxContext {
pub encoder: GfxEncoder,
pub device: Device,
pub output_color: RenderTargetView<Resources, Srgba8>,
pub output_stencil: DepthStencilView<Resources, DepthStencil>,
pub g2d: Gfx2d<Resources>,
pub factory: Factory,
}Contains state used by Gfx to draw. Can be stored within a window.
Fields
encoder: GfxEncoder
GFX encoder.
device: Device
GFX device.
output_color: RenderTargetView<Resources, Srgba8>
Output frame buffer.
output_stencil: DepthStencilView<Resources, DepthStencil>
Output stencil buffer.
g2d: Gfx2d<Resources>
Gfx2d.
factory: Factory
The factory that was created along with the device.
Methods
impl GfxContext[src]
pub fn new<W>(window: &mut W, opengl: OpenGL, samples: u8) -> Self where
W: OpenGLWindow, [src]
W: OpenGLWindow,
Constructor for a new GfxContext
pub fn draw_2d<F, U>(&mut self, f: F, args: RenderArgs) -> U where
F: FnOnce(Context, &mut G2d) -> U, [src]
F: FnOnce(Context, &mut G2d) -> U,
Renders 2D graphics.
pub fn after_render(&mut self)[src]
Called after frame is rendered to cleanup after gfx device.
pub fn check_resize(&mut self, draw_size: Size)[src]
Check whether window has resized and update the output.