notaz.gp2x.de
/
libpicofe.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add basic fullscreen support to SDL window mode
[libpicofe.git]
/
plat_sdl.c
diff --git
a/plat_sdl.c
b/plat_sdl.c
index
61e39c1
..
77bffe6
100644
(file)
--- a/
plat_sdl.c
+++ b/
plat_sdl.c
@@
-121,15
+121,26
@@
int plat_sdl_change_video_mode(int w, int h, int force)
}
if (plat_target.vout_method == 0) {
}
if (plat_target.vout_method == 0) {
- SDL_PumpEvents();
+ Uint32 flags;
+ int win_w = window_w;
+ int win_h = window_h;
#if defined SDL_SURFACE_SW
#if defined SDL_SURFACE_SW
-
plat_sdl_screen = SDL_SetVideoMode(w, h, 16, SDL_SWSURFACE)
;
+
flags = SDL_SWSURFACE
;
#elif defined(SDL_TRIPLEBUF) && defined(SDL_BUFFER_3X)
#elif defined(SDL_TRIPLEBUF) && defined(SDL_BUFFER_3X)
-
plat_sdl_screen = SDL_SetVideoMode(w, h, 16, SDL_HWSURFACE | SDL_TRIPLEBUF)
;
+
flags = SDL_HWSURFACE | SDL_TRIPLEBUF
;
#else
#else
-
plat_sdl_screen = SDL_SetVideoMode(w, h, 16, SDL_HWSURFACE | SDL_DOUBLEBUF)
;
+
flags = SDL_HWSURFACE | SDL_DOUBLEBUF
;
#endif
#endif
+ if (plat_target.vout_fullscreen && fs_w && fs_h) {
+ flags |= SDL_FULLSCREEN;
+ win_w = fs_w;
+ win_h = fs_h;
+ }
+
+ SDL_PumpEvents();
+
+ plat_sdl_screen = SDL_SetVideoMode(win_w, win_h, 16, flags);
if (plat_sdl_screen == NULL) {
fprintf(stderr, "SDL_SetVideoMode failed: %s\n", SDL_GetError());
return -1;
if (plat_sdl_screen == NULL) {
fprintf(stderr, "SDL_SetVideoMode failed: %s\n", SDL_GetError());
return -1;