Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

D3D9
[RwEngine]


Modules

Device Cache
Metrics

Functions

RwUInt32 RwD3D9EngineGetMaxMultiSamplingLevels (void)
void RwD3D9EngineSetMultiSamplingLevels (RwUInt32 numLevels)
void RwD3D9EngineSetRefreshRate (RwUInt32 refreshRate)
void RwD3D9EngineSetMultiThreadSafe (RwBool enable)
void RwD3D9EngineSetSoftwareVertexProcessing (RwBool enable)
RwBool RwD3D9ChangeVideoMode (RwInt32 modeIndex)
RwBool RwD3D9ChangeMultiSamplingLevels (RwUInt32 numLevels)
RwBool RwD3D9DeviceSupportsDXTTexture (void)
void RwD3D9SetStencilClear (RwUInt32 stencilClear)
RwUInt32 RwD3D9GetStencilClear (void)
void * RwD3D9GetCurrentD3DDevice (void)
void * RwD3D9GetCurrentD3DRenderTarget (RwUInt32 index)
RwBool RwD3D9SetRenderTarget (RwUInt32 index, RwRaster *raster)
void RwD3D9SetFVF (RwUInt32 fvf)
void RwD3D9SetVertexDeclaration (void *vertexDeclaration)
void RwD3D9SetVertexShader (void *shader)
void RwD3D9SetPixelShader (void *shader)
void RwD3D9SetStreamSource (RwUInt32 streamNumber, void *streamData, RwUInt32 offset, RwUInt32 stride)
void RwD3D9SetIndices (void *indexBuffer)
void RwD3D9DrawIndexedPrimitiveUP (RwUInt32 primitiveType, RwUInt32 minIndex, RwUInt32 numVertices, RwUInt32 primitiveCount, const void *indexData, const void *vertexStreamZeroData, RwUInt32 vertexStreamZeroStride)
void RwD3D9DrawPrimitiveUP (RwUInt32 primitiveType, RwUInt32 primitiveCount, const void *vertexStreamZeroData, RwUInt32 vertexStreamZeroStride)
void RwD3D9DrawIndexedPrimitive (RwUInt32 primitiveType, RwInt32 baseVertexIndex, RwUInt32 minIndex, RwUInt32 numVertices, RwUInt32 startIndex, RwUInt32 primitiveCount)
void RwD3D9DrawPrimitive (RwUInt32 primitiveType, RwUInt32 startVertex, RwUInt32 primitiveCount)
RwBool RwD3D9SetTransform (RwUInt32 state, const void *matrix)
void RwD3D9GetTransform (RwUInt32 state, void *matrix)
RwBool RwD3D9SetTransformWorld (const RwMatrix *matrix)
RwBool RwD3D9SetLight (RwInt32 index, const void *light)
void RwD3D9GetLight (RwInt32 index, void *light)
RwBool RwD3D9EnableLight (RwInt32 index, RwBool enable)
RwBool RwD3D9IndexBufferCreate (RwUInt32 numIndices, void **indexBuffer)
RwBool RwD3D9CreateVertexDeclaration (const void *elements, void **vertexdeclaration)
void RwD3D9DeleteVertexDeclaration (void *vertexdeclaration)
RwBool RwD3D9CreateVertexShader (const RwUInt32 *function, void **shader)
void RwD3D9DeleteVertexShader (void *shader)
void RwD3D9SetVertexShaderConstant (RwUInt32 registerAddress, const void *constantData, RwUInt32 constantCount)
RwBool RwD3D9CreatePixelShader (const RwUInt32 *function, void **shader)
void RwD3D9DeletePixelShader (void *shader)
void RwD3D9SetPixelShaderConstant (RwUInt32 registerAddress, const void *constantData, RwUInt32 constantCount)
const void * RwD3D9GetCaps (void)
RwBool RwD3D9SetMaterial (const void *material)
RwBool RwD3D9SetClipPlane (RwUInt32 index, const RwV4d *plane)
RwBool RwD3D9SetSurfaceProperties (const RwSurfaceProperties *surfaceProps, const RwRGBA *color, RwUInt32 flags)
RwBool RwD3D9SetTexture (RwTexture *texture, RwUInt32 stage)
RwBool RwD3D9CreateVertexBuffer (RwUInt32 stride, RwUInt32 size, void **vertexBuffer, RwUInt32 *offset)
void RwD3D9DestroyVertexBuffer (RwUInt32 stride, RwUInt32 size, void *vertexBuffer, RwUInt32 offset)
void RwD3D9VertexBufferManagerChangeDefaultSize (RwUInt32 defaultSize)
RwBool RwD3D9DynamicVertexBufferCreate (RwUInt32 size, void **vertexBuffer)
void RwD3D9DynamicVertexBufferDestroy (void *vertexBuffer)
RwBool RwD3D9DynamicVertexBufferLock (RwUInt32 vertexSize, RwUInt32 numVertex, void **vertexBufferOut, void **vertexDataOut, RwUInt32 *baseIndexOut)
RwBool RwD3D9DynamicVertexBufferUnlock (void *vertexBufferIn)

