DirectX SDK |
The Direct3DDevice7.SetRenderTarget method permits the application to easily route rendering output to a new DirectDraw surface as a render target.
object.SetRenderTarget(surface As DirectDrawSurface7)
If the method fails, an error is raised and Err.Number may be set one of the following values:
DDERR_INVALIDPARAMS |
DDERR_INVALIDSURFACETYPE |
For information on trapping errors, see the Visual Basic Error Trapping topic.
Capabilities do not change with changes in the properties of the render target surface. Both the Direct3D HAL and the software rasterizers have only one opportunity to expose capabilities to the application. The system cannot expose different sets of capabilities depending on the format of the destination surface.
If a depth-buffer is attached to the new render target, it replaces the previous z-buffer for the context. Otherwise, the old z-buffer is detached and z-buffering is disabled.
If more than one depth-buffer is attached to the render target, this function fails.