Welcome! Log In Create A New Profile

Advanced

Questions About SDL Port

Posted by ShinNiL 
Questions About SDL Port
August 09, 2008 04:41PM
Hello everybody!

I'm trying to port some old projects made with the SDL library to Wii last days, but I got some problems. So, here go the questions:

- There's any way to use thread? When I try to do so I got a runtime error.

- I can't figure out the wiimote keys button mapping, the only that works is SDLK_ESCAPE for wiimote home button. What's the others buttons equivalents?

- Which image formats are supported by SDL_Image? BMP and JPG works fine to me, but PNG don't.

- Which sound formats are supported by SDL_Mixer? Only IT works to me. I tried MOD, OGG, MP3 and WAV without success.

If anyone could help me I'll be very grateful.
Thanks :)



Edited 1 time(s). Last edit at 08/11/2008 05:27AM by ShinNiL.
Re: Questions About SDL Port
August 09, 2008 07:42PM
The SDL-Port doesn't have threads implemented, so its not enabled.

SDL_Image supports BMP and JPG, adding png support is pretty easy just need to add a flag to makefile and recompile you need libpng and libz and there header files to use it.

SDL_mixer can support all those types just need to add flags to Makefile and recompile.

Troy(GPF)
Re: Questions About SDL Port
August 09, 2008 08:04PM
Quote
GPF
SDL_Image supports BMP and JPG, adding png support is pretty easy just need to add a flag to makefile and recompile you need libpng and libz and there header files to use it.

SDL_mixer can support all those types just need to add flags to Makefile and recompile.

Thanks GPF, I'll try to recompile SDL_image and SDL_mixer right now.

Cheers!
Re: Questions About SDL Port
August 10, 2008 09:09PM
Hello again,

I recompiled SDL_image and SDL_mixer as GPF suggested. SDL_image is working fine, but SDL_mixer give me some errors when I try to compile my project using it.

