| View previous topic :: View next topic |
| Author |
Message |
bronxbomber92
Joined: 21 Jul 2006 Posts: 36
|
Posted: Sat Sep 23, 2006 9:25 am Post subject: SDL Controls? |
|
|
What are the controls in SDL?
For exmaple what is pad.Buttons&PSP_CTRL_CROSS in SDL? I know its sumtin todo with joystick.... |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Sat Sep 23, 2006 4:02 pm Post subject: |
|
|
| README.PSP |
|
| Back to top |
|
 |
bronxbomber92
Joined: 21 Jul 2006 Posts: 36
|
Posted: Sun Sep 24, 2006 3:20 am Post subject: |
|
|
| I saw that but I'm still confused. Can anyone provide an example? |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
|
| Back to top |
|
 |
FreePlay
Joined: 04 Jan 2006 Posts: 71 Location: Schenectady, New York, USA
|
Posted: Mon Sep 25, 2006 7:14 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
bronxbomber92
Joined: 21 Jul 2006 Posts: 36
|
Posted: Mon Sep 25, 2006 7:48 am Post subject: |
|
|
| Thanks, but I think there's a password on the zip? |
|
| Back to top |
|
 |
FreePlay
Joined: 04 Jan 2006 Posts: 71 Location: Schenectady, New York, USA
|
Posted: Mon Sep 25, 2006 8:11 am Post subject: |
|
|
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: | Code: | | init_sdl( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK); |
|
|
| Back to top |
|
 |
bronxbomber92
Joined: 21 Jul 2006 Posts: 36
|
Posted: Mon Sep 25, 2006 9:05 am Post subject: |
|
|
| :) Thanks, I'll take a look at these |
|
| Back to top |
|
 |
|