Talk:SDL Wii/tutorial

From WiiBrew
< Talk:SDL Wii
Jump to navigation Jump to search

Wiimote buttons

What's the best way to use the Wiimote with WPAD_ScanPads or with Wiimote SDL joystick mapping? Because in your tutorial you are using WPAD's functions. Thanks, Crayon 16:21, 26 May 2009 (UTC)

Well, I don't know. Never tried it with SDL joystick mapping and I dont know how I can use it. If somebody can explain how to use joystick mapping I may add it in my tutorials. GabberNL 18:09, 26 May 2009 (UTC)
Thanks, it could be great to include it in your tutorials if you find out how to use SDL joystick mapping. -Crayon 19:15, 26 May 2009 (UTC)
If you want a joystick example, you can check the UAE Wii menu code here (until line 718). The SDL page describes the button mappings. It only shows the DPAD and buttons, but the rest is available in the man-pages. --SimonKagstrom 13:04, 27 May 2009 (UTC)
Thanks, I'll check that later -Crayon 17:46, 27 May 2009 (UTC)

GabberNL, I tried to use WPAD_ButtonsDown in my SDL game but only WPAD_ButtonsHeld seems to work (like in your tutorial). Do I need to do something special to make WPAD_ButtonsDown work? -Crayon 17:46, 27 May 2009 (UTC)

Well, does it compile? Because when I try it, it does compile so I think it will also work on the Wii (haven't tested it). Have you declared down the right way? like:
u32 down = WPAD_ButtonsDown(0);

GabberNL 18:25, 27 May 2009 (UTC)

That's exactly what I've tried, it's working in my non SDL game Wii-Tac-Toe. Every thing is compiling correctly, it's just not working with my SDL program! -Crayon 21:26, 27 May 2009 (UTC)
So it compiles with no problems. Thats good. What happens on the Wii? Does it give a code dump? Maybe you could paste here the source code so I can look into it. That would be much easier. GabberNL 11:06, 28 May 2009 (UTC)
When pressing a button on the Wiimote nothing happen, so no code dump. When I change WPAD_ButtonsHeld to WPAD_ButtonsDown in my code it stops working, so my code is should be fine. I'm going to try with simpler code, just in case it's something elsewhere in the code that as an effect on the Wiimote. -Crayon 12:54, 28 May 2009 (UTC)

Cannot compile the template

I copied the template and all the sdl includes with the libs and dependencies into the libogc folder. I tried to compile it using programmers notepad.

This is the output:

> "make" 
template.c

linking ... SDL_template.elf

c:/devkitPro/libogc/lib/wii\libSDL.a(SDL_wii_main.o): In function `main':

C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/main/wii/SDL_wii_main.c:68: undefined reference to `MOUSE_Init'

C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/main/wii/SDL_wii_main.c:69: undefined reference to `KEYBOARD_Init'

c:/devkitPro/libogc/lib/wii\libSDL.a(SDL_wiievents.o): In function `PumpEvents':

C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/video/wii/SDL_wiievents.c:64: undefined reference to `KEYBOARD_GetEvent'

C:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/video/wii/SDL_wiievents.c:65: undefined reference to `MOUSE_GetEvent'

collect2: ld returned 1 exit status

make[1]: *** [/c/devkitPro/examples/wii/SDL_template/SDL_template.elf] Error 1

"make": *** [build] Error 2

> Process Exit Code: 2

> Time Taken: 00:02
I think this is because the most recent build needs to be used with the svn version of libogc. If you don't want to update libogc, download an older version of SDL, like this one: http://sdl-wii.googlecode.com/files/SDL%20Wii%2004-23-2009.zip -Crayon 18:31, 1 June 2009 (UTC)
Thanks Crayon, it worked. I made about 4 or 5 games on SDL for the pc last year. I think I'll port them to the wii now. --Sal3000 18:56, 1 June 2009 (UTC)
How do I update to the latest svn version of libogc? Can anyone confirm that this will work? Thanks. Charlatan 22:04, 17 June 2009 (UTC)