This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It took me a while to figure out how to get SDL_CreateWindow not to fail on ArchlinuxARM on the Raspberry Pi. So I'm documenting what I did here. It's mostly build flags, for SDL2 and for your program. | |
First of all, SDL2 on ArchlinuxARM doesn't build the Raspberry Pi and EGL backends. So here's the PKGBUILD for that: https://gist.github.com/fredmorcos/9866f5b318435a90c4f9 | |
It essentially disables all the X and Wayland stuff and enables the EGL backend. | |
Now, here's a Makefile for building your program: https://gist.github.com/fredmorcos/0728031217533079cc90 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS += -Wall -Wextra -pedantic -std=c11 -g `sdl2-config --cflags` | |
LDFLAGS += `sdl2-config --libs` | |
.PHONY: clean run | |
%.o: %.c | |
$(CC) -I/opt/vc/include $(CFLAGS) -c $< -o $@ | |
prog: main.o | |
$(CC) -L/opt/vc/lib $(LDFLAGS) $^ -o $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Sven-Hendrik Haase <[email protected]> | |
# Modified by Fred Morcos <[email protected]> for the Raspberry Pi | |
pkgname=sdl2 | |
pkgver=2.0.3 | |
pkgrel=1 | |
pkgdesc="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (Version 2)" | |
arch=('i686' 'x86_64' 'armv6h') | |
url="http://www.libsdl.org" | |
license=('MIT') | |
depends=('glibc' 'libxext' 'libxrender' 'libx11' 'libgl' 'libxcursor') |