SDL Library question

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

Moderators: cheriff, TyRaNiD

Post Reply
AllSystemGo
Posts: 26
Joined: Sat Jun 02, 2007 1:15 am

SDL Library question

Post by AllSystemGo »

Can anyone tell me if there is some SDL event that we can trap. I'll explain what I would like to do exactly.

In my main loop I would like to be able to trap the events like when the joystick is moving so this way I would only paint the "mouse" pointer when they actually move the mouse.

I hope you guys understand.

BTW: I do know there is a SDL_Event but I think it's mainly used for computer programming I think.

BTW 2: I do have alot of problem with the darn SDL Library can anyone direct me toward maybe another library that I could use to show Icons, Text and be able to change to another ttf font.

Cheers
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

http://svn.ps2dev.org/filedetails.php?r ... rev=0&sc=0

And the important bit:

Code: Select all

                while ( SDL_PollEvent(&event) ) {
                        switch (event.type) {
                            case SDL_JOYAXISMOTION:
                                printf("Joystick %d axis %d value: %d\n",
                                       event.jaxis.which,
                                       event.jaxis.axis,
                                       event.jaxis.value);
                                break;
You have to open the joystick first, read through the file I linked and you should pick it up.
Post Reply