linking ... project.elf
/home/nilton/devkitpro/libogc/lib/wii/libSDL_mixer.a(dynamic_ogg.o): In function `Mix_InitOgg':
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:111: undefined reference to `ov_time_seek'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:106: undefined reference to `ov_clear'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:111: undefined reference to `ov_time_seek'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:106: undefined reference to `ov_clear'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:107: undefined reference to `ov_info'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:108: undefined reference to `ov_open_callbacks'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:107: undefined reference to `ov_info'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:108: undefined reference to `ov_open_callbacks'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:109: undefined reference to `ov_pcm_total'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:110: undefined reference to `ov_read'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:109: undefined reference to `ov_pcm_total'
/home/nilton/wiidev/SDL_mixer/src/dynamic_ogg.c:110: undefined reference to `ov_read'
collect2: ld returned 1 exit status

To compile SDL_mixer I'm setting the OGG_MUSIC flag. When I use OGG_DYNAMIC everything goes ok, but I got a error dump on Wii in the run time.

I compiled libogg, but I can't modify the makefiles of libvorbis to compile. Anybody has the libvorbis binary for ogc?

Thanks again.
Re: Questions About SDL Port
August 11, 2008 08:54PM
Haven't tried to compile libogg/libvorbis for gc/wii yet, so not sure of updates needed to Makefiles, but you do need to use the OGG_MUSIC flag, as OGG_DYNAMIC wants to use a shared runtime libogg lib, which isn't available.

Did a little code browsing to figure out the wiimote/gc pad usage in current SDL-Port, right now gc pad's are not enabled so no joystick usage will work, and the wiimote is configured as a mouse with button A and button B as left and right mouse buttons, and WPAD_BUTTON_HOME is defined as SDLK_ESCAPE, none of the other buttons are defined. Seems like when the Wiimote was added the PAD_INIT(); and PAD_ScanPads(); was removed, so maybe easy to reenable, or maybe need to add in the nunchuck joystick and buttons as well.

Would be nice to enable keyboard usage within SDL, either using one of the usbkeyboard libs or onscreen keyboard libs.

Troy(GPF)
Re: Questions About SDL Port
August 12, 2008 12:23AM
I compiled the libogg/libvorbis (finally) and linked them statically in my project. No more 'undefined reference' errors, everything goes ok building my project this time.

Now the problem is in runtime, the SDL returns me
7.11 13:57:6: Error seeking in datastream
7.11 13:57:6: Error seeking in datastream
7.11 13:57:6: OGG bitstream is not valid Vorbis stream!
when I try to open a OGG file.

Maybe my libogg/libvorbis was not correctly compiled, I'll try again...

Thanks about the Wiimote mapping advices, I'll take a look.

See ya!
Re: Questions About SDL Port
August 12, 2008 12:43PM
Hi everybody, I'm new here !

Sorry for my bad english.

I'm trying to use this great SDL but I can't compile !
I have two problems :

When I write this in my makefile :
LIBS := -lSDL -lSDL_image -lSDL_ttf -lSDL_gfx -lSDL_mixer -lfreetype -ljpeg -lpng -lz -lfat -lwiiuse -lbte -logc -lm

I have this :

E:\Programmes\devkitPro\test>make
main.c
linking ... test.elf
e:/Programmes/devkitPro/libogc/lib/wii\libSDL_image.a(IMG.o): In function `IMG_L
oad':
c:\dev\apps\devkitPro\SDL_image/src/IMG.c:64: undefined reference to `SDL_RWFrom
File'
e:/Programmes/devkitPro/libogc/lib/wii\libSDL_image.a(IMG_bmp.o): In function `L
oadBMP_RW':
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:200: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:201: undefined reference to `SDL_R
eadLE16'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:202: undefined reference to `SDL_R
eadLE16'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:203: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:206: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:219: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:220: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:221: undefined reference to `SDL_R
eadLE16'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:222: undefined reference to `SDL_R
eadLE16'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:223: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:224: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:225: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:226: undefined reference to `SDL_R
eadLE32'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:227: undefined reference to `SDL_R
eadLE32'
e:/Programmes/devkitPro/libogc/lib/wii\libSDL_image.a(IMG_bmp.o):c:\dev\apps\dev
kitPro\SDL_image/src/IMG_bmp.c:228: more undefined references to `SDL_ReadLE32'
follow
e:/Programmes/devkitPro/libogc/lib/wii\libSDL_image.a(IMG_bmp.o): In function `L
oadBMP_RW':
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:208: undefined reference to `SDL_R
eadLE16'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:209: undefined reference to `SDL_R
eadLE16'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:210: undefined reference to `SDL_R
eadLE16'
c:\dev\apps\devkitPro\SDL_image/src/IMG_bmp.c:211: undefined reference to `SDL_R
eadLE16'
collect2: ld returned 1 exit status
make[1]: *** [/e/Programmes/devkitPro/test/test.elf] Error 1
make: *** [build] Error 2


And when I write this :
LIBS	:=	-lSDL_ttf -lSDL_gfx -lSDL_mixer -lSDL_image -lfreetype -ljpeg -lpng -lz -lSDL -lfat -lwiiuse -lbte -logc -lm

Like on the wiki, I have this probleme :

E:\Programmes\devkitPro\test>make
main.c
linking ... test.elf
e:/Programmes/devkitPro/libogc/lib/wii\libSDL.a(SDL_gamecube_main.o): In functio
n `main':
c:\dev\apps\devkitPro\SDL-Port/src/main/gamecube/SDL_gamecube_main.c:59: multipl
e definition of `main'
e:/Programmes/devkitPro/libogc/lib/wii\libfreetype.a(gxvfgen.o):d:/Programming/W
iiDev/freetype-2.3.6/source/gxvalid/gxvfgen.c:444: first defined here
e:/Programmes/devkitPro/libogc/lib/wii\libfreetype.a(gxvfgen.o): In function `ma
in':
gxvfgen.c:(.text.main+0xc4): undefined reference to `ft_strncmp'
collect2: ld returned 1 exit status
make[1]: *** [/e/Programmes/devkitPro/test/test.elf] Error 1
make: *** [build] Error 2

What can I do ? Please help me.

EDIT : does somebody can send me his makefile and a simple code (main function) to intialise the SDL and choose the good video mode please ?



Edited 1 time(s). Last edit at 08/12/2008 12:45PM by Risike.
Re: Questions About SDL Port
August 12, 2008 02:27PM
Hello Risike and welcome!

The order is important in this case and you must use
LIBS	:=	-lSDL_ttf -lSDL_gfx -lSDL_mixer -lSDL_image -lfreetype -ljpeg -lpng -lz -lSDL -lfat -lwiiuse -lbte -logc -lm
like on wiki

or only
LIBS	:=	-lSDL -lfat -lwiiuse -lbte -logc -lm
if you are not using SDL_ttf, SDL_mixer, SDL_image or SDL_gfx


The problem is the libfreetype provided with the SDL-port package, I got the same error when I tried compile my project with that.

Search google for libfreetype wii, if you can't find I send you for e-mail.
Re: Questions About SDL Port
August 12, 2008 02:31PM
Thanks a lot ShinNiL !

In fact I use IMG_Load...

SO can you send me the good libfreetype for Wii by email please. I send you my email adress in private.
Re: Questions About SDL Port
August 12, 2008 02:45PM
But have you seen my problem of multiple main function ? Where does it come from ?
Re: Questions About SDL Port
August 12, 2008 03:23PM
EDIT : All is OK ! Than you very much !!!!



Edited 1 time(s). Last edit at 08/12/2008 03:47PM by Risike.
Re: Questions About SDL Port
October 24, 2008 11:05AM
I got the same error about libfreetype when I port Lbreakout to wii, I google it but can't find help,
can you help me?



Edited 1 time(s). Last edit at 10/24/2008 11:08AM by gameplayu.
Re: Questions About SDL Port
October 29, 2008 04:35PM
Try the library provided with the fceugc project: http://fceugc.googlecode.com/files/devkitPro-06102008.zip
There are a compiled version of libfreetype.
Sorry, only registered users may post in this forum.

Click here to login