Kivy has traditionally used Pygame which is a python wrapper for SDL 1.2. However setting up Kivy with Pygame is a bit annoying and since Pygame is very old and unmaintained you don't want to use it anyway.
Kivy 1.9.1 however has a direct interface for SDL2 which is super modern and awesome!
To use it you should do something like this:
sudo apt-get install python3-dev libsdl2-ttf-dev libsdl2-net-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-dev
virtualenv --no-site-packages -p python3 kivyinstall
pip install cython
pip install git+https://github.com/kivy/kivy.git@master
Now if you run
python ./kivyinstall/share/kivy-examples/tutorials/pong/main.py you should see something like this:
[INFO ] [Logger ] Record log in /home/ernst/.kivy/logs/kivy_15-07-19_8.txtShare on Twitter Share on Facebook
[INFO ] [Kivy ] v1.9.1-dev
[INFO ] [Python ] v3.4.3 (default, Mar 26 2015, 22:03:40)
[INFO ] [Factory ] 176 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO ] [GL ] OpenGL version <b'3.0 Mesa 10.7.0-devel (git-8c8a71f 2015-07-19 vivid-oibaf-ppa)'>
[INFO ] [GL ] OpenGL vendor <b'X.Org'>
[INFO ] [GL ] OpenGL renderer <b'Gallium 0.4 on AMD BARTS'>
[INFO ] [GL ] OpenGL parsed version: 3, 0
[INFO ] [GL ] Shading version <b'1.30'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Text ] Provider: sdl2
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Leaving application in progress...
Dear Mr.Maezawa, Would you like to go to the Moon with me?
No matter if, i really respect your intentions behind th… https://t.co/ADrUynEWf4
1 month ago