Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
retrieve the back buffer call the getbackbuffer me

Retrieve the back buffer call the getbackbuffer method idirect ddevice

44

Chapter 2: Starting DirectX — Your First Program

NOTE. Here are some important rules to remember when surface copying:
• The source surface must have been created with
D3DPOOL_SYSTEMMEM.

• The source and dest rects must fit within the surface.

• No stretching or shrinking is allowed (the rects must be the same size).

HRESULT GetBackBuffer
(
UINT iSwapChain,
UINT BackBuffer,
D3DBACKBUFFER_TYPE Type,

Chapter 2: Starting DirectX — Your First Program

UINT BackBuffer
[in] Index of the back buffer object to return. Back buffers are numbered from 0 to the total number of back buffers minus one.

Chapter 2

A value of 0 returns the first back buffer. For the purposes of this book, pass 0.

The code to get the back buffer and copy a surface onto it might look like the following. Be sure to copy your surface onto the back buffer between the BeginScene and EndScene statements of the rendering loop, which occurs on each frame. This will ensure your data gets copied onto the back buffer correctly and that it’ll be visi-ble as the frame is presented.

if(SUCCEEDED(g_pd3dDevice->BeginScene()))
{
//Draw stuff here
IDirect3DSurface9 *BackBuffer = NULL;
g_pd3dDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, & BackBuffer); g_pd3dDevice->UpdateSurface(SourceSurface, NULL, BackBuffer, NULL);

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Frank Ramirez

PageId: ELIB2D187C