What are the controls in SDL?
For exmaple what is pad.Buttons&PSP_CTRL_CROSS in SDL? I know its sumtin todo with joystick....
SDL Controls?
-
- Posts: 36
- Joined: Fri Jul 21, 2006 11:00 am
The PSP buttons show up as joystick buttons. For SDL documentation on joysticks, see http://psp.jim.sh/sdl-doc/guideinput.html
My port of LPairs uses the D pad and buttons in SDL. If you want to check out the source, it's included with the release here.
Specifically, in pairs.c, in run_game, you'll see an example of using buttons to simulate a mouse click at a specific location. You could use it to do pretty much anything else, too.
The definitions for the keys I use (X_CROSS, X_SELECT, etc.) are in psp.h.
Porting an SDL game is an excellent way to familiarize yourself with the API. I knew nothing of SDL before I did LPairs, and I still managed to do rather well.
Specifically, in pairs.c, in run_game, you'll see an example of using buttons to simulate a mouse click at a specific location. You could use it to do pretty much anything else, too.
The definitions for the keys I use (X_CROSS, X_SELECT, etc.) are in psp.h.
Porting an SDL game is an excellent way to familiarize yourself with the API. I knew nothing of SDL before I did LPairs, and I still managed to do rather well.
-
- Posts: 36
- Joined: Fri Jul 21, 2006 11:00 am
There shouldn't be. I don't put passwords on my release files. In case you can't get to it:
pairs.h
pairs.c
psp.h
psp.c
Also, I've got this for my init_sdl call:
pairs.h
pairs.c
psp.h
psp.c
Also, I've got this for my init_sdl call:
Code: Select all
init_sdl( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK);