Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RwRaster
[Rasters, Textures & Images]


Data Structures

struct   RwRaster

Enumerations

enum   RwRasterLockMode {
  rwRASTERLOCKWRITE = 0x01, rwRASTERLOCKREAD = 0x02, rwRASTERLOCKNOFETCH = 0x04, rwRASTERLOCKRAW = 0x08,
  rwRASTERLOCKMODEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}
enum   RwRasterFlipMode { rwRASTERFLIPDONTWAIT = 0, rwRASTERFLIPWAITVSYNC = 1, rwRASTERFLIPMODEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT }
enum   RwRasterType {
  rwRASTERTYPENORMAL = 0x00, rwRASTERTYPEZBUFFER = 0x01, rwRASTERTYPECAMERA = 0x02, rwRASTERTYPETEXTURE = 0x04,
  rwRASTERTYPECAMERATEXTURE = 0x05, rwRASTERTYPEMASK = 0x07, rwRASTERDONTALLOCATE = 0x80, rwRASTERTYPEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}
enum   RwRasterFormat {
  rwRASTERFORMATDEFAULT = 0x0000, rwRASTERFORMAT1555 = 0x0100, rwRASTERFORMAT565 = 0x0200, rwRASTERFORMAT4444 = 0x0300,
  rwRASTERFORMATLUM8 = 0x0400, rwRASTERFORMAT8888 = 0x0500, rwRASTERFORMAT888 = 0x0600, rwRASTERFORMAT16 = 0x0700,
  rwRASTERFORMAT24 = 0x0800, rwRASTERFORMAT32 = 0x0900, rwRASTERFORMAT555 = 0x0a00, rwRASTERFORMATAUTOMIPMAP = 0x1000,
  rwRASTERFORMATPAL8 = 0x2000, rwRASTERFORMATPAL4 = 0x4000, rwRASTERFORMATMIPMAP = 0x8000, rwRASTERFORMATPIXELFORMATMASK = 0x0f00,
  rwRASTERFORMATMASK = 0xff00, rwRASTERFORMATFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}

Functions

RwRaster RwRasterSetFromImage (RwRaster *raster, RwImage *image)
RwRaster RwRasterRead (const RwChar *filename)
RwRaster RwRasterReadMaskedRaster (const RwChar *filename, const RwChar *maskname)
RwInt32  RwRasterGetWidth (const RwRaster *raster)
RwInt32  RwRasterGetHeight (const RwRaster *raster)
RwInt32  RwRasterGetStride (const RwRaster *raster)
RwInt32  RwRasterGetDepth (const RwRaster *raster)
RwInt32  RwRasterGetFormat (const RwRaster *raster)
RwInt32  RwRasterGetType (const RwRaster *raster)
RwRaster RwRasterGetParent (const RwRaster *raster)
RwInt32  RwRasterGetPluginOffset (RwUInt32 pluginID)
RwRaster RwRasterGetCurrentContext (void)
RwRaster RwRasterRenderScaled (RwRaster *raster, RwRect *rect)
RwRaster RwRasterGetOffset (RwRaster *raster, RwInt16 *xOffset, RwInt16 *yOffset)
RwRaster RwRasterUnlock (RwRaster *raster)
RwBool  RwRasterClear (RwInt32 pixelValue)
RwBool  RwRasterValidatePlugins (const RwRaster *raster)
RwRaster RwRasterRenderFast (RwRaster *raster, RwInt32 x, RwInt32 y)
RwBool  RwRasterClearRect (RwRect *rect, RwInt32 pixelValue)
RwRaster RwRasterRender (RwRaster *raster, RwInt32 x, RwInt32 y)
RwRaster RwRasterUnlockPalette (RwRaster *raster)
RwBool  RwRasterDestroy (RwRaster *raster)
RwRaster RwRasterPushContext (RwRaster *raster)
RwInt32  RwRasterRegisterPlugin (RwInt32 size, RwUInt32 pluginID, RwPluginObjectConstructor constructCB, RwPluginObjectDestructor destructCB, RwPluginObjectCopy copyCB)
RwUInt8 RwRasterLockPalette (RwRaster *raster, RwInt32 lockMode)
RwRaster RwRasterPopContext (void)
RwInt32  RwRasterGetNumLevels (RwRaster *raster)
RwRaster RwRasterShowRaster (RwRaster *raster, void *dev, RwUInt32 flags)
RwRaster RwRasterSubRaster (RwRaster *subRaster, RwRaster *raster, RwRect *rect)
RwRaster RwRasterCreate (RwInt32 width, RwInt32 height, RwInt32 depth, RwInt32 flags)
RwUInt8 RwRasterLock (RwRaster *raster, RwUInt8 level, RwInt32 lockMode)
void  RwRasterSetFreeListCreateParams (RwInt32 blockSize, RwInt32 numBlocksToPrealloc)

