# Package cocos.audio.SDL

Main module for importing SDL-ctypes.

This module defines the intialization and cleanup functions:
  - SDL_Init
  - SDL_InitSubSystem
  - SDL_WasInit
  - SDL_QuitSubSystem
  - SDL_Quit

It also imports all functions, constants and classes from the package submodules. Typical usage, then, is to just import this module directly into your namespace:

    from SDL import *

This gives you access to all SDL names exactly as they appear in the C header files.

## Submodules

| cocos.audio.SDL.array
| cocos.audio.SDL.audio Access to the raw audio mixing buffer.
| cocos.audio.SDL.constants Constants and enums for all SDL submodules.
| cocos.audio.SDL.dll
| cocos.audio.SDL.endian Functions for converting to native byte order
| cocos.audio.SDL.error Error detection and error handling functions.
| cocos.audio.SDL.rwops General interface for SDL to read and write data sources.
| cocos.audio.SDL.timer Time management routines.
| cocos.audio.SDL.version Functions related to the SDL shared library version.
Non-core modules
| cocos.audio.SDL.mixer A simple multi-channel audio mixer.

## Functions

int | SDL_Init(flags) Initialise the SDL library.
int | SDL_InitSubSystem(flags) Initialize specific SDL subsystems.

## Constants

| CD_PAUSED = `3`
| CD_PLAYING = `2`
| CD_STOPPED = `1`
| CD_TRAYEMPTY = `0`
| MIX_FADING_IN = `2`
| MIX_FADING_OUT = `1`
| MIX_NO_FADING = `0`
| MUS_CMD = `1`
| MUS_MID = `4`
| MUS_MOD = `3`
| MUS_MP3 = `6`
| MUS_NONE = `0`
| MUS_OGG = `5`
| MUS_WAV = `2`
| SDL_ACTIVEEVENT = `1`
| SDL_ADDEVENT = `0`
| SDL_AUDIO_PAUSED = `2`
| SDL_AUDIO_PLAYING = `1`
| SDL_AUDIO_STOPPED = `0`
| SDL_EVENT_RESERVED2 = `18`
| SDL_EVENT_RESERVED3 = `19`
| SDL_EVENT_RESERVED4 = `20`
| SDL_EVENT_RESERVED5 = `21`
| SDL_EVENT_RESERVED6 = `22`
| SDL_EVENT_RESERVED7 = `23`
| SDL_EVENT_RESERVEDA = `14`
| SDL_EVENT_RESERVEDB = `15`
| SDL_GETEVENT = `2`
| SDL_GL_ACCELERATED_VISUAL = `15`
| SDL_GL_ACCUM_ALPHA_SIZE = `11`
| SDL_GL_ACCUM_BLUE_SIZE = `10`
| SDL_GL_ACCUM_GREEN_SIZE = `9`
| SDL_GL_ACCUM_RED_SIZE = `8`
| SDL_GL_ALPHA_SIZE = `3`
| SDL_GL_BLUE_SIZE = `2`
| SDL_GL_BUFFER_SIZE = `4`
| SDL_GL_DEPTH_SIZE = `6`
| SDL_GL_DOUBLEBUFFER = `5`
| SDL_GL_GREEN_SIZE = `1`
| SDL_GL_MULTISAMPLEBUFFERS = `13`
| SDL_GL_MULTISAMPLESAMPLES = `14`
| SDL_GL_RED_SIZE = `0`
| SDL_GL_STENCIL_SIZE = `7`
| SDL_GL_STEREO = `12`
| SDL_GL_SWAP_CONTROL = `16`
| SDL_GRAB_OFF = `0`
| SDL_GRAB_ON = `1`
| SDL_GRAB_QUERY = `-1`
| SDL_JOYAXISMOTION = `7`
| SDL_JOYBALLMOTION = `8`
| SDL_JOYBUTTONDOWN = `10`
| SDL_JOYBUTTONUP = `11`
| SDL_JOYHATMOTION = `9`
| SDL_KEYDOWN = `2`
| SDL_KEYUP = `3`
| SDL_MOUSEBUTTONDOWN = `5`
| SDL_MOUSEBUTTONUP = `6`
| SDL_MOUSEMOTION = `4`
| SDL_NOEVENT = `0`
| SDL_PEEKEVENT = `1`
| SDL_QUIT = `12`
| SDL_SYSWMEVENT = `13`
| SDL_VIDEOEXPOSE = `17`
| SDL_VIDEORESIZE = `16`

## Variables

| __package__ = ``'``cocos.audio.SDL``'``

## Function Details

### SDL_Init

SDL_Init(flags)

Initialise the SDL library.

This function loads the SDL dynamically linked library and initializes the subsystems specified by `flags` (and those satisfying dependencies) Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup signal handlers for some commonly ignored fatal signals (like SIGSEGV).

The following flags are recognised:

> - SDL_INIT_TIMER
> - SDL_INIT_AUDIO
> - SDL_INIT_VIDEO
> - SDL_INIT_CDROM
> - SDL_INIT_JOYSTICK
> - SDL_INIT_NOPARACHUTE
> - SDL_INIT_EVENTTHREAD
> - SDL_INIT_EVERYTHING

Parameters:
  flags
    : int
Returns:
  int: undocumented (FIXME)

See Also: SDL_Quit

### SDL_InitSubSystem

SDL_InitSubSystem(flags)
Initialize specific SDL subsystems.

Parameters:
  flags
    : int
Returns:
  int: undocumented (FIXME)

See Also: SDL_Init, SDL_QuitSubSystem