title: Multiple SDL windows with YUV Overlay
body: <p>Does anyone know, how to create two Windows ans both should have an own YUV Overlay with the SDL 1.3 Library?</p>
  
  <p>It is possible or do I try to use a wrong strategy?</p>
  
  <p>If I tried the following source, i got an error message:
  [!] can't create local overlay YUV display is only supported on the screen surface</p>
  
  <pre><code>#include &lt;SDL/SDL.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  static bool running = true;
  static SDL_Window* win_local;
  static SDL_Window* win_remote;
  
  int main(int argc, char** argv) {
  
  //    SDL_SetVideoMode
  
      if((SDL_Init(SDL_INIT_VIDEO) != 0))
      {
          printf("[!] can't initialize SDL %s\n", SDL_GetError());
          exit(-1);
      }
  
      if(!(win_local = SDL_CreateWindow("Local Video", 0, 0, 640, 480, SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS)))
      {
          printf("[!] can't create Window %s\n", SDL_GetError());
          exit(-1);
  
      }
  
      if(!(win_remote = SDL_CreateWindow("Remote Video", 700, 0, 640, 480, SDL_WINDOW_SHOWN)))
      {
          printf("[!] can't create Window %s\n", SDL_GetError());
          exit(-1);
      }
  
  
      SDL_Surface* surface_local; 
      SDL_Surface* surface_remote; 
  
      if(!(surface_local = SDL_GetWindowSurface(win_local)))
      {
          printf("[!] can't get local surface %s\n", SDL_GetError());
          exit(-1);
      }
  
      if(!(surface_remote = SDL_GetWindowSurface(win_remote)))
      {
          printf("[!] can't get remote surface %s", SDL_GetError());
          exit(-1);
      }
  
      SDL_Overlay* overlay_local;
      SDL_Overlay* overlay_remote;
  
      if(!(overlay_local = SDL_CreateYUVOverlay(640, 480, SDL_IYUV_OVERLAY, surface_local)))
      {
          printf("[!] can't create local overlay %s\n", SDL_GetError());
                  exit(-1);
      }
  //
  //  if(!(overlay_remote = SDL_CreateYUVOverlay(640, 480, SDL_IYUV_OVERLAY, surface_remote)))
  //  {
  //      printf("[!] can't create remote overlay %s\n", SDL_GetError());
  //                exit(-1);
  //  }
  
  
      SDL_Event event;
      while(running)
      {
  
          while(SDL_PollEvent(&amp;event))
          {
              switch(event.type)
              {
              case SDL_KEYDOWN:
                  if (event.key.keysym.sym == SDLK_ESCAPE)
                      running = false;
                  break;
              case SDL_QUIT:
                  running = false;
                  break;
              }
          }
  
          SDL_Delay(20);
      }
  
      //SDL_FreeSurface(local);
      //SDL_FreeSurface(remote);
  
      SDL_DestroyWindow(win_local);
      SDL_DestroyWindow(win_remote);
      SDL_Quit();
      exit(0);
      return 0;
  }
  </code></pre>