Detailed Description

Platform specific

Function Documentation

RwBool RwD3D9ChangeMultiSamplingLevels RwUInt32    numLevels
 

RwD3D9ChangeMultiSamplingLevels is used to force an immediate change of the multisampling levels.

This function should be called before any graphics are rendered or immediately after RwRasterShowRaster or RwCameraShowRaster and before the next frame is submitted.

Note:
This function can not be called before RwEngineStart.
Parameters:
numLevels  Number of multisampling levels. A value of 1 means that multisampling is disabled.
Returns:
Returns TRUE if successful, FALSE otherwise.
See also:
RwD3D9EngineGetMaxMultiSamplingLevels

RwBool RwD3D9ChangeVideoMode RwInt32    modeIndex
 

RwD3D9ChangeVideoMode is used to force an immediate change of video mode.

This function should be called before any graphics are rendered or immediately after RwRasterShowRaster or RwCameraShowRaster and before the next frame is submitted.

Note:
This function can not be called before RwEngineStart.
Parameters:
modeIndex  An RwInt32 value equal to the video mode's index.
Returns:
Returns TRUE if successful, FALSE otherwise.
See also:
RwEngineGetNumVideoModes , RwEngineGetCurrentVideoMode , RwEngineGetVideoModeInfo

RwBool RwD3D9CreatePixelShader const RwUInt32   function,
void **    shader
 

RwD3D9CreatePixelShader creates a pixel shader.

Parameters:
function  Pointer to the pixel shader function token array, specifying the blending operations. This value cannot be NULL.
shader  Pointer to the returned pixel shader.
Returns:
TRUE if the pixel shader was created successfully, FALSE otherwise.
See also:
RwD3D9DeletePixelShader , RwD3D9SetPixelShader , RwD3D9SetPixelShaderConstant

RwBool RwD3D9CreateVertexBuffer RwUInt32    stride,
RwUInt32    size,
void **    vertexBuffer,
RwUInt32   offset
 

RwD3D9CreateVertexBuffer creates a managed vertex buffer of a specified size aligned to the stride provided.

The vertex buffer manager tries to share the same vertex buffer across different atomics and world sectors to reduce the number of vertex buffer switches at runtime. That is the reason this function returns an offset, to indicate the beginning of the allocated block on the shared vertex buffer.

Parameters:
stride  Size of the vertex in bytes. This value must be a multiple of 4.
size  Size of the buffer in bytes. This must be large enough to store at least one vertex of the format requested.
vertexBuffer  Void pointer to the LPDIRECT3DVERTEXBUFFER9 that is to be the vertex buffer.
offset  Offset from the beginning of the shared vertex buffer.
Returns:
TRUE if the vertex buffer was successfully created, FALSE otherwise.
See also:
RwD3D9DestroyVertexBuffer , RwD3D9DynamicVertexBufferCreate , RwD3D9DynamicVertexBufferDestroy

RwBool RwD3D9CreateVertexDeclaration const void *    elements,
void **    vertexdeclaration
 

RwD3D9CreateVertexDeclaration creates a vertex declaration.

Parameters:
elements  Pointer to the vertex declaration elements.
vertexdeclaration  Pointer to the returned vertex declaration. This value cannot be set as NULL.
Returns:
TRUE if the vertex shader was created successfully, FALSE otherwise.
See also:
RwD3D9DeleteVertexDeclaration , RwD3D9SetVertexDeclaration

RwBool RwD3D9CreateVertexShader const RwUInt32   function,
void **    shader
 

RwD3D9CreateVertexShader creates a vertex shader and if created successfully sets that shader as the current shader.

A vertex shader is defined by two token arrays that specify the declaration and function of the shader. The token arrays are composed of single or multiple DWORD tokens terminated by a special 0xFFFFFFFF token value.

The shader declaration defines the static external interface of the shader, including binding of stream data to vertex register inputs and values loaded into the shader constant memory. The shader function defines the operation of the shader as an array of instructions that are executed in order for each vertex processed during the time the shader is bound to a device. Shaders created without a function array apply the fixed function vertex processing when that shader is current.

Parameters:
function  Pointer to the vertex shader function token array. This parameter defines the operations to apply to each vertex. This value cannot be set as NULL.
shader  Pointer to the returned vertex shader. This value cannot be set as NULL.
Returns:
TRUE if the vertex shader was created successfully, FALSE otherwise.
See also:
RwD3D9DeleteVertexShader , RwD3D9SetVertexShader , RwD3D9SetVertexShaderConstant

void RwD3D9DeletePixelShader void *    shader
 

RwD3D9DeletePixelShader deletes the pixel shader referred to by the specified pointer.

Parameters:
shader  Pixel shader pointer, identifying the pixel shader to be deleted.
See also:
RwD3D9CreatePixelShader , RwD3D9SetPixelShader , RwD3D9SetPixelShaderConstant

void RwD3D9DeleteVertexDeclaration void *    vertexdeclaration
 

