Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2010-10-13 18:18:36
Size: 1367
Editor: SheenaSmith
Comment: update content - pointers, structs
Revision 6 as of 2011-06-29 00:31:04
Size: 1423
Editor: SheenaSmith
Comment: update content for consistency - add SDL_GetError() to NULL RVs
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
*<<BR>>Returns a pointer to a new ^SDL_^RWops structure, or NULL if it fails. <<BR>>* *<<BR>>Returns a pointer to a new ^SDL_^RWops structure, or NULL if it fails. <<BR>>*<<BR>>; call [[SDL_GetError]]() for more information.???

DRAFT

SDL_RWFromConstMem

Use this function to *prepare a constant memory area for use with RWops. *

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

green

Return Value

*
Returns a pointer to a new SDL_RWops structure, or NULL if it fails.
*
; call SDL_GetError() for more information.???

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.
*


CategoryAPI, CategoryIO

None: SDL_RWFromConstMem (last edited 2015-04-26 19:16:57 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit