| View previous topic :: View next topic |
| Author |
Message |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Sun Aug 24, 2008 4:57 am Post subject: sdl joystick |
|
|
I'm trying to understand the SDL engine.
I followed this tutorial:
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut1
My problem is...
I can't find a way to get this part working with the psp buttons
| Code: | SDL_Event event;
while ( SDL_PollEvent(&event) )
{
if ( event.type == SDL_QUIT ) { done = 1; }
if ( event.type == SDL_KEYDOWN )
{
if ( event.key.keysym.sym == SDLK_ESCAPE ) { done = 1; }
}
} |
I know that i can use the home button to shut down the program. but it's about understanding how to check pressed buttons. |
|
| Back to top |
|
 |
a_noob
Joined: 17 Sep 2006 Posts: 97 Location: _start: jr 0xDEADBEEF
|
Posted: Sun Aug 24, 2008 8:33 am Post subject: |
|
|
look in pspctrl.h
or samples/controller/basic for an example of how to use _________________
| Code: | .øOº'ºOø.
'ºOo.oOº' |
|
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Sun Aug 24, 2008 3:53 pm Post subject: |
|
|
i know that.
i want to know how to do it with sdl functions |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Aug 24, 2008 4:16 pm Post subject: |
|
|
| Then read the SDL docs from the SDL site on the SDL joystick functions. We aren't here to teach SDL. There are plenty of examples all over the web to do that. |
|
| Back to top |
|
 |
hardrive
Joined: 17 Mar 2006 Posts: 11
|
Posted: Tue Aug 26, 2008 3:47 am Post subject: |
|
|
Several months ago, I worked on a small project where I made a VERY simple pong clone. I did it in SDL, and it compiles for Linux, Windows, and PSP. It has working Makefiles and everything, and it might be enough to get you started.
I'm not saying that it is coded well or anything (I never free my font surfaces), but it compiles and works as intended.
http://hardrive4u.googlepages.com/pong.zip |
|
| Back to top |
|
 |
|