Commit 9903da21e34d84a01ab6dfc30a01f619e6ef5415
1 parent
c53be334
SDL full screen patch for Windows (malc)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1595 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
11 additions
and
0 deletions
sdl.c
@@ -55,11 +55,22 @@ static void sdl_resize(DisplayState *ds, int w, int h) | @@ -55,11 +55,22 @@ static void sdl_resize(DisplayState *ds, int w, int h) | ||
55 | flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL; | 55 | flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL; |
56 | if (gui_fullscreen) | 56 | if (gui_fullscreen) |
57 | flags |= SDL_FULLSCREEN; | 57 | flags |= SDL_FULLSCREEN; |
58 | + | ||
59 | + again: | ||
58 | screen = SDL_SetVideoMode(w, h, 0, flags); | 60 | screen = SDL_SetVideoMode(w, h, 0, flags); |
59 | if (!screen) { | 61 | if (!screen) { |
60 | fprintf(stderr, "Could not open SDL display\n"); | 62 | fprintf(stderr, "Could not open SDL display\n"); |
61 | exit(1); | 63 | exit(1); |
62 | } | 64 | } |
65 | + if (!screen->pixels && (flags & SDL_HWSURFACE) && (flags & SDL_FULLSCREEN)) { | ||
66 | + flags &= ~SDL_HWSURFACE; | ||
67 | + goto again; | ||
68 | + } | ||
69 | + | ||
70 | + if (!screen->pixels) { | ||
71 | + fprintf(stderr, "Could not open SDL display\n"); | ||
72 | + exit(1); | ||
73 | + } | ||
63 | ds->data = screen->pixels; | 74 | ds->data = screen->pixels; |
64 | ds->linesize = screen->pitch; | 75 | ds->linesize = screen->pitch; |
65 | ds->depth = screen->format->BitsPerPixel; | 76 | ds->depth = screen->format->BitsPerPixel; |