diff --git a/sdl2/pdcscrn.c b/sdl2/pdcscrn.c index 79355f34..a89f143c 100644 --- a/sdl2/pdcscrn.c +++ b/sdl2/pdcscrn.c @@ -296,24 +296,30 @@ int PDC_scr_open(int argc, char **argv) int PDC_resize_screen(int nlines, int ncols) { +#if SDL_VERSION_ATLEAST(2, 0, 5) SDL_Rect max; int top, left, bottom, right; +#endif if (!pdc_own_window) return ERR; +#if SDL_VERSION_ATLEAST(2, 0, 5) SDL_GetDisplayUsableBounds(0, &max); SDL_GetWindowBordersSize(pdc_window, &top, &left, &bottom, &right); max.h -= top + bottom; max.w -= left + right; +#endif if (nlines && ncols) { +#if SDL_VERSION_ATLEAST(2, 0, 5) while (nlines * pdc_fheight > max.h) nlines--; - pdc_sheight = nlines * pdc_fheight; while (ncols * pdc_fwidth > max.w) ncols--; +#endif + pdc_sheight = nlines * pdc_fheight; pdc_swidth = ncols * pdc_fwidth; }