Skip to content

Tremus/juce_nanovg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

juce_nanovg

NanoVG graphics module for JUCE, based on https://github.com/Archie3d/juce_bgfx

Contains a juce::LowLevelGraphicsContext and attachable component for rendering JUCE projects with NanoVG. See the example to find out how to implement this yourself. Note that this does not yet implement masking for arbitrary shapes, which is required for a fully functioning LowLevelGraphicsContext.

A work-in-progress, currently only works on MacOS with Metal and Windows with DirectX 11. I expect to add better Linux support at some point, but if you have experience with NanoVG, OpenGL or Vulkan, let me know!

Build

  • git clone https://github.com/Tremus/juce_nanovg
  • cd juce_nanovg
  • git submodule update --init --recursive --depth=1 (Use depth=1 to avoid downloading all of JUCEs git history)
  • Use CMake to build the juce_nanovg_Standalone target.

Framebuffers

A framebuffer is an image/texture living in your GPUs RAM.

If you prefer to draw shapes solely using the NanoVG API, you will quickly find your GPU usage shoots up from all the draw calls.

In that case, it may be helpful to cache the static parts of your GUI by painting to an image or framebuffer. This way you can save draw calls by painting a single pre-rendered image (framebuffer).

An example of caching with framebuffers can be found here

Screenshots

Screenshot 2022-03-25 at 00 28 24

Screenshot 2022-03-25 at 00 28 25

About

NanoVG graphics module for JUCE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 94.9%
  • CMake 4.2%
  • C 0.9%