X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=SDL_GameControllerMapping.html;h=10c4ffa91a1bf5fe49499c57061a19169c17d32d;hb=c386bad9ff26b6b26641a1288d8853e6525d893d;hp=d1610bd1e2bf3fb34124109f8257fc229278bf2c;hpb=4cbede1609515b52db5428da8ea9a100f85b7643;p=sdl2referencejp%2Fsdl2referencejp.git diff --git a/SDL_GameControllerMapping.html b/SDL_GameControllerMapping.html index d1610bd..10c4ffa 100644 --- a/SDL_GameControllerMapping.html +++ b/SDL_GameControllerMapping.html @@ -21,8 +21,47 @@
+
+
+
+#include "SDL.h"
+
+/* ... */
+
+SDL_GameController *ctrl;
+int i;
+
+SDL_Init(SDL_INIT_GAMECONTROLLER);
+
+for (i = 0; i < SDL_NumJoysticks(); ++i) {
+ if (SDL_IsGameController(i)) {
+ char *mapping;
+ SDL_Log("\'%d\'ÔÍWCXeBbNÝ·ÌRg[, ¼ÌÍ\'%s\'", i, SDL_GameControllerNameForIndex(i));
+ ctrl = SDL_GameControllerOpen(i);
+ mapping = SDL_GameControllerMapping(ctrl);
+ SDL_Log("Rg[ %i Í \"%s\" É}bsO³ê½", i, mapping);
+ SDL_free(mapping);
+ } else {
+ SDL_Log("\'%d\'ÔÍWCXeBbNÆñÝ·ÌRg[", i);
+ }
+}
+
+
+߳꽶ñÍSDL_Free()Åðú·éKvª é. +
++}bsOÌÚ×ÍSDL_GameControllerAddMapping()Ìy[WÉ é. +
++SDL 2.0.0È~ +