Struct nanovg::Context
[−]
[src]
pub struct Context(_);
A initialized NanoVG context - the central type which all operations rely on.
Methods
impl Context
[src]
pub fn raw(&self) -> *mut NVGcontext
[src]
Return the raw FFI C-struct pointer to the context.
pub fn frame<F: FnOnce(Frame)>(
&self,
(width, height): (i32, i32),
device_pixel_ratio: f32,
handler: F
)
[src]
&self,
(width, height): (i32, i32),
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]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more