mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-23 23:35:20 +00:00
Allow building SDL2 with versions before 2.0.5.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user