I ported some applications from SDL 1.2.15 to 2.0.1. They are Windows 32bits applications, compiled with Intel C/C++ (composer XE 2013). Using C, not C++.
I found one problem:
Condition : the applications was minimized and the system enters the screen-saver mode.
Result : when the system exits the screen saver and I click to restore the SDL app, the window returns in black. To refresh the window to the proper state I need to create an event (click, resize, move, etc).
I am assuming that some events were ignored in my code, but I do not find any other message to trigger the re-paint { SDL_UpdateTexture(…); SDL_SetRenderDrawColor(…);
SDL_RenderClear(…); SDL_RenderCopy(…); SDL_RenderPresent(); }
The messages used so far to trigger windows re-paint are :
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_RESIZED:
case SDL_WINDOWEVENT_RESTORED:
case SDL_WINDOWEVENT_MAXIMIZED:
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_SIZE_CHANGED:
case SDL_WINDOWEVENT_MOVED:
mevis_sdl_RefreshWindow();
break;
All other re-paint conditions are working fine. The problem is only evident after minimization followed by screen saver.
Any advice ?
Thanks.
Armando AB------------------------
Armando Alaminos Bouza
I got an alternative solution, but it is not an elegant one. Creating a timer and pushing a SDL_USEREVENT the application is forced to re-paint for all the process life.
It is not an energy efficient way…
Any way, I think that there is a better solution.
I will be glad receiving other suggestions.
Thanks------------------------
Armando Alaminos Bouza
Thanks!On Thu, Nov 7, 2013 at 10:35 AM, alabouza wrote:
I ported some applications from SDL 1.2.15 to 2.0.1. They are Windows
32bits applications, compiled with Intel C/C++ (composer XE 2013). Using C,
not C++.
I found one problem:
Condition : the applications was minimized and the system enters the
screen-saver mode.
Result : when the system exits the screen saver and I click to restore the
SDL app, the window returns in black. To refresh the window to the proper
state I need to create an event (click, resize, move, etc).
I am assuming that some events were ignored in my code, but I do not find
any other message to trigger the re-paint { SDL_UpdateTexture(…);
SDL_SetRenderDrawColor(…);
SDL_RenderClear(…); SDL_RenderCopy(…); SDL_RenderPresent(); }
The messages used so far to trigger windows re-paint are :
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_RESIZED:
case SDL_WINDOWEVENT_RESTORED:
case SDL_WINDOWEVENT_MAXIMIZED:
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_SIZE_CHANGED:
case SDL_WINDOWEVENT_MOVED:
mevis_sdl_RefreshWindow();
break;
All other re-paint conditions are working fine. The problem is only
evident after minimization followed by screen saver.
On Thu, Nov 7, 2013 at 10:35 AM, alabouza <@Armando_Alaminos_Bou (@Armando_Alaminos_Bou)> wrote:
I ported some applications from SDL 1.2.15 to 2.0.1. They are Windows 32bits applications, compiled with Intel C/C++ (composer XE 2013). Using C, not C++.
I found one problem:
Condition : the applications was minimized and the system enters the screen-saver mode.
Result : when the system exits the screen saver and I click to restore the SDL app, the window returns in black. To refresh the window to the proper state I need to create an event (click, resize, move, etc).
I am assuming that some events were ignored in my code, but I do not find any other message to trigger the re-paint { SDL_UpdateTexture(…); SDL_SetRenderDrawColor(…);
SDL_RenderClear(…); SDL_RenderCopy(…); SDL_RenderPresent(); }
The messages used so far to trigger windows re-paint are :
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_RESIZED:
case SDL_WINDOWEVENT_RESTORED:
case SDL_WINDOWEVENT_MAXIMIZED:
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_SIZE_CHANGED:
case SDL_WINDOWEVENT_MOVED:
mevis_sdl_RefreshWindow();
break;
All other re-paint conditions are working fine. The problem is only evident after minimization followed by screen saver.
I re-compiled the SDL 2 snapshot with Intel C++ Compiler XE 13.1.3.198. I am testing with three applications ported from SDL 1.2.15 and the previous problem is gone, as far as I can detect.
Thanks.
Sam Lantinga wrote:> There was a bug with SDL detecting minimize state.
On Thu, Nov 7, 2013 at 10:35 AM, alabouza <@Armando_Alaminos_Bou (@Armando_Alaminos_Bou)> wrote:
I ported some applications from SDL 1.2.15 to 2.0.1. They are Windows 32bits applications, compiled with Intel C/C++ (composer XE 2013). Using C, not C++.
I found one problem:
Condition : the applications was minimized and the system enters the screen-saver mode.
Result : when the system exits the screen saver and I click to restore the SDL app, the window returns in black. To refresh the window to the proper state I need to create an event (click, resize, move, etc).
I am assuming that some events were ignored in my code, but I do not find any other message to trigger the re-paint { SDL_UpdateTexture(…); SDL_SetRenderDrawColor(…);
SDL_RenderClear(…); SDL_RenderCopy(…); SDL_RenderPresent(); }
The messages used so far to trigger windows re-paint are :
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_RESIZED:
case SDL_WINDOWEVENT_RESTORED:
case SDL_WINDOWEVENT_MAXIMIZED:
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_SIZE_CHANGED:
case SDL_WINDOWEVENT_MOVED:
mevis_sdl_RefreshWindow();
break;
All other re-paint conditions are working fine. The problem is only evident after minimization followed by screen saver.
Great, thanks!On Thu, Nov 14, 2013 at 2:36 AM, alabouza wrote:
I re-compiled the SDL 2 snapshot with Intel C++ Compiler XE 13.1.3.198.
I am testing with three applications ported from SDL 1.2.15 and the
previous problem is gone, as far as I can detect.
Thanks.
Sam Lantinga wrote:
There was a bug with SDL detecting minimize state.
On Thu, Nov 7, 2013 at 10:35 AM, alabouza <> wrote:
Quote:
I ported some applications from SDL 1.2.15 to 2.0.1. They are Windows
32bits applications, compiled with Intel C/C++ (composer XE 2013). Using C,
not C++.
I found one problem:
Condition : the applications was minimized and the system enters the
screen-saver mode.
Result : when the system exits the screen saver and I click to restore the
SDL app, the window returns in black. To refresh the window to the proper
state I need to create an event (click, resize, move, etc).
I am assuming that some events were ignored in my code, but I do not find
any other message to trigger the re-paint { SDL_UpdateTexture(…);
SDL_SetRenderDrawColor(…);
SDL_RenderClear(…); SDL_RenderCopy(…); SDL_RenderPresent(); }
The messages used so far to trigger windows re-paint are :
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_RESIZED:
case SDL_WINDOWEVENT_RESTORED:
case SDL_WINDOWEVENT_MAXIMIZED:
case SDL_WINDOWEVENT_FOCUS_GAINED:
case SDL_WINDOWEVENT_SIZE_CHANGED:
case SDL_WINDOWEVENT_MOVED:
mevis_sdl_RefreshWindow();
break;
All other re-paint conditions are working fine. The problem is only
evident after minimization followed by screen saver.