SDL_RWFromFile (3) Linux Manual Page
SDL_FunctionName – Short description of function Synopsis #include "SDL.h" return typeSDL_FunctionName(parameter); Description Full description Examples examples here See Also SDL_AnotherFunction
SDL_FunctionName – Short description of function Synopsis #include "SDL.h" return typeSDL_FunctionName(parameter); Description Full description Examples examples here See Also SDL_AnotherFunction
SDL_QuitSubSystem – Shut down a subsystem Synopsis #include "SDL.h" void SDL_QuitSubSystem(Uint32 flags); Description SDL_QuitSubSystem allows you to shut down a subsystem that has been previously initialized by SDL_Init or SDL_InitSubSystem. The flags tells SDL_QuitSubSystem which subsystems to shut down, it uses the same values that are passed to SDL_Init. See Also SDL_Quit, SDL_Init, SDL_InitSubSystem
SDL_QuitEvent – Quit requested event Structure Definition typedef struct{ Uint8 type } SDL_QuitEvent; Structure Data type SDL_QUIT Description SDL_QuitEvent is a member of the SDL_Event union and is used whan an event of type SDL_QUIT is reported. As can be seen, the SDL_QuitEvent structure serves no useful purpose. The event itself, on the other hand,…
SDL_Quit – Shut down SDL Synopsis #include "SDL.h" void SDL_Quit(void); Description SDL_Quit shuts down all SDL subsystems and frees the resources allocated to them. This should always be called before you exit. For the sake of simplicity you can set SDL_Quit as your atexit call, like: SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO); atexit(SDL_Quit); . . Note: While using atexit maybe…
SDL_PushEvent – Pushes an event onto the event queue Synopsis #include "SDL.h" int SDL_PushEvent(SDL_Event *event); Description The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. event is a pointer to the…
SDL_PumpEvents – Pumps the event loop, gathering events from the input devices. Synopsis #include "SDL.h" void SDL_PumpEvents(void); Description Pumps the event loop, gathering events from the input devices. SDL_PumpEvents gathers all the pending input information from devices and places it on the event queue. Without calls to SDL_PumpEvents no events would ever be placed on…
SDL_PollEvent – Polls for currently pending events. Synopsis #include "SDL.h" int SDL_PollEvent(SDL_Event *event); Description Polls for currently pending events, and returns 1 if there are any pending events, or 0 if there are none available. If event is not NULL, the next event is removed from the queue and stored in that area. Examples SDL_Event…
SDL_PixelFormat – Stores surface format information Structure Definition typedef struct SDL_PixelFormat { SDL_Palette *palette; Uint8 BitsPerPixel; Uint8 BytesPerPixel; Uint8 Rloss, Gloss, Bloss, Aloss; Uint8 Rshift, Gshift, Bshift, Ashift; Uint32 Rmask, Gmask, Bmask, Amask; Uint32 colorkey; Uint8 alpha; } SDL_PixelFormat; Structure Data palette Pointer to the palette, or NULL if the BitsPerPixel>8 BitsPerPixel The number of…
SDL_PeepEvents – Checks the event queue for messages and optionally returns them. Synopsis #include "SDL.h" int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 mask); Description Checks the event queue for messages and optionally returns them. If action is SDL_ADDEVENT, up to numevents events will be added to the back of the event queue. If action…
SDL_PauseAudio – Pauses and unpauses the audio callback processing Synopsis #include "SDL.h" void SDL_PauseAudio(int pause_on); Description This function pauses and unpauses the audio callback processing. It should be called with pause_on=0 after opening the audio device to start playing sound. This is so you can safely initialize data for your callback function after opening the…
SDL_Palette – Color palette for 8-bit pixel formats Structure Definition typedef struct{ int ncolors; SDL_Color *colors; } SDL_Palette; Structure Data ncolors Number of colors used in this palette colors Pointer to SDL_Color structures that make up the palette. Description Each pixel in an 8-bit surface is an index into the colors field of the SDL_Palette…
SDL_Overlay – YUV video overlay Structure Definition typedef struct{ Uint32 format; int w, h; int planes; Uint16 *pitches; Uint8 **pixels; Uint32 hw_overlay:1; } SDL_Overlay; Structure Data format Overlay format (see below) w, h Width and height of overlay planes Number of planes in the overlay. Usually either 1 or 3 pitches An array of pitches,…
SDL_OpenAudio – Opens the audio device with the desired parameters. Synopsis #include "SDL.h" int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); Description This function opens the audio device with the desired parameters, and returns 0 if successful, placing the actual hardware parameters in the structure pointed to by obtained. If obtained is NULL, the audio data passed to…
SDL_NumJoysticks – Count available joysticks. Synopsis #include "SDL.h" int SDL_NumJoysticks(void); Description Counts the number of joysticks attached to the system. Return Value Returns the number of attached joysticks See Also SDL_JoystickName, SDL_JoystickOpen
SDL_MouseMotionEvent – Mouse motion event structure Structure Definition typedef struct{ Uint8 type; Uint8 state; Uint16 x, y; Sint16 xrel, yrel; } SDL_MouseMotionEvent; Structure Data type SDL_MOUSEMOTION state The current button state x, y The X/Y coordinates of the mouse xrel, yrel Relative motion in the X/Y direction Description SDL_MouseMotionEvent is a member of the SDL_Event…
SDL_MouseButtonEvent – Mouse button event structure Structure Definition typedef struct{ Uint8 type; Uint8 button; Uint8 state; Uint16 x, y; } SDL_MouseButtonEvent; Structure Data type SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP button The mouse button index (SDL_BUTTON_LEFT, SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT) state SDL_PRESSED or SDL_RELEASED x, y The X/Y coordinates of the mouse at press/release time Description SDL_MouseButtonEvent is a member…
SDL_MixAudio – Mix audio data Synopsis #include "SDL.h" void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume); Description This function takes two audio buffers of len bytes each of the playing audio format and mixes them, performing addition, volume adjustment, and overflow clipping. The volume ranges from 0 to SDL_MIX_MAXVOLUME and should be set to…
SDL_MapRGBA – Map a RGBA color value to a pixel format. Synopsis #include "SDL.h" Uint32 SDL_MapRGBA(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a); Description Maps the RGBA color value to the specified pixel format and returns the pixel value as a 32-bit int. If the format has a palette (8-bit) the index of…
SDL_MapRGB – Map a RGB color value to a pixel format. Synopsis #include "SDL.h" Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b); Description Maps the RGB color value to the specified pixel format and returns the pixel value as a 32-bit int. If the format has a palette (8-bit) the index of the closest…
SDL_LockYUVOverlay – Lock an overlay Synopsis #include "SDL.h" int SDL_LockYUVOverlay(SDL_Overlay *overlay); Description Much the same as SDL_LockSurface, SDL_LockYUVOverlay locks the overlay for direct access to pixel data. Return Value Returns 0 on success, or -1 on an error. See Also SDL_UnlockYUVOverlay, SDL_CreateYUVOverlay, SDL_Overlay