RwD3D9DeleteVertexDeclaration deletes the vertex declaration referred to by the specified pointer and frees up the associated resources.

Parameters:
vertexdeclaration  Vertex declaration pointer, identifying the vertex declaration to be deleted.
See also:
RwD3D9CreateVertexDeclaration , RwD3D9SetVertexDeclaration

void RwD3D9DeleteVertexShader void *    shader
 

RwD3D9DeleteVertexShader deletes the vertex shader referred to by the specified pointer and frees up the associated resources.

Parameters:
shader  Vertex shader pointer, identifying the vertex shader to be deleted.
See also:
RwD3D9CreateVertexShader , RwD3D9SetVertexShader , RwD3D9SetVertexShaderConstant

void RwD3D9DestroyVertexBuffer RwUInt32    stride,
RwUInt32    size,
void *    vertexBuffer,
RwUInt32    offset
 

RwD3D9DestroyVertexBuffer releases a block of a previously allocated managed vertex buffer. This block could either be a part of or the whole of the vertex buffer. The stride, size and offset parameters are used to identify the block in the vertex buffer.

Parameters:
stride  Size of the vertex in bytes. This value must be a multiple of 4.
size  Size of the buffer in bytes. This must be large enough to store at least one vertex of the format requested.
vertexBuffer  Void pointer to the LPDIRECT3DVERTEXBUFFER9 that is to be released.
offset  Offset from the beginning of the shared vertex buffer.
See also:
RwD3D9CreateVertexBuffer , RwD3D9DynamicVertexBufferCreate , RwD3D9DynamicVertexBufferDestroy

RwBool RwD3D9DeviceSupportsDXTTexture void   
 

RwD3D9DeviceSupportsDXTTexture is used to query the D3D9 device as to whether D3D9 compressed textures can be loaded as RenderWare textures. If this function returns TRUE, RwD3D9DDSTextureRead will load compressed DDS files into RenderWare textures.

Note that this function must be called after RwEngineStart.

Returns:
Returns TRUE if compressed textures can be loaded as RenderWare textures or FALSE otherwise.
See also:
RwD3D9DDSTextureRead , RwEngineStart

void RwD3D9DrawIndexedPrimitive RwUInt32    primitiveType,
RwInt32    baseVertexIndex,
RwUInt32    minIndex,
RwUInt32    numVertices,
RwUInt32    startIndex,
RwUInt32    primitiveCount
 

RwD3D9DrawIndexedPrimitive renders the specified geometric primitive, based on indexing into an array of vertices.

This function draws indexed primitives from the current set of data input streams.

It is advised that you batch primitives when calling this function to maximize efficiency.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::DrawIndexedPrimitive since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
primitiveType  Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.
baseVertexIndex  Offset from the start of the vertex buffer to the first vertex index.
minIndex  Minimum vertex index, relative to baseVertexIndex, for vertices used during this call.
numVertices  The number of vertices used during this call starting from baseVertexIndex + minIndex.
startIndex  Location in the index array to start reading indices.
primitiveCount  Number of primitives to render.
See also:
RwD3D9DrawPrimitive , RwD3D9DrawPrimitiveUP , RwD3D9DrawIndexedPrimitiveUP , RwD3D9SetVertexShader , RwD3D9SetPixelShader , RwD3D9SetStreamSource , RwD3D9SetIndices

void RwD3D9DrawIndexedPrimitiveUP RwUInt32    primitiveType,
RwUInt32    minIndex,
RwUInt32    numVertices,
RwUInt32    primitiveCount,
const void *    indexData,
const void *    vertexStreamZeroData,
RwUInt32    vertexStreamZeroStride
 

RwD3D9DrawIndexedPrimitiveUP renders the specified geometric primitive, based on indexing into an array of vertices with data specified by a user memory pointer.

This function is intended for use in applications that are unable to store their vertex data in vertex buffers. This method supports only a single vertex stream. The effect of this call is to use the provided vertex data pointer and stride for vertex stream zero.

It is advised that you batch primitives when calling this function to maximize efficiency. Also it should be noted that the user memory pointer functions are slower than those that use a D3D9 vertex buffer.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::DrawIndexedPrimitiveUP since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
primitiveType  Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.
minIndex  Minimum vertex index, relative to zero (the start of indexData), for vertices used during this call.
numVertices  Number of vertices used during this call; starting from minIndex.
primitiveCount  Number of primitives to render.
indexData  User memory pointer to the index data.
vertexStreamZeroData  User memory pointer to the vertex data.
vertexStreamZeroStride  The size of each vertex, in bytes.
See also:
RwD3D9DrawPrimitiveUP , RwD3D9DrawIndexedPrimitive , RwD3D9DrawPrimitive , RwD3D9SetVertexShader , RwD3D9SetPixelShader

void RwD3D9DrawPrimitive RwUInt32    primitiveType,
RwUInt32    startVertex,
RwUInt32    primitiveCount
 

RwD3D9DrawPrimitive renders a sequence of non-indexed, geometric primitives of the specified type from the current set of data input streams.

