linuxubuntusdldderelict3

SDL window seemingly improperly being marked 'unresponsive' by OS


I have an SDL2 windowed window accessed via Derelict 3.

It is supposed to strobe black and white (not because I hate epileptics), and it does this successfully. However, after a certain period of time, Ubuntu 13.10 marks the window as 'unresponsive', grays it out, and dulls the strobe effect.

This is highly irritating and totally kills the effect required by the application for visual stimulation to retrieve SSVEP readings from my EEG headset.

How do I get my OS to realize that the window is doing exactly what it should be doing?

Code

As I have wrapped the SDL calls in my actual code, I'm going to provide pseudo-code and the SDL methods called in those sections (I've checked that I'm not calling any other SDL functions):

make a window using SDL_CreateWindow (no set flags)
make a renderer using SDL_CreateRenderer (with presentvsync flag set)
for( ... )
{
  fill screen black using SDL_RenderFillRect and SDL_SetRenderDrawColor
  update screen using SDL_RenderPresent
  fill screen white (same as above filling)
  update screen (same as above update)
}
exit

I pedantically check error codes and return values for all SDL calls in the wrapper lib. They're all fine. What I need to know is what I must add to provide the heartbeat to my OS so it stops graying out my window.

Another thing...

Could someone please add an SDL2 tag? SDL2 has a very different API from SDL1.2...


Solution

  • Added event processing into the loop via SDL_PollEvent(null). This satisfied the OS.