-
- if (g_use_overlay && !in_menu) {
- Uint32 flags = SDL_RESIZABLE;
- int win_w = window_w;
- int win_h = window_h;
-
- if (g_fullscreen) {
- flags |= SDL_FULLSCREEN;
- win_w = fs_w;
- win_h = fs_h;
- }
-
- screen = SDL_SetVideoMode(win_w, win_h, 0, flags);
- if (screen == NULL) {
- fprintf(stderr, "SDL_SetVideoMode failed: %s\n", SDL_GetError());
- return -1;
- }
-
- overlay = SDL_CreateYUVOverlay(w, h, SDL_UYVY_OVERLAY, screen);
- if (overlay != NULL) {
- /*printf("overlay: fmt %x, planes: %d, pitch: %d, hw: %d\n",
- overlay->format, overlay->planes, *overlay->pitches,
- overlay->hw_overlay);*/
-
- if ((long)overlay->pixels[0] & 3)
- fprintf(stderr, "warning: overlay pointer is unaligned\n");
-
- if (!overlay->hw_overlay) {
- fprintf(stderr, "warning: video overlay is not hardware accelerated, "
- "disabling it.\n");
- g_use_overlay = 0;
- SDL_FreeYUVOverlay(overlay);
- overlay = NULL;
- }
- else
- overlay_clear();
- }
- else {
- fprintf(stderr, "warning: could not create overlay.\n");
- }