Hello.
Can someone explain to me one point related to the back buffers?
Let's say we have this code on DirectX 9:
while(true) // render loop
{
IDirect3DSurface9* backBuffer0 = nullptr, backBuffer1 = nullptr;
device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer0); // let's say it returned 0xFFFFFFFF
device->GetBackBuffer(0, 1, D3DBACKBUFFER_TYPE_MONO, &backBuffer1); // let's say it returned 0xCCCCCCCC
std::cout << "first: " << backBuffer0 << " second: " << backBuffer1 << std::endl;
device->Present(0, 0, 0, 0);
backBuffer0->Release();
backBuffer1->Release();
}
The output in the console is as follows:
first: 0xFFFFFFFF second: 0xCCCCCCCC
first: 0xFFFFFFFF second: 0xCCCCCCCC
first: 0xFFFFFFFF second: 0xCCCCCCCC
etc…
Why didn't the pointers change places? The buffers should have been flip.
I expected to see an output like this:
first: 0xFFFFFFFF second: 0xCCCCCCCC
first: 0xCCCCCCCC second: firstbufferptr
first: firstbufferptr second: 0xFFFFFFFF
etc…
But that didn't happen. Why?