Skip to content
/ sgfx Public

SGFX is a lightweight embedded library for displays and touchscreens providing everything required to build a fully featured embedded GUI.

License

Notifications You must be signed in to change notification settings

rprata/sgfx

Repository files navigation

SGFX

CircleCI

What is SGFX?

SGFX is a lightweight embedded library for displays and touchscreens providing everything required to build a fully featured embedded GUI. The SGFX library has been designed to be the smallest, fastest and most advanced embedded library for display and touchscreen solutions. For more information, access the official website.

Goals of SGFX

  • Small memory Footprint;
  • Maximize utilities of hardware acceleration;
  • Support of advanced graphics operations such as multiple alpha blending modes;
  • No kernel modifications;
  • Lightweight, OpenSource, Portable and Modular;
  • Lua support (experimental)

Supported compilers

  • GCC
  • Clang

Supported architectures

  • x86
  • x86_64
  • ARMv5
  • ARMv6
  • ARMv7
  • ARMv8 (32-bit/64-bit)

Tested platforms

  • Raspberry Pi 1 Model B
  • Raspberry Pi 2 Model B
  • Raspberry Pi 3
  • Raspberry Pi 4
  • Odroid C2
  • Beagle Bone Black
  • DragonBoard 410C

If you have a suggestion or want contribuite with a new portings, create an issue 😉

Installation

SGFX requires CMake and Ninja to compile. Follow the instructions:

$ cd sgfx
$ mkdir build
$ cmake CMakeLists.txt -Bbuild -GNinja
$ cmake --build build

In case of cross compilation:

$ cd sgfx
$ mkdir build
$ cmake CMakeLists.txt -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=toolchains/<toolchain_file>.cmake
$ cmake --build build

Running examples

First, you must configure framebuffer filedescriptor used by target archtecture. Default value used is /dev/fb0, however you can change it creating a .sgfxconfig:

FDFB=/dev/fb

After that run examples (remember to run as a superuser):

cd build
./examples/<example>
Examples Definition
helloworld Hello World Example
drawprimitives Primitives (rect, line...)
drawimages PNG, BMP and TIF
drawtext Draw simple text
eventexample Touch event example

License

SGFX may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.