SDL_VideoQuit

Name

SDL_VideoQuit -- Shuts down the video subsystem.

Synopsis

#include "SDL_video.h"

void SDL_VideoQuit (void);

Description

SDL_VideoQuit shuts down the video subsystem.

This function closes all windows, and restores the original video mode.

Return Value

This is a void function and returns nothing.

Note: You should use this function if and only if you have initialized the video subsystem with SDL_VideoInit and SDL_WasInit(SDL_INIT_VIDEO) returns 0.

Example

   1 #include "SDL.h"
   2 
   3 SDL_bool videoinit = SDL_FALSE;
   4 
   5 void OnQuit() {
   6   if (videoinit)
   7     SDL_VideoQuit();
   8   SDL_Quit();
   9 }
  10 
  11 int main(int argc, char** argv) {
  12   if (SDL_Init(0) != 0) {
  13     printf("Error initializing SDL:  %s\n", SDL_GetError());
  14     return 1;
  15   }
  16   atexit(OnQuit);
  17   
  18   if (SDL_VideoInit(NULL, 0) != 0) {
  19     printf("Error initializing SDL video:  %s\n", SDL_GetError());
  20     return 2;
  21   }
  22   videoinit = SDL_TRUE;
  23   
  24   /* ... */
  25   
  26   return 0;
  27 }

See Also

SDL_VideoInit, SDL_QuitSubSystem, SDL_Quit


CategorySDL13API CategorySDL13APIVideo

SDL-1.3/SDL_VideoQuit (last edited 2009-07-27 04:42:18 by KenBull)