SDL_quit.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * # CategoryQuit
  20. *
  21. * An SDL_QUIT event is generated when the user tries to close the application
  22. * window. If it is ignored or filtered out, the window will remain open. If
  23. * it is not ignored or filtered, it is queued normally and the window is
  24. * allowed to close. When the window is closed, screen updates will complete,
  25. * but have no effect.
  26. *
  27. * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) and
  28. * SIGTERM (system termination request), if handlers do not already exist,
  29. * that generate SDL_QUIT events as well. There is no way to determine the
  30. * cause of an SDL_QUIT event, but setting a signal handler in your
  31. * application will override the default generation of quit events for that
  32. * signal.
  33. */
  34. #ifndef SDL_quit_h_
  35. #define SDL_quit_h_
  36. #include "SDL_stdinc.h"
  37. #include "SDL_error.h"
  38. /* There are no functions directly affecting the quit event */
  39. #define SDL_QuitRequested() \
  40. (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
  41. #endif /* SDL_quit_h_ */