It is advised that you batch primitives when calling this function to maximize efficiency.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::DrawPrimitive since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
primitiveType  Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.
startVertex  Index of the first vertex to load. Beginning at startVertex the correct number of vertices will be read out of the current vertex buffer.
primitiveCount  Number of primitives to render.
See also:
RwD3D9DrawIndexedPrimitive , RwD3D9DrawPrimitiveUP , RwD3D9DrawIndexedPrimitiveUP , RwD3D9SetVertexShader , RwD3D9SetPixelShader , RwD3D9SetStreamSource , RwD3D9SetIndices

void RwD3D9DrawPrimitiveUP RwUInt32    primitiveType,
RwUInt32    primitiveCount,
const void *    vertexStreamZeroData,
RwUInt32    vertexStreamZeroStride
 

RwD3D9DrawPrimitiveUP renders the specified non-indexed geometric primitive with data specified by a user memory pointer.

This function is intended for use in applications that are unable to store their vertex data in vertex buffers. This method supports only a single vertex stream. The effect of this call is to use the provided vertex data pointer and stride for vertex stream zero.

It is advised that you batch primitives when calling this function to maximize efficiency. Also it should be noted that the user memory pointer functions are slower than those that use a D3D9 vertex buffer.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::DrawPrimitiveUP since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
primitiveType  Member of the D3DPRIMITIVETYPE enumerated type, describing the type of primitive to render.
primitiveCount  Number of primitives to render.
vertexStreamZeroData  User memory pointer to the vertex data.
vertexStreamZeroStride  The size of each vertex, in bytes.
See also:
RwD3D9DrawIndexedPrimitiveUP , RwD3D9DrawIndexedPrimitive , RwD3D9DrawPrimitive , RwD3D9SetVertexShader , RwD3D9SetPixelShader

RwBool RwD3D9DynamicVertexBufferCreate RwUInt32    size,
void **    vertexBuffer
 

RwD3D9DynamicVertexBufferCreate creates a vertex buffer of a specified size.

If an "unused" buffer already exists, of the same size, then this will be used in preference to constructing a new vertex buffer.

Otherwise, a new vertex buffer is created. If the host video card driver supports hardware TnL then it will created in video memory, otherwise in system memory.

While RWD3D9 maintains it's internal cache, vertex buffers will function at optimum performance.

Parameters:
size  Size of the buffer in bytes. This must be large enough to store at least one vertex of the format requested.
vertexBuffer  Void pointer to the LPDIRECT3DVERTEXBUFFER9 that is to be the vertex buffer.
Returns:
TRUE if the vertex buffer was successfully created, FALSE otherwise.
See also:
RwD3D9DynamicVertexBufferDestroy , RwD3D9CreateVertexBuffer , RwD3D9DestroyVertexBuffer

void RwD3D9DynamicVertexBufferDestroy void *    vertexBuffer
 

RwD3D9DynamicVertexBufferDestroy destroys a previously created vertex buffer.

To be precise, the vertex buffer is not deallocated from memory, but is instead declared to be "unused", and may therefore be reused by a future call to RwD3D9DynamicVertexBufferCreate should the size and vertex formats requested coincide.

Parameters:
vertexBuffer  Void pointer to the vertex buffer to destroy.
See also:
RwD3D9DynamicVertexBufferCreate , RwD3D9CreateVertexBuffer , RwD3D9DestroyVertexBuffer

RwBool RwD3D9DynamicVertexBufferLock RwUInt32    vertexSize,
RwUInt32    numVertex,
void **    vertexBufferOut,
void **    vertexDataOut,
RwUInt32   baseIndexOut
 

RwD3D9DynamicVertexBufferLock locks an available section of an internally managed dynamic vertex buffer ready for use by an application. The vertex format size and number of vertices required defines the size of the section in the vertex buffer. Pointers to the vertex buffer and the start of the vertex data are returned through vertexBufferOut and vertexDataOut, respectively. The base index of the vertex data block in the vertex buffer is also returned in baseIndexOut.

Warning:
It is advisable not to use any D3D9 functions on vertexBufferOut since this will interfere with the internal management of the vertex buffers resulting in undefined behavior from RWD3D9.
Note:
The vertex buffer manager running on these internally defined vertex buffers is different from that which manages user-created vertex buffers with RwD3D9DynamicVertexBufferCreate and RwD3D9DynamicVertexBufferDestroy.
Parameters:
vertexSize  Size of the vertex format to use in the vertex buffer, in bytes.
numVertex  Number of vertices of the desired format to use in the vertex buffer.
vertexBufferOut  Void pointer to the locked vertex buffer.
vertexDataOut  Void pointer to the available vertex data block.
baseIndexOut  Base index to the available vertex data block.
Returns:
TRUE upon successfully locking a vertex buffer, FALSE otherwise.
See also:
RwD3D9DynamicVertexBufferCreate , RwD3D9DynamicVertexBufferDestroy , RwD3D9DynamicVertexBufferUnlock , RwD3D9CreateVertexBuffer , RwD3D9DestroyVertexBuffer

