Monday, December 31, 2012

Getting started with SDL on BB10 and the Playbook

BlackBerry provides SDL for the available for BlackBerry 10 and the PlayBook, with a nice touch screen helper library to make it easier to create touch screen controls with minimal or even no modification to original apps.

The instructions on how to use SDL after building everything is quite lacking on the web site so, I'll document my findings here for anyone else that is interested and also as a reminder for myself.

Anyway, start with cloning TouchControlOverlay and SDL from the RIM github repo. I won't go into the details here. And remember to source the bbndk evironment first.

Ok, now you should have the sources. Start with building and installing  TouchControlOverlay

cd TouchControlOverlay
make
make install

Next, building SDL. I prefer to use an out-of-source build directory, makes it easier to build for both BB10 and PlayBook from the same source.

$ mkdir sdlbb10
$ cd sdlbb10
$ ../SDL/configure  --prefix=/home/milang/bbndk/target_10_0_9_1673/qnx6/armle-v7 \
--host=arm-unknown-nto-qnx8.0.0eabi \
--without-x --enable-pthreads \
--enable-audio --enable-video-playbook \
LDFLAGS="-lscreen -lasound -lpps -lm -lpng14 -lbps -lxml2 -lEGL -lGLESv2" \
CPPFLAGS="-D__PLAYBOOK__ -D__QNXNTO__"
$ make

Install SDL
$ make install

Ok, now SDL is installed nicely. Next edit the bbndk-env.sh script and add

PKG_CONFIG_PATH=${QNX_TARGET}/armle-v7/lib/pkgconfig
export PKG_CONFIG_PATH

in the end of the file. Re-source it or set the PKG_CONFIG_PATH manually. What this does is enable pkg-config enabled sources to find SDL (and other software that uses pkg-config to get options). For example the SDL libraries that we will add next, SDL_net and SDL_image. But that will come in another post.

No comments: