README-raspberrypi.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ================================================================================
  2. SDL2 for Raspberry Pi
  3. ================================================================================
  4. Requirements:
  5. Raspbian (other Linux distros may work as well).
  6. ================================================================================
  7. Features
  8. ================================================================================
  9. * Works without X11
  10. * Hardware accelerated OpenGL ES 2.x
  11. * Sound via ALSA
  12. * Input (mouse/keyboard/joystick) via EVDEV
  13. * Hotplugging of input devices via UDEV
  14. ================================================================================
  15. Raspbian Build Dependencies
  16. ================================================================================
  17. sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
  18. You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
  19. OpenGL ES 2.x, it usually comes pre installed, but in any case:
  20. sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
  21. ================================================================================
  22. No input
  23. ================================================================================
  24. Make sure you belong to the "input" group.
  25. sudo usermod -aG input `whoami`
  26. ================================================================================
  27. No HDMI Audio
  28. ================================================================================
  29. If you notice that ALSA works but there's no audio over HDMI, try adding:
  30. hdmi_drive=2
  31. to your config.txt file and reboot.
  32. Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
  33. ================================================================================
  34. Text Input API support
  35. ================================================================================
  36. The Text Input API is supported, with translation of scan codes done via the
  37. kernel symbol tables. For this to work, SDL needs access to a valid console.
  38. If you notice there's no SDL_TEXTINPUT message being emmited, double check that
  39. your app has read access to one of the following:
  40. * /proc/self/fd/0
  41. * /dev/tty
  42. * /dev/tty[0...6]
  43. * /dev/vc/0
  44. * /dev/console
  45. This is usually not a problem if you run from the physical terminal (as opposed
  46. to running from a pseudo terminal, such as via SSH). If running from a PTS, a
  47. quick workaround is to run your app as root or add yourself to the tty group,
  48. then re login to the system.
  49. sudo usermod -aG tty `whoami`
  50. The keyboard layout used by SDL is the same as the one the kernel uses.
  51. To configure the layout on Raspbian:
  52. sudo dpkg-reconfigure keyboard-configuration
  53. To configure the locale, which controls which keys are interpreted as letters,
  54. this determining the CAPS LOCK behavior:
  55. sudo dpkg-reconfigure locales
  56. ================================================================================
  57. Notes
  58. ================================================================================
  59. * Building has only been tested natively (i.e. not cross compiled). Cross
  60. compilation might work though, feedback is welcome!