sdl joystick

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

sdl joystick

Post by jojojoris »

I'm trying to understand the SDL engine.

I followed this tutorial:
http://cone3d.gamedev.net/cgi-bin/index ... fxsdl/tut1

My problem is...
I can't find a way to get this part working with the psp buttons

Code: Select all

    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.
a_noob
Posts: 97
Joined: Sun Sep 17, 2006 8:33 am
Location: _start: jr 0xDEADBEEF

Post by a_noob »

look in pspctrl.h

or samples/controller/basic for an example of how to use

Code: Select all

.øOº'ºOø.
'ºOo.oOº'
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

i know that.

i want to know how to do it with sdl functions
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
hardrive
Posts: 11
Joined: Fri Mar 17, 2006 11:13 am

Post by hardrive »

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
Post Reply