BLEND 2D

next generation 2d vector graphics engine

Blend2D Projects

(NOTE: This section is in preparation and will be updated when Blend2D beta version is released)

Blend2D C++ engine and other projects are available under blend2d organization on github.

Blend2D C++ Engine - b2d

Blend2D C++ engine is called b2d and it's the primary project from all projects covered by Blend2D. It's the core engine written in C++ exposing high-level C++ API.

github issues


Dependencies

AsmJit

AsmJit is the only external dependency of Blend2D library. It allows Blend2D to generate JIT code at runtime and to execute it. AsmJit is not bundled with Blend2D so it has to be downloaded separately. However, you don't have to build asmjit yourself as Blend2D embeds this library and builds it together with Blend2D.

github issues

Build Instructions

Blend2D requires only AsmJit as a dependency, which it expects by default at the same directory level as Blend2D itself. If you wish to use a different directory you would have to specify it through ASMJIT_DIR cmake definition. The simplest way to download and compile the latest Blend2D library with a statically compiled AsmJit is by using cmake:

# Get Blend2D and AsmJit.

$ git clone --depth=1 https://github.com/blend2d/b2d
$ git clone --depth=1 https://github.com/asmjit/asmjit

# Create Build Directory.

$ mkdir b2d/build
$ cd b2d/build

# Configure and build - This example uses ninja, however, any other build
# system supported by CMake should work. Use B2D_BUILD_TEST to build unit
# tests and some sample applications.

$ cmake .. -G"Ninja" -DCMAKE_BUILD_TYPE=Release -DB2D_BUILD_TEST=TRUE
$ ninja

# Done, you should have b2d.dll or libb2d.so, etc...

By default only b2d library is built. The following build options are available:

  • ASMJIT_DIR - Where to find AsmJit library (default "../asmjit").
  • ASMJIT_EMBED - Whether to embed AsmJit library (default true).
  • B2D_BUILD_TEST - Whether to build Blend2D samples and unit tests (default false).
  • B2D_BUILD_EMBED - Whether to embed Blend2D library, can only be used if you include Blend2D CMakeLists.txt from your own build script (default false).
  • CMAKE_BUILD_TYPE - Don't forget to set it to "Release" in order to create a release build as cmake builds debug by default.