SDL2 performances on RaspberryPI

You probably got the Mesa software renderer. As stated over here, the render drivers (surprisingly) don’t ask the backend to only select accelerated contexts.

To get hardware acceleration on the Raspberry Pi you have two options:

  1. Use the old firmware-side driver usually located in /opt/vc/lib.
    This is an older driver by Broadcom that kind of works, but doesn’t integrate well with X11. SDL has the rpi video driver for this driver. Because there’s no real integration with X11, you just get one fullscreen window. This works with or without X11.

  2. Use the new vc4 driver by Eric Anholt.
    Broadcom hired him to write an open source driver that uses open APIs (specifically: It’s a gallium driver). If you activate this driver (which deactivates the older driver), X11 itself and the x11 driver of SDL will get hardware acceleration. This only works from X11, of course. With SDL 2.0.5, there’s no support to run SDL applications from the console in this configuration. However, SDL 2.0.6 has a new KMSDRM driver which will make it possible.
    To activate this driver use the raspi-config program of the Raspbian distribution. Under “Advanced Options” -> “GL Driver” you can select the “GL (Full KMS)” option. It’s still somewhat experimental and the behavior might be slightly different compared to the older driver.