From: Jean-Philippe Bruyère Date: Thu, 13 Aug 2020 08:43:39 +0000 (+0200) Subject: test rtd X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=71f6d4e98dab2a19ebce2c4f2e5765c592271966;p=jp%2Fvkvg.git test rtd --- diff --git a/_config.yml b/_config.yml index c419263..ff2f838 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1,28 @@ -theme: jekyll-theme-cayman \ No newline at end of file +title: VKVG Documentation +lang: en +description: Open source 2d vector graphic library for vulkan writen in c. + +remote_theme: rundocs/jekyll-rtd-theme # rundocs/jekyll-theme-docsify + +edit: true +addons_branch: true + +addons: + - github + - plugins + - analytics + +copyright: + revision: true + +readme_index: + with_frontmatter: trueremote_theme: pmarsceill/just-the-docs + + +color_scheme: "dark" +logo: "/assets/images/vkvg.png" + +# Google Analytics Tracking (optional) +ga_tracking: UA-175345502-1 + + diff --git a/assets/images/vkvg.png b/assets/images/vkvg.png new file mode 100644 index 0000000..6b8c988 Binary files /dev/null and b/assets/images/vkvg.png differ diff --git a/assets/images/vkvg.svg b/assets/images/vkvg.svg new file mode 100644 index 0000000..df4f790 --- /dev/null +++ b/assets/images/vkvg.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/docs/building/building.md b/docs/building/building.md new file mode 100644 index 0000000..cdada10 --- /dev/null +++ b/docs/building/building.md @@ -0,0 +1,20 @@ +--- +layout: default +title: Building +nav_order: 2 +has_children: true +permalink: /docs/building +--- + +## Requirements: + +- [CMake](https://cmake.org/): version > 12. +- [Vulkan](https://www.khronos.org/vulkan/) +- [FontConfig](https://www.freedesktop.org/wiki/Software/fontconfig/) +- [Freetype](https://www.freetype.org/) +- [Harfbuzz](https://www.freedesktop.org/wiki/Software/HarfBuzz/) +- GLSLC: spirv compiler, included in [LunarG SDK](https://www.lunarg.com/vulkan-sdk/) (building only) +- [xxd](https://linux.die.net/man/1/xxd): generate headers with precompiled shaders (building only) +- [GLFW](http://www.glfw.org/): optional, if present tests are built. + +if `glslc` or `xxd` are not present, a precompiled version of the shaders is stored in the git tree. diff --git a/docs/building/debian.md b/docs/building/debian.md new file mode 100644 index 0000000..fd31268 --- /dev/null +++ b/docs/building/debian.md @@ -0,0 +1,46 @@ +--- +layout: default +title: Debian instructions +parent: Building +nav_order: 1 +--- + +# Install Dependencies + +`glslc` and `xxd` are required to compile the shaders. If one of them is not installed, a precompiled version of the shaders is stored in the git tree. + +### build tools +```bash +sudo apt install git cmake gcc g++ xxd +``` + +### vulkan lib and tools + +###### from debian packages +```bash +sudo apt install libvulkan-dev mesa-vulkan-drivers +``` +###### from lunarg sdk +```bash + +``` + +##### build dependencies +```bash +sudo apt-get install libfontconfig-dev libfreetype-dev libharfbuzz-dev +``` + + +## Getting the sources from GitHub + +```bash +#fetch sources from github +git clone --recursive https://github.com/jpbruyere/vkvg.git +cd vkvg +# Create build directory +mkdir build +cd build +# Run CMake, optionaly setup glslc path +cmake .. +make +``` diff --git a/docs/building/windows.md b/docs/building/windows.md new file mode 100644 index 0000000..e6fb3af --- /dev/null +++ b/docs/building/windows.md @@ -0,0 +1,62 @@ +--- +layout: default +title: Windows instructions +parent: Building +nav_order: 2 +--- + +# Build on Windows with Visual Studio IDE: + +(*Tested with VS 2017*) +Ensure [CMake and c/c++ support options](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio?view=vs-2019) are installed along with Visual studio. + +The easyest way to proceed is to open a visual studio command prompt, and issue commands manually. Once dependencies are build and vkvg project files have been created, you may use the ide. + +#### Build dependencies +Install the latest [vulkan sdk](https://vulkan.lunarg.com/) from lunarg. + +Make sure that [Git](https://git-scm.com/download/win) is installed on your machine by typing on the command line (cmd): +```bash +> git --version +git version 2.19.1.windows.1 +``` +Install [vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2019) to build required libraries: +```bash +git clone https://github.com/Microsoft/vcpkg.git +cd vcpkg +.\bootstrap-vcpkg.bat +``` +Then install the libraries required by vkvg, use the triplet corresponding with your architecture: +```bash +vcpkg install fontconfig:x64-window freetype:x64-window harfbuzz:x64-window +``` +Optionaly, install [GLFW] to build the samples: +```bash +vcpkg install glfw:x64-window +``` +Add the path to the shared libraries binaries to your **PATH** environment variable, they are in %vcpkg-root%/installed/x64-windows/bin/. + +To make those libraries available for vsstudio use the [system wide integration](https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/#vsmsbuild-project-user-wide-integration) from vcpkg. +```bash +vcpkg integrate install +``` +#### CMake configuration +Exit vcpkg directory and clone the vkvg repository and its submodule vkh: +```bash +git clone --recursive https://github.com/jpbruyere/vkvg.git +cd vkvg +#create a build directory +mkdir build +``` +To generate the solution file (.sln) from the build directory we use cmake with the toolchain file provided by vcpkg and we also disable the lcd font filtering (FreeType is built without [lcd fonts](https://en.wikipedia.org/wiki/Subpixel_rendering) by default). +``` +cmake .. -DCMAKE_TOOLCHAIN_FILE=..\..\vcpkg\scripts\buildsystems\vcpkg.cmake -DVKVG_LCD_FONT_FILTER=off +``` +To adjust later compilation options, you may recall cmake command, or use the cmake-gui command. +```bash +cmake-gui .. +``` +Now you should have the vkvg.sln and all the projects file into your build directory. You may build the complete solution on the command line with: +```bash +msbuild vkvg.sln +``` diff --git a/index.md b/index.md index 271d8e4..a2e4c45 100644 --- a/index.md +++ b/index.md @@ -1,37 +1,13 @@ -## Welcome to GitHub Pages +--- +layout: default +title: Home +nav_order: 1 +description: "Vulkan Vector Graphics" +permalink: / +--- -You can use the [editor on GitHub](https://github.com/jpbruyere/vkvg/edit/gh-pages/index.md) to maintain and preview the content for your website in Markdown files. +# VKVG Documentations -Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. +**vkvg** is an open source *2D graphics library* written in **c** using [Vulkan](https://www.khronos.org/vulkan/) as backend. It's **api** follows the same pattern as [Cairo](https://www.cairographics.org/), but new functions and original drawing mechanics may be added. -### Markdown - -Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for - -```markdown -Syntax highlighted code block - -# Header 1 -## Header 2 -### Header 3 - -- Bulleted -- List - -1. Numbered -2. List - -**Bold** and _Italic_ and `Code` text - -[Link](url) and ![Image](src) -``` - -For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/). - -### Jekyll Themes - -Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/jpbruyere/vkvg/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file. - -### Support or Contact - -Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out. +![](https://raw.githubusercontent.com/jpbruyere/vkvg/master/screenshot1.png) diff --git a/introduction.md b/introduction.md new file mode 100644 index 0000000..fc85a8b --- /dev/null +++ b/introduction.md @@ -0,0 +1,94 @@ +

