I’am writing some terminal program of sorts. The thing is i want window to be resisizable only by Y direction. So I went ahead and did:
SDL_SetWindowMinimumSize(wnd, 100, 100);
SDL_SetWindowMaximumSize(wnd, 100, 200);
But this applies only minimum size. I can still resize window as big as i want.
But if I do this:
SDL_SetWindowMinimumSize(wnd, 100, 100);
SDL_SetWindowMaximumSize(wnd, 101, 200);
It kinda works, but looks a bit off. Is this normal behavior? Is this a known bug?
I’am using Windows and SDL 2.0.9.
Cheers
Looks like it is indeed bug for me:
SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h)
. . .
if (max_w <= window->min_w || max_h <= window->min_h) {
SDL_SetError(“SDL_SetWindowMaximumSize(): Tried to set maximum size smaller than minimum size”);
return;
}
. . .
}
There is no need in equals signs in this condition. Anyway i did some workaround based on SDL_Window definition:
SDL_SetWindowMinimumSize(wnd, 100, 100);
//SDL_SetWindowMaximumSize(wnd, 100, 200);
int hack = (int *)wnd;hack[10] = 100; // w
hack[11] = 200; // h
I know that this is very dangerous(not portable, version and compiler dependant) but I need the fix. I’am going to file this one as a bug to bugtracker.
Cheers