src/video/SDL_video.c
changeset 6788 036f53f2f5aa
parent 6787 95a4c5a5464c
child 6876 3a4f7453da33
     1.1 --- a/src/video/SDL_video.c	Mon Dec 31 11:07:46 2012 -0800
     1.2 +++ b/src/video/SDL_video.c	Mon Dec 31 12:15:25 2012 -0800
     1.3 @@ -1641,6 +1641,45 @@
     1.4  }
     1.5  
     1.6  void
     1.7 +SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h)
     1.8 +{
     1.9 +    CHECK_WINDOW_MAGIC(window, );
    1.10 +    
    1.11 +    if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
    1.12 +        window->max_w = max_w;
    1.13 +        window->max_h = max_h;
    1.14 +        if (_this->SetWindowMaximumSize) {
    1.15 +            _this->SetWindowMaximumSize(_this, window);
    1.16 +        }
    1.17 +        /* Ensure that window is not larger than maximal size */
    1.18 +        SDL_SetWindowSize(window, SDL_min(window->w, window->max_w), SDL_min(window->h, window->max_h));
    1.19 +    }
    1.20 +}
    1.21 +
    1.22 +void
    1.23 +SDL_GetWindowMaximumSize(SDL_Window * window, int *max_w, int *max_h)
    1.24 +{
    1.25 +    int dummy;
    1.26 +    
    1.27 +    if (!max_w) {
    1.28 +        max_w = &dummy;
    1.29 +    }
    1.30 +    if (!max_h) {
    1.31 +        max_h = &dummy;
    1.32 +    }
    1.33 +    
    1.34 +    *max_w = 0;
    1.35 +    *max_h = 0;
    1.36 +    
    1.37 +    CHECK_WINDOW_MAGIC(window, );
    1.38 +    
    1.39 +    if (_this && window && window->magic == &_this->window_magic) {
    1.40 +        *max_w = window->max_w;
    1.41 +        *max_h = window->max_h;
    1.42 +    }
    1.43 +}
    1.44 +
    1.45 +void
    1.46  SDL_ShowWindow(SDL_Window * window)
    1.47  {
    1.48      CHECK_WINDOW_MAGIC(window, );