summaryrefslogtreecommitdiffstats
path: root/libvo/vo_sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_sdl.c')
-rw-r--r--libvo/vo_sdl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libvo/vo_sdl.c b/libvo/vo_sdl.c
index ba7070a9ce..5ca488c1c7 100644
--- a/libvo/vo_sdl.c
+++ b/libvo/vo_sdl.c
@@ -731,6 +731,29 @@ static void set_fullmode (int mode) {
/* try to change to given fullscreenmode */
newsurface = SDL_SetVideoMode(priv->dstwidth, screen_surface_h, priv->bpp,
priv->sdlfullflags);
+
+ /*
+ * In Mac OS X (and possibly others?) SDL_SetVideoMode() appears to
+ * destroy the datastructure previously retrived, so we need to
+ * re-assign it. The comment in sdl_close() seems to imply that we
+ * should not free() anything.
+ */
+ #ifdef SYS_DARWIN
+ {
+ const SDL_VideoInfo *vidInfo = NULL;
+ vidInfo = SDL_GetVideoInfo ();
+
+ /* collect all fullscreen & hardware modes available */
+ if (!(priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags))) {
+
+ /* non hardware accelerated fullscreen modes */
+ priv->sdlfullflags &= ~SDL_HWSURFACE;
+ priv->fullmodes = SDL_ListModes (vidInfo->vfmt, priv->sdlfullflags);
+ }
+ }
+ #endif
+
+
/* if creation of new surface was successfull, save it and hide mouse cursor */
if(newsurface) {