Closed seanshpark closed 6 years ago
Comment out this line in /boot/config.txt
# dtoverlay=vc4-kms-v3d
Save, reboot and try again.
googling showed that currently it's an experimental OpenGL driver.
SDL2 build from source
sudo apt-get install libudev-dev
../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
sudo make install
set environment to rpi
export SDL_VIDEODRIVER=rpi
Existing issues
With DirectFB, export SDL_VIDEODRIVER=directfb
DirectFB/fbdev/vt: Unable to restore VT mode!!!
--> it's called when shutdown. https://github.com/djbclark/directfb-core-DirectFB/blob/master/systems/fbdev/vt.c
DFBResult
dfb_vt_shutdown( bool emergency )
Another error right before this:
Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0]
[1434: 0.000] --> Caught signal 1 (sent by the kernel)
Run again with second virtual console by pressing ALT-F2.
$ cat ~/.directfbrc
mode=1024x768
depth=16
pixelformat=RGB16
Changes resolution , still no rectangle
One solution is to change video resolution at boot time.
edit /boot/config.txt
and change settings;
hdmi_group=2
hdmi_mode=16
This will change to 1024x768 60Hz
set video to RPi
export SDL_VIDEODRIVER=rpi
Run the program.
There exist a program that can change resolution
Change to 1024x768 60Hz
tvservice -e "DMT 16"
Change to prefered, (default?)
tvservice -p
or
tvservice -e "DMT 82"
Problem: screen is on but blank, nothing is shown. Chaging to another virtual screen (ALT-Fx) solves.
fbset -depth 24 && fbset -depth 32
Added to https://github.com/seanshpark/help/wiki/Graphics page.
Have problem with RPi3 graphics from console,
SDL_Init()
but doesn't work and no error messagefailed to add service - already in use