src/video/x11/SDL_x11modes.c
branchSDL-1.2
changeset 4254 8afecb86be35
parent 4223 63fd67e17705
child 4274 915406c331dc
equal deleted inserted replaced
4253:b0c979816d67 4254:8afecb86be35
   336 static void move_cursor_to(_THIS, int x, int y)
   336 static void move_cursor_to(_THIS, int x, int y)
   337 {
   337 {
   338     XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y);
   338     XWarpPointer(SDL_Display, None, SDL_Root, 0, 0, 0, 0, x, y);
   339 }
   339 }
   340 
   340 
       
   341 static int add_default_visual(_THIS)
       
   342 {
       
   343     int i;
       
   344     int n = this->hidden->nvisuals;
       
   345     for (i=0; i<n; i++) {
       
   346         if (this->hidden->visuals[i].visual == DefaultVisual(SDL_Display, SDL_Screen)) return n;
       
   347     }
       
   348     this->hidden->visuals[n].depth = DefaultDepth(SDL_Display, SDL_Screen);;
       
   349     this->hidden->visuals[n].visual = DefaultVisual(SDL_Display, SDL_Screen);;
       
   350     this->hidden->nvisuals++;
       
   351     return(this->hidden->nvisuals);
       
   352 }
   341 static int add_visual(_THIS, int depth, int class)
   353 static int add_visual(_THIS, int depth, int class)
   342 {
   354 {
   343     XVisualInfo vi;
   355     XVisualInfo vi;
   344     if(XMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) {
   356     if(XMatchVisualInfo(SDL_Display, SDL_Screen, depth, class, &vi)) {
   345         int n = this->hidden->nvisuals;
   357         int n = this->hidden->nvisuals;
   799                         } else {
   811                         } else {
   800                                 add_visual(this, depth_list[i], PseudoColor);
   812                                 add_visual(this, depth_list[i], PseudoColor);
   801                                 add_visual(this, depth_list[i], StaticColor);
   813                                 add_visual(this, depth_list[i], StaticColor);
   802                         }
   814                         }
   803                 }
   815                 }
       
   816                 add_default_visual(this);
   804         }
   817         }
   805         if ( this->hidden->nvisuals == 0 ) {
   818         if ( this->hidden->nvisuals == 0 ) {
   806             SDL_SetError("Found no sufficiently capable X11 visuals");
   819             SDL_SetError("Found no sufficiently capable X11 visuals");
   807             return -1;
   820             return -1;
   808         }
   821         }