I configure SDL-1.2.7 with qtopia support and also cross-compiled it using arm-cross-compiler.
I port it to arm-based mobile board. and I write a program to test the joystick on the board.
the program is as below:
SDL_Joystick *joy;
if ( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK)< 0)
printf("failed to init SDL !!\n") ;
i = SDL_JoystickEventState(SDL_ENABLE);
printf("joystickevent state : %d \n",i);
//if (SDL_NumJoysticks() > 0)
{
joy = SDL_JoystickOpen(0);
if(joy)
{
printf("Opened Joystick 0\n");
printf("Name: %s\n", SDL_JoystickName(0));
printf("Number of Axes: %d\n", SDL_JoystickNumAxes(joy));
printf("Number of Buttons: %d\n", SDL_JoystickNumButtons(joy));
printf("Number of Balls: %d\n", SDL_JoystickNumBalls(joy));
// SDL_JoystickEventState(SDL_ENABLE);
}
else
printf(“Couldn’t open Joystick 0\n”);
}
but I can’t get any joystick information event the joysticknum is zero.
what can I get the right joystick information?
thanks in advance
dragon
ps: what is “lowlevel.library” used in SDL_SYS_JoystickInit() mean ?========================================================
AOC???----2004 AOC ???http://design.163.com/aocmonitor/index.html
ps: what is “lowlevel.library” used in SDL_SYS_JoystickInit() mean ?
lowlevel.library is a library to handle AmigaOS/MorphOS digital/analog
joysticks and joypads, obviously it’s only relevant for the AmigaOS
version of SDL so it seems that the SDL_sysjoystick.c you are using in
your build is the “amiga” subfolder one and not the “dummy” one as it
should be.
Maybe there is a bug in the cross-configure script?
Do you mean that I shouldn’t use disable-video-dummy?
if I use the “dummy” one. It just return a zero_value with SDL_joysticknums set by zero. Then I can’t get real joysticknum and thus I can’t open this joystick.
In other word, if I configure SDL with enable-video-dummy. Do joystick_related functions will invoke the right functions in the right subdir ?
thanks once again!> higsn wrote:
ps: what is “lowlevel.library” used in SDL_SYS_JoystickInit() mean ?
lowlevel.library is a library to handle AmigaOS/MorphOS digital/analog
joysticks and joypads, obviously it’s only relevant for the AmigaOS
version of SDL so it seems that the SDL_sysjoystick.c you are using in
your build is the “amiga” subfolder one and not the “dummy” one as it
should be.
Maybe there is a bug in the cross-configure script?