树莓派4b配置rpi-opengl-without-x编译开发环境
查看程序运行在显示器的第几层:
vcgencmd dispmanx_list
display:2 format:XRGB8888 transform:0 layer:-127 2392x768 src:0,0,1368,768 dst:0,0,1368,768 cost:849 lbm:0
display:2 format:ARGB8888 transform:0 layer:1 64x64 src:0,0,64,64 dst:1022,382,64,64 cost:125 lbm:0
display:7 format:XRGB8888 transform:0 layer:-127 2392x768 src:1368,0,1024,768 dst:0,0,1024,768 cost:658 lbm:0
开始安装依赖库
1.sudo apt-get install libegl-mesa0-dev libegl1-mesa-dev libgbm-dev libgles2-mesa-dev libdrm-dev
2.git clone https://github.com/matusnovak/rpi-opengl-without-x && cd rpi-opengl-without-x
3.gcc -o triangle_rpi4 triangle_rpi4.c -ldrm -lgbm -lEGL -lGLESv2 -I/usr/include/libdrm -I/usr/include/GLES2
4.Execute, no X server, no HDMI output connected.