Git Product home page Git Product logo

sfml-pi's Introduction

SFML-Pi

This library allows the use of SFML on Linux-based systems (including Raspberry Pis) WITHOUT the use of X11. It supports two options for achieving this: One is to use direct rendering manager/kernel mode setting (DRM/KMS). The other is specific to Raspberry Pi 0-3 systems and involves using the RPi's legacy "DISPMANX" drivers.

This software should be considered experimental. It has a number of known limitations. It might work if you only need a single fullscreen window. UDEV is used for the handling of keyboard, mouse and touch input, and appropriate permissions to /dev/input/event* are required for input handling to work correctly.

Instructions for the DRM/KMS version:

Step 1: Install the SFML dependencies on your system

  • See: http://www.sfml-dev.org/tutorials/2.4/compile-with-cmake.php

  • Install the libraries required for building SFML on Linux (other than the x11 ones... x11, xrandr, xcb*).

  • Also install the following additional libraries: "drm-dev", "gbm-dev" and "EGL-dev"

  • The command to do this on a debian-based system will look something like this:

sudo apt-get install cmake libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg8-dev libfreetype6-dev libudev-dev libdrm-dev libgbm-dev libegl1-mesa-dev

Step 2: Build the "DRM" version of SFML-Pi

  • From the source directory for sfml-pi, run cmake with the '-DSFML_DRM=1' parameter.
  • Once cmake runs successfully, compile using 'make' and then 'sudo make install' and 'sudo ldconfig'
  • The commands will look something like this:
mkdir build
cd build
cmake .. -DSFML_DRM=1
make -j4
sudo make install
sudo ldconfig

This version uses OpenGL by default. If you want to use OpenGL ES instead, add the '-DSFML_OPENGL_ES=1' parameter when you run cmake in the instructions above.

SFML-Pi will autodetect the display device, mode and refresh rate to use with drm. You can override the default behaviour with the the following environment variables:

  • Set "SFML_DRM_DEVICE" to indicate the device you want to use.
  • Set "SFML_DRM_MODE" to indicate the video mode you want to use.
  • Set "SFML_DRM_REFRESH" to request a specific refresh rate.
  • Set "SFML_DRM_DEBUG" for a console print out of the mode and rate settings used.

Instructions for the (RPi 0-3) DISPMANX version:

Step 1: Install the SFML dependencies on your system

sudo apt-get install cmake libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg8-dev libfreetype6-dev libudev-dev libraspberrypi-dev

Step 2: Build the "DISPMANX" version of SFML-Pi

  • From the source directory for sfml-pi, run cmake with the '-DSFML_RPI=1' parameter.
  • Once cmake runs successfully, compile using 'make' and then 'sudo make install' and 'sudo ldconfig'
  • The commands will look something like this:
mkdir build
cd build
cmake .. -DSFML_RPI=1 -DEGL_INCLUDE_DIR=/opt/vc/include -DEGL_LIBRARY=/opt/vc/lib/libbrcmEGL.so -DGLES_INCLUDE_DIR=/opt/vc/include -DGLES_LIBRARY=/opt/vc/lib/libbrcmGLESv2.so
make -j4
sudo make install
sudo ldconfig

Note: if you are using a Pi firmware older than 1.20160921-1, please replace "libbrcmEGL.so" and "libbrcmGLESv2" with the old names, "libEGL.so" and "libGLESv2".

This mode uses OpenGL ES

More Info

Please consult the SFML readme for more info: readme-original.md

sfml-pi's People

Contributors

laurentgomila avatar mantognini avatar binary1248 avatar intjelic avatar expl0it3r avatar bromeon avatar marioliebisch avatar mickelson avatar tankos avatar oomek avatar foaly avatar cobaltergeist avatar bluecobold avatar zsbzsb avatar texus avatar frex avatar jonnyptn avatar tomgalvin594 avatar jcowgill avatar eatse21 avatar amdmi3 avatar hapaxia avatar dermoumi avatar ceylo avatar firefly2442 avatar hobby8 avatar dawid-aurobit avatar tiaanl avatar ppelleti avatar kipernal avatar

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.