sdl2.ext.common - Frequently Used SDL2 Functions¶
This module wraps various common SDL2 functions, including methods for initializing and quitting SDL2 and its various subsystems and for retrieving events from the SDL2 event queue.
-
sdl2.ext.common.
init
()[source]¶ Initializes the SDL2 video subsystem.
See pygame for a comparison between this function and
pygame.init()
.Raises: SDLError
– If the SDL2 video subsystem cannot be initialized.
-
sdl2.ext.common.
quit
()[source]¶ Quits the SDL2 video subysystem.
If no other subsystems are active, this will also call
sdl2.SDL_Quit()
,sdlttf.TTF_Quit()
andsdlimage.IMG_Quit()
.
-
sdl2.ext.common.
get_events
()[source]¶ Gets all SDL events that are currently on the event queue.
Returns: A list of all SDL_Event
objects currently in the event queue.Return type: List