onepad, zeropad: init the sdl video subsystem (sdl 1.3).

cmake: allow to compile pad with sdl 1.3


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4394 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut@gmail.com 2011-03-06 14:26:17 +00:00
parent b83d1601ba
commit a61c657717
3 changed files with 18 additions and 10 deletions

View File

@ -168,8 +168,6 @@ set(PadNull TRUE)
#---------------------------------------
# requires: -SDL
#---------------------------------------
# FIXME: internal sdl does not like X11 input with dynamic feature (SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT)
if(NOT FORCE_INTERNAL_SDL)
if(SDL_FOUND)
set(onepad TRUE)
else(SDL_FOUND)
@ -177,9 +175,6 @@ else(SDL_FOUND)
message(STATUS "Skip build of onepad: miss some dependencies")
message(STATUS "${msg_dep_onepad}")
endif(SDL_FOUND)
else(NOT FORCE_INTERNAL_SDL)
message(STATUS "Skip build of onepad not compatible with internal SDL")
endif(NOT FORCE_INTERNAL_SDL)
#---------------------------------------
#---------------------------------------
@ -187,8 +182,6 @@ endif(NOT FORCE_INTERNAL_SDL)
#---------------------------------------
# requires: -SDL
#---------------------------------------
# FIXME: internal sdl does not like X11 input with dynamic feature (SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT)
if(NOT FORCE_INTERNAL_SDL)
if(SDL_FOUND)
set(zeropad TRUE)
else(SDL_FOUND)
@ -196,9 +189,6 @@ else(SDL_FOUND)
message(STATUS "Skip build of zeropad: miss some dependencies")
message(STATUS "${msg_dep_zeropad}")
endif(SDL_FOUND)
else(NOT FORCE_INTERNAL_SDL)
message(STATUS "Skip build of zeropad not compatible with internal SDL")
endif(NOT FORCE_INTERNAL_SDL)
#---------------------------------------
#---------------------------------------

View File

@ -72,7 +72,16 @@ void JoystickInfo::EnumerateJoysticks(vector<JoystickInfo*>& vjoysticks)
if (!s_bSDLInit)
{
#if SDL_VERSION_ATLEAST(1,3,0)
// SDL in 3rdparty wrap X11 call. In order to get x11 symbols loaded
// video must be loaded too.
// Example of X11 symbol are XAutoRepeatOn/XAutoRepeatOff
// Just to play it safe I separate 1.2 and 1.3 but I think it will be
// fine in 1.2 too -- greg
if (SDL_Init(SDL_INIT_JOYSTICK|SDL_INIT_VIDEO) < 0) return;
#else
if (SDL_Init(SDL_INIT_JOYSTICK) < 0) return;
#endif
SDL_JoystickEventState(SDL_QUERY);
s_bSDLInit = true;
}

View File

@ -79,7 +79,16 @@ void JoystickInfo::EnumerateJoysticks(vector<JoystickInfo*>& vjoysticks)
if (!s_bSDLInit)
{
#if SDL_VERSION_ATLEAST(1,3,0)
// SDL in 3rdparty wrap X11 call. In order to get x11 symbols loaded
// video must be loaded too.
// Example of X11 symbol are XAutoRepeatOn/XAutoRepeatOff
// Just to play it safe I separate 1.2 and 1.3 but I think it will be
// fine in 1.2 too -- greg
if (SDL_Init(SDL_INIT_JOYSTICK|SDL_INIT_VIDEO) < 0) return;
#else
if (SDL_Init(SDL_INIT_JOYSTICK) < 0) return;
#endif
SDL_JoystickEventState(SDL_QUERY);
s_bSDLInit = true;
}