Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RwIm3D
[Immediate Mode]


Modules

PlayStation 2

Enumerations

enum   RwIm3DTransformFlags {
  rwIM3D_VERTEXUV = 1, rwIM3D_ALLOPAQUE = 2, rwIM3D_NOCLIP = 4, rwIM3D_VERTEXXYZ = 8,
  rwIM3D_VERTEXRGBA = 16, rwIM3DTRANSFORMFLAGSFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}

Functions

void *  RwIm3DTransform (RwIm3DVertex *pVerts, RwUInt32 numVerts, RwMatrix *ltm, RwUInt32 flags)
RwBool  RwIm3DEnd (void)
RwBool  RwIm3DRenderIndexedPrimitive (RwPrimitiveType primType, RwImVertexIndex *indices, RwInt32 numIndices)
RwBool  RwIm3DRenderPrimitive (RwPrimitiveType primType)
RwBool  RwIm3DRenderTriangle (RwInt32 vert1, RwInt32 vert2, RwInt32 vert3)
RwBool  RwIm3DRenderLine (RwInt32 vert1, RwInt32 vert2)
RxPipeline RwIm3DGetTransformPipeline (void)
RxPipeline RwIm3DGetRenderPipeline (RwPrimitiveType primType)
RxPipeline RwIm3DSetTransformPipeline (RxPipeline *pipeline)
RxPipeline RwIm3DSetRenderPipeline (RxPipeline *pipeline, RwPrimitiveType primType)

Detailed Description

3D immediate mode support

RwIm3D Overview

Requirements

Overview

This object exposes RenderWare Graphics' 3D Immediate Mode API.

3D Immediate Mode is the lowest-level 3D graphics rendering API available within RenderWare and is always available. It makes use of hardware acceleration and is most often used together with RenderWare's default scene graph API, RpWorld, to add additional 'chrome' to a rendered scene.

Your target platform may be provided with additional, platform-specific Immediate Mode functionality. Check the platform-specific SDK documentation for more details.


Enumeration Type Documentation

enum RwIm3DTransformFlags
 

RwIm3DTransformFlags The bit-field type RwIm3DTransformFlags specifies options available for controlling execution of the 3D immediate mode pipeline (see API function RwIm3DTransform):

Enumeration values:
rwIM3D_VERTEXUV  Texture coordinates in source vertices should be used
rwIM3D_ALLOPAQUE  All source vertices are opaque (alpha is 255)
rwIM3D_NOCLIP  No clipping should be performed on the geometry (the app may know it is all onscreen or within the guard band clipping region for the current hardware, so clipping can be skipped)
rwIM3D_VERTEXXYZ  Vertex positions
rwIM3D_VERTEXRGBA  Vertex color

Function Documentation

RwBool RwIm3DEnd void   
 

RwIm3DEnd is used to indicate that the application has finished using the transformed 3D immediate mode vertices and they can be discarded by the engine. After this is called, other pipelines may be executed since the global heap (see RxHeapGetGlobalHeap) will have been cleared.

Returns:
TRUE on success, FALSE otherwise.
See also:
RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline
RxPipeline* RwIm3DGetRenderPipeline RwPrimitiveType    primType
 

RwIm3DGetRenderPipeline returns the current RwIm3D render pipeline associated with a given primitive type

RwIm3D render pipelines do not perform lighting. They merely clip, cull and submit triangles to the rasterizer.

The default RwIm3D transform pipeline is platform-specific, see RwIm3DGetRenderPipeline (platform-specific) for details.

Parameters:
primType  An RwPrimitiveType equal to the primitive type.
Returns:
A pointer to the current RwIm3D render pipeline for the specified primitive type on success, otherwise NULL.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline
RxPipeline* RwIm3DGetTransformPipeline void   
 

RwIm3DGetTransformPipeline returns the current RwIm3D transform pipeline.

The RwIm3D transform pipeline transforms the vertices submitted to RwIm3DTransform, generating camera-space and screen-space vertices and caching these in a packet when the pipeline is interrupted. When the pipeline is resumed by a call to a RwIm3D render function, primitive information (usually including indices) is added into the packet and it is dispatched to the appropriate RwIm3D render pipeline for the specified primitive type.

The default RwIm3D transform pipeline is platform-specific, see RwIm3DGetTransformPipeline (platform-specific) for details.

Returns:
A pointer to the current RwIm3D transform pipeline on success, otherwise NULL.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline
RwBool RwIm3DRenderIndexedPrimitive RwPrimitiveType    primType,
RwImVertexIndex   indices,
RwInt32    numIndices
 

RwIm3DRenderIndexedPrimitive executes the remainder of the RwIm3D transform pipeline, (internally passing in the cached packets containing the transformed vertices) and specifying the primitive type and index data in the (void *)data parameter of RxPipelineExecute.

Parameters:
primType  RwPrimitiveType primitive type
indices  pointer to RwImVertexIndex array of indices
numIndices  RwInt32 number of Indices in the primitive.
Returns:
Returns TRUE on success, FALSE on error.
See also:
RwIm3DEnd , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline
RwBool RwIm3DRenderLine RwInt32    vert1,
RwInt32    vert2
 

