test/testgesture.c
changeset 7900 cc2289c332eb
parent 7678 286c42d7c5ed
child 8149 681eb46b8ac4
equal deleted inserted replaced
7899:e94abe9c40ca 7900:cc2289c332eb
   203 int main(int argc, char* argv[])
   203 int main(int argc, char* argv[])
   204 {
   204 {
   205   SDL_Surface *screen;
   205   SDL_Surface *screen;
   206   SDL_Event event;
   206   SDL_Event event;
   207   SDL_bool quitting = SDL_FALSE;
   207   SDL_bool quitting = SDL_FALSE;
   208   SDL_RWops *src;
   208   SDL_RWops *stream;
   209 
   209 
   210   /* Enable standard application logging */
   210   /* Enable standard application logging */
   211   SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
   211   SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
   212 
   212 
   213   /* gesture variables */
   213   /* gesture variables */
   239           {
   239           {
   240           case SDLK_SPACE:
   240           case SDLK_SPACE:
   241         SDL_RecordGesture(-1);
   241         SDL_RecordGesture(-1);
   242         break;
   242         break;
   243           case SDLK_s:
   243           case SDLK_s:
   244         src = SDL_RWFromFile("gestureSave","w");
   244         stream = SDL_RWFromFile("gestureSave", "w");
   245         SDL_Log("Wrote %i templates",SDL_SaveAllDollarTemplates(src));
   245         SDL_Log("Wrote %i templates", SDL_SaveAllDollarTemplates(stream));
   246         SDL_RWclose(src);
   246         SDL_RWclose(stream);
   247         break;
   247         break;
   248           case SDLK_l:
   248           case SDLK_l:
   249         src = SDL_RWFromFile("gestureSave","r");
   249         stream = SDL_RWFromFile("gestureSave", "r");
   250         SDL_Log("Loaded: %i",SDL_LoadDollarTemplates(-1,src));
   250         SDL_Log("Loaded: %i", SDL_LoadDollarTemplates(-1, stream));
   251         SDL_RWclose(src);
   251         SDL_RWclose(stream);
   252         break;
   252         break;
   253           case SDLK_ESCAPE:
   253           case SDLK_ESCAPE:
   254         quitting = SDL_TRUE;
   254         quitting = SDL_TRUE;
   255         break;
   255         break;
   256         }
   256         }