changeset 4772:9c65efb6ac7e

support for VOCTRL_FULLSCREEN
author atmos4
date Wed, 20 Feb 2002 22:42:46 +0000
parents ef9079037084
children 976bf6a9ded5
files libvo/vo_sdl.c
diffstat 1 files changed, 12 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_sdl.c	Wed Feb 20 22:41:54 2002 +0000
+++ b/libvo/vo_sdl.c	Wed Feb 20 22:42:46 2002 +0000
@@ -1129,20 +1129,6 @@
 					if(verbose > 1) printf("SDL: Set next available fullscreen mode.\n");
 				}
 
-				/* f key pressed toggles/exits fullscreenmode */
-				else if ( keypressed == SDLK_f ) {
-					if (priv->surface->flags & SDL_FULLSCREEN) {
-						priv->surface = SDL_SetVideoMode(priv->windowsize.w, priv->windowsize.h, priv->bpp, priv->sdlflags);
-						SDL_ShowCursor(1);
-						if(verbose > 1) printf("SDL: Windowed mode\n");
-					} 
-					else if (priv->fullmodes){
-						set_fullmode(priv->fullmode);
-
-						if(verbose > 1) printf("SDL: Set fullscreen mode\n");
-					}
-				}
-
 				else if ( keypressed == SDLK_n ) {
 #ifdef HAVE_X11					
 					aspect(&priv->dstwidth, &priv->dstheight,A_NOZOOM);
@@ -1328,9 +1314,21 @@
 
 static uint32_t control(uint32_t request, void *data, ...)
 {
+  struct sdl_priv_s *priv = &sdl_priv;
   switch (request) {
   case VOCTRL_QUERY_FORMAT:
     return query_format(*((uint32_t*)data));
+  case VOCTRL_FULLSCREEN:
+    if (priv->surface->flags & SDL_FULLSCREEN) {
+      priv->surface = SDL_SetVideoMode(priv->windowsize.w, priv->windowsize.h, priv->bpp, priv->sdlflags);
+      SDL_ShowCursor(1);
+      if(verbose > 1) printf("SDL: Windowed mode\n");
+    } else if (priv->fullmodes) {
+      set_fullmode(priv->fullmode);
+      if(verbose > 1) printf("SDL: Set fullscreen mode\n");
+    }
+    //return VO_TRUE; // XXX what should VOCTRL_FULLSCREEN return?
   }
+
   return VO_NOTIMPL;
 }