Detailed Description

Image/raster coupling handling.

RwRaster Overview

Requirements

Overview

The Raster is a platform-dependent representation of bitmaps. Raster formats are largely dictated by the underlying hardware and are not even guaranteed to use the RGB color model - some platforms may even use compressed formats.

Rasters need to be locked if you need to access or edit their contents and should be unlocked after processing.

It is possible to tell RenderWare Graphics that you only wish to read data, or access structures like palettes, so that unlocking does not impact too much on performance.

These hints are used to determine whether RenderWare needs to perform conversions on the data before and/or after unlocking.

Rasters are closely connected with

See also:
RwCamera , RwImage and , RwTexture objects.

Enumeration Type Documentation

enum RwRasterFlipMode
 

RwRasterFlipMode represents raster flip modes

Enumeration values:
rwRASTERFLIPDONTWAIT  Don't wait for VSync
rwRASTERFLIPWAITVSYNC  Flip on VSync
enum RwRasterFormat
 

RwRasterFormat is a set of values and flags which may be combined to specify a raster format. The format chosen for a particular raster depends on the hardware device and the raster type specified at creation time (see API function RwRasterCreate). The format may be retrieved using API function RwRasterGetFormat.

The raster format is a packed set of bits which contains the following four pieces of information (these may be combined with bitwise OR):-

  1. The pixel color format corresponding to one of the following values:-
    • rwRASTERFORMAT1555
    • rwRASTERFORMAT565
    • rwRASTERFORMAT4444
    • rwRASTERFORMATLUM8
    • rwRASTERFORMAT8888
    • rwRASTERFORMAT888
    • rwRASTERFORMAT16
    • rwRASTERFORMAT24
    • rwRASTERFORMAT32
    • rwRASTERFORMAT555
    This value may be masked out of the raster format using rwRASTERFORMATPIXELFORMATMASK.
  2. The palette depth if the raster is palettized:-
    • rwRASTERFORMATPAL4
    • rwRASTERFORMATPAL8
    In these cases, the color format refers to that of the palette.
  3. Flag rwRASTERFORMATMIPMAP. Set if the raster contains mipmap levels.
  4. Flag rwRASTERFORMATAUTOMIPMAP. Set if the mipmap levels were generated automatically by RenderWare.
Enumeration values:
rwRASTERFORMAT1555  16 bits - 1 bit alpha, 5 bits red, green and blue
rwRASTERFORMAT565  16 bits - 5 bits red and blue, 6 bits green
rwRASTERFORMAT4444  16 bits - 4 bits per component
rwRASTERFORMATLUM8  Gray scale
rwRASTERFORMAT8888  32 bits - 8 bits per component
rwRASTERFORMAT888  24 bits - 8 bits per component
rwRASTERFORMAT16  16 bits - undefined: useful for things like Z buffers
rwRASTERFORMAT24  24 bits - undefined: useful for things like Z buffers
rwRASTERFORMAT32  32 bits - undefined: useful for things like Z buffers
rwRASTERFORMAT555  16 bits - 5 bits red, green and blue
rwRASTERFORMATAUTOMIPMAP  RenderWare generated the mip levels
rwRASTERFORMATPAL8  8 bit palettised
rwRASTERFORMATPAL4  4 bit palettised
rwRASTERFORMATMIPMAP  Mip mapping on
rwRASTERFORMATPIXELFORMATMASK  The pixel color format (excluding palettised bits)
rwRASTERFORMATMASK  The whole format
enum RwRasterLockMode
 

RwRasterLockMode represents the options available for locking a raster so that it may be modified (see API function RwRasterLock). An application may wish to write to the raster, read from the raster or simultaneously write and read a raster (rwRASTERLOCKWRITE | rwRASTERLOCKREAD).

