From Laurens Voerman, "The current version will not compile with SDL version 2, error

OpenSceneGraph\src\osgPlugins\sdl\JoystickDevice.cpp(42): error C2664: 'const char *SDL_JoystickName(SDL_Joystick *)' : cannot convert argument 1 from 'int' to 'SDL_Joystick *'
due to changes in the SDL api.

Tested with Visual Studio Express 2013; SDL 2.0.1"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14776 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-03-11 17:36:45 +00:00
parent 75b9cd3627
commit 11f5039695

View File

@ -39,7 +39,11 @@ JoystickDevice::JoystickDevice()
std::cout<<"number of joysticks "<<numJoysticks<<std::endl;
for(int i=0; i<numJoysticks; ++i)
{
std::cout<<"Joystick name '"<<SDL_JoystickName(i)<<"'"<<std::endl;
#if SDL_VERSION_ATLEAST(2, 0, 0)
std::cout << "Joystick name '" << SDL_JoystickNameForIndex(i) << "'" << std::endl;
#else
std::cout << "Joystick name '" << SDL_JoystickName(i) << "'" << std::endl;
#endif
}
}