{"id":13731824,"url":"https://github.com/jpbruyere/vkvg","last_synced_at":"2025-05-15T07:04:22.089Z","repository":{"id":39663650,"uuid":"115539227","full_name":"jpbruyere/vkvg","owner":"jpbruyere","description":"Vulkan 2D graphics library","archived":false,"fork":false,"pushed_at":"2025-03-24T18:31:13.000Z","size":5391,"stargazers_count":789,"open_issues_count":33,"forks_count":34,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-09T16:21:28.804Z","etag":null,"topics":["2d","cairo","drawing-library","gpu","graphics","graphics-library","vector","vector-graphics","vulkan"],"latest_commit_sha":null,"homepage":"https://jpbruyere.github.io/vkvg/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpbruyere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":"FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://www.paypal.me/GrandTetraSoftware"}},"created_at":"2017-12-27T16:34:11.000Z","updated_at":"2025-04-30T16:05:21.000Z","dependencies_parsed_at":"2024-01-19T02:24:42.659Z","dependency_job_id":"b3a536db-594a-44c4-afd0-d981eaccb143","html_url":"https://github.com/jpbruyere/vkvg","commit_stats":{"total_commits":561,"total_committers":9,"mean_commits":"62.333333333333336","dds":0.05169340463458105,"last_synced_commit":"ae733f3e299a7faa3adab6cee8a493b196d8010c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbruyere%2Fvkvg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbruyere%2Fvkvg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbruyere%2Fvkvg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpbruyere%2Fvkvg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpbruyere","download_url":"https://codeload.github.com/jpbruyere/vkvg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254050899,"owners_count":22006377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","cairo","drawing-library","gpu","graphics","graphics-library","vector","vector-graphics","vulkan"],"created_at":"2024-08-03T02:01:39.245Z","updated_at":"2025-05-15T07:04:22.054Z","avatar_url":"https://github.com/jpbruyere.png","language":"C","funding_links":["https://www.paypal.me/GrandTetraSoftware"],"categories":["C","Libraries","Graphics"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/jpbruyere/vkvg/blob/master/vkvg.svg\"\u003e\n\t\u003cimg src=\"https://github.com/jpbruyere/vkvg/blob/master/vkvg.svg?sanitize=true\" alt=\"vkvg\" width=\"140\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n\t\u003cbr\u003e\n  Vulkan Vector Graphics\n  \u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jpbruyere/vkvg/actions/workflows/cmake.yml\"\u003e\n     \u003cimg src=\"https://github.com/jpbruyere/vkvg/actions/workflows/cmake.yml/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/github/license/jpbruyere/vkvg.svg?style=flat-square\"\u003e\n  \u003ca href=\"https://www.paypal.me/GrandTetraSoftware\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://gitter.im/CSharpRapidOpenWidgets?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\n    \u003cimg src=\"https://badges.gitter.im/CSharpRapidOpenWidgets.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://aur.archlinux.org/packages/vkvg\"\u003e\n    \u003cimg src=\"https://img.shields.io/aur/version/vkvg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://mpr.hunterwittenborn.com/packages/vkvg\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/mpr-v0.3.0--beta-blue\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\t\n\u003c/h1\u003e\n\n**vkvg** is an open-source *2D graphics library* written in **C** using [Vulkan](https://www.khronos.org/vulkan/) as backend.\nThe **API** follows the same pattern as [Cairo](https://www.cairographics.org/), but new functions and original drawing mechanics may be added.\n\n**vkvg** is in alpha development stage and the core api is mostly stabilized. All contributions are welcome.\n\nIn progress API documentation is available online at http://vkvg.org.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jpbruyere/vkvg/blob/master/vkvg-tiger.png\"\u003e\n\t\u003ckbd\u003e\u003cimg src=\"https://github.com/jpbruyere/vkvg/blob/master/vkvg-tiger.png\" height=\"260\"\u003e\u003c/kbd\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jpbruyere/vkvg/blob/master/screenshot3.png\"\u003e\n\t\u003ckbd\u003e\u003cimg src=\"https://raw.githubusercontent.com/jpbruyere/vkvg/master/screenshot3.png\" height=\"260\"\u003e\u003c/kbd\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jpbruyere/vkvg/blob/master/screenshot1.png\"\u003e\n\t\u003ckbd\u003e\u003cimg src=\"https://github.com/jpbruyere/vkvg/blob/master/screenshot1.png\" height=\"260\"\u003e\u003c/kbd\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Performance comparison\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jpbruyere/vgperf/blob/master/vgperf.png\"\u003e\n\t\u003ckbd\u003e\u003cimg src=\"https://raw.githubusercontent.com/jpbruyere/vgperf/master/vgperf.png\" height=\"300\"\u003e\u003c/kbd\u003e\n  \u003c/a\u003e\n   \u003cbr\u003emajor libs perf comparison\u003c/br\u003e\n\u003c/p\u003e\n\n## Current status:\n\n- Fill (stencil even-odd, non-zero).\n- Stroke.\n- Basic painting operation.\n- Font system with caching operational.\n- Linear/Radial Gradients.\n- Line caps and joins.\n- Dashes.\n- Context should be thread safe, extensive tests required.\n- Image loading and writing with [stb lib](https://github.com/nothings/stb)\n- Test includes svg rendering either with built-in renderer or [nanoSVG](https://github.com/memononen/nanosvg)\n\n## Requirements:\n\n- [CMake](https://cmake.org/): version \u003e= 3.16\n- [Vulkan](https://www.khronos.org/vulkan/): version \u003e= 1.1\n- [FontConfig](https://www.freedesktop.org/wiki/Software/fontconfig/): optional, without fontconfig, use `vkvg_load_font_from_path`.\n- [Freetype](https://www.freetype.org/): optional, stb_truetype as alternative.\n- [Harfbuzz](https://www.freedesktop.org/wiki/Software/HarfBuzz/): optional, without complex text shaping may be wrong.\n- GLSLC: spirv compiler, included in [LunarG SDK](https://www.lunarg.com/vulkan-sdk/): compile shader to spir-V (building only, optional)\n- [xxd](https://linux.die.net/man/1/xxd): generate headers with precompiled shaders (building only, optional)\n- [GLFW](http://www.glfw.org/): optional, if present tests are built.\n\nif `glslc` or `xxd` are not present, a precompiled version of the shaders is stored in the git tree.\n\n## Building\n\n\u003ca href=\"https://aur.archlinux.org/packages/vkvg\"\u003e\u003cimg src=\"https://img.shields.io/aur/version/vkvg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://mpr.hunterwittenborn.com/packages/vkvg\"\u003e\u003cimg src=\"https://img.shields.io/badge/mpr-v0.3.0--beta-blue\"\u003e\u003c/a\u003e\n\n```bash\n#fetch sources from github\ngit clone --recursive https://github.com/jpbruyere/vkvg.git\ncd vkvg\n# Create build directory\nmkdir build\ncd build\n# Run CMake configuration\ncmake ..\n```\n\n### CMake configure options\n\n##### Core library options:\n\n* `-DVKVG_USE_GLUTESS=true`: Use embedded glu tesselator to fill polygones in NON-ZERO mode. If false, a simple ear clipping algorithm is used.\n* `-DVKVG_SVG=true`: Enable experimental svg renderer. If false, use nanoSVG.\n* `-DVKVG_RECORDING=true`: Enable experimental draw commands recording infrastructure.\n* `-DVKVG_BUILD_DOCS=true`: Build documentation if doxygen is found.\n\n##### Vulkan Features:\n\n* `-DVKVG_ENABLE_VK_SCALAR_BLOCK_LAYOUT=true`: Enable `VK_EXT_scalar_block_layout` that reduce structure padding for gpu.\n* `-VKVG_ENABLE_VK_TIMELINE_SEMAPHORE=true`: Enable experimental work syncing with `VK_KHR_timeline_semaphore` instead of Fences.\n\n##### Text rendering libraries:\n\nThose libraries are enabled by default, but disabled if not found.\n* `-DVKVG_USE_FONTCONFIG=true`: enable FontConfig to resolve font's names.\n* `-DVKVG_USE_FREETYPE=true`: enable FreeType to render glyphs, if false glyphs are rendered with stb_truetype.\n* `-DVKVG_USE_HARFBUZZ=true`: enable harfbuzz for text shaping.\n\n##### Tests options:\n\n* `-DVKVG_BUILD_TESTS=true`: build all tests in the tests forlder.\n* `-DVKVG_TEST_DIRECT_DRAW=true`: enable drawing directly on the swapchain images.\n\n##### Debugging options:\n\nIf vkvg is compiled with `CMAKE_BUILD_TYPE=Debug`, several additional options are made available to help debugging:\n* `-DENABLE_VALIDATION=true`: enable vulkan validation layer.\n* `-DENABLE_DBG_UTILS=true`: enable various vulkan debug utils extensions features.\n* `-DENABLE_RENDERDOC=true`: enable renderdoc layer.\n* `-DENABLE_WIRED_FILL=true`: enable rendering in wired mode, current mode is controled with the global variable `vkvg_wired_debug`.\n* `-DENABLE_PROFILING=true`: add -pg to the compile options.\n* `-DVKVG_DBG_STATS=true`: store various context statistics fetchable with `vkvg_device_get_stats()`\n\n```bash\ncmake --build .\n```\nA [detailed tutorial](doc/windows_build_tutorial.md) is available for Windows.\n\n## Running tests\n\nAppend the `-h` option to see available command line parameters.\n\n## Contributing\n\nSee the [contribution guide](https://github.com/jpbruyere/vkvg/blob/master/CONTRIBUTING.md) for more information.\n\nJoin us on [gitter](https://gitter.im/CSharpRapidOpenWidgets) for any question.\n\n## Addtitional Credits\n\n- vkvg use the [AGG project](http://antigrain.com/)'s recursive bezier algorithm which is kindly exposed [here](http://agg.sourceforge.net/antigrain.com/research/adaptive_bezier/index.html).\n- I've learned Vulkan with the help of the excellent [Sacha Willems's vulkan examples](https://github.com/SaschaWillems/Vulkan).\n- The 2d affine matrix implementation follows Cairo's one.\n\n## Change log\n\n* v0.2.0\n\t- radial gradients.\n\t- better stroke joins handling.\n\t- png saved in srgb format.\n\t- doxygen cmake target and style\n\n## To Do\n\n- [x] Use Scissor where possible.\n- [x] Improve stroke algorithms.\n- [x] Radial gradients.\n- [x] Dashed lines.\n- [ ] Operators.\n- [x] Optimize vulkan memory allocations by sub-allocating from a single shared memory chunk per type.\n- [x] Optimize command submissions.\n- [x] Test SDF font rendering.\n- [x] Avoid line joins inside curves and arc.\n- [ ] Structured unit testing.\n- [x] Perf and memory checks.\n- [ ] Code cleanup and comments.\n- [ ] Documentations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpbruyere%2Fvkvg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpbruyere%2Fvkvg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpbruyere%2Fvkvg/lists"}