Enumeration values:
rwRASTERLOCKWRITE  Lock for writing
rwRASTERLOCKREAD  Lock for reading
rwRASTERLOCKNOFETCH  When used in combination with rwRASTERLOCKWRITE, asks the driver not to fetch the pixel data. This is only useful if it is known that ALL the raster data is going to be overwritten before the raster is unlocked, i.e. from an RwRasterSetFromImage call. This flag is not supported by all drivers.
rwRASTERLOCKRAW  When used in combination with rwRASTERLOCKWRITE or rwRASTERLOCKREAD allows access to the raw platform specific pixel format
enum RwRasterType
 

RwRasterType This type represents the options available for creating a new raster (se API function RwRasterCreate)

Enumeration values:
rwRASTERTYPENORMAL  Normal
rwRASTERTYPEZBUFFER  Z Buffer
rwRASTERTYPECAMERA  Camera
rwRASTERTYPETEXTURE  Texture
rwRASTERTYPECAMERATEXTURE  Camera texture
rwRASTERTYPEMASK  Mask for finding type
rwRASTERDONTALLOCATE  If set the raster is not allocated

Function Documentation

RwBool RwRasterClear RwInt32    pixelValue
 

RwRasterClear is used to clear the entire area of the current render target to the given device specific pixel value. The current render target is the raster at the top of the context stack.

Parameters:
pixelValue  An RwInt32 value equal to the device specific pixel value
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RwRasterClearRect , RwRasterPopContext , RwRasterPushContext , RwRGBAToPixel
RwBool RwRasterClearRect RwRect   rect,
RwInt32    pixelValue
 

RwRasterClearRect is used to clear the specified rectangular sub-region of the current render target to the given device specific pixel value. The current render target is the raster on top of the context stack. The sub-region must be wholly contained within the bounds of the destination raster.

Parameters:
rect  An RwRect value describing the rectangular sub-region.
pixelValue  An RwInt32 value equal to the device specific pixel value
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RwRasterClear , RwRasterPopContext , RwRasterPushContext , RwRGBAToPixel
RwRaster* RwRasterCreate RwInt32    width,
RwInt32    height,
RwInt32    depth,
RwInt32    flags
 

RwRasterCreate is used to create a new raster of the specified type with the given width, height and depth. The width and height are specified in pixels, the depth is the number of bits per pixel, and the flags indicate the type, and possibly the format, of the raster to create. Specifying zero for the depth indicates that the device default value should be used.

Parameters:
width  An RwInt32 value equal to the width of the raster
height  An RwInt32 value equal to the height of the raster
depth  An RwInt32 value equal to the depth of the raster
flags  An RwInt32 value specifying the type and format of raster to create, combined using a bit-wise OR. The formats are as described under RwRasterGetFormat. The following types are defined:
  • rwRASTERTYPENORMAL - Device default raster
  • rwRASTERTYPEZBUFFER - Camera Z-buffer raster
  • rwRASTERTYPECAMERA - Camera frame buffer raster
  • rwRASTERTYPETEXTURE - Texture raster
  • rwRASTERTYPECAMERATEXTURE - Camera texture raster.
Returns:
Returns a pointer to the new raster if successful or NULL if there is an error.
See also:
RwRasterGetWidth , RwRasterGetHeight , RwRasterGetDepth , RwRasterGetStride , RwRasterGetFormat , RwRasterGetType , RwRasterDestroy , RwRasterRead
RwBool RwRasterDestroy RwRaster   raster
 

RwRasterDestroy is used to destroy the specified raster and free any resources it may have used.

Note:
If the raster is a parent raster, its sub raster must be destroyed as it will no longer be valid. Destruction of the sub raster does not occur when the parent raster is destroyed and therefore RwRasterDestroy must be called again to destroy the sub raster.
Parameters:
raster  A pointer to the raster
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RwRasterCreate
RwRaster* RwRasterGetCurrentContext void   
 

RwRasterGetCurrentContext is used to determine which, if any, raster is the current target for raster rendering and clearing.

The current raster is only defined between calls to RwRasterPushContext and RwRasterPopContext.

Returns:
Returns a pointer to the current raster if successful or NULL if there is an error or if there is no current raster (context stack is empty).
See also:
RwRasterPushContext , RwRasterPopContext
RwInt32 RwRasterGetDepth const RwRaster   raster
 

RwRasterGetDepth is used to retrieve the depth of the specified raster in bits per pixel.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
raster  A pointer to the raster.
Returns:
Returns an RwInt32 value equal to the raster's depth if successful or -1 if there is an error.
See also:
RwRasterGetWidth , RwRasterGetHeight , RwRasterGetStride
RwInt32 RwRasterGetFormat const RwRaster   raster
 

RwRasterGetFormat is used to retrieve the RwRasterFormat of the specified raster. This describes the pixel color format, and where applicable, the palette depth and mipmap settings. These are set when the raster is created. For example, a raster created on a 16-bit device with type rwRASTERTYPECAMERA may have a format rwRASTERFORMAT565. This indicates that it stores color information at 16-bits per pixel with 5-bits allocated to the red channel, 6-bits to the green and 5-bits to the blue. See RwRasterFormat for more information.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
raster  A pointer to the raster.
Returns:
Returns an RwInt32 value describing the raster's format if successful or -1 if there is an error. See RwRasterFormat.
See also:
RwRasterCreate , RwRasterGetDepth , RwRasterGetHeight , RwRasterGetStride , RwRasterGetType , RwRasterGetWidth
RwInt32 RwRasterGetHeight const RwRaster   raster
 

RwRasterGetHeight is used to retrieve the height of the specified raster in pixels.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
raster  A pointer to the raster.
Returns:
Returns an RwInt32 equal to the raster's height.
See also:
RwRasterGetDepth , RwRasterGetWidth , RwRasterGetStride
RwInt32 RwRasterGetNumLevels RwRaster   raster
 

RwRasterGetNumLevels is used to retrieve the number of mipmap levels in a specified raster (usually of type rwRASTERTYPETEXTURE). This can depend on platform and raster size.

Parameters:
raster  A pointer to the raster
Returns:
Returns the number of mipmap levels present in a raster or -1 if there is an error.
RwRaster* RwRasterGetOffset RwRaster   raster,
RwInt16   xOffset,
RwInt16   yOffset
 

RwRasterGetOffset is used to retrieve the x- and y-offset of the specified raster relative to the top-level parent raster i.e. the raster that holds the pixel data. If the specified raster is not a sub-raster the offsets are zero.

Parameters:
raster  Pointer to the raster.
xOffset  Pointer to an RwInt16 value that will receive the x-offset.
yOffset  Pointer to an RwInt16 value that will receive the y-offset.
Returns:
Returns pointer to the raster if successful or NULL if there is an error.
See also:
RwRasterSubRaster , RwRasterGetParent
RwRaster* RwRasterGetParent const RwRaster   raster
 

RwRasterGetParent is used to retrieve the raster that the specified sub-raster references for its pixel data. If the given raster is not a sub-raster it references its own pixels and is self-parenting.

Parameters:
raster  A pointer to the raster.
Returns:
Returns a pointer to the raster's parent if successful or NULL if there is an error.
See also:
RwRasterSubRaster , RwRasterGetOffset
RwInt32 RwRasterGetPluginOffset RwUInt32    pluginID
 

RwRasterGetPluginOffset is used to get the offset of a previously registered raster plugin.

Parameters:
pluginID  An RwUInt32 value equal to the plugin ID.
Returns:
Returns an RwInt32 value equal to the data block offset if successful or -1 if the plugin is not registered.
See also:
RwRasterRegisterPlugin , RwRasterValidatePlugins
RwInt32 RwRasterGetStride const RwRaster   raster
 

RwRasterGetStride is used to retrieve the stride of the specified raster. The stride is measured in bytes per raster line and is the number of bytes that separate two vertically adjacent pixels. If the specified raster is a sub-raster this function will return the stride of its parent.

Note that the stride is only defined when the raster is locked. Calling RwRasterGetStride when the raster has not been locked will produce undefined results.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
raster  A pointer to the raster.
Returns:
Returns an RwInt32 equal to the raster's stride.
See also:
RwRasterGetDepth , RwRasterGetHeight , RwRasterGetWidth , RwRasterLock , RwRasterUnlock
RwInt32 RwRasterGetType const RwRaster   raster
 

RwRasterGetType is used to retrieve the RwRasterType of the specified raster. This describes the type of the raster, such as whether it is a texture raster (rwRASTERTYPETEXTURE), a camera raster (rwRASTERTYPECAMERA) and so on. The type of a raster is set when it is created.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
raster  A pointer to the raster.
Returns:
Returns an RwInt32 value describing the raster's type if successful or -1 if there is an error. See RwRasterType.
See also:
RwRasterCreate , RwRasterGetDepth , RwRasterGetFormat , RwRasterGetHeight , RwRasterGetStride , RwRasterGetWidth
RwInt32 RwRasterGetWidth const RwRaster   raster
 

