|
Size: 914
Comment: create page, add content (Wed Mar 10 ver; changeset 4428)
|
Size: 1121
Comment: add SDL_GetError to RV
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 2: | Line 2: |
| #pragma disable-camelcase | #pragma camelcase off |
| Line 6: | Line 6: |
| Use this function to create [[SDL_RWops]] structures from memory. | Use this function to create an SDL_RWops structure from memory of a certain size. |
| Line 17: | Line 17: |
| ||'''mem'''||^a pointer to the memory location containing the information to fill an [[SDL_RWops]] structure with^|| ||'''size'''||^the size of the memory location^ ???|| |
||'''mem'''||,,a pointer to ,,^the memory location^|| ||'''size'''||^the size of the memory location^|| <<Color2(green,Is '''mem''' an exception to the 'pointer rule'?)>> |
| Line 21: | Line 23: |
| A pointer to the [[SDL_RWops]] structure that is created. | A pointer to the SDL_RWops structure that is created or NULL on failure; call [[SDL_GetError]]() for more information. |
| Line 24: | Line 26: |
| * | |
| Line 25: | Line 28: |
| You can add your code example here | char bitmap[310000]; SDL_RWops *rw; rw = SDL_RWFromMem(bitmap, sizeof(bitmap)); SDL_SaveBMP_RW(screen, rw, 0); |
| Line 27: | Line 34: |
| * | |
| Line 29: | Line 37: |
| ''You can add useful comments here'' | *<<BR>>If the memory is not writable, use [[SDL_RWFromConstMem]]() instead.<<BR>>* |
| Line 36: | Line 44: |
DRAFT |
SDL_RWFromMem
Use this function to create an SDL_RWops structure from memory of a certain size.
Contents
Syntax
SDL_RWops* SDL_RWFromMem(void* mem,
int size)
Function Parameters
mem |
a pointer to the memory location |
size |
the size of the memory location |
green
Return Value
A pointer to the SDL_RWops structure that is created or NULL on failure; call SDL_GetError() for more information.
Code Examples
*
char bitmap[310000];
SDL_RWops *rw;
rw = SDL_RWFromMem(bitmap, sizeof(bitmap));
SDL_SaveBMP_RW(screen, rw, 0);
*
Remarks
*
If the memory is not writable, use SDL_RWFromConstMem() instead.
*
Related Functions
SDL_RWFromFile ???
SDL_RWFromFP ???
