SDL_RWFromMem

Name

SDL_RWFromMem -- prepares a memory area for use with RWops.

Synopsis

#include "SDL.h"

SDL_RWops *SDL_RWFromMem(void *mem, int size);

Description

SDL_RWFromMem sets up a RWops struct based on a chunk of memory of a certain size.

Note: If the memory is not writable, use SDL_RWFromConstMem instead.

Return Value

Returns pointer to a new RWops struct, or NULL if it fails.

Example

char bitmap[310000];
SDL_RWops *rw;

rw = SDL_RWFromMem(bitmap, sizeof(bitmap));
SDL_SaveBMP_RW(screen, rw, 0);

See Also

SDL_RWFromFile, SDL_RWFromConstMem

SDL_RWFromMem (last edited 2008-04-17 08:18:15 by localhost)