igl-nanovg is a project that combines nanovg with igl, enabling nanovg to run on opengl, metal, and vulkan.
Support Platforms : MacOS, Windows, Linux, iOS, Android.
The project originally wanted to submit a PR to merge into igl , but the Facebook/igl team thought that it conflicted with their principle of minimizing dependence on third-party projects, so i created this repository separately.
Original PR: facebook/igl#213
1,Download the code (including submodule:igl):
git clone --recursive https://github.com/vinsentli/igl-nanovg.git
2,Execute script in the root directory:
prepare.sh
3,Enter the igl directory and execute the script and CMake commands according to the igl requirements to open the igl project
1)Execute the script to download the third-party code that igl depends on:
python3 deploy_deps.py
2)Execute the CMake command to generate the project:
- Windows
cd build
cmake .. -G "Visual Studio 17 2022"
- Linux
sudo apt-get install clang xorg-dev libxinerama-dev libxcursor-dev libgles2-mesa-dev libegl1-mesa-dev libglfw3-dev libglew-dev libstdc++-12-dev
cd build
cmake .. -G "Unix Makefiles"
- macOS
cd build
cmake .. -G "Xcode" -DIGL_WITH_VULKAN=OFF
- iOS
cd build
cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../third-party/deps/src/ios-cmake/ios.toolchain.cmake -DDEPLOYMENT_TARGET=13.0 -DPLATFORM=OS64
- Android
The Gradle project is located within the build/android folder.
4,Compile and run the project:
1)For Linux, MacOS, Windows, or iOS, select the NanovgSession project。
2)Select nanovg project for Android。
modify SampleLib.java:
System.loadLibrary("NanovgSession");
Metal :
2024-11-26.11.14.23222-720.mov
OpenGL:
2024-11-29.19.22.00.222.80.mov
Vulkan :