docs.rs failed to build nanovg-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: nanovg-1.0.2

NanoVG Rust wrapper

Now with Cargo!

This is a Rust-language wrapper for the NanoVG vector-graphis library.

NanoVG is C code, and it supports several back-ends: GL2, GL3, GLES...

NanoVG is not an extremely complete or extensive implementation of vector graphics. It is however small and hardware-accelerated, which is what I want.

Screenshot

yay! screenshot works in rust demo!

Prerequisites

This build process will produce a Rust library, which includes the Rust wrapper for nanovg functions, and which statically links in those functions. NanoVG only does the graphics drawing, though; you'll need to be getting a GL context from somewhere. The examples use GLFW.

Premake4 is required for building NanoVG itself.

GLFW3 needs to be installed.

Building

Build using cargo:

  git clone https://github.com/KevinKelley/nanovg-rs
  cd nanovg-rs
  cargo build

To build the demo, then:

  cd examples/demo
  cargo build
  ./target/example

(note that font and image resources won't be found if you run from inside the target directory)

In the demo,

  • 'p' switches between pre- and un-premultiplied alpha;
  • 's' saves a screenshot;
  • and 'space' toggles scale/rotate of the pseudo-window stuff.

Used By

License

MIT, for this binding. NanoVG is released under the zlib license.

Links