SDL Library

Dependents:   H261_decoder

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDL_quit.h Source File

SDL_quit.h

Go to the documentation of this file.
00001 /*
00002   Simple DirectMedia Layer
00003   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
00004 
00005   This software is provided 'as-is', without any express or implied
00006   warranty.  In no event will the authors be held liable for any damages
00007   arising from the use of this software.
00008 
00009   Permission is granted to anyone to use this software for any purpose,
00010   including commercial applications, and to alter it and redistribute it
00011   freely, subject to the following restrictions:
00012 
00013   1. The origin of this software must not be misrepresented; you must not
00014      claim that you wrote the original software. If you use this software
00015      in a product, an acknowledgment in the product documentation would be
00016      appreciated but is not required.
00017   2. Altered source versions must be plainly marked as such, and must not be
00018      misrepresented as being the original software.
00019   3. This notice may not be removed or altered from any source distribution.
00020 */
00021 
00022 /**
00023  *  \file SDL_quit.h
00024  *
00025  *  Include file for SDL quit event handling.
00026  */
00027 
00028 #ifndef _SDL_quit_h
00029 #define _SDL_quit_h
00030 
00031 #include "SDL_stdinc.h"
00032 #include "SDL_error.h"
00033 
00034 /**
00035  *  \file SDL_quit.h
00036  *
00037  *  An ::SDL_QUIT event is generated when the user tries to close the application
00038  *  window.  If it is ignored or filtered out, the window will remain open.
00039  *  If it is not ignored or filtered, it is queued normally and the window
00040  *  is allowed to close.  When the window is closed, screen updates will
00041  *  complete, but have no effect.
00042  *
00043  *  SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
00044  *  and SIGTERM (system termination request), if handlers do not already
00045  *  exist, that generate ::SDL_QUIT events as well.  There is no way
00046  *  to determine the cause of an ::SDL_QUIT event, but setting a signal
00047  *  handler in your application will override the default generation of
00048  *  quit events for that signal.
00049  *
00050  *  \sa SDL_Quit()
00051  */
00052 
00053 /* There are no functions directly affecting the quit event */
00054 
00055 #define SDL_QuitRequested() \
00056         (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
00057 
00058 #endif /* _SDL_quit_h */