Files
MapLibreParticleLab/platform/linux
Tiago Vignatti 32b6f2fa03 [linux] Implement EGL headless backend
Original author: Tiago Vignatti <tvignatti@gmail.com>

Calling X11 window system is superfluous for headless rendering. This patch
implements EGL platform using GBM, which is slightly more simple than the GLX
path when using X11.

In principle there are no big advantages in terms of performance etc. My
motivation behind this was to get in touch with the code and the project. For
testing I'm using:

  $ unset DISPLAY && ./build/linux-x86_64/Debug/mbgl-test

v2: rebased patch against the new cmake changes; walk through render node to
find a valid one; remove EGLSurface completely cause windows are not needed
here.
2016-11-17 01:01:15 +01:00
..
2016-08-05 11:42:22 +02:00

Linux

A simple map application and test suite for Linux based on Mapbox GL Native and GLFW.

We are using Ubuntu for development. While the software should work on other distributions as well, we are not providing explicit build instructions here.

This process gives you a Linux desktop app built on a Linux host system.

Build

Install GCC 5+ if you are running Ubuntu 14.04 or older. Alternatively, you can also use Clang 3.5+.

sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
export CXX=g++-5

Ensure you have git and other build essentials:

sudo apt-get install curl git build-essential zlib1g-dev automake \
                     libtool xutils-dev make cmake pkg-config python-pip \
                     libcurl4-openssl-dev libpng-dev libsqlite3-dev \
                     libllvm3.4

Install glfw3 dependencies:

sudo apt-get install libxi-dev libglu1-mesa-dev x11proto-randr-dev \
                     x11proto-xext-dev libxrandr-dev \
                     x11proto-xf86vidmode-dev libxxf86vm-dev \
                     libxcursor-dev libxinerama-dev

Set the environment variable MAPBOX_ACCESS_TOKEN to your Mapbox access token:

export MAPBOX_ACCESS_TOKEN=MYTOKEN

Optionally, you can specify a custom style to the test application:

export MAPBOX_STYLE_URL=MYSTYLEURL

Then, you can then proceed to build the test application:

make glfw-app

Set an access token as described below, and then run:

make run-glfw-app

Test

  • make test-* Builds and runs all tests. You can specify individual tests by replacing * with their name (e.g. make test-Sprite.CustomSpriteImages).

The zsh will treat the * in this command as a glob, so you'll need to run make "test-*" instead.

Usage

Keyboard shortcuts for testing functionality are logged to the console when the test app is started.