SDL_GetFullscreenDisplayMode

Name

SDL_GetFullscreenDisplayMode -- Get the fullscreen display mode.

Synopsis

#include "SDL_video.h"

int SDL_GetFullscreenDisplayMode (SDL_DisplayMode * mode);

Description

SDL_GetFullscreenDisplayMode fills in information about the display mode used when a fullscreen window is visible on the currently selected display.

Return Value

Returns 0 if successful or -1 if the video subsystem has not been initialized.

Example

   1 #include "SDL.h"
   2 #include <stdio.h>
   3 
   4 int main(int argc, char** argv)  {
   5   SDL_DisplayMode mode;
   6   
   7   if (SDL_Init(SDL_INIT_VIDEO) != 0)  {
   8     printf ("Error initializing SDL:  %s\n", SDL_GetError());
   9     return 1;
  10   }
  11   atexit (SDL_Quit);
  12   
  13   SDL_GetDesktopDisplayMode(&mode);
  14   printf ("The desktop display mode is %d x %d, %d Hz, %d BPP\n",
  15           mode.w, mode.h, mode.refresh_rate, SDL_BITSPERPIXEL(mode.format));
  16   
  17   SDL_GetFullscreenDisplayMode(&mode);
  18   printf ("The fullscreen display mode is %d x %d, %d Hz, %d BPP\n",
  19           mode.w, mode.h, mode.refresh_rate, SDL_BITSPERPIXEL(mode.format));
  20   
  21   SDL_GetCurrentDisplayMode(&mode);
  22   printf ("The current display mode is %d x %d, %d Hz, %d BPP\n",
  23           mode.w, mode.h, mode.refresh_rate, SDL_BITSPERPIXEL(mode.format));
  24 }

See Also

SDL_SetFullscreenDisplayMode, SDL_GetDesktopDisplayMode, SDL_GetCurrentDisplayMode, SDL_GetNumDisplayModes, SDL_GetDisplayMode


CategorySDL13API CategorySDL13APIVideo

SDL-1.3/SDL_GetFullscreenDisplayMode (last edited 2009-07-30 03:46:19 by KenBull)