src/video/SDL_video.c
changeset 12143 673ec0369266
parent 12070 1d65571b57dd
child 12151 5b9895d82ebe
equal deleted inserted replaced
12142:b2123abf97e0 12143:673ec0369266
   639         return 0;
   639         return 0;
   640     }
   640     }
   641     return _this->num_displays;
   641     return _this->num_displays;
   642 }
   642 }
   643 
   643 
   644 static int
   644 int
   645 SDL_GetIndexOfDisplay(SDL_VideoDisplay *display)
   645 SDL_GetIndexOfDisplay(SDL_VideoDisplay *display)
   646 {
   646 {
   647     int displayIndex;
   647     int displayIndex;
   648 
   648 
   649     for (displayIndex = 0; displayIndex < _this->num_displays; ++displayIndex) {
   649     for (displayIndex = 0; displayIndex < _this->num_displays; ++displayIndex) {
   735     } else {
   735     } else {
   736         return SDL_Unsupported();
   736         return SDL_Unsupported();
   737     }
   737     }
   738 
   738 
   739     return -1;
   739     return -1;
       
   740 }
       
   741 
       
   742 SDL_DisplayOrientation
       
   743 SDL_GetDisplayOrientation(int displayIndex)
       
   744 {
       
   745     SDL_VideoDisplay *display;
       
   746 
       
   747     CHECK_DISPLAY_INDEX(displayIndex, SDL_ORIENTATION_UNKNOWN);
       
   748 
       
   749     display = &_this->displays[displayIndex];
       
   750     return display->orientation;
   740 }
   751 }
   741 
   752 
   742 SDL_bool
   753 SDL_bool
   743 SDL_AddDisplayMode(SDL_VideoDisplay * display,  const SDL_DisplayMode * mode)
   754 SDL_AddDisplayMode(SDL_VideoDisplay * display,  const SDL_DisplayMode * mode)
   744 {
   755 {
  1005     if (_this->SetDisplayMode(_this, display, &display_mode) < 0) {
  1016     if (_this->SetDisplayMode(_this, display, &display_mode) < 0) {
  1006         return -1;
  1017         return -1;
  1007     }
  1018     }
  1008     display->current_mode = display_mode;
  1019     display->current_mode = display_mode;
  1009     return 0;
  1020     return 0;
       
  1021 }
       
  1022 
       
  1023 SDL_VideoDisplay *
       
  1024 SDL_GetDisplay(int displayIndex)
       
  1025 {
       
  1026     CHECK_DISPLAY_INDEX(displayIndex, NULL);
       
  1027 
       
  1028     return &_this->displays[displayIndex];
  1010 }
  1029 }
  1011 
  1030 
  1012 int
  1031 int
  1013 SDL_GetWindowDisplayIndex(SDL_Window * window)
  1032 SDL_GetWindowDisplayIndex(SDL_Window * window)
  1014 {
  1033 {