The Metal port of NanoVG.
MetalNanoVG is the native Metal port of NanoVG that tries to get the most out of Apple's Graphics APIs.
If you found this project useful, please consider donating to show your support ❤️
NanoVGand
MetalNanoVGsource codes.
NanoVGand
MetalNanoVG's
srcdirectories to the header search path.
NanoVG's
src/nanovg.cand
MetalNanoVG's
src/nanovg_mtl.mto the
Compile Sourcessection in Xcode.
Metaland
QuartzCoreframeworks.
Done.
#include "nanovg.h" #include "nanovg_mtl.h"
CAMetalLayerobject when creating the NanoVG context.
NVGcontext* ctx = nvgCreateMTL(metalLayer, NVG_ANTIALIAS | NVG_STENCIL_STROKES);
The following table depicts a simple CPU usage benchmark of running the NanoVG demo app on iOS devices with full Retina resolution. Both Metal and OpenGL ES2 implementations get constant 60 FPS.
| | iPhone 6s+ | iPad Pro 12.7" (2015) | | ---------- | ----------- | --------------------- | | Resolution | 1080 x 1920 | 2732 * 2048 | | Metal | 20% | 20% | | OpenGL ES2 | 35% | 33% |
MetalNanoVG was originally created to improve the performance of the iOS app Fog of World.