RenderWare V2.1

Previous Page Index Next Page

RwRaster *

RwCreateUserRaster(RwInt32 w, RwInt32 h, RwInt32 stride,
void *pixels);

Description

Builds a user defined raster.

Arguments

w Width of the raster.

h Height of the raster.

stride Stride of the image (number of bytes between scan lines).

pixels Pointer to the image

Return Value

Pointer to the created raster on success, else NULL.

Comments

This function can be used for building rasters which are not allocated by RenderWare. Note that when RwDestroyRaster() is called with a user raster, RenderWare will not free the pixels pointer of the raster. It is the responsibility of the programmer to ensure that the image memory is freed if necessary. Such rasters can be used in exactly the same way as normal rasters - they can be used as the image for a texture or for a camera image.

Passing a raster into RwCreateCamera will enable rendering to an arbitrary section of memory.

See Also

RwSetUserRasterParameters()

RwCreateCamera()