forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

sdl joystick

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Sun Aug 24, 2008 4:57 am    Post subject: sdl joystick Reply with quote

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
View user's profile Send private message
a_noob



Joined: 17 Sep 2006
Posts: 97
Location: _start: jr 0xDEADBEEF

PostPosted: Sun Aug 24, 2008 8:33 am    Post subject: Reply with quote

look in pspctrl.h

or samples/controller/basic for an example of how to use
_________________
Code:
.øOº'ºOø.
'ºOo.oOº'
Back to top
View user's profile Send private message AIM Address MSN Messenger
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Sun Aug 24, 2008 3:53 pm    Post subject: Reply with quote

i know that.

i want to know how to do it with sdl functions
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Aug 24, 2008 4:16 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
hardrive



Joined: 17 Mar 2006
Posts: 11

PostPosted: Tue Aug 26, 2008 3:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group