Render issues after SDL_SetWindowSize

Hello, I decided to port my software from SDL 1.2 to SDL2.
With SDL1.2, to resize the screen, I had to free the screen surface and the background then recreate them.
With SDL2, I use SDL_SetWindowSize but I experiment a writes issue after that. When I call SDL_CreateTextureFromSurface after a resize, it return NULL and the error is “INVALIDCALL”. If I destroy the render variable then recreate it after the resize, then it works. The problem is that SDL_CreatRender is quite long to execute (0,5 sec on gdb) so I can’t use it after EACH resize. Is there any way to patch the render to work with the new screen size? I imported sdl_sysrender.h so the structure is defined. If not, is recreate the render really the only way?

I work on Windows 7 x64 with the SDL2 version who was on libsdl.org last saturday (6713).

I think I found out a ‘patch’. In fact, if you initialize the window with the SDL_WINDOW_OPENGL flag:

  • you don’t have a window that appear before disappear then appear again at launch
  • the issue I had also go away

I’m updating wiki samples