Over 10 Million Study Resources Now at Your Fingertips


Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Language:EN
Pages: 2

And resized fit within this rectangle the destination surface

Surface Types

Render Target Surface

Off-screen Plain

Yes

TextureRender Target

No

Render Target Surface

No

No

Yes

Yes

DirectX 9.0 introduced a new 2D surface copying function called IDirect3DDevice9::StretchRect. This function is used primarily for copying images from surfaces to render target surfaces. Unlike the UpdateSurface function, the pixel formats of the source and destination pixel formats do not have to match because color conversion will be applied if necessary. Also, the source and destination rectangles do not require matching dimensions either. This allows us to magnify/minify the source image onto the destination surface using a specified filtering technique. While the function looks simple enough, there are some rules and restrictions that must be considered. We will discuss these as we move along.

IDirect3DSurface9 *pSourceSurface
The source surface of the copy operation. This surface must have been created in the D3DPOOL_DEFAULT memory resource pool.

www.gameinstitute.com Graphics Programming with DX9 Page 101 of 108

CONST RECT *pDestRect
The destination rectange on the destination surface. The pixels that fall within the source rectangle on the source surface will be copied, color coverted if necessary, and resized to fit within this rectangle on the destination surface. If this is set to NULL, the source rectangle will be resized to fill the entire destination surface.

D3DTEXTUREFILTERTYPE Filter
If the pixels copied from the source image need to be resized to fit the destination rectangle, this parameter describes one of three possible filter types used to reduce aliasing. Possible values are D3DTEXF_NONE, D3DTEXF_POINT or D3DTEXF_LINEAR. If D3DTEXF_NONE is specified, the driver will choose a filtering algorithm. If you intend to explicity set a filter type you should check that the filter type is supported for the device. The D3DCAPS9 structure has a member called StretchRectFilterCaps. You can check one of the following filter flags for support:

D3DPTFILTERCAPS_MINFLINEAR

Device supports bilinear interpolation filtering for minifying rectangles. This filter type is requested by calling IDirect3DDevice9::StretchRect using
D3DTEXF_LINEAR.

D3DPTFILTERCAPS_MAGFLINEAR

Device supports bilinear interpolation filtering for magnifying rectangles. This filter type is requested by calling IDirect3DDevice9::StretchRect using
D3DTEXF_LINEAR.

www.gameinstitute.com Graphics Programming with DX9 Page 102 of 108
How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Payment
Make payment
Document download
Download File
PageId: ELID9035A7
img
Uploaded by :
GMDxydGX
Page 1 Preview
and resized fit within this rectangle the destinat
Sell Your Old Documents & Earn Wallet Balance