+
+ + vkvg + +
+
+ Vulkan Vector Graphics +
+

+ + + + + + + + + + +

+

+ +**vkvg** is an open source *2D graphics library* written in **c** using [Vulkan](https://www.khronos.org/vulkan/) as backend. It's **api** follows the same pattern as [Cairo](https://www.cairographics.org/), but new functions and original drawing mechanics may be added. + +**vkvg** is in early development stage, api may change, any contribution is welcome. + +For API documentation and usage, please refer to the [Cairo](https://www.cairographics.org/) documentation for now. + +

+ + + + + + +

+ +#### Current status: + +- Fill (stencil even-odd, non-zero with ear clipping). +- Stroke. +- Basic painting operation. +- Font system with caching operational. +- Linear Gradients. +- Line caps and joins. +- Context should be thread safe, extensive tests required. +- Image loading and writing with [stb lib](https://github.com/nothings/stb) +- Test includes svg rendering with [nanoSVG](https://github.com/memononen/nanosvg) + +### Requirements: + +- [CMake](https://cmake.org/): version > 12. +- [Vulkan](https://www.khronos.org/vulkan/) +- [FontConfig](https://www.freedesktop.org/wiki/Software/fontconfig/) +- [Freetype](https://www.freetype.org/) +- [Harfbuzz](https://www.freedesktop.org/wiki/Software/HarfBuzz/) +- GLSLC: spirv compiler, included in [LunarG SDK](https://www.lunarg.com/vulkan-sdk/) (building only) +- [xxd](https://linux.die.net/man/1/xxd): generate headers with precompiled shaders (building only) +- [GLFW](http://www.glfw.org/): optional, if present tests are built. + +if `glslc` or `xxd` are not present, a precompiled version of the shaders is stored in the git tree. + +### Building + +```bash +#fetch sources from github +git clone --recursive https://github.com/jpbruyere/vkvg.git +cd vkvg +# Create build directory +mkdir build +cd build +# Run CMake, optionaly setup glslc path +cmake .. +make +``` + +A [detailed tutorial](doc/windows_build_tutorial.md) is available for Windows. + +### To Do + +- [x] Use Scissor where possible. +- [x] Improve stroke algorithms. +- [ ] Radial gradients. +- [x] Dashed lines. +- [ ] Operators. +- [x] Optimize vulkan memory allocations by sub-allocating from a single shared memory chunk per type. +- [x] Optimize command submissions. +- [x] Test SDF font rendering. +- [x] Avoid line joins inside curves and arc. +- [ ] Structured unit testing. +- [ ] Perf and memory checks. +- [ ] Code clean and comment. +- [ ] Documentations. \ No newline at end of file