RwIm3DRenderLine executes the remainder of the RwIm3D transform pipeline, (internally passing in the cached packets containing the transformed vertices) and specifying the primitive type and index data in the (void *)data parameter of RxPipelineExecute. It effectively renders a one-triangle line list.

This function is very inefficient and should not be used to render many individual lines - for that purpose use RwIm3DRenderPrimitive or RwIm3DRenderIndexedPrimitive.

Parameters:
vert1  RwInt32 index of the first vertex in the line
vert2  RwInt32 index of the second vertex in the line.
Returns:
Returns TRUE on success, FALSE on error.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline
RwBool RwIm3DRenderPrimitive RwPrimitiveType    primType
 

RwIm3DRenderPrimitive executes the remainder of the RwIm3D transform pipeline, (internally passing in the cached packets containing the transformed vertices) and specifying the primitive type and index data in the (void *)data parameter of RxPipelineExecute.

Parameters:
primType  An RwPrimitiveType equal to the primitive type.
Returns:
Returns TRUE on success, FALSE on error.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline
RwBool RwIm3DRenderTriangle RwInt32    vert1,
RwInt32    vert2,
RwInt32    vert3
 

RwIm3DRenderTriangle executes the remainder of the RwIm3D transform pipeline, (internally passing in the cached packets containing the transformed vertices) and specifying the primitive type and index data in the (void *) data parameter of RxPipelineExecute. It effectively renders a one-triangle triangle list.

This function is very inefficient and should not be used to render many individual triangles - for that purpose use RwIm3DRenderPrimitive or RwIm3DRenderIndexedPrimitive.

Parameters:
vert1  RwInt32 index of the first vertex in the triangle
vert2  RwInt32 index of the second vertex in the triangle
vert3  RwInt32 index of the third vertex in the triangle.
Returns:
Returns TRUE on success, FALSE on error.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline
RxPipeline* RwIm3DSetRenderPipeline RxPipeline   pipeline,
RwPrimitiveType    primType
 

RwIm3DSetRenderPipeline sets the RwIm3D render pipeline associated with a given primitive type.

Parameters:
pipeline  A pointer to the RxPipeline to make the current RwIm3D render pipeline for the specified primitive type - if NULL is passed, the default pipeline is restored
primType  An RwPrimitiveType equal to the primitive type.
Returns:
updated current RwIm3D transform pipeline.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetTransformPipeline
RxPipeline* RwIm3DSetTransformPipeline RxPipeline   pipeline
 

RwIm3DSetTransformPipeline sets the RwIm3D transform pipeline.

Parameters:
pipeline  A pointer to the RxPipeline to make the current RwIm3D transform pipeline - if NULL is passed, the default pipeline is restored.
Returns:
A pointer to the updated current RwIm3D transform pipeline.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DTransform , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline
void* RwIm3DTransform RwIm3DVertex   pVerts,
RwUInt32    numVerts,
RwMatrix   ltm,
RwUInt32    flags
 

RwIm3DTransform is used to transform the given vertices into the current camera in preparation for rendering. Following transformation there exists an array of camera space vertices, together with an array of screen space (device-dependent) vertices for those which lie in the camera's frustum.

This function executes the immediate mode transform pipeline, which is accessible through RwIm3DGetTransformPipeline. This transforms the vertices into world space and caches them ready for rendering by subsequent calls to RwIm3D render functions. These vertices are cached and can be used by any number of RwIm3D rendering functions until RwIm3DEnd is called, at which point the vertices are discarded.

Note that because RwIm3D behaves (from the point of view of the API and the application) exactly as it did with the old RenderWare Graphics pipeline, there are some restrictions due to the details of the implementation using the new flexible pipeline code. In-between a RwIm3DTransform and RwIm3DEnd pair, no other pipeline execution, that is, anything which calls RxPipelineExecute - can take place. This is because the caching of the vertices requires the global heap - see RxHeapGetGlobalHeap - to remain uncleared. Executing other pipelines would clear the heap. There will be a successor to RwIm3D which will work more cleanly with the new PowerPipe functionality and which will not have these restrictions, but that is not yet available.

This function takes an optional matrix which is concatenated onto the world-to-camera matrix before vertices are transformed. This is useful if the vertices are in object space, in which case the argument should be the local transformation matrix.

Note:
The RwIm3DTransformFlags flags rwIM3D_VERTEXXYZ and rwIM3D_VERTEXRGBA are added automatically by this function, thus requiring at least positional and color information in the pVerts data.
Parameters:
pVerts  A pointer to the RwIm3DVertex array to transform
numVerts  An RwInt32 value equal to the number of vertices to transform
ltm  A pointer to the object-to-world matrix, or NULL if the vertices are provided in world space
flags  flags of type RwIm3DTransformFlags.
Returns:
Returns the vertex array if successful, otherwise NULL.
See also:
RwIm3DEnd , RwIm3DRenderIndexedPrimitive , RwIm3DRenderLine , RwIm3DRenderPrimitive , RwIm3DRenderTriangle , RwIm3DGetRenderPipeline , RwIm3DGetRenderPipeline (platform-specific) , RwIm3DGetTransformPipeline , RwIm3DGetTransformPipeline (platform-specific) , RwIm3DSetRenderPipeline , RwIm3DSetTransformPipeline

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