test/testgamecontroller.c
changeset 9340 af5be9462bb4
parent 9290 fe975b2313fa
child 9607 7746ab058d12
equal deleted inserted replaced
9339:45c49e8c9416 9340:af5be9462bb4
   161     const char *name = SDL_GameControllerName(gamecontroller);
   161     const char *name = SDL_GameControllerName(gamecontroller);
   162     const char *basetitle = "Game Controller Test: ";
   162     const char *basetitle = "Game Controller Test: ";
   163     const size_t titlelen = SDL_strlen(basetitle) + SDL_strlen(name) + 1;
   163     const size_t titlelen = SDL_strlen(basetitle) + SDL_strlen(name) + 1;
   164     char *title = (char *)SDL_malloc(titlelen);
   164     char *title = (char *)SDL_malloc(titlelen);
   165     SDL_Window *window = NULL;
   165     SDL_Window *window = NULL;
       
   166 
       
   167     retval = SDL_FALSE;
       
   168     done = SDL_FALSE;
       
   169 
   166     if (title) {
   170     if (title) {
   167         SDL_snprintf(title, titlelen, "%s%s", basetitle, name);
   171         SDL_snprintf(title, titlelen, "%s%s", basetitle, name);
   168     }
   172     }
   169 
   173 
   170     /* Create a window to display controller state */
   174     /* Create a window to display controller state */
   217         loop(gamecontroller);
   221         loop(gamecontroller);
   218     }
   222     }
   219 #endif
   223 #endif
   220 
   224 
   221     SDL_DestroyRenderer(screen);
   225     SDL_DestroyRenderer(screen);
       
   226     screen = NULL;
       
   227     background = NULL;
       
   228     button = NULL;
       
   229     axis = NULL;
   222     SDL_DestroyWindow(window);
   230     SDL_DestroyWindow(window);
   223     return retval;
   231     return retval;
   224 }
   232 }
   225 
   233 
   226 int
   234 int