RwBool RwD3D9DynamicVertexBufferUnlock void *    vertexBufferIn
 

RwD3D9DynamicVertexBufferUnlock unlocks a previously locked internally managed vertex buffer that was provided through RwD3D9DynamicVertexBufferLock.

Note:
The vertex buffer manager running on these internally defined vertex buffers is different from that which manages user-created vertex buffers with RwD3D9DynamicVertexBufferCreate and RwD3D9DynamicVertexBufferDestroy.
Parameters:
vertexBufferIn  Void pointer to the vertex buffer to unlock.
Returns:
TRUE upon successfully unlocking the vertex buffer, FALSE otherwise.
See also:
RwD3D9DynamicVertexBufferCreate , RwD3D9DynamicVertexBufferDestroy , RwD3D9DynamicVertexBufferLock

RwBool RwD3D9EnableLight RwInt32    index,
RwBool    enable
 

RwD3D9EnableLight enables or disables a set of lighting parameters.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::EnableLight since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
index  Zero-based index of the set of lighting properties that are the target of this function.
enable  Value that indicates if the set of lighting parameters are being enabled or disabled. Set this parameter to TRUE to enable lighting with the parameters at the specified index, or FALSE to disable it.
Returns:
TRUE if the function succeeds, FALSE otherwise.
See also:
RwD3D9SetLight , RwD3D9GetLight

RwUInt32 RwD3D9EngineGetMaxMultiSamplingLevels void   
 

RwD3D9EngineGetMaxMultiSamplingLevels returns the maximum available levels of multisampling for the current subsystem and video mode.

Call this function after RwEngineOpen and before RwEngineStart.

Returns:
Returns maximum levels of multisampling for the current subsystem and video mode. A value of 1 means that the current subsystem and video mode doesn't support multisampling.
See also:
RwD3D9EngineSetMultiSamplingLevels , RwEngineOpen , RwEngineSetSubSystem , RwEngineSetVideoMode , RwEngineStart

void RwD3D9EngineSetMultiSamplingLevels RwUInt32    numLevels
 

RwD3D9EngineSetMultiSamplingLevels sets the number of multisampling levels for the current subsystem and video mode.

Call this function after RwEngineOpen and before RwEngineStart.

If the current subsystem and video mode doesn't support the specified number of multisampling levels, RWD3D9 will choose the highest number of supported multisampling levels below that which was specified.

Note that changing the current subsystem or the current video mode will reset the number of multisampling levels to 1.

Parameters:
numLevels  Number of multisampling levels. A value of 1 means that multisampling is disabled.
See also:
RwD3D9EngineGetMaxMultiSamplingLevels , RwEngineOpen , RwEngineSetSubSystem , RwEngineSetVideoMode , RwEngineStart

void RwD3D9EngineSetMultiThreadSafe RwBool    enable
 

RwD3D9EngineSetMultiThreadSafe indicates that the application requests Direct3D to be multithread safe. This makes Direct3D take its global critical section more frequently, which can degrade performance.

Call this function after RwEngineOpen and before RwEngineStart.

Parameters:
enable  TRUE if the Direct3D device should be created as multithread safe, FALSE otherwise.
See also:
RwEngineOpen , RwEngineStart

void RwD3D9EngineSetRefreshRate RwUInt32    refreshRate
 

RwD3D9EngineSetRefreshRate sets the rate in Hertz at which the display adapter refreshes the screen.

Call this function after RwEngineOpen and before RwEngineStart.

If the current subsystem and video mode doesn't support the specified refresh rate, RWD3D9 will choose the highest supported refresh rate below that which was specified.

Parameters:
refreshRate  The rate in Hertz at which the display adapter refreshes the screen. A value of 0 means use the default video card refresh rate.
See also:
RwEngineOpen , RwEngineSetSubSystem , RwEngineSetVideoMode , RwEngineStart

void RwD3D9EngineSetSoftwareVertexProcessing RwBool    enable
 

RwD3D9EngineSetSoftwareVertexProcessing indicates that the application requests Direct3D to use software vertex processing.

Call this function after RwEngineOpen and before RwEngineStart.

Parameters:
enable  TRUE if the Direct3D device should be created to use software vertex processing, FALSE otherwise.
See also:
RwEngineOpen , RwEngineStart

const void* RwD3D9GetCaps void   
 

RwD3D9GetCaps return a const void pointer to a D3DCAPS9 structure for the current active device.

Use this function in preference to obtaining the current D3D9 device since it will maintain RWD3D9's internal cache.

The capabilities of the video card associated with the D3D9 device can be queried through the pointer to the structure returned from this function. See the D3D9 API documentation for more information.

Returns:
Void pointer to the D3DCAPS9 structure containing the relevant capability information.
See also:
RwD3D9GetCurrentD3DDevice

void* RwD3D9GetCurrentD3DDevice void   
 

RwD3D9GetCurrentD3DDevice is used to determine which (if any) Direct3D9 device is being used for 3D rendering of the current scene.

