Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/GameLogic/Joystick')
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp9
-rw-r--r--source/gameengine/GameLogic/Joystick/SCA_Joystick.h5
2 files changed, 14 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
index 8b343be8226..b7fbe958c86 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
@@ -321,3 +321,12 @@ int SCA_Joystick::pAxisTest(int axisnum)
return 0;
#endif /* WITH_SDL */
}
+
+const char *SCA_Joystick::GetName()
+{
+#ifdef WITH_SDL
+ return SDL_JoystickName(m_joyindex);
+#else /* WITH_SDL */
+ return "";
+#endif /* WITH_SDL */
+}
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
index 912484a2fe5..dd9fbefa545 100644
--- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
+++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h
@@ -192,6 +192,11 @@ public:
* Test if the joystick is connected
*/
int Connected(void);
+
+ /**
+ * Name of the joytsick
+ */
+ const char *GetName();
};
#endif