Tao.Sdl SDK Documentation

Sdl.SDL_RWFromConstMem Method 

Prepares a constant memory area for use with RWops.

[Visual Basic]
Public Shared Function SDL_RWFromConstMem( _
   ByVal mem As IntPtr, _
   ByVal size As Integer _
) As IntPtr
[C#]
public static IntPtr SDL_RWFromConstMem(
   IntPtr mem,
   int size
);

Parameters

mem
size

Return Value

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

Remarks

SDL_RWFromConstMem sets up a RWops struct based on a memory area of a certain size. It assumes the memory area is not writable.

Example

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

See Also

Sdl Class | Tao.Sdl Namespace | SDL_RWFromMem