RwRasterGetWidth is used to retrieve the width of the specified raster in pixels.

Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.

Parameters:
raster  a pointer to the raster.
Returns:
Returns an RwInt32 equal to the raster's width.
See also:
RwRasterGetDepth , RwRasterGetHeight , RwRasterGetStride
RwUInt8* RwRasterLock RwRaster   raster,
RwUInt8    level,
RwInt32    lockMode
 

RwRasterLock is used to lock the specified raster for direct pixel access according to the given lock mode. The lock prevents the device changing the raster's data while it is under the control of the application. This function also puts a valid stride in the raster for retrieval.

If the specified raster is a sub-raster, this function returns a pointer to the first sub- raster pixel. The stride of the sub-raster, however, is equal to that of the parent raster and must be used for accessing successive scan lines in the sub-raster.

The raster must be unlocked when the application has finished updating the pixel data so that the device is made aware of the changes.

Parameters:
raster  Pointer to the raster.
level  A value equal to the mipmap level to be locked. 0 is the source raster.
lockMode  A value equal to the lock mode. See RwRasterLockMode.
Returns:
Returns pointer to the raster's pixel data if successful or NULL if there is an error.
See also:
RwRasterGetStride , RwRasterLockPalette , RwRasterUnlock , RwRasterUnlockPalette
RwUInt8* RwRasterLockPalette RwRaster   raster,
RwInt32    lockMode
 

RwRasterLockPalette is used to lock the specified raster for direct palette access according to the given lock mode. The lock prevents the device changing the palette’s data while it is under the control of the application.

The palette must be unlocked when the application has finished updating the palette data so that the device is made aware of the changes.

Parameters:
raster  Pointer to the raster.
lockMode  A value equal to the lock mode. See RwRasterLockMode.
Returns:
Returns pointer to the raster's palette data if successful or NULL if there is an error.
See also:
RwRasterLock , RwRasterUnlock , RwRasterUnlockPalette
RwRaster* RwRasterPopContext void   
 

RwRasterPopContext is used to indicate that the raster on the top of the context stack is no longer to be targeted with subsequent clears and blits.

This function cannot be used between RwCameraBeginUpdate and RwCameraEndUpdate.

Returns:
Returns pointer to the raster which has been popped if successful or NULL if there is an error or if the context stack is empty.
See also:
RwRasterGetCurrentContext , RwRasterPushContext , RwRasterRender , RwRasterRenderFast , RwRasterRenderScaled
RwRaster* RwRasterPushContext RwRaster   raster
 

RwRasterPushContext is used to indicate that the specified raster is to be the target of subsequent clears and blits. Whenever any 2D rendering is performed the graphical output is stored in the raster on the top of the context stack. This function therefore selects the raster that will be rendered to.

This function cannot be used between RwCameraBeginUpdate and RwCameraEndUpdate.

Parameters:
raster  A pointer to the raster.
Returns:
Returns a pointer to the raster if successful or NULL if there is an error.
See also:
RwRasterGetCurrentContext , RwRasterPopContext , RwRasterRender , RwRasterRenderFast , RwRasterRenderScaled
RwRaster* RwRasterRead const RwChar   filename
 

RwRasterRead is used to read an image from a disk file and convert it into a raster. If the file name is not an absolute path name the current search path is used to determine in which directory the image file can be found.

The types of image files that are supported are determined by the format modules which have been registered using RwImageRegisterImageFormat. Note that the filename must include the file's extension, as this identifies the image’s type for dispatch to the correct loader module.

The raster is created as type rwRASTERTYPENORMAL and with the default depth.

Gamma correction is not applied to the raster’s image

Parameters:
filename  A pointer to a string specifying the file name of the image.
Returns:
Returns a pointer to the resulting raster if successful or NULL if there is an error.
See also:
RwRasterReadMaskedRaster , RwImageSetPath , RwImageRead , RwImageRegisterImageFormat , RwImageReadMaskedImage , RwTextureRead
RwRaster* RwRasterReadMaskedRaster const RwChar   filename,
const RwChar   maskname
 

RwRasterReadMaskedRaster is used to read two images from disk files, apply the mask contained in the second to the first and convert the result to a raster. If the file names are not absolute path names the current search path is used to determine in which directory the image files can be found.

