Lion Vector Graphics
LVG is a lightweight flash player replacement. Basic idea: we have some assets in a package and sctipts that renders them.
It’s designed to use a very small runtime (around 200kb without video codecs) for player and runs on android, ios, web and more.
Currently it uses C script to load and render assets.
Why C script? Because C compiler is small, and runtime written in C, so no other language is needed and script can be compiled in to a save the space.
Another reason is compatibility: lvg only exposes small API and opengl, with other scripting laguages we must do all from scratch, including GUI.
But there are huge amount of already-written C code.
Usually author prefer C++, but there also some reasons to use pure C for whole project:
Following assets currently supported:
Render can be done using following backends:
Works:
Not works:
Basic svg demo (images clickable):
NanoVG demo incapsulated in lvg:
Nuklear GUI demo:
Flash swf demo:
For now windows executables builds only on linux host using mingw.
For windows and linux install all build dependencies with the following command:
apt-get install -qq -y git cmake meson yasm libglfw3-dev libsdl2-dev libavcodec-dev mingw-w64 wget
For macos brew must be installed:
brew install meson upx glfw sdl2 ffmpeg tcc
LVG uses meson as build system. Actual building with the following commands in project directory:
mkdir build
cd build
meson ..
ninja
LVG can be configured to use different backends for platform, audio and video. You can see current configuration by executing mesonconf (or meson configure for newer meson versions) in build directory:
meson configure
...
Project options:
Option Description Current Value Possible Values
------ ----------- ------------- ---------------
AUDIO_SDL AUDIO_SDL true [True, False]
ENABLE_AUDIO ENABLE_AUDIO true [True, False]
ENABLE_SCRIPT ENABLE_SCRIPT true [True, False]
ENABLE_VIDEO ENABLE_VIDEO true [True, False]
PLATFORM_GLFW PLATFORM_GLFW true [True, False]
PLATFORM_SDL PLATFORM_SDL false [True, False]
RENDER_NANOVG RENDER_NANOVG true [True, False]
RENDER_NVPR RENDER_NVPR true [True, False]
SCRIPT_TCC SCRIPT_TCC true [True, False]
VIDEO_FFMPEG VIDEO_FFMPEG true [True, False]
...
You can change configuration using meson commands. Example:
mesonconf -DENABLE_SCRIPT=False
LVG is developed and maintained by https://github.com/lieff