It is expected that, once cast to a LPDIRECT3DDEVICE9 pointer, the device returned by this function can be used to call D3D9 functions from outside of RenderWare. This should be done with caution however as RenderWare maintains an internal cache that will not be updated by external D3D9 calls. In fact, the cache is made invalid when RwD3D9GetCurrentD3DDevice is called. Because of this, if the device is required, it is recommended that it is obtained immediately after RwEngineStart is called since this does not invalidate the cache.

Note:
This function does not increment any reference counts.
Returns:
Returns a pointer to the Direct3D9 device used for rendering or NULL if there is a error.

void* RwD3D9GetCurrentD3DRenderTarget RwUInt32    index
 

RwD3D9GetCurrentD3DRenderTarget is used to determine which (if any) LPSURFACE is being used as the target for 3D rendering of the current scene.

It is expected that, once cast to a LPSURFACE pointer, the surface returned by this function can be used as a parameter to D3D functions from outside of RenderWare, giving greater flexibility to the programmer at the expense of portability. This should be done with caution however as RenderWare maintains an internal cache that will not be updated by external D3D9 calls.

Parameters:
index  Index of the render target. The device can support multiple render targets.
Note:
Calling this method will not increase the internal reference count on the IDirect3DSurface9 interface.
Returns:
Returns a pointer to the render target surface used for rendering or NULL if there is a error.

void RwD3D9GetLight RwInt32    index,
void *    light
 

RwD3D9GetLight retrieves a set of lighting properties for the requested lights array index.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::GetLight since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
index  Zero-based index of the set of lighting properties to retrieve.
light  Void pointer to a D3DLIGHT9 structure that is filled with the retrieved lighting-parameter set.
See also:
RwD3D9SetLight , RwD3D9EnableLight

RwUInt32 RwD3D9GetStencilClear void   
 

RwD3D9GetStencilClear returns the current value that will be stored in each stencil-buffer entry when it is cleared.

Returns:
Stencil clear value, in the range 0 through (2 to the power n) - 1, where n is the bit depth of the stencil buffer.
See also:
RwD3D9SetStencilClear , RwCameraClear

void RwD3D9GetTransform RwUInt32    state,
void *    matrix
 

RwD3D9GetTransform retrieves a matrix describing a transformation state.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::GetTransform since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
state  State variable that is being requested, a member of the D3DTRANSFORMSTATETYPE enumerated type.
matrix  Void pointer to a D3DMATRIX structure, describing the returned transformation state.
See also:
RwD3D9SetTransform , RwD3D9SetTransformWorld , RwD3D9SetRenderState

RwBool RwD3D9IndexBufferCreate RwUInt32    numIndices,
void **    indexBuffer
 

RwD3D9IndexBufferCreate creates a 16-bit index buffer that is write-only and managed by D3D9.

Index buffers created using this function are not managed by RWD3D9, unlike dynamic vertex buffers.

Parameters:
numIndices  Number of indices to create in the buffer.
indexBuffer  Void pointer to the LPDIRECT3DINDEXBUFFER9 structure that is to be the index buffer.
Returns:
TRUE if the index buffer was successfully created, FALSE otherwise.
See also:
RwD3D9DynamicVertexBufferCreate , RwD3D9DynamicVertexBufferDestroy , RwD3D9CreateVertexBuffer , RwD3D9DestroyVertexBuffer

RwBool RwD3D9SetClipPlane RwUInt32    index,
const RwV4d   plane
 

RwD3D9SetClipPlane sets the coefficients of a user-defined clipping plane.

The coefficients that this method sets take the form of the general plane equation. If the values in plane were labeled A, B, C, and D in the order that they appear in RwV4d, they would fit into the general plane equation so that Ax + By + Cz + Dw = 0. A point with homogeneous coordinates (x, y, z, w) is visible in the half space of the plane if Ax + By + Cz + Dw >= 0. Points that exist behind the clipping plane are clipped from the scene. When the fixed function pipeline is used the plane equations are assumed to be in world space. When the programmable pipeline is used the plane equations are assumed to be in the clipping space (the same space as output vertices).

Note:
This method does not enable the clipping plane equation being set. To enable a clipping plane, set the corresponding bit in the value applied to the D3DRS_CLIPPLANEENABLE render state. It is highly recomended to disable the clipping plane when it is no longer useful.
Parameters:
index  Index of the clipping plane for which the plane equation coefficients are to be set.
plane  Pointer to a RwV4d that represent the clipping plane coefficients to be set, in the form of the general plane equation.
Returns:
TRUE if the clip plane was set, FALSE otherwise.
See also:
RwD3D9SetRenderState

void RwD3D9SetFVF RwUInt32    fvf
 

RwD3D9SetFVF sets the current vertex stream declaration in RWD3D9.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetFVF since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
fvf  Flexible Vertex Format Constants.
See also:
RwD3D9CreateVertexShader , RwD3D9DeleteVertexShader , RwD3D9SetVertexDeclaration , RwD3D9SetVertexShader , RwD3D9SetVertexShaderConstant

