GP2X_Coder
Member
Can anyone else confirm this with the officail sdk for the gp2x.
It works perfect in windows but on the Gp2x it only release the first joystick PEP Joy.
Can anyone test this out if you have BOB or Cradle?
I can open all of the usb controllers that are attached and get them all to work fine but when I go to close them it will only release the first joystick and that is the Gp2x's joystick its called PEP Joy and then crashes on the rest of them. Anybody have any Idea's ? I first check with SDL_JoystickOpened( ) and it shows that the joysticks are open but when I call SDL_JoystickClose() for each of them it will only release the first one none of the USB ones and then crashes??
Thanks for any help?
Here is a test I made real fast if you want to compile it and it will work on windows but crash on the gp2x
CODE
#include "SDL/SDL.h"
#include <unistd.h>
int TotalJoyFound = 0;
SDL_Joystick **JoyStick;
char *ExeDir = NULL;
int main( int argc, char* args[] )
{
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
// Get the total number of joysticks attached to the device
TotalJoyFound = SDL_NumJoysticks();
// If we found any joysticks for this test
if( TotalJoyFound )
{
// Create the joysticks
JoyStick = new SDL_Joystick*[ TotalJoyFound ];
// Now lets open all of the joysticks found
for( int a = 0; a < TotalJoyFound; a++ )
{
JoyStick[ a ] = SDL_JoystickOpen( a );
// If the joysticks are opened close them
if( SDL_JoystickOpened( a ) )
SDL_JoystickClose( JoyStick[ a ] );
}
// Delete the joysticks
if( JoyStick )
delete [] JoyStick;
}
//Quit SDL
SDL_Quit();
#ifdef GP2X
// Finished with program now return to the main
chdir( "/usr/gp2x" );
execl( "/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL );
#endif
return 0;
}
It works perfect in windows but on the Gp2x it only release the first joystick PEP Joy.
Can anyone test this out if you have BOB or Cradle?
I can open all of the usb controllers that are attached and get them all to work fine but when I go to close them it will only release the first joystick and that is the Gp2x's joystick its called PEP Joy and then crashes on the rest of them. Anybody have any Idea's ? I first check with SDL_JoystickOpened( ) and it shows that the joysticks are open but when I call SDL_JoystickClose() for each of them it will only release the first one none of the USB ones and then crashes??
Thanks for any help?
Here is a test I made real fast if you want to compile it and it will work on windows but crash on the gp2x
CODE
#include "SDL/SDL.h"
#include <unistd.h>
int TotalJoyFound = 0;
SDL_Joystick **JoyStick;
char *ExeDir = NULL;
int main( int argc, char* args[] )
{
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
// Get the total number of joysticks attached to the device
TotalJoyFound = SDL_NumJoysticks();
// If we found any joysticks for this test
if( TotalJoyFound )
{
// Create the joysticks
JoyStick = new SDL_Joystick*[ TotalJoyFound ];
// Now lets open all of the joysticks found
for( int a = 0; a < TotalJoyFound; a++ )
{
JoyStick[ a ] = SDL_JoystickOpen( a );
// If the joysticks are opened close them
if( SDL_JoystickOpened( a ) )
SDL_JoystickClose( JoyStick[ a ] );
}
// Delete the joysticks
if( JoyStick )
delete [] JoyStick;
}
//Quit SDL
SDL_Quit();
#ifdef GP2X
// Finished with program now return to the main
chdir( "/usr/gp2x" );
execl( "/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL );
#endif
return 0;
}