Install SDL2 on Raspberry Pi4

提供 Raspberry Pi 4 安裝、設定
inho
文章: 69
註冊時間: 2017-12-08, 23:00

Install SDL2 on Raspberry Pi4

文章inho » 2019-10-30, 08:41

https://choccyhobnob.com/sdl2-2-0-8-on-raspberry-pi/
get rid of the default SDL2
$ sudo apt-get remove -y --force-yes libsdl2-dev
$ sudo apt-get autoremove -y
$ sudo apt-get install libasound2-dev libpulse-dev
Install SDL2 :
$ ./autogen
$ ./configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-opengl --host=arm-raspberry-linux-gnueabihf
# Another option ??? :
$ ./configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl
Try...
$ ./configure
$ make -j4 && sudo make install
$ sdl2-config –version
2.0.10 --> Great Success

Install SDL2_Image :
$ ./autogen.sh
$ ./configure
$ make -j4 && sudo make install
Install SDL2_ttf :
$ ./autogen.sh
$ ./configure
$ make -j4 && sudo make install
Install SDL2_mixer :
$ ./autogen.sh
$ ./configure
$ make -j4 && sudo make install
Install SDL2_net :
$ ./autogen.sh
$ ./configure
$ make -j4 && sudo make install

All done. Any program that uses SDL2 to draw to the framebuffer should now be doing it in hardware on the raspberry pis videocore4 using opengles2!

#============ install SDL2 == ALSA: Advanced Linux Sound Architecture. ===
# 解決 SDL_OpenAudio: No such audio device 的問題
# to includes PulseAudio and ALSA support.
$ sudo apt-get install libasound2-dev libpulse-dev
# 解決 ERROR: Could not initialize SDL video
$ sudo apt-get install xorg-dev
# 解決 libavcodec/avcodec.h: No such file or directory
$ sudo apt-get install libavcodec-dev
# 解決 fatal error: libswscale/swscale.h: No such file or directory
$ sudo apt-get install libswscale-dev
# -lavformat -lavcodec -lswscale -lavutil
$ sudo apt-get install libavutil-dev
# solve problem:
Mix_OpenAudio error : No such audio device
INFO: SDL_GetDesktopDisplayMode failed: Video subsystem has not been initialized

$ sudo apt-get install libasound2-dev libpulse-dev
then, reinstall SDL core again...
$ ....
#=================================================

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 7 位訪客