The types of image files that are supported are determined by the format modules which have been registered using RwImageRegisterImageFormat. Note that the filename must include the file's extension, as this identifies the image’s type for dispatch to the correct loader module.

The raster is created as type rwRASTERTYPENORMAL and with the default depth.

Gamma correction is not applied to the raster’s image.

Parameters:
filename  A pointer to a file name of the first image
maskname  A pointer to a file name of the second image supplying the mask.
Returns:
Returns a pointer to the resulting raster if successful or NULL if there is an error.
See also:
RwRasterRead , RwImageSetPath , RwImageReadMaskedImage , RwImageRegisterImageFormat , RwImageRead , RwTextureRead
RwInt32 RwRasterRegisterPlugin RwInt32    size,
RwUInt32    pluginID,
RwPluginObjectConstructor    constructCB,
RwPluginObjectDestructor    destructCB,
RwPluginObjectCopy    copyCB
 

RwRasterRegisterPlugin is used to register a plugin and reserve some space within a raster. This must happen after the engine has been initialized but before the engine is opened.

Parameters:
size  An RwInt32 value equal to the size of the memory block to reserve.
pluginID  An RwUInt32 value equal to the plugin ID (must be unique - used to identify binary chunks).
constructCB  A constructor for the plugin data block.
destructCB  A destructor for the plugin data block.
copyCB  A copy constructor for the plugin data block.
Returns:
Returns an RwInt32 value equal to the byte offset within the raster of memory reserved for this plugin if successful or -1 if there is an error.
See also:
RwRasterGetPluginOffset , RwRasterValidatePlugins
RwRaster* RwRasterRender RwRaster   raster,
RwInt32    x,
RwInt32    y
 

RwRasterRender is used to render the specified raster to the currently selected render target. The current render target is the raster on top of the context stack. The rendering takes place such that the upper-left corner of the raster falls at the specified position in the destination raster and if the raster has a mask defining transparency in its alpha- channel this is taken into account. No Z-buffering of the raster with its destination is considered - this function only performs a simple blit operation. Areas of the raster which fall outside the destination are clipped before rendering takes place.

The raster itself is not changed in any way.

Use the API function RwRasterPushContext to set the current raster.

Parameters:
raster  Pointer to the raster.
x  A RwInt32 value equal to the destination x-position.
y  A RwInt32 value equal to the destination y-position.
Returns:
Returns pointer to the raster if successful or NULL if there is an error.
See also:
RwRasterRenderScaled , RwRasterRenderFast , RwRasterPopContext , RwRasterPushContext
RwRaster* RwRasterRenderFast RwRaster   raster,
RwInt32    x,
RwInt32    y
 

RwRasterRenderFast is used to render the specified raster to the currently selected render target. The current render target is the raster on top of the context stack. Unlike RwRasterRender, transparency information in the raster, if any, is not considered in the rendering, making this function considerably faster. The rendering takes place such that the upper-left corner of the raster falls at the specified position in the destination raster. No Z-buffering of the raster with its destination is considered - this function only performs a simple blit operation. Areas of the raster which fall outside the destination are clipped before rendering takes place.

The raster itself is not changed in any way.

Use the API function RwRasterPushContext to set the current raster.

Parameters:
raster  A pointer to the raster
x  An RwInt32 value equal to the destination x-position
y  An RwInt32 value equal to the destination y-position.
Returns:
Returns pointer to the raster if successful or NULL if there is an error.
See also:
RwRasterRender , RwRasterRenderScaled , RwRasterPopContext , RwRasterPushContext
RwRaster* RwRasterRenderScaled RwRaster   raster,
RwRect   rect
 

RwRasterRenderScaled is used to render the specified raster to the given rectangular region in the currently selected render target. The current render target is the raster on top of the context stack. If the raster has a mask defining transparency in its alpha-channel this is taken into account. No Z-buffering of the raster with its destination is considered - this function only performs a simple blit operation. The size of the specified rectangle determines the area in the destination raster where rendering takes place. The raster is scaled to fit this region, using pixel replication or averaging, as appropriate. Areas of the raster (after scaling) which fall outside the destination are clipped before rendering takes place.

The raster itself is not changed in any way.

Use the API function RwRasterPushContext to set the current raster.

