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 | 55 | flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL; |
56 | 56 | if (gui_fullscreen) |
57 | 57 | flags |= SDL_FULLSCREEN; |
58 | + | |
59 | + again: | |
58 | 60 | screen = SDL_SetVideoMode(w, h, 0, flags); |
59 | 61 | if (!screen) { |
60 | 62 | fprintf(stderr, "Could not open SDL display\n"); |
61 | 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 | 74 | ds->data = screen->pixels; |
64 | 75 | ds->linesize = screen->pitch; |
65 | 76 | ds->depth = screen->format->BitsPerPixel; | ... | ... |