|
Size: 1274
Comment: add content from old wiki
|
Size: 1293
Comment: update formatting
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 17: | Line 17: |
| ||'''mem'''||^a pointer to a memory location to use for an SDL_RWops structure^ ???|| ||'''size'''||^the size of the memory location^ ???|| |
||'''mem'''||^a pointer to a memory location to use for an SDL_RWops structure^|| ||'''size'''||^the size of the memory location^|| |
| Line 21: | Line 21: |
| *Returns a pointer to a new ^SDL_^RWops structure, or NULL if it fails. * | *<<BR>>Returns a pointer to a new ^SDL_^RWops structure, or NULL if it fails. <<BR>>* |
| Line 40: | Line 40: |
| *[[SDL_RWFromConstMem]]() sets up a ^SDL_^RWops struct based on a memory area of a certain size. It assumes the memory area is not writable. * | *<<BR>>[[SDL_RWFromConstMem]]() sets up a^n^ ^SDL_^RWops struct based on a memory area of a certain size. It assumes the memory area is not writable. <<BR>>* |
DRAFT |
SDL_RWFromConstMem
Use this function to *prepare a constant memory area for use with RWops. *
Contents
Syntax
SDL_RWops* SDL_RWFromConstMem(const void* mem,
int size)
Function Parameters
mem |
a pointer to a memory location to use for an SDL_RWops structure |
size |
the size of the memory location |
Return Value
*
Returns a pointer to a new SDL_RWops structure, or NULL if it fails.
*
Code Examples
*
char bitmap[] = {
66, 77, 86, 2, 0, 0, 0, 0 ...
}
SDL_RWops *rw;
SDL_Surface *img;
rw = SDL_RWFromConstMem(bitmap, sizeof(bitmap));
img = SDL_LoadBMP_RW(rw, 1); // Automatically frees the RWops struct for us
// Do something with img...
*
Remarks
*
SDL_RWFromConstMem() sets up an SDL_RWops struct based on a memory area of a certain size. It assumes the memory area is not writable.
*
Related Functions
SDL_RWFromFile ???
SDL_RWFromFP ???
