Struct nanovg::Context [−][src]
pub struct Context(_);
A initialized NanoVG context - the central type which all operations rely on.
Methods
impl Context
[src]
impl Context
pub fn raw(&self) -> *mut NVGcontext
[src]
pub fn raw(&self) -> *mut NVGcontext
Return the raw FFI C-struct pointer to the context.
pub fn frame<'a, F: FnOnce(Frame<'a>)>(
&'a self,
(width, height): (f32, f32),
device_pixel_ratio: f32,
handler: F
)
[src]
pub fn frame<'a, F: FnOnce(Frame<'a>)>(
&'a self,
(width, height): (f32, f32),
device_pixel_ratio: f32,
handler: F
)
Begin drawing a frame. All NanoVG drawing takes place within a frame.
width
and height
should be the width and height of the framebuffer / window client size.
device_pixel_ratio
defines the pixel ratio. NanoVG doesn't guess this automatically to allow for Hi-DPI devices.
Basically, this is your hidpi factor.
handler
is the callback in which you draw your paths. You cannot draw paths outside of this callback.
Trait Implementations
impl Debug for Context
[src]
impl Debug for Context
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Drop for Context
[src]
impl Drop for Context