void RwD3D9SetIndices void *    indexBuffer
 

RwD3D9SetIndices sets the current index array to an index buffer. The single set of indices is used to index all streams of vertex buffers.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetIndices since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
indexBuffer  Void pointer to the LPDIRECT3DINDEXBUFFER9, representing the index data to be set.
See also:
RwD3D9IndexBufferCreate

RwBool RwD3D9SetLight RwInt32    index,
const void *    light
 

RwD3D9SetLight assigns a set of lighting properties in the requested lights array index.

It is advised for efficiency purposes for applications using a large number of lights in an array, that the whole array of lights is sent to D3D9 with those individual lights required enabled, rather than sending individual lights.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetLight since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
index  Zero-based index of the set of lighting properties to assign. If a set of lighting properties exists at this index, it is overwritten by the new properties specified.
light  Void pointer to a D3DLIGHT9 structure, containing the lighting-parameters to set.
Returns:
TRUE if the light was set, FALSE otherwise.
See also:
RwD3D9GetLight , RwD3D9EnableLight

RwBool RwD3D9SetMaterial const void *    material
 

RwD3D9SetMaterial sets the material properties to be used in subsequent rendering operations.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetMaterial since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
material  Void pointer to a D3DMATERIAL9 structure, describing the material properties to set.
Returns:
TRUE if the material was set, FALSE otherwise.

void RwD3D9SetPixelShader void *    shader
 

RwD3D9SetPixelShader is used to set the pixel shader used to process pixels in RWD3D9.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9:SetPixelShader since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
shader  Pointer to the vertex shader to be set. This pointer is returned from IDirect3DDevice9::CreateVertexShader.
See also:
RwD3D9CreatePixelShader , RwD3D9DeletePixelShader , RwD3D9SetPixelShaderConstant

void RwD3D9SetPixelShaderConstant RwUInt32    registerAddress,
const void *    constantData,
RwUInt32    constantCount
 

RwD3D9SetPixelShaderConstant sets the values in the pixel constant array.

This is the method used to load the constant registers of the pixel shader assembler.

Parameters:
registerAddress  Register address at which to start loading data into the pixel constant array.
constantData  Pointer to the data block holding the values to load into the pixel constant array. The size of the data block is (ConstantCount * 4 * sizeof(float)) bytes.
constantCount  Number of constants to load into the pixel constant array. Each constant is comprised of four floating-point values.
See also:
RwD3D9CreatePixelShader , RwD3D9DeletePixelShader , RwD3D9SetPixelShader

RwBool RwD3D9SetRenderTarget RwUInt32    index,
RwRaster   raster
 

RwD3D9SetRenderTarget sets the raster to be used as the target for 3D rendering of the current scene.

Parameters:
index  Index of the render target. The device can support multiple render targets.
raster  Pointer to the RwRaster to set as a render target.
Returns:
TRUE if the render target was set, FALSE otherwise.

void RwD3D9SetStencilClear RwUInt32    stencilClear
 

RwD3D9SetStencilClear sets the value to store in each stencil-buffer entry.

rwCAMERACLEARSTENCIL can be OR'd into the camera clear flags to clear the stencil buffer.

Parameters:
stencilClear  This parameter can be in the range from 0 through (2 to the power n) - 1, where n is the bit depth of the stencil buffer.
See also:
RwD3D9GetStencilClear , RwCameraClear , RwCameraClearMode

void RwD3D9SetStreamSource RwUInt32    streamNumber,
void *    streamData,
RwUInt32    offset,
RwUInt32    stride
 

RwD3D9SetStreamSource binds a vertex buffer to a device data stream.

This function creates an association between vertex data and a data stream that feeds RWD3D9 primitive processing functions.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetStreamSource since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
streamNumber  The stream number to set.
streamData  Void pointer to the LPDIRECT3DVERTEXBUFFER9 vertex buffer to be used as the source to the stream.
offset  Offset from the beginning of the stream to the beginning of the vertex data, in bytes.
stride  The size of the vertex formats in the vertex buffer.
See also:
RwD3D9CreateVertexBuffer , RwD3D9DestroyVertexBuffer , RwD3D9DynamicVertexBufferCreate , RwD3D9DynamicVertexBufferDestroy

RwBool RwD3D9SetSurfaceProperties const RwSurfaceProperties   surfaceProps,
const RwRGBA   color,
RwUInt32    flags
 

RwD3D9SetSurfaceProperties sets the surface properties to be used in subsequent rendering operations.

This function internally converts the RenderWare RwSurfaceProperties to the equivalent D3D9 D3DMATERIAL9 structure, and sets this as the current material for subsequent rendering operations.

Parameters:
surfaceProps  Pointer to a RwSurfaceProperties structure with the surface properties to be set.
color  Pointer to a RwRGBA structure with the color to be set.
flags  Geometry flags.
Returns:
TRUE if the surface properties were set, FALSE otherwise.

