-
Notifications
You must be signed in to change notification settings - Fork 0
Graphics
SaeHie Park edited this page Mar 26, 2019
·
7 revisions
For both Ubuntu with/without X11 and Raspberry Pi 2/3 on Ubuntu
Simple windowless graphics to display Image(texture)/2D/3D
- https://www.libsdl.org/download-2.0.php
- https://github.com/seanshpark/SDL from https://github.com/SDL-mirror/SDL
- https://github.com/seanshpark/SDL_ttf from https://github.com/SDL-mirror/SDL_ttf
Prerequisite
sudo apt-get install xorg-dev
Build and Install
mkdir -p ~/v/build/sdl2
cd ~/v/build/sdl2
$HOME/v/src/SDL2-2.0.5/configure \
--prefix=$HOME/v/local \
--disable-pulseaudio --disable-esd --disable-video-mir \
--disable-video-wayland --disable-video-opengl \
--with-x
make -j3
make install
Add to environment
# add $HOME/v/local/bin to PATH
# add $HOME/v/local/lib to LD_LIBRARY_PATH
cd SDL
mkdir -p build.arm
cd build.arm
../configure --prefix=/opt/rpi \
--disable-pulseaudio --disable-esd --disable-video-mir \
--disable-video-wayland --disable-video-x11 --without-x \
--disable-video-opengl --disable-video-vulkan \
--enable-video-opengles --enable-video-opengles1 \
--enable-video-opengles2 \
--enable-video-rpi \
--enable-video-directfb
make -j1
sudo make install
SDL RPi2/3 resolution is fixed to video mode that is set on boot time.
One can change /boot/config.txt
to change the resolution but not prefereable.
One can change at runtime while boot with full HD resolution.
$ tvservice -e "DMT 16"
$ sleep 1
To restore,
$ tvservice -p
$ sleep 1
$ fbset -depth 24 && fbset -depth 32
When tvservice -p
is called, don't know the reason, screen is blank and doesn't show anything.
fbset -depth 24 && fbset -depth 32
is a hack to make things visible.
mkdir -p build.arm
cd build.arm
../configure --prefix=/opt/rpi
make
sudo make install