https://elinux.org/index.php?title=Didj_and_Explorer_SDL_image&feed=atom&action=historyDidj and Explorer SDL image - Revision history2024-03-28T16:06:41ZRevision history for this page on the wikiMediaWiki 1.31.0https://elinux.org/index.php?title=Didj_and_Explorer_SDL_image&diff=46897&oldid=prevJsujjava: Add Category Didj2011-05-10T15:11:24Z<p>Add Category Didj</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 15:11, 10 May 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l87" >Line 87:</td>
<td colspan="2" class="diff-lineno">Line 87:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Obviously change the arm-linux-uclibcgnueabi-gcc to your chosen cross compiler.  If you added extra image formats don't forget to add a -l for each extra lib and support lib that is needed.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Obviously change the arm-linux-uclibcgnueabi-gcc to your chosen cross compiler.  If you added extra image formats don't forget to add a -l for each extra lib and support lib that is needed.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Didj]]</ins></div></td></tr>
<!-- diff cache key elinux:diff::1.12:old-26437:rev-46897 -->
</table>Jsujjavahttps://elinux.org/index.php?title=Didj_and_Explorer_SDL_image&diff=26437&oldid=prevReggie at 13:55, 5 November 20102010-11-05T13:55:40Z<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 13:55, 5 November 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l3" >Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A short tutorial on how to build, install and get started with the SDL_Image handling library, adding .jpg and .png support to your apps/games.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>A short tutorial on how to build, install and get started with the SDL_Image handling library, adding .jpg and .png support to your apps/games.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">I'd like to thank Nirvous, NullMoogleCable, PhillKll, Claude, JKent, Jburks, GrizzlyAdams and anyone I may have forgotten for their help :)</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Prerequisites</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Prerequisites</div></td></tr>
<!-- diff cache key elinux:diff::1.12:old-23293:rev-26437 -->
</table>Reggiehttps://elinux.org/index.php?title=Didj_and_Explorer_SDL_image&diff=23293&oldid=prevReggie: Created page with "How to install SDL_Image library A short tutorial on how to build, install and get started with the SDL_Image handling library, adding .jpg and .png support to your apps/games. ..."2010-09-16T17:04:53Z<p>Created page with "How to install SDL_Image library A short tutorial on how to build, install and get started with the SDL_Image handling library, adding .jpg and .png support to your apps/games. ..."</p>
<p><b>New page</b></p><div>How to install SDL_Image library<br />
<br />
A short tutorial on how to build, install and get started with the SDL_Image handling library, adding .jpg and .png support to your apps/games.<br />
<br />
<br />
Prerequisites<br />
<br />
A working toolchain<br />
LX Kernel sources and ThirdParty tarball unpacked to your harddrive<br />
correct environment variables set <br />
zlib (installed as part of this tutorial)<br />
libpng (installed as part of this tutorial)<br />
libjpg (installed as part of this tutorial)<br />
libSDL (should already be installed)<br />
<br />
<br />
<br />
SDL_Image requires a few libraries to be installed, namely the image formats that you want supported and any libraries they are dependent on. I have chosen libjpg as its a very popular format and libpng as we already have .png files on the Didj/LX. <br />
<br />
Luckily for us, all 3 of these libraries are provided for us, zlib and libpng are in the packages directory and libjpeg is part of the Third Party tarball.<br />
<br />
'''Installing zlib and libpng'''<br />
----<br />
first we need to install zlib, this is the same procedure used for all /package apps. go to your /packages directory, make sure your env vars are set correctly and do:<br />
<br />
./install.sh<br />
<br />
you should end up with the headers and lib files in their appropriate directories under ROOTFS_PATH/usr/include and /lib respectively.<br />
<br />
Do the same for libpng:<br />
<br />
./install.sh<br />
<br />
<br />
<br />
'''Installing libjpeg'''<br />
----<br />
<br />
go to where you unpacked the ThirdParty folder, I unpacked mine into the same folder that /scripts and /packages are in the LX kernel sources. Next go into the /libJPEG/Source folder.<br />
<br />
Now do the usual to start the installation, slightly different filename this time though:<br />
<br />
CLEAN=1 ./setup-libjpeg.sh<br />
<br />
the libJPEG lib and header files should be in ROOTFS_PATH/usr/lib and /include folders respectively.<br />
<br />
<br />
Now that we have the libs and headers installed we can go ahead and make our SDL_image library, to do this we will need a folder in PROJECT_PATH/packages and an install.sh file, so make the directory and enter it:<br />
<br />
mkdir $PROJECT_PATH/packages/SDLimage<br />
cd $PROJECT_PATH/packages/SDLimage<br />
<br />
<br />
Copy the following and paste it into a text file, save it as install.sh in your $PROJECT_PATH/packages/SDLimage folder:<br />
<br />
#!/bin/bash<br />
export CFLAGS='-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/SDL'<br />
export LD_FLAGS='-L${ROOTFS_PATH}/usr/lib'<br />
export CC=arm-linux-uclibcgnueabi-gcc<br />
export CXX=arm-linux-uclibcgnueabi-g++ <br />
if [ "$CLEAN" == "1" ]; then<br />
rm -rf ./SDL_image-1.2.10<br />
rm ./SDL_image-1.2.10.tar.gz<br />
wget http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.tar.gz<br />
tar -xf SDL_image-1.2.10.tar.gz<br />
fi<br />
cd ./SDL_image-1.2.10<br />
./configure CPPFLAGS="-I${ROOTFS_PATH}/usr/include" --prefix=$ROOTFS_PATH/usr --build=`uname -m` --host=arm-linux --enable-shared --with-sdl-prefix=${ROOTFS_PATH}/usr --libdir=${ROOTFS_PATH}/usr/lib --includedir= ${ROOTFS_PATH}/usr/include --enable-jpg<br />
make -j3<br />
make -j3 install<br />
<br />
next you just have to run the install.sh script (make sure your environment variables are set):<br />
<br />
CLEAN=1 ./install.sh<br />
<br />
this should now build and install SDL_Image to your ROOTFS_PATH/usr/lib and include folders, if you want to add other libraries, then compile and install them (use the install.sh files for libjpg and libpng for hints on what to do), then re-run the SDLimage/install.sh file again<br />
<br />
<br />
You can now build an app with SDL_image support by adding the following to your .c file:<br />
<br />
#include "SDL/SDL_image.h"<br />
<br />
and to compile an app with SDL_image support, try the following:<br />
<br />
arm-linux-uclibcgnueabi-gcc -o mysdlApp mysdlApp.c -I${ROOTFS_PATH}/usr/include -L${ROOTFS_PATH}/usr/lib -lSDL -lSDL_image -ljpeg -lpng -lz -lpthread <br />
<br />
Obviously change the arm-linux-uclibcgnueabi-gcc to your chosen cross compiler. If you added extra image formats don't forget to add a -l for each extra lib and support lib that is needed.</div>Reggie