RwBool RwD3D9SetTexture RwTexture   texture,
RwUInt32    stage
 

RwD3D9SetTexture assigns a texture to a stage.

This function may change the following texture or sampler states for the selected stage, if the states stored in the RwTexture do not match those cached in the D3D9 driver:

  • D3DSAMP_ADDRESSU
  • D3DSAMP_ADDRESSV
  • D3DSAMP_MINFILTER
  • D3DSAMP_MAGFILTER
  • D3DSAMP_MIPFILTER
  • D3DSAMP_MAXANISOTROPY
Parameters:
texture  Pointer to an RwTexture, representing the texture being set.
stage  Stage identifier to which the texture is set. Stage identifiers are zero-based. Devices can have up to 8 textures set, so the maximum value allowed for stage is 7.
Returns:
TRUE if the texture value was set, FALSE otherwise.
See also:
RwD3D9SetSamplerState , RwD3D9GetSamplerStageState , RwD3D9SetTextureStageState , RwD3D9GetTextureStageState

RwBool RwD3D9SetTransform RwUInt32    state,
const void *    matrix
 

RwD3D9SetTransform sets a transformation-related state. These states refer to the view, projection, texture, and world matrices in D3D9. See the D3D9 API documentation from Microsoft for more details.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetTransform since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
state  State variable that is being modified, a member of the D3DTRANSFORMSTATETYPE enumerated type.
matrix  Void pointer to a D3DMATRIX structure that modifies the current transformation.
Returns:
TRUE if the matrix was set, FALSE otherwise.
See also:
RwD3D9SetTransformWorld , RwD3D9GetTransform , RwD3D9SetRenderState

RwBool RwD3D9SetTransformWorld const RwMatrix   matrix
 

RwD3D9SetTransformWorld sets the object-to-world transformation matrix.

This function internally converts the RenderWare RwMatrix to the equivalent D3D9 D3DMATRIX structure, and sets this as the current world transformation matrix.

Parameters:
matrix  Pointer to a RwMatrix structure that modifies the object-to-world transformation.
Returns:
TRUE if the matrix was set, FALSE otherwise.
See also:
RwD3D9SetTransformWorld , RwD3D9GetTransform , RwD3D9SetRenderState

void RwD3D9SetVertexDeclaration void *    vertexDeclaration
 

RwD3D9SetVertexDeclaration sets the current vertex stream declaration in RWD3D9.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetVertexDeclaration since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
vertexDeclaration  Pointer to an IDirect3DVertexDeclaration9 object, which contains the vertex declaration.
See also:
RwD3D9CreateVertexShader , RwD3D9DeleteVertexShader , RwD3D9SetVertexFVF , RwD3D9SetVertexShader , RwD3D9SetVertexShaderConstant

void RwD3D9SetVertexShader void *    shader
 

RwD3D9SetVertexShader is used to set the vertex shader used to process vertices in RWD3D9.

It is preferred that this utility function is used rather than the D3D9 API function IDirect3DDevice9::SetVertexShader since RenderWare can optimize performance using it's internal cache. See Device Cache.

Parameters:
shader  Pointer to the vertex shader to be set. This pointer is returned from IDirect3DDevice9::CreateVertexShader.
See also:
RwD3D9CreateVertexShader , RwD3D9DeleteVertexShader , RwD3D9SetFVF , RwD3D9SetVertexShaderConstant

void RwD3D9SetVertexShaderConstant RwUInt32    registerAddress,
const void *    constantData,
RwUInt32    constantCount
 

RwD3D9SetVertexShaderConstant sets values in the vertex constant array.

This is the method used to load the constant registers of the vertex shader assembler. When loading transformation matrices, the application should transpose them row/column and load them into consecutive constant registers.

Parameters:
registerAddress  Register address at which to start loading data into the vertex constant array.
constantData  Pointer to the data block holding the values to load into the vertex constant array. The size of the data block is (ConstantCount * 4 * sizeof(float)) bytes.
constantCount  Number of constants to load into the vertex constant array. Each constant is comprised of four floating-point values.
See also:
RwD3D9CreateVertexShader , RwD3D9DeleteVertexShader , RwD3D9SetVertexShader

void RwD3D9VertexBufferManagerChangeDefaultSize RwUInt32    defaultSize
 

RwD3D9VertexBufferManagerChangeDefaultSize is used to change the default vertex buffer size used by the vertex buffer manager to generate new vertex buffers.

The vertex buffer manager tries to share the same vertex buffer across different atomics and world sectors to reduce the number of vertex buffer switches at runtime. So the greater the default size, the more objects can fit in the same vertex buffer, but you should be aware that big vertex buffers may fail to be created depending on the video card. Also, some video card drivers have problems to render primitives when the base index does not fit into a 16-bit number. As a general rule we recommend to use sizes under 1 MB and in multiples of 128 KB.

Parameters:
defaultSize  New default size in bytes for all managed vertex buffers created after calling this function. This value will be rounded up to a multiple of the vertex size.


Criterion Software © 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:46:57 2004. Send Feedback