Parameters:
raster  A pointer to the raster.
rect  A pointer to an RwRect value describing the region in the destination raster where rendering takes place.
Returns:
Returns pointer to the raster if successful or NULL if there is an error.
See also:
RwRasterRender , RwRasterRenderFast , RwRasterPopContext , RwRasterPushContext
void RwRasterSetFreeListCreateParams RwInt32    blockSize,
RwInt32    numBlocksToPrealloc
 

RwRasterSetFreeListCreateParams allows the developer to specify how many RwRaster s to preallocate space for. Call before RwEngineOpen.

Parameters:
blockSize  number of entries per freelist block.
numBlocksToPrealloc  number of blocks to allocate on RwFreeListCreateAndPreallocateSpace.
See also:
RwFreeList
RwRaster* RwRasterSetFromImage RwRaster   raster,
RwImage   image
 

RwRasterSetFromImage is used to change the pixels of the specified raster to those of the given image. The width and height of the image must be equal to those of the raster.

If the raster is locked before calling this function then the pixel data is put into the currently locked mip level of the raster, and the lock is not released afterwards. Otherwise the raster is locked at mip level 0 in order to set the pixel data and then unlocked afterwards.

Parameters:
raster  Pointer to the raster whose pixels will be changed
image  Pointer to the image providing the pixel data.
Returns:
Returns pointer to the raster if successful or NULL if there is an error.
See also:
RwImageSetFromRaster , RwRasterCreate
RwRaster* RwRasterShowRaster RwRaster   raster,
void *    dev,
RwUInt32    flags
 

RwRasterShowRaster is used to copy the specified raster to the display device. The raster must be of type rwRASTERTYPECAMERA.

Parameters:
raster  A pointer to the raster.
dev  A device-dependent parameter, e.g. for Windows applications the handle of the output window returned by CreateWindow (type HWND).
flags  An RwUInt32 bit-field value equal to the raster display options (type RwRasterFlipMode):
  • rwRASTERFLIPWAITVSYNC - Wait for the next vertical retrace on the output device, if possible, before displaying (full-screen applications only). Specify zero otherwise.
Returns:
Returns a pointer to the raster if successful or NULL if there is an error.
See also:
RwCameraShowRaster , RwRasterCreate , RwRasterGetFormat , RwRasterGetType
RwRaster* RwRasterSubRaster RwRaster   subRaster,
RwRaster   raster,
RwRect   rect
 

RwRasterSubRaster is used to define a raster that references a rectangular sub-region in another raster. The sub-region must be wholly contained within the bounds of the raster it references. It is necessary that the sub-raster is created with zero width and height so that no memory is actually allocated for the raster's pixel data (which would become unused). Hence, the sub-raster acts as a place-holder whose pixel pointer references the pixel data in another raster covered by the specified rectangle.

Parameters:
subRaster  A pointer to the sub-raster.
raster  A pointer to the parent raster.
rect  A pointer to a RwRect describing the rectangular sub-region.
Returns:
Returns a pointer to the sub-raster if successful or NULL if there is an error.
See also:
RwRasterCreate , RwRasterGetParent , RwRasterGetOffset
RwRaster* RwRasterUnlock RwRaster   raster
 

RwRasterUnlock is used to unlock the specified raster, following a call to RwRasterLock, allowing it to be used by the device again.

Parameters:
raster  A pointer to the raster.
Returns:
Returns a pointer to the raster if successful or NULL if there is an error.
See also:
RwRasterLock , RwRasterLockPalette , RwRasterUnlockPalette
RwRaster* RwRasterUnlockPalette RwRaster   raster
 

RwRasterUnlockPalette is used to unlock the specified raster’s palette, following a call to RwRasterLockPalette, allowing it to be used by the device again.

Parameters:
raster  A pointer to the raster.
Returns:
Returns a pointer to the raster if successful or NULL if there is an error.
See also:
RwRasterLock , RwRasterLockPalette , RwRasterUnlock
RwBool RwRasterValidatePlugins const RwRaster   raster
 

RwRasterValidatePlugins is used to validate the plugin memory allocated within the specified raster. This function is useful for determining where memory trampling may be occurring within an application.

This function only returns a meaningful response under a debug library.

Parameters:
raster  A pointer to the raster to validate.
Returns:
Returns TRUE is the raster data is valid or FALSE if there is an error or if the raster data has become corrupt.
See also:
RwRasterRegisterPlugin , RwRasterGetPluginOffset

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:15 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)