SDL2: SDL_Delay() makes the window bar hidden on El Capitan

"Feng" <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
Env: 
SDL 2.0.4; 
OS X El Capitan 10.11.5 (15F34); 
clang 7.3

After calling the SDL_Delay(), the window bar is hidden and a white bar is shown instead. 
I'm not sure if this is a feature or bug. Or I missed something?

Thank you!

Here is my code:


Code:

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <SDL2/SDL.h>

const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;

int main(int argc, const char *argv[])
{
  if( SDL_Init( SDL_INIT_VIDEO ) < 0 )
  {
    printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
  }
  bool quit = false;
  SDL_Event event;
  SDL_Window* window = NULL;
  window = SDL_CreateWindow("Test SDL", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN);
  SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);

  SDL_SetRenderDrawColor(renderer, 255, 254, 255, 255 );
  SDL_RenderClear(renderer);

  SDL_RenderPresent(renderer);
  SDL_Delay(5000); // window bar is hidden, a white blank bar is shown instead.

  while (!quit) // window bar is shown right now.
  {
    SDL_WaitEvent(&event);
    switch (event.type)
    {
      case SDL_QUIT:
        quit = true;
        break;
    }
  }


  SDL_DestroyRenderer(renderer);
  SDL_DestroyWindow(window);

	SDL_Quit();
  return 0;
}


[/img]

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.