Giter VIP home page Giter VIP logo

rprata / sgfx Goto Github PK

View Code? Open in Web Editor NEW
23.0 4.0 8.0 253 KB

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

License: MIT License

C 89.11% CMake 4.19% Objective-C 6.64% Shell 0.06%
lightweight-embedded-library graphic-library graphical-interface framebuffer embedded-systems c touchscreen lua lua-binding framebuffers

sgfx's Introduction

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.

sgfx's People

Contributors

rprata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sgfx's Issues

ibutterfree_config_read: ‘strncpy’ output truncated before terminating nul copying

Descrição:
  • Tentei compilar mas recebo alguns erros na função strncopy strncpy(m_bfcs->fdfb, FB, strlen(FB));. Uma busca rápida no Google vi que algumas pessoas mudaram o strncpy por memcpy. Quando faço isso outro erro acontece mas em uma função do ibutterfree_surface.c error: argument 1 null where non-null expected [-Werror=nonnull].
  • TL;DR: strncopy e memcpy retornam erros inesperados.

Arquitetura:
  • SO: Linux 5.5.13-1-MANJARO #1 SMP PREEMPT Wed Mar 25 17:14:28 UTC 2020 x86_64 GNU/Linux | ArchLinux
  • Processador: i3
  • Memória: 12GB

Erro:

strncpy(m_bfcs->fdfb, FB, strlen(FB));

Scanning dependencies of target ibutterfree
[  4%] Building C object src/CMakeFiles/ibutterfree.dir/utils/ibutterfree_config.c.o
/home/diegocatalao/Desktop/workspace/ibutterfree/src/utils/ibutterfree_config.c: In function ‘ibutterfree_config_read’:
/home/diegocatalao/Desktop/workspace/ibutterfree/src/utils/ibutterfree_config.c:11:3: error: ‘strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length [-Werror=stringop-truncation]
   11 |   strncpy(m_bfcs->fdfb, FB, strlen(FB));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/diegocatalao/Desktop/workspace/ibutterfree/src/utils/ibutterfree_config.c:12:3: error: ‘strncpy’ output truncated before terminating nul copying 17 bytes from a string of the same length [-Werror=stringop-truncation]
   12 |   strncpy(m_bfcs->fdev, INPUT, strlen(INPUT));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/diegocatalao/Desktop/workspace/ibutterfree/src/utils/ibutterfree_config.c:30:6: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
   30 |      strncpy(m_bfcs->fdev, buff + 5, strlen(buff + 5) - 1);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/diegocatalao/Desktop/workspace/ibutterfree/src/utils/ibutterfree_config.c:30:38: note: length computed here
   30 |      strncpy(m_bfcs->fdev, buff + 5, strlen(buff + 5) - 1);
      |                                      ^~~~~~~~~~~~~~~~
/home/diegocatalao/Desktop/workspace/ibutterfree/src/utils/ibutterfree_config.c:24:6: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
   24 |      strncpy(m_bfcs->fdfb, buff + 5, strlen(buff + 5) - 1);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/diegocatalao/Desktop/workspace/ibutterfree/src/utils/ibutterfree_config.c:24:38: note: length computed here
   24 |      strncpy(m_bfcs->fdfb, buff + 5, strlen(buff + 5) - 1);
      |                                      ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/ibutterfree.dir/build.make:96: src/CMakeFiles/ibutterfree.dir/utils/ibutterfree_config.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:147: src/CMakeFiles/ibutterfree.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

error: argument 1 null where non-null expected [-Werror=nonnull]

[  4%] Building C object src/CMakeFiles/ibutterfree.dir/utils/ibutterfree_config.c.o
[  8%] Building C object src/CMakeFiles/ibutterfree.dir/core/ibutterfree_surface.c.o
/home/diegocatalao/Desktop/workspace/ibutterfree/src/core/ibutterfree_surface.c: In function ‘ibutterfree_surface_set_description’:
/home/diegocatalao/Desktop/workspace/ibutterfree/src/core/ibutterfree_surface.c:111:3: error: argument 1 null where non-null expected [-Werror=nonnull]
  111 |   memcpy(surface->desc, desc, sizeof(IButterFreeSurfaceDescription));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/diegocatalao/Desktop/workspace/ibutterfree/includes/core/ibutterfree.h:30,
                 from /home/diegocatalao/Desktop/workspace/ibutterfree/includes/core/ibutterfree_surface.h:25,
                 from /home/diegocatalao/Desktop/workspace/ibutterfree/src/core/ibutterfree_surface.c:1:
/usr/include/string.h:43:14: note: in a call to function ‘memcpy’ declared here
   43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
      |              ^~~~~~
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/ibutterfree.dir/build.make:135: src/CMakeFiles/ibutterfree.dir/core/ibutterfree_surface.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:147: src/CMakeFiles/ibutterfree.dir/all] Error 2
make: *** [Makefile:104: all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.