Resize SDL2 window?

TakingItCasual picture TakingItCasual · Dec 23, 2013 · Viewed 20.7k times · Source

Just made the jump from SDL1.2 to SDL2, been converting my code but couldn't figure out how to resize the window. Here's the code I have now:

SDL_DestroyWindow(Window);
Window = SDL_CreateWindow("Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, ScreenSizeX, ScreenSizeY, SDL_WINDOW_SHOWN);
screen = SDL_GetWindowSurface(Window);

Which as you can see just destroys the window and creates a new one. Sloppy but it works. What I want is to just resize the window, is it possible?

Answer

novice picture novice · Nov 28, 2014

I believe that that you could use the SDL_WINDOW_RESIZABLE flag in SDL_CreateWindow to make the window resizable.