SDL Questions. Please help!
I''m wondering how to play audio in SDL and how to use Gamepads? Could anyone explain and/or provide an example?
Joysticks:
if want to know more, go to the sdl website in the section Doc Project
Matt
[edited by - lemurion on October 11, 2003 3:08:27 PM]
SDL_Joystick *InitJoy(){ int nb_joy; SDL_Joystick *joy; nb_joy = SDL_NumJoysticks(); // return the number of joysticks available if(nb_joy > 0) joy = SDL_JoystickOpen(0); // open first joystick if(!joy) { printf("Error: unable to open joystick"); return NULL } SDL_JoystickEventState(SDL_ENABLE); // enable joystick to send events return joy;}
if want to know more, go to the sdl website in the section Doc Project
Matt
[edited by - lemurion on October 11, 2003 3:08:27 PM]
I Don''t know about gamepads but I suggest using SDL_mixer for sound in SDL apps. It handles all the mixing so you don;t have to.
http://jcatki.no-ip.org/SDL_mixer/SDL_mixer.html
http://jcatki.no-ip.org/SDL_mixer/SDL_mixer.html
http://www.libsdl.org
Should have enough information for what you''re looking for.
~~~ Signature: ~~
"Satan sent me to destroy the video game industry." - Trigger(my alter ego)
"God is a game designer too and his game, ''Life'' " - Me
"Squirrles make me horny." - Sean Randy Rowlen Uranus
Should have enough information for what you''re looking for.
~~~ Signature: ~~
"Satan sent me to destroy the video game industry." - Trigger(my alter ego)
"God is a game designer too and his game, ''Life'' " - Me
"Squirrles make me horny." - Sean Randy Rowlen Uranus
I''ve looked at the sdl site but their "help" is too complex for me.. I don''t get it.
Could someone post an example? Oh and about gamepads, thanx lemurion that''s great! But what about actually detecting if someone is pressing a button on the gamepad? How do I do that?
Could someone post an example? Oh and about gamepads, thanx lemurion that''s great! But what about actually detecting if someone is pressing a button on the gamepad? How do I do that?
And what about gamepads that support rumble and force feedback? How would you get the gamepad to shake using SDL?
--{You fight like a dairy farmer!}
--{You fight like a dairy farmer!}
As mentioned in the documentation, force feedback is not yet supporte. Perhaps it will be in SDL 2.0 . The docs also have many code snippets that help you understand the API.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement